Adaptive AI Engine for RTS Games

Discussing the theory and practice

AI Engine Structure for RTS Games

Posted by Ogail on June 29, 2009

AI Engine Structure for RTS Games

Article in PDF –> Download Here

  • Aim, discuss following:
    • The elements that require some form of AI in RTS games
    • AI techniques used in finished products
    • Real-world examples
    • Notable exceptions
    • Areas of improvement
  • Common AI Elements:
    • Individual Players:
      • The more individual intelligence a unit has, the less you have to chech your army
      • Replicating behavior (attack/retrieve pattern)
    • Economic Individual Units:
      • Called peons (builders, gatherers)
      • Techniques used:
        • Order Queue: make order queue to each unit
        • Auto-retreating: retrieving when there is an attack and after danger go they get back to work
          • Improvement: go to more secure place! Saying Help!
    • Commanders and Medium-level Strategic Elements:
      • Controlling group of elements in a bigger war sense
      • This is medium level AI not low (such as shoot) and not high (such as defense base)
    • High Level Strategic AI
      • Think of things in general as a real army
      • Here it’s multifaceted
    • Town Building:
      • Criteria of building the buildings are hard to cover all
  • Indigenous Life:
    • As sheep, wolf …
  • Pathfinding (PF):
    • Why pathfinding is one of the most important aspects in AI
    • Flocking techniques and follow-the leader-type systems will improve the speed of per-unit PF
  • Tactical and Strategic Support Systems:
    • Techniques that makes the decisions of AI systems appear smart:
      • Terrain Analysis:
        • Dividing terrains into meaningful chunks and breaking down each aspect of chuck, then AI can glean huge amount of useful data in strategic decisions:
          • Used in pathfinding
          • Keep track of enemy base locations, resources, finding holes,
        • Most of this is done by influence map (fancy name for grid-based map)
        • Intelligent collection of resources (centered resource)
    • Opponent Modeling “Know your enemy”:
      • AI controller can’t ASSUME what his opponent will do
      • AI should build a model of his opponent
      • Some of data to consider: which unit player use, time interval between attacks…)
    • Resource Management:
      • Using need-base system AI opponent could be implemented on map type a attributes
    • Reconnaissance:
      • Explaining the concept of “fog of war”
      • Bottleneck of keeping the data up-to-date
        • Common solutions: tower, guard-post placement or complex wall building
      • Diplomacy Systems:
        • Synchronizing work between AI opponent and its allies
  • Useful AI Techniques in RTS Games:
    • Messaging:
      • Messaging systems can be used for broadcasting of events and game flags to large number of registered units quickly and easily
    • Finite-State-Machines (FSM)
      • Individual work unit, AI most likely implemented as stack-based FSMs so that they can be temporally interrupted then restored easily
      • Systems within the strategy level, a city building might be a FSM with an offline constructed build order that has been proven to work
    • Fuzzy-State-Machines (FuSM):
      • Help AI to take decision in blend of opponent behavior not cheating!
      • There are several ways to victory FuSMs help in determining which one to use
    • Hierarchal AI:
      • Attacked group example
        • Answer is determined by the amount of strategic Vs. tactics
        • Hierarchical systems provide a means for RTS games to form high-level goals but also appear smart at unit level, without choking (الإختناق) the primary AI system for resources
    • Planning:
      • Planning is important to accomplish higher-level tasks
      • Even running away from threats need some level of thinking beyond just pathfinding
    • Scripting:
      • Used to describe certain unit behavior under certain conditions
    • Data Driven AI (135):
      • Many RTS games are putting large portions of AI decision making into non-code form
      • Advantages: level designers and gamers can change them later easily
      • Example:

  • Developed RTS Games Examples:
    • Herzog Zwei was developed using simple AI as FSM in states like GetMoney. Defines, Attack

  • Warcraft, Starcraft and Command & Conquer emphasis on pathfinding not influence maps or better planning algorithms because the memory and processing limitations
  • Later games used super-units and heroes (instead of just using mindless units)
  • Areas That Need Improvement:
    • Learning
      • RTS AI get in the same trap repeatedly
      • The AI should take into account successful travel information about map locations (using influence map techniques), so it didn’t go to kill zones where there are areas of migration

  • Determine when AI Element is Stuck:
    • What to do in stuck situations (from a peon to a group of tanks)
    • The AI should know it has been beaten! (The last peon problem)
  • AI Helper (to the human player)
  • Opponent Personality:
    • Herzog Zwei had two opponent AI personalities (offense based defensive based
    • Examples: AI madness
  • More Strategy, Less Tactics:
    • What we mean by this title?
    • Make it real: clicking the mouse and hitting hot keys
    • Some common strategic systems that the RST AI should accomplish:
      • Grouping units by type and then using groups to back up other groups
        • Respond to specific threats with the correct counter type unit
        • When attacking make each suitable unit to attack object
      • Setting up attack lines to take advantage of multiple fronts and leave support lines open for additional forces to come on
      • Using terrain feature to setup optimal wall structure
      • How to retreat
      • Setup ambush situations:
        • Get the enemy army to an ambush place

Get enemy army out from base and attack after that!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: