Difference between revisions of "Ability pack"

From AI Product Manuals
Jump to navigationJump to search
m (Davemark moved page Ability Pack to Ability pack without leaving a redirect: Capitalization)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{IAUS Header}}
{{IAUS Header}}
== Concept ==
== Concept ==
An Ability Pack is similar to a [[Behavior Pack]] in that it is a collection of [[Behavior]]s that is named and given a description. They are then assigned to one or more [[Brain]]s to indicate that the agent has access to the behaviors in it. Typically, Ability Packs are "conceptual" in that they contain similar behaviors or behaviors that are part of a large idea.  
An Ability Pack is similar to a [[Behavior pack]] in that it is a collection of [[behavior ability pair]]s that is named and given a description. They are then assigned to one or more [[brain]]s 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]]. The way to think of this is that the Behavior is "why" something would be done and the Ability is "what" to do.
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 in the pack.  
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 [[Consideration]]s) 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.  
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 [[Consideration]]s) 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 Pair]]s 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:
An Ability Pack may therefore have multiple [[behavior ability pair]]s 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
* Default Melee
* Special Melee
* Special Melee
Line 16: Line 16:
However, all three of the above character types would have different abilities matched with them. (e.g. "throw rock", "shoot bow", "breathe fireball").
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.
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.


== Code ==
== Code ==
The implementation for an ability pack is kept in the class, '''AbilityPackage'''. It is merely a name, description and a list of [[behavior ability pair]]s.
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.


== Data ==
== Data ==
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.

Latest revision as of 02:55, 8 October 2021

This page is part of the IAUS Manual.BrainBehaviorBehavior TypeDecisionAI Entity

Concept

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.

Code

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.

Data

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.