locke.bruce@yahoo.com



FEAR AI Primer


Introduction

Presented here is a brief introduction to FEAR AI. Three elements a level designer can use to influence combat are Cover Nodes, Enemy Awareness, and Nav Meshes. These are described in greater detail below.

First a video that demonstrates how changes in Cover Nodes and Enemy Awareness effect combat is shown. This was run in "God" mode, which allows the player to move around and test enemy response without taking damage. In the first room you see enemies spawned, and even though they are not looking at the player they know instantly where he is and soon attack. The enemies here like to close in and combat is at close range. In the second room enemies do not notice the player until a shot is fired. The enemies here are more cautious and combat takes place at a greater distance.


Combat Demo Note, this is the same video shown on the LEVELS page.

Windows Media (wmv) format 640x480, 23 MB, 3 minutes 41 seconds. Right click on the link or image to save the video, left click to download and play.


The FEAR level editor was released to the public in Nov. 2005, and the pictures shown below are from the public version.



FEAR Cover Nodes


Cover Nodes (AINodeCover entities) define locations that characters can shoot from. They set the character facing and animations played while firing. Two important fields in the nodes that effect behavior are Boundry Radius and Threat Radius.

- Boundry Radius: determines the distance which an an enemy must be within for the node to be valid.

- Threat Radius: when an enemy gets within this radius the node is no longer valid.

The first room in the video used Cover Nodes with smaller values for the Boundry and Threat Radii. The Threat Radii were 2 meters (m) for all nodes. The player is about 2 m tall, so basically the player had to be on top of a Node before it would be invalid. The Boundry Radii were generally 16 m or less, encouraging the enemies to find and use Nodes close to the player. In the second room the Boundry and Threat Radii were generally higher (10 m for Threat and 16-24 m for Boundry). Here the enemies could not use Nodes close to the player and had to fire from a distance.

Figure 1 shows a cover node in the editor (Panel A), and an enemy character using the node in game (B). The blue line indicates which way the character will face, while the red line indicates which direction he will step if using a "fire around the corner" animation.

Figure 1



Enemy Awareness

The entities that spawn characters (AISpawner) have fields that effect how alert the character will be. The "Awareness" field effects how rapidly an enemy will notice the player, and also the animations used if the character is scripted to move somewhere. When "Relaxed" enemies will walk along patrol routes, and if scripted to move to a location will walk there. When "Alert" enemies will spot the player sooner and if scripted will run to a location.

In the video above the "SeekEnemy" value of AISpawners was set to True for the first room. This means that as soon as the enemies are spawned they will know where the player is and try to get him - even if he's not in view. In contrast, the "SeekEnemy" tab was set to False for the second room. The "Awareness" was set to relaxed, and the enemies did not notice the player until a shot was fired.



FEAR Nav Meshes

Nav Meshes determine where characters can go in a FEAR level.

The amusing antics of FEAR enemies, such as knocking objects over for cover and leaping walls, depend upon the Nav Mesh. Links in a Nav Mesh are areas where a character will play a defined "leap" or "dive" animation and move over a wall. Nodes can be placed on a Nav Mesh that will have the character play a "knock something over" animation and move the object to it's new location. Links near a moved object can be turned "on" and "off" to prevent enemies from moving through it.

Figure 2 shows Nav Meshes of the video "Combat Demo" level the editor. The Nav Meshes are the light blue sheets (with a NAV MESH texture) and define where enemies can move. The link labeled A is where enemies will jump over the balcony.


Figure 2