JavaScript EditorFree JavaScript Editor     Ajax Editor 

Main Page
  Previous Section Next Section

Part IV: Choose Your Weapon

Numerous different scenarios can arise in combat: stealth missions or ambushes, frontal attacks and flanking, mobile warfare and entrenched battles, and so on. When soldiers find themselves in particular situations, they undeniably want the best tools for the job to increase the likelihood of success, or just the chances of survival. This part covers weapon selection, allowing the animats to prepare for each situation. We'll discuss both a voting system created directly by experts, as well as a decision tree that can learn with less supervision.


In the previous part, when considering the shooting behaviors alone, higher-level abilities are disregarded completely. The importance of shooting is undeniable; however, tactics can often make the most out of any situation. As a complement to weapon skills, the choice of weapon falls into the category of higher-level strategies. This seems to be the next step in developing a competent animat for deathmatch.

The problem of weapon selection itself is very interesting; it provides a problem where there is more variation within the game. With shooting, often one good behavior works fine regardless of the context. However, for weapon handling, the animat must take more factors into account dynamically. The scope of weapon-selection behaviors is also much larger, taking into account most of the local surroundings. Even though it's not rocket science, the problem of choosing a weapon is certainly an increase in complexity; therefore, this problem seems an ideal next move.

Using learning to deal with weapons reveals interesting trends in the design of the game, or even the AI. For example, we can determine whether weapons are well balanced, and modify the game logic if necessary. In our case, the weapon design is already frozen, so we can identify strengths and weaknesses in the AI and spend more time working on shooting abilities.


Many of the following chapters extend their counterparts in Part III. Indeed, many of the software, interfaces, and behaviors used in weapon selection partly depend on shooting abilities. We'll make a point of emphasizing higher-level behaviors in the next few pages, relying on the lower-level details of the previous part when necessary.

Chapter 22, "Fighting Conditions." We start by analyzing the platform for the AI. Specifically, the different conditions of the environment that affect the choice of weapons are discussed (that is, layout of the terrain, location of the enemy).

Chapter 23, "Weapon Selection." The understanding phase explains the different methods humans use to make decisions. Specifically, we'll investigate deduction- and experience-based approaches applied to weapon selection.

Chapter 24, "Formalizing Weapon Choice." The interfaces used for choosing weapons can be formalized. This involves extending the inventory interfaces and weapon interfaces.

Chapter 25, "Scripting Tactical Decisions." This chapter is a practical one, using a scripting language to implement such tactical decisions. After covering the basics of scripting, we explain voting systems and how they can be used to solve this decision-making problem. These ideas are implemented with a simple script.

Chapter 26, "Classification and Regression Trees." After identifying a few problems with the scripting solution, we look at the theory behind decision trees—both the classification and regression variants. We show how these are particularly well suited to learning patterns in data to predict unknown values.

Chapter 27, "Learning to Assess Weapons." Decision trees are applied to assess weapons, learning from experience how well weapons perform in the game. We notice the importance of having highly plausible errors, and identify the additional code required to collect the data and compute the training pattern.

Chapter 28, "Understanding the Solution." Finally, we cover a lesson about knowing the solution in general, and thereby gain an understanding the complexity of the solution in theory and practice. These concepts provide developers with more control over the AI techniques during the application phase.


Naturally, all the software used so far is required for weapon selection. The essential parts are as follows:

  • We need animats capable of shooting. They don't need to have perfect behaviors; in fact, any kind of aiming mistakes will make this part more interesting.

  • The support for multiple weapons in the game is an absolute necessity for weapon selection! As usual, this needs to be handled by the game engine.

  • We assume that the environment has a wide diversity of locations that lead to many different combat situations.

Now we're finally ready to get involved with the design of the AI, starting with the first analytical stages of the development. Be sure to visit the web site at for the digital complements to each chapter.

      Previous Section Next Section

    JavaScript EditorAjax Editor     JavaScript Editor