Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / turn based strategy AI

Author
Message
greg man
21
Years of Service
User Offline
Joined: 6th May 2004
Location:
Posted: 28th Jul 2005 01:00
I am making a turn based strategy game at the moment and i think its not too bad so far. However im completely stuck when it comes to AI. I don't really know where to start. If someone could help me write some simple AI that could handle things like building units, moving attacking etc. it would be a real help. I have attached any models that you might need to run the game and the code is here:



I know its kind of long, sorry.
Also if when you help me you could explain why your doing stuff so i learn and i can do it myself in the future.
(ps. i have DB classic 1.13)

Thankyou in advance
Leeorg
19
Years of Service
User Offline
Joined: 5th Jul 2005
Location:
Posted: 28th Jul 2005 01:52
I would suggest a set of rules and objectives.
i.e. arrays such as RULE(x)=a each <x> could mean a different thing and <a> would be true of false and based apon these rules you can derive what the objective should be and each objective number will have a certain meaning like, build such and such and move to such and such. See what i mean?
so rule(1) = Being attacked
rule(2) = Not enough soldiers
so if rule(1)=1 and rule(2)=1 then objective=1

so if being attacked and not enough soldiers then objective = 1 which means build more soldiers.
Obviously this is the simplest of the simplest examples and I'm sure there are plenty more suggestions out there.
greg man
21
Years of Service
User Offline
Joined: 6th May 2004
Location:
Posted: 28th Jul 2005 03:33 Edited at: 28th Jul 2005 03:34
Thanks for the tip i'll try and implement it now. I might post it when i finish if i remember.
(by the way if you are looking through the code and you notice that the save part doesn't work properly its because i cant be bothered to sort it out yet but i know how to cos i used the same system in another program.)

Login to post a reply

Server time is: 2025-05-22 13:45:43
Your offset time is: 2025-05-22 13:45:43