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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now