Game logic - AI Behavior – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "{{DEFAULTSORT:{{#sub:{{PAGENAME}}|19}}}}" to "{{DEFAULTSORT:{{#sub:{{PAGENAME}}|13}}}}")
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=Description=
=Description=
*AI behaviour is a game logic allows to set up behaviour to entities (animals, NPC). Double click on animal on NPC to select AI behavior logic.
*AI behaviour is the game logic for controlling the behaviour of [[Ylands:Actors|Actors]] (NPCs, Animals, Mutants, and Monsters). Click on the Actor to change its properties, including assigning AI behaviour logic using the eyedropper.


[[Image:Ylands_AIBehaviour.jpg|right|400px|]]
= Properties =
[[Image:Ylands_AIBehaviour.png|right|400px|]]
=== Behaviour type ===
*'''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 [[Ylands:Zone|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 [[Ylands:Game_logic_-_Reference_point|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.


=Properties=
=== Detection Radius ===
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).


<b>Aggressivity settings:</b>
=== Aggressivity ===
*Aggressive and stand options - AI will chase detected player, returns to standing in a set point after disengaging.
*'''Aggressive''' - The Actor will chase the detected player and return to normal behavior after the Actor is outside the Detection Radius.
*Aggressive and loiter\patrol options - AI will chase detected player, returns to loitering in a set point after disengaging.
**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).
*Flee on sight and stand option - AI will run from detected player, will return to standing in a set point after player is outside of detection radius.
**Aggressivity Level Increase Factor - how aggressive the Actor will be. It can be set between 0 and 50 (3 by default).
*Flee on sight and loiter\patrol option - AI will run from detected player, returns to loitering in a set point after player is outside of detection radius.
**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).
*Ignore player - No action, just ignore player even if it's near.
*'''Flee on sight''' - The Actor will run from the detected player and return to normal behavior after the Actor is outside the Detection Radius.
*Non-aggressive and stand option - AI has neutral behaviour, just staring at player.  
**Flee radius - the distance the Actor will run away. It can be set between 0 and 200 (50 by default).
*Non-aggressive and loiter\patrol option - AI stops walks and start staring at player.  
**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.


=Radius and distance=
=== Note ===
*Detection radius - the radius at which the AI detects 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.
*Flee radius - the radius at which the AI will walk
*Minimum fear distance - the distance from which AI can start to run away from the player.
*Minimum aggressivity distance - the distance of aggressivity, when the player is closer to the AI.


=Behaviour type:=
= AI Behaviour Events =
*Stand - stands on the waypoint, idling.
*[[Ylands:Tile_-_On_AI_Behavior_Assigned|On Behaviour Assigned]]
*Loiter - walks randomly in a limited area around waypoint.
*Patrol - walks in selected zone. Possible to set up between reference points.
 
=Other settings=
*Combat range - defines radius in which AI will chase player before disengaging.


= Related Instructions =
*[[Ylands:Tile_-_AI_agresivity_setting|AI Aggressivity Setting]]
*[[Ylands:Tile_-_AI_-_Get-set_agresivity|AI Get-Set Aggressivity]]
*[[Ylands:Tile_-_AI_-_Get-set_entity|AI Get-Set Entity]]
*[[Ylands:Tile_-_AI_-_Get-set_fear_distance|AI Get-Set Fear Distance and Get-Set Fear Level Increase Factor]]
*[[Ylands:Tile_-_AI_-_Get-set_agresivity_distance|AI Get-Set Aggressivity Distance and Get-Set Aggressivity Level Increase Factor]]
*[[Ylands:Tile_-_AI_-_Get-set_flee_radius|AI Get-Set Flee Radius]]
*[[Ylands:Tile_-_AI_-_Get-set_combat_range|AI Get-Set Combat Range]]
*[[Ylands:Tile_-_AI_-_Get-set_detection_radius|AI Get-Set Detection Radius]]
*[[Ylands:Tile_-_Move_to_target|Move to Target]]
*[[Ylands:Tile_-_Attack_target|Attack Target]]




----
----
{{Ylands scripting navbox}}
{{Navbox/Ylands}}
{{DEFAULTSORT:{{#sub:{{PAGENAME}}|19}}}}
{{DEFAULTSORT:{{#sub:{{PAGENAME}}|13}}}}


[[Category: Game Logic]]
[[Category: Game Logic]]
[[Category: Ylands 0.15]]
[[Category: Ylands 0.15]]

Latest revision as of 14:21, 24 November 2023

Description

  • 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.

Properties

Ylands AIBehaviour.png

Behaviour type

  • 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.

Detection Radius

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).

Aggressivity

  • 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.

Note

  • 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

Related Instructions