Difference between revisions of "Entity tag"

From AI Product Manuals
Jump to navigationJump to search
m (Davemark moved page Entity Tag to Entity tag without leaving a redirect: Capitalization)
 
(One intermediate revision by the same user not shown)
(No difference)

Latest revision as of 13:37, 7 October 2021

This page is part of the IAUS Manual.BrainBehaviorBehavior TypeDecisionAI Entity

Concept

Tags are a way of keeping information about an agent or object. They can be assigned to an object based on its world object type (i.e. properties that they are “born with”) or they can be added to and removed from an object dynamically in the game. They are largely considered Boolean -- either you have a tag of a particular type or you do not. In a way, they would act in a similar fashion to having maybe Boolean variables on the object, one representing each potential property. However, these are stored in a sparse manner using an unordered map (C++) or dictionary (C#) so that they can be added to and removed as necessary without having hundreds or thousands of placeholder Booleans on an object that may never have that particular property set to true.

The other advantage is that tags are added via the data tool as necessary by designers. Once that happens and the tag data is exported, they can be used on any object and by any behavior without code changes. Because tags are often used for specific scenarios or as part of specific suites of behaviors or level design, this allows enormous flexibility and extensibility from the data side only.

Code

Individual Tags that can be used are listed in the enum EntityTag in the enums file. They are exported here from the Data Tool.

An AI Entity contains the currently active tags for that object in an EntityTagSet. This is where the information about that entity is stored.

Data

Tags are created and stored in the AI database via the Data Tool. While there, they are available to be assigned to World Object Types (via Tag Sets) and be accessed by Behaviors that are either checking for them, or adding/removing them as a result of the behavior execution.