Game logic - AI Behavior
Jump to navigation Jump to search
- AI behaviour is the game logic for controlling the behaviour of Actors (NPCs, Animals, Mutants, and Monsters). Click on the Actor to change its properties, including assigning AI behaviour logic using the eyedropper.
- Stand - The Actor stands in one place, idling. The Actor will still move slightly, like it is breathing. If the player enters the detection radius, it will react according to the Aggressivity settings. Once the player is no longer within the detection radius of the Actor, the Actor will return to the original position, but not the original rotation.
- Loiter - The Actor walks randomly in a limited area (Sphere, Capsule, or Block Zone) centered on the original point. NPCs will move constantly within the zone, but the other Actors will pause occasionally to do their respective animations. The Actor's speed can be changed to: Run, Trot, Walk, or can be left at Default.
- Patrol - The Actor walks between Reference Points. The Reference Points can be used: In Order, Ping Pong (back and forth), or Random Order. The Minimum/Maximum Time Spent in the Idle State can be set between 0 and 30. If there are no reference points set, the Actor will walk in random directions but still pause occasionally according to the Idle settings. For this mode, the Actor's speed can also be changed to: Run, Trot, Walk, or can be left at Default.
Use the slider or type in a value to set the detection radius between 0 and 50. By default, the detection radius is 15. This radius will determine when the Actor detects the player (unless the Aggressivity is set to Ignore Player).
- Aggressive - The Actor will chase the detected player and return to normal behavior after the Actor is outside the Detection Radius.
- Minimum Aggressivity Distance - the distance where the Actor will start active aggressively. If this value is greater than the Detection Radius, the Actor will start acting aggressively as soon as the player is detected. This can be set between 0 and 100 (3 by default).
- Aggressivity Level Increase Factor - how aggressive the Actor will be. It can be set between 0 and 50 (3 by default).
- Combat Range - defines radius in which the Actor will chase the player before disengaging. It can be set between 0 and 200 (50 by default).
- Flee on sight - The Actor will run from the detected player and return to normal behavior after the Actor is outside the Detection Radius.
- Flee radius - the distance the Actor will run away. It can be set between 0 and 200 (50 by default).
- Minimum fear distance - the distance from which the Actor will start to run away from the player. It can be set between 0 and 100 (5 by default).
- Fear Level Increase Factor - how fearful the Actor will be. It can be set between 0 and 50 (5 by default).
- Ignore player - The Actor will not react to the player even if it is near.
- Non-aggressive - The Actor will rotate to stare at the player. If the Actor is set to loiter or patrol, the Actor will stop moving before turning to face the player.
- If no AI Behaviour is assigned, the Actor will Patrol without Reference Points (movement in random directions with pauses). They will be aggressive or flee based on their default. For example, rabbits will flee and all Mutants will be aggressive.
AI Behaviour Events
- AI Aggressivity Setting
- AI Get-Set Aggressivity
- AI Get-Set Entity
- AI Get-Set Fear Distance and Get-Set Fear Level Increase Factor
- AI Get-Set Aggressivity Distance and Get-Set Aggressivity Level Increase Factor
- AI Get-Set Flee Radius
- AI Get-Set Combat Range
- AI Get-Set Detection Radius
- Move to Target
- Attack Target