This page is part of the IAUS Manual. ♦ Brain ♦ Behavior ♦ Behavior Type ♦ Decision ♦ AI 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.
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.