Emergent behavior in the game AI war

I just finished reading a really good 6-part blog post about game design, emergent behavior, and artificial intelligence by the creator of the game AI War.

A quick overview of AI War stolen from the wiki for the game:

  • Cooperative RTS (real time strategy)  game (1-8 players) with numerous unique ship types.
  • Challenging AI in 26 styles, 20 additional with the first two expansions; many with unique superweapons.
  • Insanely high unit counts: 30,000+ ships in most games.
  • Lengthy campaigns featuring up to 120 simultaneous planetary battlefields.
  • Different Every Time: 16 billion procedural maps, each with specific units.
  • A focus on deep strategy that you don’t get in most RTS games.
The blog goes into his general design approach which is different from many other RTS games on the market. Most AI in this genre seeks to imitate how a human player would act, and is usually easily exploited or has to cheat to offer experienced human players any challenge. The developer of AI war took a different approach, instead of trying to imitate human players he just tried to create a challenging adversary. Instead of fighting a poor imitation of a human player, its like fighting skynet.One of the most interesting parts of the blog series was the type of AI he used for individual units. He explains in the post that the traditional mechanism for creating AI is to use branching decision trees. So if situation A occurs do action C, if situation B occurs do action D.

In AI war when enemy ships jump into a solar system they have to determine which targets they want to attack. Instead of using branching decision trees, he created a preference system for targets. (what follows is a general idea of how it works, but the creator would probably cringe if he read my description) For example an expensive player factory may be worth 5 points while a cheap one might be worth 3 points. If the expensive one is defended, that is minus 2 points. If the cheap one is vulnerable to the type of damage that a ship does, that is plus 1 point. Add in a bit of randomization and fuzzy logic (changing how many points get added or subtracted) and you get a fleet of ships that is very responsive to a situation.Reading the blog gave me a little more hope for my own project of making economic simulation games. My first introduction to programming had me looking at decision trees, and that had me very worried. It has also made me re-think exactly how I should approach a game. Trying to predict humans is the fatal flaw of any policy maker, and perhaps trying to imitate them is the fatal flaw of game AI programmers.

  • toban

    Very interesting. The preference system approach makes more sense than decision trees for the purposes of AI. This is what evolution used in intelligent organisms. Unintelligent organisms (plants, bacteria) which can’t process information rely on simple if-then rules. But organisms with brains that can analyze situations can be programmed with a preference system, and the organism then simply behaves in the way that it expects will best satisfy its preferences (i.e., it solves the optimization problem on the fly, rather than the solution being hard-coded in).

    • cole Terlesky

      One of the other benefits of the preference system was that it was easy to maintain and expand. If some weakness can be easily found and exploited you can just add in an additional preference.

      I also forgot to mention that that the civilization games use something similar in certain aspects of their game AI.

  • Pingback: Quora

  • Pingback: Xbox 360 Console Reviews Consumer Reports