Welcome back.
So now that we have some sort of idea what the gameplay ability system is, we need to know the different
parts that make up the system.
So we'll discuss those in this video and lay out a plan for the next steps moving forward that we can
take to start adding gas to our project.
Now, one of the most important parts of gas is the ability system component.
This is a type of component that can be added to an actor and it handles lots of important things in
the gameplay ability system, such as granting abilities, activating those abilities, handling notifications
for when certain abilities are activated or effects are applied, and lots of other things that we'll
learn about.
So the ability system component is something that we must add to our character.
If we'd like that character to participate in gas.
Now, just as important as the ability system component is, the attribute set just about any game involves
a number of attributes that you associate with any given object or character, and these range from
life and mana to just about any other attribute that you can think of in gas.
We store these attributes on the attribute set, which has a number of capabilities that allow us to
associate those attributes with other various parts of the gas system.
Now at the core of the gameplay ability system are the abilities.
Gameplay abilities are classes that we use to encapsulate the functionality of some sort of thing that
a character or object can do in the game.
Things like attacks and casting spells are generally abilities, and the gameplay ability allows us
to keep all the code and functionality kept inside of a specific gameplay ability class.
Now gameplay abilities run asynchronous tasks that we call ability tasks.
These allow us to execute code that is asynchronous, meaning that once we start the task it may perform
its job and finish immediately or its job may span across a period of time and may do different things
depending on what's going on in the game for that specific ability.
So ability tasks are like the workers that perform the work for the gameplay ability itself.
Now we also have gameplay effects.
These are what we use to change the values of attributes and they're capable of a number of different
things related to attributes.
We use gameplay effects to change attributes directly, change them over time, periodically increase
or decrease them, and associate those attribute changes with various calculations that take other parameters
and attributes into account.
We also have gameplay cues.
These are responsible for handling cosmetic effects such as particle systems and sounds and can handle
the replication of those as well.
Now another core part of the ability system are gameplay tags.
Now gameplay tags are not actually unique to the gas system.
They exist outside of gas and can be used in non gameplay ability system projects, but their use is
pervasive all throughout gas and gameplay tags are extremely useful for identifying just about anything
you can think of and their hierarchical nature makes them more versatile than simple variables such
as enums, booleans or strings.
And we'll learn all about their usefulness throughout the course as we use them.
So these are the main parts of gas.
And we need to start with the first two of these.
In order to incorporate gas into our project, we need an ability system component and an attribute
set.
Now the way that we add an ability system component can vary.
We can have a pawn and in the case of our project, our player controlled pawn is an aura character
and you can add the ability system component directly on the pawn class.
You can do the same thing with the attribute set if you like.
Now another option is to take some other class associated with your pawn, such as the player state
and add the ability system component and the attribute set to that class.
Now, there are various reasons to do it one way or another, and the truth is you have some flexibility
here.
But let's discuss a couple of reasons to put the ability system component and attribute set on the pawn
versus the player state.
Specifically, let's say that we've added our ability, system component and attribute set to the pawn
class.
And let's say this is a multiplayer game, at which point our pawn dies and we decide to destroy that
pawn so that we can respawn another one.
Well, because the ability system component and the attribute set exist on that pawn.
When the pawn is destroyed, so are the ability, system component and attribute set.
They go away.
And if you haven't taken measures to save any pertinent data on those classes, say in a save game object
or on a database somewhere, that data is gone.
And when you respawn a new pawn, the ability system component and the attribute set are created fresh,
starting off at their default values and with the default abilities.
Now, let's say instead we have the ability system component and the attribute set on the player state
which is associated with our pawn.
Now if our pawn dies and we destroy it, the ability system component and the attribute set don't get
destroyed with it because they don't exist on that class.
They exist on the player state which persists when you destroy the pawn so we can spawn a new pawn and
associate it with our player state.
And then we still have the same values in our attribute set and the same abilities in our ability system
component because they haven't been destroyed.
Now, this is one reason to set things up this way, but another reason is you just might not want your
ability, system, component and attribute set cluttering up the character.
You may wish to swap out your character for another character and you may not want your ability, system,
component and attribute set to be unique to any given character.
You may want to keep that associated with the player itself.
Now reasons to keep these things on the pawn may be that the pawn might be simple.
Your game might have simple enemies that do have the ability system component and attribute set, but
there's no need for a player state for those enemies because they're simple.
They just have to have attributes and abilities and perform their logic based on AI.
So an ability, system component and attribute set directly on the pawn might be appropriate for that
scenario.
In this game project.
That's the approach we're going to take.
Our enemy characters are going to have their ability, system components and their attribute sets directly
on the character class.
But for our player controlled character, we're going to put our ability system component and attribute
set on the player state.
This gives us the opportunity to see both ways of doing things and the things that you have to take
into account, doing it one way versus the other.
So we need these three classes and these will be associated with our player controller and our character,
which we've already created.
What we have not created yet are the player state, the ability system component and the attribute set.
So we have a number of steps to take to get started adding gas to our project.
First we need a player state class.
And we need to create an ability system component class that we can add to the player state.
And of course we also need the attribute set.
These are the fundamental classes that we're going to need to create to start implementing gas in our
project, and we'll start making those next.