Skip to content

AI component documentation

Peter Crew edited this page Jan 15, 2019 · 1 revision

This page covers all of the AI components that can be added to an entity. It should be noted that each entity can only have one AI type active.


BeeAi

The most basic form of AI, used for the base AI of bees. This simply causes the entity to wander around in an approximate circle area.

Required components

  • MovementComponent

Constructor

The constructor takes no arguments, e.g. new BeeAi().


BirdAi

A generic bird AI that causes the entity to fly around and land on perches.

Required components

  • MovementComponent
  • GrowthComponent
  • PercherComponent

Constructor

The constructor takes no arguments, e.g. new BirdAi().


PatrolAI

A generic AI that causes the entity to follow its parent if it is young, or simply wander around if it is older.

Required components

  • MovementComponent
  • GrowthComponent

Constructor

The constructor takes two float arguments defining the minimum and maximum amounts of time (in seconds) that the entity will stay idle for, e.g. new PatrolAi(5, 10) allows the entity to remain idle for between 5 and 10 seconds.


PatrolWithSwimAi

Very similar to the PatrolAi, but allows the entity to swim whilst wandering.

Required components

  • MovementComponent
  • GrowthComponent

Constructor

The constructor takes two float arguments defining the minimum and maximum amounts of time (in seconds) that the entity will stay idle for, e.g. new PatrolWithSwimAi(5, 10) allows the entity to remain idle for between 5 and 10 seconds.


SwimAi

Causes the entity to swim around under water. This should only be used for entities that are placed in the water.

Required components

  • MovementComponent

Constructor

The constructor takes no arguments, e.g. new SwimAi().


TortoiseAi

Provides the same behaviour as PatrolWithSwimAi but treats the first entity model as an egg stage, where the entity has to wait to hatch.

Required components

  • MovementComponent
  • GrowthComponent

Constructor

The constructor takes two float arguments defining the minimum and maximum amounts of time (in seconds) that the entity will stay idle for, e.g. new TortoiseAi(5, 10) allows the entity to remain idle for between 5 and 10 seconds.


WalkingBirdAi

Provides the same behaviour as PatrolAi but treats the first entity model as an egg stage, where the entity has to wait to hatch.

Required components

  • MovementComponent
  • GrowthComponent

Constructor

The constructor takes two float arguments defining the minimum and maximum amounts of time (in seconds) that the entity will stay idle for, e.g. new WalkingBirdAi(5, 10) allows the entity to remain idle for between 5 and 10 seconds.

Clone this wiki locally