AI: Difference between revisions
No edit summary |
No edit summary |
||
(15 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{CustomHeader|Title=AI Types}} | |||
<p>Currently in ARCADIA we have 3 types of AI. These are the biped bots (exile, switchblade, etc), dangerous plants, and turrets. All work functionally similar, though the bipeds work with more complex nodes involving movement. All 3 types also use the same set of factions which are explained in the section below.</p> | |||
AI | {{CustomHeader|Title=AI Factions}} | ||
<ul> | |||
<li><strong>Friendly:</strong> This faction is friendly to all other factions; players cannot damage this faction, but other factions may attack it. The friendly faction will never fight back.</li> | |||
<li><strong>Neutral:</strong> This faction is neutral to all other factions; players can damage this faction and other factions may attack it. The neutral faction will never fight back.</li> | |||
<li><strong>Hostile:</strong> This faction is hostile to everything, including other members of the hostile factions. Players can damage this faction and other factions may attack it.</li> | |||
<li><strong>DefaultPlayer:</strong> This faction is the players faction, AI set to this faction will assist the player by attacking DefaultAI.</li> | |||
<li><strong>DefaultAI:</strong> This faction opposes DefaultPlayer, AI set to this faction will attack the player and any other AI set to DefaultPlayer.</li> | |||
</ul> | |||
{{CustomHeader|Title=AI Properties}} | |||
<p>In addition to their faction, AI's also have two other properties, with bipeds having even more.</p> | |||
<ul> | |||
<li><strong>Weapon:</strong> The weapon bipeds start with. If they are set to no weapon, they will not be able to attack.</li> | |||
<li><strong>Idle Animation:</strong> The animation bipeds loop before entering combat.</li> | |||
<li><strong>Health:</strong> The health of the AI.</li> | |||
<li><strong>Invincible:</strong> Can the AI be killed or not.</li> | |||
</ul> | |||
= | {{CustomHeader|Title=AI Spawners}} | ||
<p>AI spawners allow the dynamic spawning of AI's during play mode.</p> | |||
<p>The spawner has many properties:</p> | |||
<ul> | |||
<li><strong>AI To Spawn:</strong> This determines which AI is spawned by the spawner, and covers all types explained at the top of this page.</li> | |||
<li><strong>Faction:</strong> This determines which faction the AI is spawned as.</li> | |||
<li><strong>Entity Health:</strong> This determines the AI’s health when spawned.</li> | |||
<li><strong>Weapon:</strong> If the AI spawned is a biped, it will be equipped with the selected option.</li> | |||
<li><strong>Animation:</strong> The idle animation a biped will spawn with.</li> | |||
<li><strong>Lifetime:</strong> How long the AI will exist in the world before being despawned. If this option is set to 0, the AI will never despawn.</li> | |||
<li><strong>Spawn Limit:</strong> How many AI can this spawner spawn in total. If this option is set to 0 the spawner will never stop spawning AI.</li> | |||
<li><strong>Simultaneous Spawn Limit:</strong> How many AI this spawner can have active at a time. If the spawner attempts to go over this limit, it will despawn the oldest spawned AI. If this option is set to 0, the spawner will have no limit. Despite this it should be noted there are plans for a global simultaneous spawn limit that will prevent spawners creating new AI once it is reached.</li> | |||
<li><strong>Offset:</strong> Three axis (X,Y,Z) determining how offset the spawner spawns the AI from its current location.</li> | |||
<li><strong>Despawn Last:</strong> When the AI spawner reaches its spawn limit, will it despawn the first or last created bot.</li> | |||
</ul> | |||
<p>The logic event the spawner has is called OnAISpawned, and will trigger any time an AI is spawned by the spawner. It is a trigger type can can be linked to On/Off nodes, other spawners, and a variety of other logic nodes. Various other logic, including mostly variables, can be linked to the spawner to get or set data.</p> | |||
= | {{CustomHeader|Title=AI Weapons}} | ||
<p>Bipeds have a set of weapons that determine their attack patterns, damage, and rate of fire.</p> | |||
= | {{CustomHeader|Title=AI Commands}} | ||
<p>All AI, and AI spawners, are compatible with command nodes. These are a variety of nodes that can instruct an AI on how to behave. If linked to an AI they will cause it to execute a behavior when activated. If linked to an AI spawner they will cause all currently active AI spawned by the spawner to execute a behavior.</p> | |||
<h3>Follow Node</h3> | |||
<p>The follow node causes bipeds to follow the selected target when activated. It can be linked to AI spawners, but will only function if the entity is set to a biped.</p> | |||
<p>It has four properties:</p> | |||
<ul> | |||
<li><strong>Follow distance:</strong> Determines how closely the biped will follow the target. Both this value, and the follow target, can be set dynamically using variables.</li> | |||
<li><strong>Combat stance:</strong> Causes the biped to always aim down sights, even when there is no nearby target.</li> | |||
<li><strong>Allow Target:</strong> Enables the biped to shoot whilst moving.</li> | |||
<li><strong>Run:</strong> Causes the biped to run towards its target instead of walking.</li> | |||
</ul> | |||
<h3>Attack Node</h3> | |||
<p>The attack node causes AI to attack the selected target when activated. It can be linked to AI spawners. Whilst it has no properties, its attack target can be dynamically set using variables.</p> | |||
<h3>Nav Restriction Node</h3> | |||
<p>The navigation restriction node can be linked to volumes to prevent an AI from entering or leaving.</p> | |||
<h3>Patrol Node</h3> | |||
<p>The patrol node causes bipeds to follow a patrol designed using patrol points. The biped will move from point to point, until encountering an enemy or commanded to use another behavior. It can be linked to AI spawners, but will only function if the entity is set to a biped. If a patrol point is placed out of the bots reach, it will continue to attempt to reach it, until it becomes within reach.</p> | |||
<p>The patrol node has 3 properties:</p> | |||
<ul> | |||
This | <li><strong>Minimum patrol delay:</strong> The shortest amount of time a biped will wait at a patrol point before moving towards the next.</li> | ||
<li><strong>Maximum patrol delay:</strong> The longest amount of time a biped will wait at a patrol point before moving towards the next.</li> | |||
<li><strong>Ping-Pong:</strong> If the biped reaches the last point in the patrol, will it reverse back through all the points to the start.</li> | |||
</ul> | |||
<p>The points themselves also have an optional delay override that will take priority over the patrol nodes delay properties if enabled. This allows select points to have a longer wait for variable times at different patrol locations.</p> | |||
<p>The OnMovementFinished event on the bipeds can be paired with this node to cause a trigger whenever a biped reaches a stop.</p> | |||
<h3>Wander Node</h3> | |||
<p>The wander node causes bipeds to wander about randomly. It can be linked to AI spawners, but will only function if the entity is set to biped.</p> | |||
<h3>Go To Node</h3> | |||
<p>The go to node causes bipeds to go to the location of an object. Unlike the follow node, once the biped has reached the location, it will stop. It can be linked to AI spawners, but will only function if the entity is set to biped. It should be noted that the biped will continually try to reach its destination, even if it is unreachable. It will only stop once it has either reached this location or is commanded to perform another behavior. Bipeds will also not go to the exact location of the object, but as close as is reasonable to prevent clumping of AI.</p> | |||
<p>The go to node has 3 properties, all of which are shared with the follow node:</p> | |||
<ul> | |||
<li><strong>Combat stance:</strong> Causes the biped to always aim down sights, even when there is no nearby target.</li> | |||
<li><strong>Allow Target:</strong> Enables the biped to shoot whilst moving.</li> | |||
<li><strong>Run:</strong> Causes the biped to run towards its destination instead of walking.</li> | |||
</ul> | |||
<p>The OnMovementFinished event on the bipeds can be paired with this node to cause a trigger whenever a biped reaches a stop.</p> | |||
<h3>Biped Alertness</h3> | |||
<p>When a biped transitions from one state of alertness to another, it will trigger an event that can be linked up to other logic objects. Currently the bipeds have 3 states of alertness:</p> | |||
<ul> | |||
<li><strong>Oblivious:</strong> This is when the biped has no idea of the presence of an enemy faction. This is most commonly observed when the bipeds terminate the player they are fighting, and the player respawns.</li> | |||
<li><strong>Aware:</strong> This is when the biped knows the location of an enemy faction. This is most commonly observed when the player gets near an enemy biped and it begins to attack.</li> | |||
<li><strong>Intrigued:</strong> This is when the biped knows of the presence of an enemy faction, but not their location and are likely seeking them out.</li> | |||
</ul> | |||
Latest revision as of 16:43, 17 June 2024
AI Types
Currently in ARCADIA we have 3 types of AI. These are the biped bots (exile, switchblade, etc), dangerous plants, and turrets. All work functionally similar, though the bipeds work with more complex nodes involving movement. All 3 types also use the same set of factions which are explained in the section below.
AI Factions
- Friendly: This faction is friendly to all other factions; players cannot damage this faction, but other factions may attack it. The friendly faction will never fight back.
- Neutral: This faction is neutral to all other factions; players can damage this faction and other factions may attack it. The neutral faction will never fight back.
- Hostile: This faction is hostile to everything, including other members of the hostile factions. Players can damage this faction and other factions may attack it.
- DefaultPlayer: This faction is the players faction, AI set to this faction will assist the player by attacking DefaultAI.
- DefaultAI: This faction opposes DefaultPlayer, AI set to this faction will attack the player and any other AI set to DefaultPlayer.
AI Properties
In addition to their faction, AI's also have two other properties, with bipeds having even more.
- Weapon: The weapon bipeds start with. If they are set to no weapon, they will not be able to attack.
- Idle Animation: The animation bipeds loop before entering combat.
- Health: The health of the AI.
- Invincible: Can the AI be killed or not.
AI Spawners
AI spawners allow the dynamic spawning of AI's during play mode.
The spawner has many properties:
- AI To Spawn: This determines which AI is spawned by the spawner, and covers all types explained at the top of this page.
- Faction: This determines which faction the AI is spawned as.
- Entity Health: This determines the AI’s health when spawned.
- Weapon: If the AI spawned is a biped, it will be equipped with the selected option.
- Animation: The idle animation a biped will spawn with.
- Lifetime: How long the AI will exist in the world before being despawned. If this option is set to 0, the AI will never despawn.
- Spawn Limit: How many AI can this spawner spawn in total. If this option is set to 0 the spawner will never stop spawning AI.
- Simultaneous Spawn Limit: How many AI this spawner can have active at a time. If the spawner attempts to go over this limit, it will despawn the oldest spawned AI. If this option is set to 0, the spawner will have no limit. Despite this it should be noted there are plans for a global simultaneous spawn limit that will prevent spawners creating new AI once it is reached.
- Offset: Three axis (X,Y,Z) determining how offset the spawner spawns the AI from its current location.
- Despawn Last: When the AI spawner reaches its spawn limit, will it despawn the first or last created bot.
The logic event the spawner has is called OnAISpawned, and will trigger any time an AI is spawned by the spawner. It is a trigger type can can be linked to On/Off nodes, other spawners, and a variety of other logic nodes. Various other logic, including mostly variables, can be linked to the spawner to get or set data.
AI Weapons
Bipeds have a set of weapons that determine their attack patterns, damage, and rate of fire.
AI Commands
All AI, and AI spawners, are compatible with command nodes. These are a variety of nodes that can instruct an AI on how to behave. If linked to an AI they will cause it to execute a behavior when activated. If linked to an AI spawner they will cause all currently active AI spawned by the spawner to execute a behavior.
Follow Node
The follow node causes bipeds to follow the selected target when activated. It can be linked to AI spawners, but will only function if the entity is set to a biped.
It has four properties:
- Follow distance: Determines how closely the biped will follow the target. Both this value, and the follow target, can be set dynamically using variables.
- Combat stance: Causes the biped to always aim down sights, even when there is no nearby target.
- Allow Target: Enables the biped to shoot whilst moving.
- Run: Causes the biped to run towards its target instead of walking.
Attack Node
The attack node causes AI to attack the selected target when activated. It can be linked to AI spawners. Whilst it has no properties, its attack target can be dynamically set using variables.
The navigation restriction node can be linked to volumes to prevent an AI from entering or leaving.
Patrol Node
The patrol node causes bipeds to follow a patrol designed using patrol points. The biped will move from point to point, until encountering an enemy or commanded to use another behavior. It can be linked to AI spawners, but will only function if the entity is set to a biped. If a patrol point is placed out of the bots reach, it will continue to attempt to reach it, until it becomes within reach.
The patrol node has 3 properties:
- Minimum patrol delay: The shortest amount of time a biped will wait at a patrol point before moving towards the next.
- Maximum patrol delay: The longest amount of time a biped will wait at a patrol point before moving towards the next.
- Ping-Pong: If the biped reaches the last point in the patrol, will it reverse back through all the points to the start.
The points themselves also have an optional delay override that will take priority over the patrol nodes delay properties if enabled. This allows select points to have a longer wait for variable times at different patrol locations.
The OnMovementFinished event on the bipeds can be paired with this node to cause a trigger whenever a biped reaches a stop.
Wander Node
The wander node causes bipeds to wander about randomly. It can be linked to AI spawners, but will only function if the entity is set to biped.
Go To Node
The go to node causes bipeds to go to the location of an object. Unlike the follow node, once the biped has reached the location, it will stop. It can be linked to AI spawners, but will only function if the entity is set to biped. It should be noted that the biped will continually try to reach its destination, even if it is unreachable. It will only stop once it has either reached this location or is commanded to perform another behavior. Bipeds will also not go to the exact location of the object, but as close as is reasonable to prevent clumping of AI.
The go to node has 3 properties, all of which are shared with the follow node:
- Combat stance: Causes the biped to always aim down sights, even when there is no nearby target.
- Allow Target: Enables the biped to shoot whilst moving.
- Run: Causes the biped to run towards its destination instead of walking.
The OnMovementFinished event on the bipeds can be paired with this node to cause a trigger whenever a biped reaches a stop.
Biped Alertness
When a biped transitions from one state of alertness to another, it will trigger an event that can be linked up to other logic objects. Currently the bipeds have 3 states of alertness:
- Oblivious: This is when the biped has no idea of the presence of an enemy faction. This is most commonly observed when the bipeds terminate the player they are fighting, and the player respawns.
- Aware: This is when the biped knows the location of an enemy faction. This is most commonly observed when the player gets near an enemy biped and it begins to attack.
- Intrigued: This is when the biped knows of the presence of an enemy faction, but not their location and are likely seeking them out.