Skip to content

Documentation

Peter Gilbert edited this page Mar 6, 2024 · 17 revisions

General Concepts

GMAS is built to make the process of adding Abilities to your game as easy and extendable as possible. It's a framework to allow developers to build anything they can imagine without having to worry about too much of the multiplayer tech. With its tight dependence on GMC, it is only intended to be used for multiplayer games. If you're making a single player game, use GAS.

Proper usage of this plugin requires understanding of how the GMC operates. Familiarize yourself with GMC and its documentation before using GMAS.

Some examples of abilities that are possible to create with GMAS:

Usage requires a GMC License. The GMCAbilitySystem is not officially affiliated with or supported by the General Movement Component or GRIMTEC. Don't ping GRIM on Discord for support on this plugin, he won't be able to help you

GAS Comparison

GMAS functions very similarly to GAS. The following apply to both systems:

  • Everything is client predicted by default
  • Abilities are typically implemented via Blueprint
  • Attributes, Abilities, and Effects concepts are used very similarly
  • Attribute changes are handled via Effects
  • GameplayTags are used extensively throughout

There are some differences that mostly surface at a deep technical level, mostly around how data is passed through GMC. However, here are some surface level differences:

  • No C++ needed to get started! Everything functions through BP, but can be extended via C++.
  • Effect removal can be predicted
  • Periodic Effects can be predicted
  • Activating abilities is done purely through GameplayTags
  • GameplayEffects can be made dynamically at runtime. You can define an Effect spec on the fly.
  • Attributes can be defined in the editor via DataAssets

Ability System Component

The Ability System Component (GMC_AbilitySystemComponent) is required on any actor using GMAS. It is responsible for handling all communication between GMC and the GMAS. It's also responsible for handling everything related to GMAS, such as ability activation or effect application. See the QuickStart guide for instructions on how to hook it into GMC.

Properties

Attributes: Attributes that are defined via a Data Asset based on GMCAttributesData.

Starting Abilities: Abilities that the component will have Granted to it at the start.

Starting Effects: Effects that the component will have applied to it at the start. These are applied on the server and replicated down to the client.

Ability Map: A TMap of gameplay tags to Ability objects. This handles the association between the two; it's what lets the component know what ability to actually activate when you pass a tag to ActivateAbility. This allows for reusing the same tag for different abilities across different components. Ex: You may want Ability.Jump to use a different Ability for a Human than a Monster.

Events

OnPreAttributeChanged: Called when an attribute is about to be changed on the component. Changes made to the AttributeModifier (retrievable from the AttributeModifierContainer) will happen before the change is actually applied to the component.

OnAttributeChanged: Called immediately after an attribute is changed. Contains the Attribute tag, old value, and new value.

Abilities

Abilities are actions taken by the Actor. Jumping, sprinting, teleporting, etc. are all examples of abilities. GMAS Abilities allow for affecting movement directly from "outside" the GMC (it's all happening inside the GMC behind the scenes). This allows for completely isolating your ability logic inside an ability.

This jump example functions very similarly to the GMC Demo jump, and shows how modifying movement from abilities can be done:
Example Jump Ability

Properties

Ability Tag: An ability tag to identify this ability. Not used for any logic. May be removed in the future.

Ability Cost: An effect that is applied to an Ability as its cost. Cost can be checked with a CanAffordAbiltiyCost call that will ensure any affected attributes are >= 0 after the effect is applied. Cost is applied by the ability with a call to CommitAbilityCost.

Activation Required Tags: GameplayTags that must be present in the owner's ActiveTags for the ability to activate. BeginAbility is not called if these tags are missing.

Activation Blocked Tags: GameplayTags that must be not present in the owner's ActiveTags for the ability to activate. BeginAbility is not called if these tags are present.

Events

Event Begin Ability: Called at the start of an Ability

Event Tick Ability: An event that is called very move step. Can be used for things like applying movement while a key is held.

Event End Ability: Called at the end of an ability. Good for cleaning up effects the the ability may have applied.

Ability Effects

Ability Effects, also known as "Effects", are objects that modify an Ability System Component (ASC). They are the primary way in how you interact with the state of the ASC (Attributes, Tags, etc.).

Ability Effects can be blueprinted, allowing for easy re-use of Effects. They can also be defined at runtime [Example], allow for extreme customization in how effects are built and applied.

Properties

Is Instant: Effect applies instantly and then ends immediately. Will not tick.

Negate Effect At End: Reverse the effect attribute modifiers and granted tags when the effect is removed. Good for buffs/debuffs.

Delay: Time before the effect applies any modifiers and tags.

Duration: How long this effect should be active. 0 is infinite.

Period: How often the effect should apply. Good for Damage Over Time effects.

Period Tick At Start: Whether the periodic effect should apply immediately or only at the first periodic tick.

Effect Tag: An optional tag to associate with the effect. It makes it easier to debug, and also allows removal/access without a direct reference.

Granted Tags: Tags applied to the ability controller's "Active Tags"

Granted Abilities: Tags applied to ability controller's "Granted Abilities"

Must Have Tags: Tags that must be present for the effect to be applied and maintained.

Must Not Have Tags: Tags that must not be present for the effect to be applied and maintained.

Attributes

Attributes consist of an identifying tag (ie. Attribute.Health), a float Value, and whether or not they are bound by GMC. Non bound Attributes cannot be used for prediction and are replicated using Unreal's default replication. Bound attributes can be used during GMC's MovementUpdate.

At runtime, Attributes should only be altered via Effects. For example, if you wanted to remove 10 health, apply an Instant effect that modifies health. See Ability Effects for more details.

Future Development

GMAS is very early in its development, and is missing a lot of features that GAS has. There is plenty of room for growth, and the plan is to keep adding features over time. If there's a feature you absolutely must have, feel free to reach out to @reznok on Discord.