Page contents

Objectives

When AI is placed into a level, they are entirely without purpose and direction, giving them a pathfinding setup will allow them to move around, but they will likely not move around much outside of engaging in basic combat, in order to give the illusion of purpose and intelligence, as well as to give them direction; we use the objective system to set up tasks for AI to fill.

The objective system works on priority, as such AI will always attempt to move to a higher priority task and fill them. The AI fills tasks on the squad level, thus squads cannot be split up to fill different tasks and will only enter a task that can fit the entire squad.

AI units that lack an objective or a valid task are displayed with a green arrow over their head.

Creation

Within the hierarchy view window in Sapien under AI you will see a tab for Objectives, clicking this tab you can then click the "New Instance" button to create a brand new blank objective, keep in mind adding a new objective will delete all AI.

When creating a new objective, you will be met with a new Sapien UI, using this UI you may name your objective and set a default zone, and then from there you may create brand new tasks to fill the objective, or alter prior existing ones

Pictured: The UI displayed when creating a new objective, and the box popup when assigning a default zone

The box saying Add is what will be used for adding new tasks, you can fill out the objective menu, when a task is selected and a default zone is selected for this objective, the game window will show all firing point areas, from which you can simply click to assign to the selected task.

Tasks

Tasks represent the actual orders the AI is given, for example, telling the AI what firing position zones they are allowed to use and in what configuration, what attitude they should take as well as various properties and scripting variables.

When changing the order of tasks, with a task selected hold Ctrl + Arrow Keys to move the task, left and right may be used to nest and un-nest tasks within parent tasks (child tasks will have higher priority than parent tasks) while up and down move the task higher and lower in priority (or swap the parent and child relationship between tasks)

Task color/text colorDescription
Red overlayTask is using the invalid flag
Light grey overlayTask is using the single use flag
Dark grey overlayTask is using the gate flag
Green outlineTask is using the LATCH ON flag
Red outlineTask is using the LATCH OFF flag
Red task nameTask is currently invalid due to conditions not being met, or the condition script failing to compile
Blue condition textCondition script has been edited but not yet compiled
Red condition textCondition script is invalid, needs to be corrected
Green task nameTask is currently active and in use
Red task nameTask is currently disabled
Grey task nameTask is inactive due to a condition being met

Flags and inhibitors

FlagDescription
LATCH ONOnce this task's conditions are met, this task will stay enabled and will not disable, even if the conditions are not met
LATCH OFFOnce this task's conditions are no longer met, this task will disable and will not re-enable, even if the conditions are met
GateTask is marked as invalid to AI, AI will never enter this task, good option to use with parent tasks so only the children are open to AI
Single UseOnce this task has been emptied of all AI after being entered, this task disables and stays disabled
Suppress CombatAI units with the engage sync flag enabled in their style tag will not engage targets unless attacked first, will watch and aim at targets however
Active CamoAI who enter this task become cloaked, and will not decloak unless they exit the task or die
BlindNeeds testing
DeafNeeds testing
BraindeadNeeds testing
Magic Player SightAny AI who enter this task will be given the ability to see the player through all walls, seems to have a range limit to be activated, but once activated does not deactivate
DISABLEDisables this task entirely
GroupsDescription
CoverPrevents AI from initiating cover behavior when inside this task
RetreatPrevents AI from initiating retreat/flee behavior when inside this task
VehiclesNeeds testing
GrenadesPrevents AI from throwing grenades when inside this task
BerserkPrevents AI from initiating berserk behavior when inside this task, does not prevent melee or melee charge behavior
EquipmentPrevents AI from using or deploying equipment when inside this task
Pureform RangedNeeds testing
Pureform TankNeeds testing
Pureform StalkerNeeds testing
DifficultyDescription
EasyDisables task on easy
NormalDisables task on normal
HeroicDisables task on heroic
LegendaryDisables task on legendary

General properties

MovementDescription
defaultAI will default to walking, unless they are already alert, then they will run
walkAI will walk into this task with weapons stowed in combat status 1 (Assuming they haven't been alerted prior)
runAI will run into this task while in combat status 3
crouchAI will crouch into this task while in combat status 3
FollowDescription
noneUnits in this task will not follow anyone
playerMakes units in this task follow the player throughout areas in this task
squadMake units in this task follow the follow squad option below throughout areas in this task
lead playerNeeds additional research
FieldsData typeDescription
Follow squadSelectionThis field allows you to select one of the squads in the scenario, note that self-following squads will crash sapien
Follow radiusRealAssumed in WU, the radius in which to follow the target
Entry scriptStringThe script to run when this task is entered
Command scriptStringAllows you to set a command script that will be fired when a squad enters this task, on all the units of the squad that enters
Exhaustion scriptStringThe script to run when this task has become invalid due to a condition
Squad group filterSelectionThis field accepts a created squad-group entry to filter entry into this task
Dialogue TypeEnumA selection of pre-defined dialogue responses that a unit will play when it enters this task

When directing a task into follow behavior, note that following is between areas and not between firing points

Pureform distribution

FieldData typeDescription
num rangedintUnknown, seems to force a transformation into this number of ranged pure forms when flood pureform units enter this task
num tankintUnknown, seems to force a transformation into this number of tank pure forms when flood pureform units enter this task
num stealthintUnknown, seems to force a transformation into this number of stalker pure forms when flood pureform units enter this task

UI controlled

For this section, almost everything here can be done via the objective GUI window

Activation Script

Don't use the properties window in Sapien to modify this, it will not save. This section handles data related to scripting functions used inside a task, you can use scripting to define when a task becomes active or inactive, any changes made to this script must be saved and then compiled.

name (string): The name of this task

Conditions

FieldData typeDescription
lifetime countintAfter this number of units has entered this task, mark the task to become inactive the moment it becomes empty
filter flagflagThis flag detetmines if the filter flag below is actually in effect
filterenumSets a pre-defined filter that blocks anything but the filter target, if a squad contains a foridden unit the entire squad is locked out
capacityintThe forced number of units in a squad in order to enter this task, if a squad does not fall within the bounds, it cannot enter this task (killing units does work to reduce the squad size)
max body countintThis task becomes inactive after this number of units inside the task have died
styleenumUse the objective UI to set this, allows you to set the preferred global style tag for AI who enter this task, vanilla uses normal, bunkering and assaulting
min strengthrealThis task will become inactive when a squad that enters it loses enough total body vitality to surpass this threshold (0.5 = 50% of max body vitality), shields and regions that absorb damage will not count towards this ratio, only base body vitality

Areas

With a task selected, you can cursor in the game window to available areas within the zone you have defined for this objective, and then select areas to be assigned to your current task. Ideally you won't ever need to touch these fields and flags manually as almost everything can be handled via the gamewindow and hotkeys.

Area typeHotkeyVisualDescription
NormalClickWhite overlayThis area is marked as a normal area that AI will navigate to and fight from
CoreShift + Click AgainPink overlayThis area is marked for AI with the highest leadership within the squad, they will navigate to and fight from these firing points
SearchShift + ClickGreen overlayThis area acts as an extended area AI can search within when looking for targets
GoalCtrl + ClickPink borderThis area is treated as a goal, AI will actively try to reach this area at all costs, this trait can be combined with any of the prior ones
Flags/fieldsData typeDescription
character flagsflagMarks what types of flood pure forms are allowed within this specific area for this task, AI do not change form to accommodate areas, a bit inconsistent and has no hotkey for quick assignment
ZoneenumWhat zone this area index belongs to, you shouldn't need to set this manually as setting a default zone for this objective will fill this entry, but should you decide to use areas from other zones you can set the zone here
AreaenumWhat area this area index is using, will pull from the area list belonging to the zone this entry is referencing

Direction

With a task selected, holding the Alt key and using right and Left Click in the game window, you can place two points that create an arrow, this arrow defines the direction the AI face when they are idle within this task. Or you can manually set the markers for each point of the arrow.

Point0: Using XYZ coordinates, set the placement of the back of the arrow

Point1: Using XYZ coordinates, set the placement of the front of the arrow

Acknowledgements

Thanks to the following individuals for their research or contributions to this topic:

  • odchylanie_uderzenia (writing and research)