Game logic - AI Behavior – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "[[Ylands_" to "[[Ylands:")
(21 intermediate revisions by 4 users not shown)
Line 1: Line 1:
=Description=
=Description=
*AI behaviour is a game logic allows to set up behaviour for entities (animals, NPC).
*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.


=Properties=
= 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.


<b>Aggressivity settings:</b>
=== Detection Radius ===
*Aggressive - will attack player
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).
*Flee on sight - start running on sight
*Ignore player - no action, just ignore
*Non-aggressive - neutral behaviour


=Behaviour type:=
=== Aggressivity ===
*Stand - stands on the waypoint, idling
*'''Aggressive''' - The Actor will chase the detected player and return to normal behavior after the Actor is outside the Detection Radius.
*Loiter - walks randomly in a limited area around waypoint
**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).
*Patrol - walks in selected zone. Possible to set up between reference points.
**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 =
*[[Ylands:Tile_-_On_AI_Behavior_Assigned|On Behaviour Assigned]]
= 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}}|19}}}}


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

Revision as of 17:36, 16 November 2022

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