Entity tag

From AI Product Manuals
Revision as of 21:07, 29 September 2021 by Davemark (talk | contribs) (→‎Code)
Jump to navigationJump to search
This page is part of the IAUS Manual.BrainBehaviorBehavior TypeDecisionAI Entity


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.


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.