Adaptive AI Engine for RTS Games

Discussing the theory and practice

Decision Making Levels in RTS Games

Posted by MHesham on October 27, 2010

RTS games provide a rich and challenging domain for autonomous agent research.  In RTS games one has to make a real-time decisions that directly or indirectly affects the environment which impose a complexity making it a big challenge for an AI agent to play an RTS game.

RTS game contain a large number of unique objects and actions.Domain objects include units, buildings with different capabilities and attributes, researches and upgrades for these units and buildings, resources that should be gathered. Domain actions include unit and building construction, what kind of research to do for each unit and building, resource management, utilize units capabilities during battle.

Actions in RTS games occur at multiple levels:

  1. High level strategic decisions
  2. Intermediate (Medium) level tactical decisions
  3. Low-level micromanagement decisions

The most stunning part in AI is the lack of standards. You will find each AI book or paper author talking about the decision making levels in RTS games from his own rich perspective. This is the nature of AI field, it is the field of Wagers. You will find some authors talking about tactics and micromanagement as one thing, Others name the medium-level as tactics and the low-level as micromanagement. Each time you read about decision making levels in RTS you should expect different namings that pop-up off your face making you feel hazy.

The need of standard terms is needed, this is obvious. On the other hand we can agree on the concepts of each level in decision making in RTS games. Next we mention each level and a description of what it is all about supported with some examples, so that the reader gets a clear picture of the decision making hierarchy regardless of the namings and terminologies.

High-Level AI (Strategy)

We can think of high-level strategy as the general of a real army. High-level plans usually include actions at many different levels of AI to complete (e.g: build base, train units, set income ratio, attack enemy, request information, etc…). The perception at this level is built-on information from the lower levels to determine what the enemies are doing. Given all this precious feedback, the army general (in our situation it is the player whether human or AI agent) is able to deal with threats or take strategic decisions. In this way the high-level strategy affects everything from the individual soldiers to the entire economic system.

We will find that the player has to develop and deploy strategies which coordinate the style of the economic build-up, the base layout, offensive an defensive style. A well known strategy in “Warcraft 2” is “Knight`s rush”, the knight is a heavy unit in the middle of the game tech-tree, the player focus on making the minimum necessary upgrades and buildings to produce knights, and as soon as they are available a fast rush using knights is to be performed to take out enemy. This strategy is about a tradeoff between an early defense and a later offensive power, the reason behind this is that in early game the player has no defensive structures or units.

Player decides his high-level strategy early at the beginning of the game based on some information such as map size, number of opponents and resources state in the map. However, player must be ready to switch his strategy based on the new information gathered through map scouting.

Medium-Level AI (Tactics)

Some games use what is called “commanders” to control a group units like Total Annihilation game. In other games we find the player uses the commanders to group units into fighting elements and control them in a large war sense.

When we talk about medium-level AI we find ourselves talking about deployment and grouping decisions. Unlike micromanagement, tactics involves coordinating a groups of units to do a specific task. One common tactics found in “Warcraft3” is coordinating units to block enemy retreat using area effect attacks or block terrain bottlenecks using units (e.g stand on a bridge that allows a few units to pass at a time). This can be considered as medium-level AI because it requires more then individual units actions and it is not fully high-level strategy.Tactical decisions requires the knowledge of common tactics and their counter-tactics.

A simple example is a commander choosing a new destination for a group of units (medium-level), but the individual units decide how to stay in formation and use the terrain features to get there (low-level). By thinking in this way, You can write high-level system that cover large troop movements, and lower-level system to get over and round the map. The part of the system that tries get the units across the map doesn’t have to worry about keeping the long range units behind the short.

Low-level AI (Micromanagement)

Micromanagement in RTS game terms are defined as small, detailed gameplay commands, most commonly commands such as moving units or using a unit’s special abilities during combat. Micromanaging units in an RTS game are essentially the task of giving orders to units. The ultimate goal of micromanagement is to win by losing as few units as possible.

When we talk about human players employing micromanagement, will find that expert human players has developed a micro-management techniques applicable to nearly all RTS games. “Dancing” technique is about a specific use of ranged units in which a group of ranged units hold a ranged attack simultaneously, then “dancing” back during their “cooldown” (i.e the time needed by a unit after each attack to perform a new attack). This dancing allows the weak ranged units to stay away from the melee battle area during cooldown. We call “dancing” a micro-management technique because it involved the detailed control of the individual unit moves. When a micro-management is absent the units will receive their orders in response to the high-level directives as “Attack” using their simple built-in behaviors (e.g path finding, obstacle avoidance, etc …).

When we talk about scripted AI employing micromanagement, we can remember the archer behavior in Age of Empires games. The computer will send in many weak projectile units, which then retreat, shoot, retreat. This very simple behavior micromanagement makes these very weak units very effective because they will strike and make guards spread in all directions.

Decision Making Hierarchy


To support this hierarchy, lets make consider a complete example: The general decides that attacking player#3 is the best course of action (high-level) after asking the “Recon Commander” about the state of the enemy. The “Troops Commander” (medium-level) would then ask the “Production Commander” to produce the necessary troops (soldiers and archers), When troop construction is finished the “Troops Commander” divide the troops into 2 groups, and orders the first group to attack from west and the other to attack from east. As always the low-level micromanagement path finding and avoidance AI would get all those units along the map to their destination.

Notable Conclusion

The medium-level AI worth research and work, because it is usually lacking in most games due to its complexity whether in creation or tuning. High-level goals can be somehow direct and simple (e.g Attack Player#3) stripped of all necessary details required to accomplish the attack, the entire plan is 3 words. Low-level goals are also straightforward involving very atomic behaviors and local and small scale perceptions (e.g Attack unit with Id 3 at position 10, 30). In contrast, the commanders or the Medium-level AI requires a large collection of feedback information from many sources. It has to combine all these percetions into short-and medium-range  plans that coordinate group movements, resource allocation.


  • AI Game Engine Programming , 2nd edition by Brian Schwab
  • A CBR-RL system for learning for micromanagment in RTS Games – 2009
  • An Integrated Agent for Playing Real-Time Strategy Games – 2008

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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s

%d bloggers like this: