Game Development Reference
In-Depth Information
Strategy
Strategy is an AI's vision of how it should compete in the game. For instance,
should it be more aggressive or more defensive? In an RTS game, there are
often two components of strategy: micro and macro strategy. Micro strategy con-
sists of per-unit actions. This can typically be implemented with behavioral state
machines, so it is nothing that requires further investigation. Macro strategy,
however, is a far more complex problem. It is the AI's overarching strategy, and it
determines how it wants to approach the game. When programming AIs for games
such as StarCraft , developers often model the strategy after top professional play-
ers. An example of a macro strategy in an RTS game might be to “rush” (try to
attack the other player as quickly as possible).
Strategies can sometimes seem like nebulous mission statements, and vague
strategies are difficult to program. To make things more tangible, strategies are
often thought in terms of specific goals. For example, if the strategy is to “tech”
(increase the army's technology), one specific goal might be to “expand” (create a
secondary base).
Note
Full-gameRTSAIstrategycanbeextremelyimpressivewhenimple-
mented well. The annual Artificial Intelligence and Interactive Di-
gital Entertainment (AIIDE) conference has a StarCraft AI competi-
tion. Teams from different universities create full-game AI bots that
fight it out over hundreds of games. The results are quite interesting,
with the AI displaying proficiency that approaches that of an exper-
ienced player. More information as well as videos are available here
at www.starcraftaicompetition.com .
A single strategy typically has more than one goal. This means that we need a
prioritization system to allow the AI to pick which goal is most important. All
other goals would be left on the back burner while the AI attempts to achieve its
highest priority one. One way to implement a goal system would be to have a base
AIGoal class as such this:
Click here to view code image
class AIGoal
function CalculatePriority()
Search WWH ::




Custom Search