WEBVTT

00:06.980 --> 00:07.940
Welcome.

00:07.940 --> 00:11.240
In this section, we're going to start using gameplay tags.

00:11.270 --> 00:18.350
Gameplay tags are essential in gas, though they do exist outside of gas and can be used in non gas

00:18.350 --> 00:19.700
projects too.

00:19.970 --> 00:23.030
But in gas we use them extensively.

00:23.030 --> 00:24.800
So what are they?

00:24.830 --> 00:28.070
Gameplay tags are basically names.

00:28.340 --> 00:34.700
They have the type of gameplay tag and they're registered with the gameplay tag manager.

00:34.730 --> 00:37.970
Gameplay tags are hierarchical in nature.

00:38.000 --> 00:45.710
They take the form of parent child grandchild where each level of the hierarchy is separated by a dot.

00:45.740 --> 00:49.430
They don't have to have a three level hierarchy like this example.

00:49.430 --> 00:51.430
They can have more or less.

00:51.440 --> 00:54.740
So why are gameplay tags so great?

00:54.770 --> 01:01.430
Can't we just use an f string or f name or maybe an enum or just booleans in some cases?

01:01.550 --> 01:06.110
Well, tags come with a number of inherent qualities that make them versatile.

01:06.140 --> 01:12.390
Yes, they seem a lot like strings or F names, and in fact they are f names at the core.

01:12.420 --> 01:19.800
They have a member variable called tag name, which is indeed an F name, but their hierarchical nature

01:19.800 --> 01:24.300
makes them useful tools when it comes to making our code more flexible.

01:24.600 --> 01:31.080
Two tags can be compared for exact equality or even partial equality.

01:31.110 --> 01:36.540
Maybe they share the same root tag names only and that might be significant in code.

01:36.570 --> 01:43.170
The gameplay ability system is designed to use gameplay tags in just about every single class.

01:43.170 --> 01:48.180
In the API, we have the concept of giving tags to actors.

01:48.300 --> 01:53.940
What we mean by that is that we're giving the tag to an actor's ability system component.

01:54.240 --> 01:58.500
We then say that that ability system component has that tag.

01:58.500 --> 02:04.740
The ability system component implements an interface called the gameplay tag asset interface.

02:04.830 --> 02:12.570
This interface has a number of functions that make it easy to look at all owned tags, see if a particular

02:12.570 --> 02:20.220
tag is owned, or get all tags that match a given tag, or even see if any of the owned tags match a

02:20.220 --> 02:21.570
specified tag.

02:21.690 --> 02:27.180
Since these are interface functions, any class can implement this interface and decide how to handle

02:27.180 --> 02:28.320
these operations.

02:28.320 --> 02:34.470
Although the ability system component handles these in its own way, since classes can have multiple

02:34.470 --> 02:39.810
gameplay tags, we naturally need to store them in some sort of container.

02:39.960 --> 02:43.260
Now we don't use arrays to store our gameplay tags.

02:43.260 --> 02:50.010
Instead we use the gameplay tag container, which has some gameplay tag specific functionality and some

02:50.040 --> 02:51.390
added efficiency.

02:51.420 --> 02:58.890
Gameplay tag containers have the concept of a tag map count, meaning you can have more than one instance

02:58.890 --> 03:01.080
of a single tag in the container.

03:01.080 --> 03:08.340
It's this tag map count that tells us how many of a given tag exists in the container and at times this

03:08.340 --> 03:14.460
could be zero depending on whether a tag has been added and then subsequently removed, for example.

03:14.670 --> 03:21.870
So in debug mode, for example, we might see a given tag in the container even though its tag map count

03:21.870 --> 03:22.740
is zero.

03:22.740 --> 03:24.720
So that's something to be aware of.

03:24.930 --> 03:33.390
But all of these functions that check to see if a given object has a tag and its tag container are equipped

03:33.390 --> 03:35.100
to handle that situation.

03:35.100 --> 03:38.700
So it's the tag map count that they check for a given tag.

03:38.970 --> 03:43.200
Various classes and gas can have and use gameplay tags.

03:43.440 --> 03:49.920
Gameplay effects, for example, can contain tags that they grant to the ability system component.

03:49.920 --> 03:51.300
They're being applied to.

03:51.330 --> 03:57.750
Say we have an actor that applies a gameplay effect to a given ability system component.

03:57.750 --> 04:02.070
For this example, we'll say that this is a duration based effect.

04:02.340 --> 04:08.580
Now this gameplay effect can have a certain tag that it grants to the ability system component upon

04:08.580 --> 04:09.720
application on.

04:09.720 --> 04:17.190
Now that ability system component has that tag when the effects duration expires and it removes itself,

04:17.190 --> 04:19.590
it removes the tag as well.

04:19.770 --> 04:23.250
Gameplay effects are designed to handle that.

04:23.280 --> 04:26.400
Now in gas, this is actually quite significant.

04:26.430 --> 04:29.160
Many operations depend on tags.

04:29.160 --> 04:33.990
For example, an ability system component might have some gameplay ability.

04:34.230 --> 04:34.770
Now.

04:34.770 --> 04:41.070
Yes, we haven't learned about abilities yet, but let's just say that it has an ability that it wants

04:41.070 --> 04:42.090
to apply.

04:42.540 --> 04:43.140
Now.

04:43.140 --> 04:49.560
This gameplay ability may have a blocked tag, meaning that if the ability system component has that

04:49.560 --> 04:54.510
tag and it attempts to activate the ability, it will not be able to do so.

04:54.510 --> 05:02.730
It's blocked because it has the blocked tag or an ability system component may have an ability which

05:02.730 --> 05:06.600
contains a list of required tags, in other words.

05:06.720 --> 05:13.800
The ability system component must have these tags to activate the ability, and if it attempts to activate

05:13.800 --> 05:19.060
the ability, it will not be able to do so as it doesn't meet those tag requirements.

05:19.080 --> 05:22.080
It must have those tags to activate the ability.

05:22.470 --> 05:29.310
These are just a couple of examples of built in capabilities that work with tags, but tags can be used

05:29.310 --> 05:30.400
for other things.

05:30.420 --> 05:39.720
We can use them to identify inputs, abilities, attributes, damage types, buffs and debuffs messages,

05:39.720 --> 05:43.460
any type of data or really anything else we can think of.

05:43.470 --> 05:49.230
So we'll be making extensive use of gameplay tags all throughout this course, and we'll first begin

05:49.230 --> 05:51.810
by learning how to add them to our project.

05:51.810 --> 05:53.310
So we'll do that next.

05:54.090 --> 05:55.110
I'll see you soon.
