Source: Nolf 2 Documentation
All AI placed through Dedit are CAIHuman. (Yes, including robots, rats, and rabbits).
In addition to placing CAIHumans, other AI objects are placed in Dedit that allow AI to understand the world.
AI navigate the world by planning paths through connected AIVolumes.
AI determine what objects or places of interest are nearby by searching for AINodes.
AIVolumes and AINodes are invisible to the player ingame.
Properties on the CAIHuman object determine the AI’s look and behavior:
CAIHuman Parameters:
ModelTemplate | The model template from modelbutes.txt. The model template deteremines the ltb model file, skeleton, animation data file, skin textures, and renderstyles. The model template references an AI template in aibutes.txt. The AI template determines the AI’s alignment, and sensory parameters. |
Brain | The brain template from aibutes.txt. The brain determines a number of parameters that affect the AI’s behavior. |
GoalSet | The goalset defined in aigoals.txt. The goalset lists the goals that will control the AI’s behavior. |
AIButes.txt
AIButes.txt contains various sections defining parameters that affect AI behavior.
The major sections are AIBrains, and AI Attribute Templates.
Sections not described are insignificant, self-explanatory, or beyond the scope of this document (AIStimulus – tweak at your own risk!).
AIBrain
AIBrains specify a number of parameters that define an AI’s behavior. Many AI may share the same brain. There are a number of required parameters, and some optional parameters. Some parameters found in AIbutes.txt were not used for NOLF2.
Required Parameters:
DodgeVectorCheckTime | How frequently we check to see if we need to dodge a vector |
DodgeVectorCheckChance | The % chance we will check to see if we need to dodge a vector once this time is up |
DodgeVectorDelayTime | After dodging a vector, the time we must wait before we can check again |
DodgeVectorShuffleDist | How much space is needed to shuffle. |
DodgeVectorRollDist | How much space is needed to roll. |
DodgeVectorShuffleChance | The % chance the dodge will be a shuffle. |
DodgeVectorRollChance | The % chance the dodge will be a roll. |
DodgeVectorBlockChance | The % chance the dodge will be a block. |
DodgeProjectileCheckTime | Not used for NOLF2. |
DodgeProjectileCheckChance | Not used for NOLF2. |
DodgeProjectileDelayTime | Not used for NOLF2. |
AttackRangedRange | The min/max distance we must be at to attack with a ranged weapon (e.g. rifle) |
AttackThrownRange | The min/max distance we must be at to attack with a thrown weapon (e.g. grenade) |
AttackMeleeRange | The min/max distance we must be at to attack with a melee weapon (e.g. sword) |
AttackChaseTime | After we lose sight of our target, how long do we wait before chasing |
AttackChaseTimeRandom | An additional random amount of time to the above time |
AttackPoseCrouchChance | When we enter the attack state, chance we will crouch and fire |
AttackPoseCrouchTime | How long we stay crouched |
AttackGrenadeThrowTime | How often we'll consider throwing a grenade |
AttackGrenadeThrowChance | Chance we'll attempt to throw the grenade after this time expires |
AttackCoverCheckTime | How often we check for the presence of cover |
AttackCoverCheckChance | Chance we'll check once this time expires |
AttackSoundTimeMin | Min amount of time since any AI played combat dialog before this AI can play combat dialog |
AttackWhileMoving | Can the AI attack while moving? |
AttackFromCoverCoverTime | How long we will stay covered for before uncovering |
AttackFromCoverCoverTimeRandom | An additional random amount of time to the above time |
AttackFromCoverUncoverTime | How long we will stay uncovered for before covering |
AttackFromCoverUncoverTimeRandom | An additional random amount of time to the above time |
AttackFromCoverReactionTime | If uncovered and shot at, the delay before we will go back to cover |
AttackFromCoverMaxRetries | How many times we will attempt to go for new cover when cover becomes invalidated. |
AttackFromVantageAttackTime | Time we will fire from a vantage node before moving on to the next one |
AttackFromVantageAttackTimeRandom | An additional random amount of time to the above time |
AttackFromViewChaseTime | How long we will we wait to chase at an attack from view node |
ChaseExtraTime | Not used for NOLF2. |
ChaseExtraTimeRandom | Not used for NOLF2. |
ChaseSearchTime | Not used for NOLF2. |
PatrolSoundTime | Time between chances of playing a patrolling sound |
PatrolSoundTimeRandom | An additional random amount of time to the above time |
PatrolSoundChance | The chance we'll play a patrol sound after the patrolsoundtime |
DistressFacingThreshhold | Dot product (-1=180' to 1=0') at which target must be facing towards us to be considered threatening |
DistressIncreaseRate | Rate at which distress increases when being threatened |
DistressDecreaseRate | Rate at which distress decreases when not being threatened |
DistressLevels | How many levels of distress to go through before panic |
MajorAlarmThreshold | How high alarm level must be to start searching (threat assumed) |
ImmediateAlarmThreshold | How high alarm level must be to know threat is immediate |
TauntDelay | How long between checks to taunt |
TauntChance | Chance the AI should taunt when it is able to |
CrawlThreshhold | Not used for NOLF2. |
CrawlChance | Not used for NOLF2. |
CrawlLifetime | Not used for NOLF2. |
CanLipSync | Can this AI lip sync? |
DamageMask | Mask of accepted types of damage. Other types are ignored. "None" means affected by all damage types. |
Optional Parameters:
Parameters that are not required for every AI are specified in the AIBrain with name = value pairs, in the form AIDataN = “SomeLabel=SomeValue”. For example:
AIData0 = "AccidentChance=0.1"
AIData1 = "DivergePaths=1.0"
AIData2 = "OneAnimCover=1.0"
AccidentChance | Percent chance of AI having an accident. Used for AIs falling on their faces when jumping over railings. |
BreaksDoors | AI destroys doors when going through them. Used for SuperSoldiers. |
CannotPathThruDoors | AI may not go through doors. Used to contain ambient life. |
ChaseEndurance | Number of seconds running before AI needs to catch his breath. Used for police. |
DeflectChance | Percent chance of deflecting a bullet. Used for ninjas with katanas. |
DisappearDistMin | Minimum distance away a threat must be to trigger AI to disappear. Used for ninjas. |
DisappearDistMax | Minimum distance away a threat can be to trigger AI to disappear. Used for ninjas. |
DisappearFadeTime | Amount of time to fade translucency when disappearing. Used for ninjas. |
DisposeLantern | AI must detach object from light socket when leaving an investigative state. Used for ninjas with search lanterns. |
DivergePaths | AIs try to split up taking separate paths to the same destination. |
DoNotCloseDoors | AI does not close doors after going through them. |
DoNotDamageSelf | AI does not damage himself with his own weapons. Used to keep Volkov from injuring himself with rocket splash damage. |
DoNotExposeHiding | AI does not expose a hidden player, in a hiding spot. Used for ambient life. |
DoNotToggleLights | AI does not attempt to turn on/off lights. |
DynMoveTimeMin | Minimum time AI stands still while attacking with a ranged weapon. |
DynMoveTimeMax | Maximum time AI stands still while attacking with a ranged weapon. |
DynMoveBackupDist | Distance an AI backs up while attacking with a ranged weapon. |
DynMoveFlankPassDist | Distance past a target AI will travel when flanking. |
DynMoveFlankWidthDist | Distance to the side of a target AI will travel when flanking. |
IgnoreJunctions | AI cannot get lost in junctions. |
LethalSpecialDamage | SpecialDamage will instantly kill AI. Used for ambient life, when hit with sleeping damage, electrical damage, etc. |
LongJumpHeightMin | Minimum height of parabola when jumping long distances. Used for ninja lunge. |
LongJumpHeightMax | Maximum height of parabola when jumping long distances. Used for ninja lunge. |
LungeDistMin | Minimum distance away a target can be to trigger a lunge. Used for ninja. |
LungeDistMax | Maximum distance away a target can be to trigger a lunge. Used for ninja. |
LungeSpeed | Speed AI travels while lunging. Used for ninja. |
LungeStopDistance | Distance in front of a target to end a lunge. Used for ninja. |
GoalProximityDist | Distance to trigger the ProximityCommand goal. |
MeleeKnockBackDist | Distance to push back a target with a melee attack. |
MinPathWeight | Minimum weight of an AIVolume that AI will use when pathfinding. Used to restrict some AI to preferred volumes. |
MusicMoodMin | Minimum music mood AI will set. Used to keep ambient life from affecting music. |
MusicMoodMax | Maximum music mood AI will set. Used to keep ambient life from affecting music. |
NoDynamicPathfinding | AI will not try to avoid dynamic obstacles. |
OneAnimCover | AI uses one movement-encoded animation to attack from cover, rather than a series of animations. |
PrimaryWeaponOnLeft | Primary weapon is on AI’s left side, instead of the default right side. |
ProneDistMin | Minimum distance from target AI must be to go prone. |
ProneSlideDist | Distance AI slides forward when diving to the ground to go prone. |
ProneTime | Amount of time AI stays prone. |
ReappearDist | Distance away AI reappears after disappearing. Used for ninja. |
RetreatTriggerDist | Distance from target to AI required to trigger AI to retreat. Used for ninja. |
RetreatJumpDist | Distance AI jumps back when retreating. Used for ninja. |
RetreatSpeed | Speed AI travels while jumping back when retreating. Used for ninja. |
SleepTimeMin | Minimum time AI sleeps. Used for powered-down SuperSoldiers. |
SleepTimeMax | Maximum time AI sleeps. Used for powered-down SuperSoldiers. |
AI Attribute Templates
AI attribute templates define parameters for AI behavior associated with a model. Multiple models may share the same template.
Required Parameters:
Name | Name of template, referenced in modelbutes.txt as AIName. |
RunSpeed | Speed AI moves when running with an animation that uses constant velocity (rather than movement encoding). |
JumpSpeed | Speed AI moves while playing a jumpUp animation. |
JumpOverSpeed | Speed AI moves while playing a jumpOver animation. |
FallSpeed | Speed AI moves while falling. |
CrawlSpeed | Not used in NOLF2. |
WalkSpeed | Speed AI moves when walking with an animation that uses constant velocity (rather than movement encoding). |
SwimSpeed | Not used in NOLF2. |
FlySpeed | Not used in NOLF2. |
Marksmanship | Not used in NOLF2. |
Bravado | Not used in NOLF2. |
SoundRadius | Sound radius used when AI plays dialogue sounds. |
HitPoints | Amount of hit points AI starts with. Modified by difficulty. |
Armor | Always 0 for NOLF2. |
Accuracy | Percent chance a shot will hit AI’s target. |
AccuracyIncreaseRate | Rate AI regains accuracy after a change due to attacking from cover. |
AccuracyDecreaseRate | Not used in NOLF2. |
FullAccuracyRadius | Radius from AI where AI has perfect accuracy. |
AccuracyMissPerturb | Amount of perturb on bullets that miss their target. |
MaxMovementAccuracyPerturb | Maximum amount of perturb caused by aiming at a moving target. |
MovementAccuracyPerturbTime | Amount of time to catch up when aiming at a moving target. |
CanUseVolumeXXX | AI may pathfind through AIVolumes of type XXX (e.g. CanUseVolumeJumpUp). By default, AI may pathfind through all AIVolume types. Types of AIVolumes are described in the AIVolume section of this document. |
CanXXX | TRUE if sense is turned on for AI, where XXX is a sense. (e.g. CanSeeEnemy). |
XXXDistance | Distance that AI can sense XXX. (e.g. SeeEnemyDistance). |
Senses referenced by XXX above include:
SeeEnemy | AI sees an enemy. |
SeeEnemyLean | AI sees a leaning enemy. |
SeeEnemyWeaponImpact | AI sees someone get shot by an enemy. |
SeeEnemyDanger | AI sees something dangerous. Used for AIGoalLoveKitty. |
SeeEnemyDisturbance | AI sees something disturbed by an enemy. |
SeeEnemyLightDisturbance | AI sees a light disturbed by an enemy (turned on or off). |
SeeEnemyFootprint | AI sees an enemy’s footprint. |
SeeAllyDeath | AI sees an ally’s dead, or knocked out body. |
SeeAllyDisturbance | AI sees an ally get disturbed. |
HearEnemyWeaponFire | AI hears an enemy fire a weapon. |
HearEnemyWeaponImpact | AI hears an enemy’s weapon impact. |
HearEnemyFootstep | AI hears an enemy’s footsteps. |
HearEnemyAlarm | AI hears an alarm sound, due to an enemy’s presence. |
HearEnemyDisturbance | AI hears an enemy make a disturbance. |
HearAllyDeath | AI hears an ally die. |
HearAllyPain | AI hears an ally shout in pain. |
HearAllyWeaponFire | AI hears an ally fire a weapon. |
HearAllyDisturbance | AI hears an ally get disturbed. |
SeeAllyDistress | AI sees an ally in distress, going for backup. |
SeeAllySpecialDamage | AI sees an ally affected by special damage (glued, in bear trap, on fire, etc) |
AIVolumes
AIVolumes denote open space to an AI, and must be placed everywhere an AI may travel. AIVolumes are invisible to the player.
The restrictions and requirements for placing AIVolumes in general are:
· AIVolumes do not contain any physical obstacles (e.g. desks, walls, columns, etc).
· AIVolumes align exactly with adjacent AIVolumes.
· AIVolumes containing doors must be narrow volumes just containing the dimensions of the closed door. Only one door may be in an AIVolume.
· AIVolumes have minimum dimensions in XZ of 48x48.
· AIVolumes are generally 16 units tall, and 8 units off the ground. This is not a requirement.
· AIVolumes touching other AIVolumes must have a connection of at least 48 units.
There are several varieties of AIVolumes, used for different purposes. Below are descriptions of the purposes and parameters of the different types of AIVolumes. AIVolumes not listed below were not used on NOLF2.
AIVolume
There are several varieties of AIVolumes, used for different purposes.
Below are descriptions of the purposes and parameters of the different types of AIVolumes.
AIVolumes not listed below were not used on NOLF2.
AIVolume is the most basic volume type. All other AIVolume objects are derived from AIVolume. All AIVolumes have the parameters below at a minimum.
Lit | FALSE if volume is in the dark. Tells AI whether they need to turn on a light. Can be toggled through the commands “lit” and “unlit”. msg aivolume01 unlit |
Region | AIRegion this AIVolume is part of. Regions are used for alarms and for searching. |
LightSwitchNode | LightSwitch AINodeUseObject used to toggle the light state of this volume (lit/unlit). |
PreferredPath | TRUE if this volume should be preferred over other for pathfinding. |
PreferredPath In NOLF2 was used a couple of different ways.
Only SuperSoliders and Robots can travel through AIVolume with PreferredPath set to true so they don’t walk through spaces that are too small for them to fit.
The AIBrain AIData MinPathWeight=1 takes care of this.
We also used this to make the AI path finding look better in some situations.
For instance in Japan, when a ninja was patrolling a section of street sometimes she would walk through a flower bed to get to her next patrol point.
Setting the PreferredPath to True on the AIVolumes that were on the streets helped make the AI paths look better by making them walk on the streets when in a relaxed state..
AIVolumeAmbientLife
There is nothing special about AIVolumeAmbientLife.
The volume types simply exists so that ambient life AI can be use a set of volumes that other AI do not use (e.g. so that a rat can run under a table, but a soldier cannot).
AI are restricted from pathfinding through AIVolumeAmbientLife by adding this line to their AI Attribute Template in AIButes.txt:
CanUseVolumeAmbientLife = FALSE
AIVolumeJumpOver
AI use AIVolumeJumpOvers to pathfind and jump over obstacles (e.g. fences).
This volume should connect to AIVolumes horizontally.
AI jump from one edge of the volume to the opposite edge.
The height of the parabola of the jump is determined by the height of the top of the volume.
AIVolumeJumpUp
AI use AIVolumeJumpUps to pathfind and jump up and down from things (e.g. rooftops).
This volume should connect to AIVolumes above and below the jump destination.
AIVolumeJumpUp has several additional parameters.
OnlyJumpDown | This volume may only be used to jump down from something (and not jump up onto something). |
OnlyJumpWhenAlert | AI may only jump through this volume when alerted to a threat. |
HasRailing | AI must play an animation to jump over a railing when jumping through this volume. |
AIVolumeJunction
AI get lost when chasing a target, and running through an AIVolumeJunction while the target is out of sight.
A junction connects up to four AIVolumes.
AIVolumeJunctions have extra parameters determining the percent chance of different actions that can be taken once the junction is reached.
The extra parameters are duplicated for each of the connecting volumes in four possible directions, North, South, East, and West.
Junction Actions:
Nothing | Run through junction and get lost. |
Continue | Run through junction and get lost. |
Peek | Peek into a connecting volume, and then run a different direction. |
Search | Run into a volume and search its AIRegion. |
AIVolumeLadder
AI use AIVolumeLadders to pathfind and climb on ladders.
This volume should be centered on the ladder, and connect to AIVolumes above and below the ladder.
AI play a special death animation when killed inside an AIVolumeLadder.
AIVolumeLedge
AI play a special death animation when killed inside an AIVolumeLedge.
These volumes are typically used on balconies, rooftops, and cliffs.
The angle of the Yaw determines which direction the AI will fall off the ledge.
AIVolumeStairs
AI use AIVolumeStairs to pathfind and walk up stairs. This volume should enclose the staircase, and connect to AIVolumes above and below the stairs. AI play a special death animation when killed inside an AIVolumeStairs. The angle of the Yaw determines which direction the AI will roll down the stairs when killed.
AIVolumePlayerInfo
AIVolumePlayerInfo is totally unrelated to the other AIVolumes. AIVolumePlayerInfo is not used for AI pathfinding. It is used to determine if the player is hidden, or attackable from an associated AINodeView. AIVolumePlayerInfo has a number of unique parameters.
On | Volume is usable for hiding, and sense mask is enabled when On is TRUE. This volume can be messaged “On” and “Off” with commands. |
SenseMask | SenseMask applied to the volume, that blocks out specified senses while AI are relaxed. Used in the HARM Villa to make enemies ignore Cate when she was in unrestricted areas. |
Hiding | Player can use this volume to hide. |
HidingCrouch | Player can use this volume to hide, if she is crouched. |
ViewNodes | List of AINodeViews that are associated with this volume. If an AI cannot find a path to the player, and wants to attack, he may go to an AINodeView and attack from there. |