AI Entity

AI controlled entity is a basic object which can execute behaviors. Behaviors might be provided by user via setter or by assigned reasoner.

Public Interface

Reasoner [get/set]

This entity’s assigned reasoner.

Behavior [get/set]

This entity’s assigned behavior.

Blackboard [get/set]

This entities blackboard.

Shared Blackboards [get/set]

Shared blackboards to which this entity is subscribed.

Has Active Behavior

Returns true if this entity is executing legal behavior.

Tips

Registering entity in manager

Entity should be registered in AI manager to properly work.

  • C++

  • C#

auto entity = std::make_shared<grail::AIEntity>();
manager.RegisterAIEntity(entity, 0); //registered entity with priority 0
manager.UpdatePlayingModels(); //Update entities' playing models - let them think
manager.UpdateEntities(1.0f); //Update entities and their behaviors indicating that previous update was 1 second ago.
var entity = new Grail.AIEntity();
manager.RegisterAIEntity(entity, 0); //registered entity with priority 0
manager.UpdatePlayingModels(); //Update entities' playing models - let them think
manager.UpdateEntities(1.0f); //Update entities and their behaviors indicating that previous update was 1 second ago.
Each entity can be registered in more than one manager. This can help user LOD their AI.

Entity =/= Character

In-game character does not necessarily need to be represented by only one entity. Entities can represent just some of the functions full character have.

In a twin stick shooter the user can create two entities: one responsible for movement and one for shooting. A single in-game character will consist of those two entities, because they can make decisions independently. If they should make decisions in cooperation, the user can connect them to the same shared blackboard and let them communicate through it.

API Reference