Entity tag

From AI Product Manuals
Revision as of 21:02, 29 September 2021 by Davemark (talk | contribs) (→‎Concept)
Jump to navigationJump to search
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

Data