Turn-Based Strategy AI...

BlitzMax Forums/BlitzMax Programming/Turn-Based Strategy AI...

Picklesworth(Posted 2006) [#1]
Any advice on writing AI for a turn-based strategy game?

I understand that A* Pathfinding is a good way to go, but it doesn't seem nearly enough to write solid, thinking AI.
The other problem is that my entire scene is always changing, and it's entirely controlled by a physics engine which I know nothing about.

One potential advantage which cuts out a lot of decision-making code is that nothing can be moved directly after it is placed... although, that could turn into more of a difficulty if players end up often moving their own guys indirectly. (Placing new objects right on top of them, moving the game board, etc.)
This inability to move your own units also means that the AI has to work completely in a 3rd-person way.

The real complexity comes along with that "thinking" AI that you see in all those smart turn-based games, where it will decide to attack you in a particular way and stick with it instead of just scattering things randomly in the hopes of achieving something.
(Risk-taking comes to mind here, which would be quite a clever thing to have).

So far I've found this article, which seems rather useful. I suppose the different AI modes are a good method to control how the AI decides to attack things, but it would be significantly more cool to have it actually decide to first surround the target and have a plan to then fortify and attack the target all at once.
http://www.maddocsoftware.com/pdf/I_Davis_99-Strategy.pdf#search=%22turn%20strategy%20AI%22


smilertoo(Posted 2006) [#2]
You're right, A* wont help with thinking AI...but its great for pathfinding.
For the thinking you're probably just going to have to write a big state machine.


tonyg(Posted 2006) [#3]
If you're talking about strategic decisions then AI Game programming Wisdom has 'An economic Approach to Goal-Directed Reasoning in an RTS' (works for turn-based). If you're talking about tactical then search on 'Influence Maps'.
The first tells you what to build and when. The second tells you what to attack (or avoid) and how.
Smilertoo is correct that, once you know what you want to do, it'll probably be FSMs.