JavaScript EditorFree JavaScript Editor     Ajax Editor 

Main Page
  Previous Section Next Section


This chapter discussed the interaction between the weapon-selection capability and the game engine, used to gather information and perform the weapon changes:

  • The weapons are modeled as symbols; their properties need to be learned or included into the AI.

  • The interfaces with the environment are extended to provide queries for spatial restriction.

  • Queries to the personal state and inventory are also provided, allowing the animat to determine health and weapons available.

  • Information about enemy damage is handled indirectly, thanks to callbacks and events sent by the environment.

  • All the interfaces were chosen to be compatible with the existing ones and are simple to use.

The next chapter provides a simple prototype for weapon selection using scripting facilities and a voting system.

Practical Demo

Sir Obvious is an animat that makes use of the interfaces defined in this chapter. It checks the inventory to find the weapons and corresponding ammo available and prints the result to a debug console. Health changes and the constriction of the terrain are also worthy of Sir Obvious's comments. The source and demo is available online at

      Previous Section Next Section

    JavaScript EditorAjax Editor     JavaScript Editor