This page is part of the IAUS Manual. ♦ Brain ♦ Behavior ♦ Behavior Type ♦ Decision ♦ AI Entity ♦
An Ability Pack is similar to a Behavior pack in that it is a collection of behavior ability pairs that is named and given a description. They are then assigned to one or more brains to indicate that the agent has access to the abilities in it. Typically, Ability packs are "conceptual" in that they contain similar behaviors or behaviors that are part of a large idea.
The difference between a behavior pack and an ability pack is that the ability pack is, rather than a simple list of behaviors, it is a combination of a behavior matched with an ability in a behavior ability pair. The way to think of this is that the behavior is "why" something would be done and the ability is "what" to do.
In a way, this is similar to how a behavior has a behavior type as part of its data. In this case, the behavior type for the behavior in question is "Ability". That is because it is meant to be matched up with the ability specified in the pack.
The use case for this is that different character types may have different actions they perform for largely the same reason. For example, the default melee attack for an orc, a warrior, and a dragon would be largely different and would be dealt with by the game logic differently. If we were to do this in the Behavior data alone, we would have to create three different Behavior Types -- one for each of the three agent types. In this way, however, we can create a single "Default Melee" behavior that specifies the relevant reasons (via Considerations) we would want to conduct a melee attack. The Ability Pack would match up the "Default Melee" behavior with the ability for that particular agent type and would be saved with a name that specifies that it is meant for that particular type. By doing this, a Brain can be assigned the appropriate Ability Pack depending on the type of character.
An Ability Pack may therefore have multiple behavior ability pairs in it. The Behaviors (i.e. the "whys") themselves may be the same but the abilities would be different to show that they are being executed in the agent-specific way. For example, the behaviors in the Ability Pack may be:
- Default Melee
- Special Melee
- Ranged Attack
However, all three of the above character types would have different abilities matched with them. (e.g. "throw rock", "shoot bow", "breathe fireball").
Because of this organization by concept, more than one Ability Pack can be assigned to a Brain but often there will only be one that specifies the abilities that the Brain is allowed to use and the reasons it would do so.
The implementation for an ability pack is kept in the class, AbilityPackage. It is merely a name, description and a list of behavior ability pairs.
In addition to standard accessor functions, there are functions for adding an ability to the package, removing one from the package, and seeing if an selected ability is already in the list.
Ability packages are created in the data tool and abilities (with their associated behaviors) are assigned to them there. Once they have been created, they can be assigned to a brain which has the effect of allowing that brain to use all the abilities in the ability pack.