Sample design document:

I made this brief overview to describe the system I wanted for AI communication. It’s very possible for a player to get confused or frustrated when enemies attack him en masse and he or she doesn’t know why. This is why I wanted to try having the NPCs communicate in ways apparent to the player as well as themselves, allowing the player to adjust his tactics accordingly. Half Life had, at the time, raised the bar in terms of NPCs acting as a unit, and believably so, and I wanted our game to benefit from the lessons learned by Valve.

 

 

A.I Communication

 

 

Hostile enemies will make up the majority of NPCs encountered. This document outlines a system that will outline how these units will respond to the player and how they will communicate with other enemy (and sometimes neutral) NPCs in regards to the player’s whereabouts and actions.

 

Fundamentally, there is a basic level of communication in the game built in. When something suspicious, like a scream or gunshot is heard, or the player passes through the sight area of an enemy NPC, that character will have to decide whether to investigate. The louder the noise or the more obvious the player is in movement, the more the NPC will feel obligated to investigate or to call for help. This is the basic communication system using sound events, sight awareness and the NPC AI.

 

However, for a more advanced communication and alert system, allowing different NPCs on a map to exchange information on the player’s position and actions, as well as to command other characters, there will be four different types of warning and communication:

 

Sound: shouting, gunfire, explosions, screams, thrown items, doors creaking, footsteps etc.

Sight: other NPCs struggling, waving, running. Movement. Alarm lights.

Devices:  alarms, sirens, whistles, flares, searchlights, etc.

Radio: characters communicate information to their squad/group immediately but audibly (Half Life)

 

There will be 6 main varieties of individual enemy NPC:

 

Mobile

Non Combat

Non Combat NPCs will seek to run from the player and hide or to run until they encounter an ally and communicate the player’s position to them. These NPCs will almost always use devices to primarily attract attention – whistles, flares, and alarm switches - only shouting or waving when they are trapped or wounded.

Patrol

A Patrol NPC will walk a scripted route or patrol a delineated area. If the Patrol NPC encounters the player alone, it may seek to attack, to hide, or to run and gather reinforcements, after which it will return with the friendly units it encounters to the last spot it detected the player. These NPCs will communicate via audio/visual cue or use devices such as flares or alarms to alert other characters.

Tactical

A Tactical NPC is usually part of a Squad that patrols a designated area or guards a specific location. When alerted to the player they will act as a team and pursue the player or protect their location. An internal variable will determine how many casualties will be suffered before the squad retreats, to look for allied NPCs. These teams will most often use audio/visual communication, but may also use radio.

Elite

Elite NPCs can work singly or in squads. They will use the highest means of AI in order to communicate and engage the player including all available alarms, verbal and visual commands and the use of radio communication, whichever is available. Elite squads will stay within sight or hearing range of each other and move as a unit. Individual elite NPCs will seek to engage the player one-on-one until they are wounded enough to seek help or retreat.

Static

Sentries

Sentries are non- or lightly-armed NPCs that are placed to watch over a certain area of the map for the player. They are usually equipped with, or positioned next to, alarm or signaling devices, which they will use to draw attention to the player. They most often act as spotters to ground teams or snipers.

Snipers

Snipers are non-moving NPC that, like sentries, keep watch over a game designer-delineated area but will track and shoot the player when they see or hear him and successfully find him. Noise, sight or other types of NPC can alert snipers easily.

 

Each NPC starts as an individual entity. This means that unless the NPC is assigned to at least 1 squad, he or she will act as a solo enemy, attacking the player alone and seeking no help from other NPCs. The noise of struggle or conflict may indirectly attract the intention of other characters in the area, but an unattached NPC will flee and hide when wounded or outgunned, instead of running to find help.

 

Squads are determined by names set in the NPCs squad variable. Squads by default are composed of the same NPC type (snipers can only be combined with snipers, patrolmen with patrolmen etc.) Squads will act as a unit, investigating sounds, searching for Buster or patrolling. They will also fight and retreat as a combined force.

Squads can be linked together in Groups. Groups allow communication between squads (i.e., patrolmen can alert snipers to Buster’s position when they see him, or ask snipers for back up). Groups are determined by a numerical value and link any actor with that number in its group variable.

Squads may be part of more than one group, meaning they can communicate with other squads that may be hidden or unconnected with each other. 

 

 

 

Snipers Squad (Group1)

Sentries Squad (Group1)

 

 

 

 

 


Patrol Squad (Group1) (Group 2)

 

 

 

 


Workers (Group 2)

 

 

 

= Communication route

 

 

Alert Levels

When an NPC needs to communicate to another, it will use a set of requests based on what it has seen or heard.  The type of communication is reflected by the alert level of the NPC. When an NPC first detects the player’s actions, or finds an environmental change (an opened security door, a missing object, etc.) then that NPCs level is upgraded to suspicion. Likewise, if the NPC continues to witness or hear more minor disturbances, it will be upgraded to the threat level. If the NPC discovers something of a major disturbance, like a corpse or hears the player make a loud noise close by, then it will skip the suspicions level and immediately go to the Threat alert level.

The highest of the three levels is Combat, which is activated when an NPC decides to attack, or is attacked by, the player directly.

 

• Suspicion level NPCs will become slower and more cautious. Possibly their hearing and vision cone will become a little more sensitive. They will pursue suspicious activity more readily.

 

• Threat level NPCs will have a much more active hearing and sight sensitivity. They will move more cautiously but will react speedily to suspicious sounds and sights. They will also ready their weapons if they haven’t done or need to.

 

Combat Level is the level at which the NPCs are now in combat… they will engage the player based on their AI and the AI decisions of their squad and group members.

 

 

Commands and Logic

*If the NPC has radio communication available, the command will affect that NPCs entire squad or Group

 

Suspicion (Squad level communication)

Communication

Command Modifier

Description

Request Backup

… and search

Requests NPCs within sight or hearing to join the commanding NPC and search the area where the player was seen, heard, or changed the environment noticeably.

 

… and wait

Requests that NPCs join the commanding character and wait for further signs of the player.

 

… and move on

Requests that NPCs join the commanding NPC and then return to the original task designated for that squad.

Report suspicion

 

Will cause all NPCs within sight or hearing to upgrade to suspicion alert level after the commanding NPC sees evidence of the player’s activities

 

 Threat (Group Level Communication)

Communication

Command Modifier

Description

Player is here!

 

When the Player is positively identified, the commanding NPC will shout, or otherwise raise the alarm. All NPCs in the group will move to intercept the player.

Player Last seen here!

 

When the NPC positively identifies the player, but the player manages to hide again quickly the NPC will raise the alarm and the group mates will move to search that area.

Report Emergency

 

When the NPC finds a major disturbance…. A corpse, a vital item missing or the like, then he will alert his group. This will upgrade the members of that group to threat alert level.