Advertisement

2D Turn-Based Strategy AI Design Question

Started by December 05, 2010 10:23 AM
4 comments, last by juggerp 13 years, 11 months ago
Hello everyone,

I've posted this on the XNA forums as well but I am hoping that someone will be able to provide some insight here too.

I have a question regarding game AI and the best design approach to take. I am currently working on a 2D turn-based strategy game and I trying to figure out the best approach to handling AI on a per-unit basis. For a CPU player, should each individual game unit be responsible for handling its own AI decisions or does it make more sense to have an AI "Director" that handles performing any AI calculations and simply move the game units around as seen fit?

Here is a list of my thoughts so far:
- I'm trying to keep things simple, so I am just having one unit active at one time
- The units should be working together towards a common goal...either capturing objectives on the map or defending
- There will only ever be one CPU player at a time
- Only the CPU units would need AI functionality; Player control units have dumb AI and await human commands.
- AI actions are pretty basic in my mind (I'm sure I'll come up with more later):

ATTACK

- Attack Nearest Enemy Unit
- Attack Weakest Enemy Unit
- Attack Strongest Enemy Unit

DEFEND

- Fortify Position
- Defend Friendly Unit By Attacking Threatening Unit

MOVE

- Move to objective


Thank you for your time.
If you were playing as your AI, would you be coordinating your units (e.g. chess)? Is that the type of AI player you are trying to model?

(A better description of the game would help.)

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

Advertisement
To answer your question, yes I would be coordinating all the movements for the units that I control. A good example of the type of game I am working on would be an old Nintendo game L'Empereur (made by KOEI, very similar to the Nobunaga's Ambition series as well) but with a medieval fantasy setting. The battle game play would follow in a very similar vein, where there are two players (one human, one computer) that each take a turn moving and attacking with all the units they control on their own turn, one unit at a time. Once I have used up all of the available movements for all of my units, the turn would end and the computer would then iterate through each of its units, one at a time, making the appropriate moves as deemed fit by my AI routines.
Short answer: A bit of both might be best.

In strategy games makes more sense to have all the decisions point towards a common goal.

So, if you add independent AI for each unit, it would seem reasonable for the AI at times to consider it's own best interest rather then the interest of the CPU player, for instance, retreating before dying when it's death would produce a better outcome. And this behaviour alone doesn't make much sense.

It would make more sense to have a single AI entity decide what each unit does in order to achieve this common goal.

You might however spice things up a bit. For instance, you might introduce the concept of fearful units that will retreat if they face a particularly scary opponent. This would play out more like a characteristic of that particular unit, rather then an individual decision, and the CPU player would just have to make it's decisions bearing that characteristic in mind.
Yep. Master AI making all the decisions. Of course, the master AI would likely need to take into account the individual situations of its pieces.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

Ok guys thank you for your input!

This topic is closed to new replies.

Advertisement