Attribute

What is an Attribute?


An Attribute represents a property of an Entity that has a corresponding value. The Attribute level is a bit more complicated than the other levels since an Attribute can be made to accept any type of value. For example, an Attribute could be an InventorySlot out of a choice of InventorySlots or a float level between a min and a max. It is common for Attributes to have either choices or ranges since they can then be used with Selectors to dynamically choose a value based on runtime logic.

Attributes are used in many locations. They are used in Sensor Types, Target Factors, Selectors, Output Changes, and Behavior Types.

A couple of examples will make Attributes more concrete. The two most common Attributes are MovementSpeedAT and DetectionRadiusAT. MovementSpeedAT is a range Attribute which represents the min and max speed of the Agent. This Attribute is used by Behavior Types to dynamically set the Agent's speed. Also Selectors can use it to select a speed between the min and max using complex game logic. DetectionRadiusAT on the other hand has no range. It is just a level which is used in multiple Sensor Types to set the Agent's radius of Entity Detection. (Although it could be made to use a range if the detection radius should be dynamic.)

Attribute Type


Inspector Reference
Script Reference

Unlike other Level Types Attribute Type is an abstract class. It must be implemented by another class which will specify the Type of values the Attribute Type uses. For example the most common Attribute Type is MinMaxFloatAT. This inherits from Attribute Type is is for a ranged float value. The other common Attibute Type is the EnumAT. This is an abstract class though as it has the general code for an Enum Type but then the specific Type of the Enum is in the class that inherits from it. For example EnumStringAT inherits from EnumAT and defines its Enum type to be a string.