Behavior type

From AI Product Manuals
Revision as of 22:02, 28 September 2021 by Davemark (talk | contribs) (Initial Entries)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Behavior Types are the core actions that an agent can perform. One way of thinking of Behavior Types is as "button presses". That is, there is often an analog to what the player would do in order to execute an action.

Implementation

Behavior Types are specified in the data tool as simply a list that gets exported to the Enums file.

In code, each Behavior Type is given it's own class that is inherited from the Behavior class. The mappings between the enum and the appropriate class are done in the BehaviorData class. Therefore, if a new Behavior Type is created in the data tool, the sub-class needs to be written (in Behavior.cpp) and there needs to be a matchup specified in BehaviorData.cpp as well.

Note that there will often be a Behavior Type called "Ability". This is intentionally generic as it is handled in a different way by a different class.

Examples

Examples of Behavior Types are, "Move to Target", "Face Target", and "Play Animation".

Actions that would fall under the "Ability" Behavior Type could be "melee attack", "ranged attack", "special attack", etc. Again, these would all be specified as "Ability" for their Behavior Type with the matchup to the appropriate action handled elsewhere.