Jump to content
  • Advertisement
Sign in to follow this  
juggerp

2D Turn-Based Strategy AI Design Question

This topic is 2783 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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.)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!