Advertisement

Game AI architecture for a RTS game

Started by October 03, 2017 08:29 AM
5 comments, last by IADaveMark 7 years, 1 month ago

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.

Questions:

  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.

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.

 

Advertisement

Preach, Brother Alvaro!

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

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?

No, it's not "goal oriented AI". In the classification of this article it's the "utility-based salad".

 

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.

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

This topic is closed to new replies.

Advertisement