AI

From EVERYWHERE wiki
Jump to navigation Jump to search

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.

Nav Restriction Node

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.