WEBVTT

00:06.950 --> 00:07.850
Welcome.

00:07.850 --> 00:12.500
So we've been hearing a lot about gameplay effects, but we still haven't used them.

00:12.680 --> 00:17.630
We already know that we should be using gameplay effects to change our attribute values.

00:18.020 --> 00:22.730
It's now time to discuss what gameplay effects are and what they're capable of.

00:22.850 --> 00:28.310
Now they're capable of quite a lot and we'll touch on much of that in this lecture, but we're going

00:28.310 --> 00:32.330
to take things one step at a time in our project so we don't get overwhelmed.

00:32.360 --> 00:35.120
Remember, gas is a powerful system.

00:35.120 --> 00:37.730
It's important to take this step by step.

00:37.760 --> 00:43.880
This video is just an overview of some of the mini features of gameplay effects.

00:44.270 --> 00:46.760
So what is a gameplay effect?

00:46.940 --> 00:51.110
A gameplay effect is an object of type u gameplay effect.

00:51.140 --> 00:56.000
We use gameplay effects to change attributes and gameplay tags.

00:56.090 --> 01:02.660
Now we'll discuss what gameplay tags are a little later on when we start making some of our own.

01:02.690 --> 01:09.030
For now, it's just enough to understand that they can be used to identify by various things.

01:09.060 --> 01:13.710
Really, they're much more versatile than that, but we'll get to that now.

01:13.740 --> 01:16.140
Gameplay effects are data only.

01:16.140 --> 01:18.180
We don't add logic to them.

01:18.210 --> 01:22.230
We create a blueprint based on the new gameplay effect class.

01:22.260 --> 01:26.400
We don't subclass the gameplay effect into child classes.

01:26.430 --> 01:31.950
Gameplay effects change attributes through modifiers and executions.

01:32.070 --> 01:39.630
Modifiers come in various flavors, including more complex custom calculations for when attribute changes

01:39.630 --> 01:42.300
must be intricate and specific to gameplay.

01:42.300 --> 01:49.560
Design modifiers specify a type of operation to be performed on the attribute in question.

01:49.650 --> 01:58.620
These modifiers take a value which we refer to as a magnitude, and it uses that magnitude to change

01:58.620 --> 02:02.850
the attribute in a way that depends on the modifier operation.

02:02.880 --> 02:05.550
Here are the different types of operations.

02:05.700 --> 02:10.710
Add simply adds a given magnitude to the attributes value.

02:10.740 --> 02:15.750
You can add negative values here as well to get the effect of subtraction.

02:16.020 --> 02:18.810
Multiply multiplies the attribute.

02:18.840 --> 02:27.000
Divide divides it and override will replace the attributes value with the value provided for the magnitude.

02:27.570 --> 02:33.660
The magnitude used in these operations is produced from the magnitude calculation.

02:33.690 --> 02:37.440
Gameplay effects support several calculation types.

02:37.860 --> 02:41.820
Scalable float is the simplest type of modification.

02:41.850 --> 02:49.710
You can specify a hardcoded value for the magnitude directly, or you can use a table which scales the

02:49.710 --> 02:52.440
magnitude based on the gameplay effects level.

02:52.650 --> 02:56.010
You see, gameplay effects themselves can have their own levels.

02:56.040 --> 02:59.910
Attribute based uses another attributes value.

02:59.940 --> 03:05.970
For example, you can add a value to the player's health equal to the player's strength, for instance.

03:06.000 --> 03:10.110
Now there are options to customize this further.

03:10.110 --> 03:16.680
You could add to the player's health a value equal to strength times ten or something like that.

03:17.190 --> 03:21.410
Now, custom calculation class is another option.

03:21.420 --> 03:27.880
We can create a class designed to capture other values such as attributes or really any other variables

03:27.880 --> 03:33.410
that we want and use them in a calculation that can be arbitrarily complex.

03:33.430 --> 03:41.290
We typically call these modifier magnitude calculations or MKs, and these are a powerful way to change

03:41.290 --> 03:44.950
a single attribute based on a custom calculation.

03:45.340 --> 03:52.600
Another way to set the magnitude for the gameplay effect modifier is to use a set by color magnitude.

03:52.630 --> 03:54.940
This is a key value pair.

03:54.970 --> 03:59.590
Assigning a magnitude associated with a name or a gameplay tag.

03:59.590 --> 04:05.860
And this is useful if you need to set the modifiers magnitude based on code logic at the time that we

04:05.890 --> 04:09.130
create the gameplay effect or apply it.

04:09.370 --> 04:16.420
An even more powerful way to change an attributes value in the gameplay effect is to use a custom execution

04:16.420 --> 04:22.090
also known as a gameplay effect, execution calculation or exec calc.

04:22.120 --> 04:27.430
These can change more than one attribute and they can really do anything else that we choose to code

04:27.430 --> 04:27.970
in them.

04:27.970 --> 04:34.630
They're the most powerful way to modify attributes in a gameplay effect, and we'll learn more about

04:34.630 --> 04:36.610
all of these in time.

04:36.700 --> 04:40.090
Now gameplay effects have a duration policy.

04:40.300 --> 04:49.190
They can be either instant effects in which their modifier is applied instantly in a one off action.

04:49.210 --> 04:56.650
They can have a duration, meaning they can modify an attribute for a set period of time after which

04:56.650 --> 05:01.080
that modification is undone and they can be infinite.

05:01.090 --> 05:05.930
So they affect an attribute and that effect doesn't go away.

05:05.950 --> 05:08.370
Now, it's not that it never goes away.

05:08.380 --> 05:14.050
We can remove infinite effects, it's just that they stay until we manually remove them.

05:14.050 --> 05:20.740
So these are useful in situations where we may not know how long that effect should be applied and it

05:20.740 --> 05:23.710
should be removed in response to some gameplay.

05:23.740 --> 05:30.550
Gameplay effects can stack and they have their own policies for how to stack and of course they can

05:30.550 --> 05:32.190
add gameplay tags.

05:32.200 --> 05:33.970
They can also grant abilities.

05:33.970 --> 05:36.970
And these are just a few things the gameplay effects can do.

05:36.970 --> 05:40.750
So they're actually a lot more versatile than all of these things.

05:40.780 --> 05:47.800
Now gameplay effects can be applied directly, but usually we create a more lightweight version of them

05:47.800 --> 05:50.620
known as a gameplay effect spec.

05:50.650 --> 05:56.570
This concept of a spec is common in gas and is a form of optimization.

05:56.590 --> 06:03.520
The spec contains the bare bones information needed to perform the modifications and the only actual

06:03.520 --> 06:10.150
instance of the gameplay effect class that typically gets instantiated is the class default object or

06:10.150 --> 06:10.910
CDO.

06:10.930 --> 06:13.240
Now that's just how it typically occurs.

06:13.240 --> 06:17.860
Most of the things we're covering here are just ways that it's typically done.

06:17.890 --> 06:25.500
The gameplay effect class is just versatile enough to never need to be subclassed into child classes.

06:25.510 --> 06:33.070
If you need complex attribute modifications, you use custom executions or magnitude calculations rather

06:33.070 --> 06:36.600
than subclassing the gameplay effect into a child class.

06:36.610 --> 06:42.910
The effect spec carries information with it as well, such as gameplay tags that the effect has, and

06:42.910 --> 06:49.150
it also has an effect context an additional class that can store more information about the effects

06:49.150 --> 06:50.260
being applied.

06:50.290 --> 06:56.830
References to the causer and the target of the effect are easily accessed and can be used to determine

06:56.830 --> 07:02.800
what happens to the overall magnitude calculation, as well as trigger gameplay mechanics to any actors

07:02.800 --> 07:04.210
involved in the effect.

07:04.210 --> 07:09.510
So as you can see, gameplay effects are quite versatile and very customizable.

07:09.520 --> 07:14.980
They were designed to meet just about any need you may have when it comes to affecting a player's attributes

07:14.980 --> 07:15.830
in the game.

07:15.850 --> 07:21.220
Gameplay effects are often applied from within gameplay abilities, but they don't have to be.

07:21.220 --> 07:27.130
An actor may have a gameplay effect that it wishes to apply to some other actor that overlaps with it.

07:27.420 --> 07:31.440
This is a nice simple example, and it's what we'll start with.

07:31.470 --> 07:34.120
Remember our aura effect actor?

07:34.140 --> 07:40.230
We're going to return to this class and make it quite a bit more useful, and we'll do that next.

07:40.350 --> 07:41.460
I'll see you soon.
