Jump to content
  • Advertisement

Game AI architecture for a RTS game

This topic is 411 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

I am developing a RTS game involving robber and cops. I have designed a simple rule based AI system for the robber.

Goals of the robber AI:

  • Escape from the cops (robber should not get caught)
  • Conduct robbery

Current implementation:
The robber AI uses a rule based system to escape from the cops. I have written IF-THEN clauses to build the rule based AI system. The robber AI uses the knowledge of cops’ current positions.

Future requirements:

I am worried about the current architecture of this robber AI system. I read that rule based systems are inefficient and difficult to maintain. For the future,

  • I want the robber AI to use some power-ups (to escape)
  • The AI should consider the power-ups used by the cops before making decisions.
  • For conducting the robbery, the robber has to move to a specific location escaping from the cops.


  1. Is the current rule based AI system will flexible enough (and easy to maintain) to meet the future requirements?
  2. What can be better alternatives for the existing rule based system? (Like decision trees or state machines etc.)
  3. I read people suggesting that the rule based systems are difficult to debug. Can anyone explain why?

I would appreciate any thought/suggestions on this topic. Thank you.

Share this post

Link to post
Share on other sites

I think the main weakness of rule-based systems is a different one: They are fragile. There will be circumstances you have not considered, where following the rules looks dumb. You will have some rule that seems perfectly sensible, like "if you are hungry, go to the fridge", and then there will be a fire in the house and some idiot will go to the fridge because he was hungry.

My favorite architecture is a utility maximization paradigm, where you assign a utility value to each action the agent can perform (i.e. how happy it makes you), then pick the action for which this value is maximum. You still have rules, but they are expressed as terms in the utility function that indicate priorities, so staying in a burning house has a negative contribution to utility that is much larger than the positive contribution of going to the fridge when you have the munchies.


Share this post

Link to post
Share on other sites

Thank for your response Alvaro. Are talking about "Goal oriented AI"? The AI in which actions are taken to meet the immediate needs/goals. Will there be any advantage of using decisions trees instead of rule based system?

Share this post

Link to post
Share on other sites

That said, there are all sorts of benefits to using a decision tree (or more specifically, a behavior tree) than using a "rule based system". Since you seem very new to game AI (another reason this is a big challenge for you), read the article that Alvaro linked to (it's mine). That will give you an overview of the different types of architectures.

Share this post

Link to post
Share on other sites

  • 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!