WEBVTT

00:06.780 --> 00:07.790
Welcome.

00:07.800 --> 00:08.850
In this section.

00:08.850 --> 00:15.960
We're concerned with making combat even more exciting as we're going to want more features while we're

00:15.960 --> 00:19.140
implementing more complex gameplay abilities.

00:19.290 --> 00:25.950
Now the features I'm talking about are things like debuffs and other effects that happen as a result

00:25.950 --> 00:27.900
of different types of damage.

00:28.080 --> 00:33.260
If I launch a fireball at one of these enemies, I'd like there to be a burn chance.

00:33.270 --> 00:39.030
And based on that burn chance, I'd like to determine if there's a successful burn.

00:39.030 --> 00:44.160
And I'm going to consider burn to be a debuff, which will last for a duration.

00:44.160 --> 00:51.540
And during that duration, things will be happening to the victim, such as taking fire damage every

00:51.540 --> 00:53.340
so often and so on.

00:53.430 --> 01:02.160
Now we have another gameplay ability that so far is just empty and if I level up I can upgrade.

01:03.600 --> 01:04.890
This ability.

01:04.890 --> 01:12.870
We called it electrocute, and I can spend a point on it so that it's now unlocked and I can even equip

01:12.870 --> 01:13.440
it.

01:13.530 --> 01:18.870
But the thing about this ability is it's a different damage type.

01:18.960 --> 01:21.090
It's going to be lightning.

01:21.150 --> 01:28.260
So the lightning damage type, I'd like to be associated with a different kind of debuff.

01:29.190 --> 01:36.120
So for this game project, each offensive ability is going to be associated with its element.

01:36.150 --> 01:42.120
We'll have fire abilities, lightning abilities and a third type of element.

01:42.150 --> 01:49.320
So for that reason, each of these abilities needs to have its own chance to do its particular type

01:49.320 --> 01:50.880
of debuff, right?

01:50.910 --> 01:56.940
So I'm going to do a little bit of a change to our design because each of our gameplay abilities has

01:56.970 --> 02:05.760
a team map of damage types to an scalable float using a curve for that particular damage type.

02:05.760 --> 02:06.420
Right.

02:06.630 --> 02:13.260
Well, I'm going to make our gameplay abilities have one damage type that they can apply.

02:13.350 --> 02:21.080
Now if you like, you could still keep the team map and have multiple damage types per ability.

02:21.090 --> 02:22.410
That's fine.

02:22.410 --> 02:29.800
But to simplify our design, I'm going to have one damage type per ability and then each ability that

02:29.800 --> 02:34.360
causes damage will have its own chance to do a debuff.

02:34.390 --> 02:35.020
Right.

02:35.020 --> 02:38.020
And I think this way is a little bit simpler.

02:38.030 --> 02:45.100
It allows us to avoid over complicating our code and encapsulate damage types into different abilities.

02:45.100 --> 02:50.050
And if you really need it to a given gameplay ability could be specialized.

02:50.050 --> 02:57.700
You could derive a new gameplay ability class and give it more than one damage type and damage parameters.

02:57.700 --> 03:02.980
But the base aura damage ability class will have a single damage type.

03:02.980 --> 03:09.120
So for that reason we're going to make a little bit of a change to the aura damage gameplay ability.

03:09.130 --> 03:13.960
We're going to remove the map and just have a single scalable flow for damage.

03:13.960 --> 03:19.630
And we're also going to have debuff parameters corresponding to each damage type.

03:19.630 --> 03:27.490
So what I'm going to do in this video is remove the team map from our gameplay ability and just use

03:27.520 --> 03:30.370
a single damage type for it.

03:30.400 --> 03:36.190
Now what does that mean for our abilities in the editor here?

03:36.190 --> 03:38.380
Well, we have a firebolt ability.

03:38.380 --> 03:41.230
That's our only offensive ability so far.

03:41.350 --> 03:43.930
Where do we actually apply damage?

03:43.930 --> 03:48.070
Well, we don't apply damage until the projectile hits, right?

03:48.070 --> 03:49.930
We don't apply the gameplay effect.

03:49.930 --> 03:53.420
So we're going to have to go into the projectile and fix that as well.

03:53.440 --> 03:55.750
So a couple things to do here.

03:56.210 --> 03:58.040
First, I'm going to close the editor.

03:59.660 --> 04:08.900
And we're going to go into our public ability system abilities folder and open aura damage gameplay

04:08.900 --> 04:15.470
ability where we have the team map and instead of having a team map now I'd like to have just a single

04:15.680 --> 04:20.570
gameplay tag for damage type and an F scalable float for base damage.

04:21.020 --> 04:24.680
So first we'll have the gameplay tag for damage type.

04:24.680 --> 04:30.950
So this will be damage type and we'll have the F scalable float for damage.

04:31.850 --> 04:33.470
This will be damage.

04:34.250 --> 04:41.390
And we'll make these both edit defaults only and we'll remove damage types altogether.

04:42.110 --> 04:45.260
Now what complications does this create?

04:45.290 --> 04:48.260
Well, there are a couple areas we'll have to change.

04:48.290 --> 04:55.040
For one, we have to go into our projectile spell, which is using our map we removed.

04:55.040 --> 05:01.010
So we can do that here in the private folder in abilities or a projectile spell.

05:01.010 --> 05:03.140
And we can search for damage types.

05:04.150 --> 05:07.690
Now what we're doing here is looping over damage types.

05:07.720 --> 05:12.610
We're getting the scale damage based on that damage type in the pair.

05:12.760 --> 05:14.590
But now we don't have to do that.

05:14.590 --> 05:16.510
We can just use the damage.

05:16.540 --> 05:21.310
So instead of looping now, we're just going to take the contents of that loop.

05:22.080 --> 05:29.640
We're going to create a const float called scale Damage, and instead of using dot value, we can just

05:29.640 --> 05:33.150
use our damage scalable float.

05:34.730 --> 05:39.650
And for the set by color magnitude, we can just use our damage type gameplay tag.

05:43.040 --> 05:45.530
And we can get rid of this loop altogether.

05:45.560 --> 05:52.100
Now, this is going to make things a lot simpler and also allows us to stop looping over options that

05:52.100 --> 05:54.680
are not going to be there most of the time.

05:55.100 --> 06:01.400
And if we create specialized gameplay effects, say, one that causes lightning and fire damage, well

06:01.400 --> 06:05.560
then we'd assign those set by color magnitudes just for fire and lightning.

06:05.570 --> 06:08.330
No need to loop over all damage types.

06:09.430 --> 06:13.210
Now, where are we retrieving this set by caller magnitude?

06:13.240 --> 06:16.650
That's going to be in our exec calc damage.

06:16.660 --> 06:20.230
Let's go into that and see what's happening here.

06:20.320 --> 06:26.650
We're getting damage set by caller magnitudes and we're doing this by looping over all of the damage

06:26.650 --> 06:28.870
types that exist in our project.

06:28.870 --> 06:31.780
And we're checking resistances for all of them.

06:32.500 --> 06:38.410
We can still do this because we may create gameplay abilities that set multiple damage types in their

06:38.410 --> 06:39.280
effect.

06:39.460 --> 06:45.010
It's just that now by default, the base damage gameplay ability just has one.

06:45.190 --> 06:48.220
So we can leave the exact calc as is.

06:48.370 --> 06:51.730
So with this we can compile and launch the editor.

06:53.960 --> 06:59.960
And of course, that's going to allow us to find other errors resulting from our change.

06:59.960 --> 07:05.660
For one or a damage gameplay ability does have a cause damage function, doesn't it?

07:06.510 --> 07:09.180
And this, of course, loops over damage types.

07:09.270 --> 07:16.440
This doesn't need to be a loop anymore as we're only going to have by default one so we can replace

07:16.440 --> 07:19.470
the for loop with its contents.

07:19.470 --> 07:21.930
So we're going to copy the contents of the for loop.

07:22.460 --> 07:28.430
We're going to replace the for loop with the contents and instead of pair value, this would be the

07:28.430 --> 07:29.300
damage.

07:30.320 --> 07:33.950
Scalable float and the key was the damage type.

07:33.950 --> 07:37.070
So we can replace pair key with damage type.

07:38.040 --> 07:44.070
Now get damage by damage type is actually not necessary anymore.

07:44.100 --> 07:51.450
So what we can do is remove this function altogether and we'll remove it from the header file as well.

07:52.720 --> 07:56.770
Now, a quick compile is going to tell us if that breaks anything.

07:58.610 --> 08:02.720
And or a firebolt also is going to need to change.

08:02.720 --> 08:03.290
Right.

08:03.440 --> 08:06.110
This is going to be a little bit simpler as well.

08:06.110 --> 08:07.850
This is for get description.

08:07.850 --> 08:11.060
We now no longer need get damage by damage type.

08:11.060 --> 08:17.660
All we need to do is use our damage scalable float, evaluating it at a particular level, like we're

08:17.660 --> 08:24.320
doing an aura projectile spell so we can copy those two lines where we're doing it and back in Aura

08:24.320 --> 08:28.310
Firebolt, we can go ahead and paste those two lines.

08:28.490 --> 08:30.500
Actually, we don't need that second line there.

08:30.500 --> 08:35.210
We just need to get damage and get the value at the ability level.

08:36.130 --> 08:43.510
Except since this is on the aura Firebolt spell itself, it doesn't know its ability level.

08:43.510 --> 08:45.910
We have to use the level that was passed in.

08:46.120 --> 08:48.370
So we have that scale damage.

08:48.370 --> 08:53.740
And in fact, this is what we can replace this with here.

08:54.490 --> 09:00.940
And because damage is now a member variable, this right here can be called scaled damage.

09:02.020 --> 09:04.060
And we have to replace everywhere.

09:04.060 --> 09:06.490
We're using damage with scale damage.

09:07.220 --> 09:13.700
So I'm going to take this line scale damage and we're going to use that in our descriptions.

09:13.700 --> 09:16.190
So I'm going to go down to the else case.

09:16.840 --> 09:20.470
We're going to replace damage with scaled damage.

09:23.950 --> 09:31.150
And replace the damage local variable with our scaled damage where we're getting the value from our

09:31.150 --> 09:32.740
scalable float.

09:33.660 --> 09:36.030
And replacing damage with scale damage.

09:38.300 --> 09:40.220
So that takes care of those errors.

09:40.220 --> 09:43.820
I'm going to compile again and see if we get any more.

09:46.520 --> 09:49.340
And that seems to have called out all of them.

09:49.340 --> 09:52.040
So now we can just make sure things work.

09:52.070 --> 09:56.150
Make sure our damage is set for fire, bolt and so on.

09:58.800 --> 10:02.220
So in the editor we can open up firebolt.

10:02.640 --> 10:08.840
We need to go to our damage which is now unset because this used to be a team map.

10:08.850 --> 10:10.640
Now we're going to have to set it.

10:10.650 --> 10:18.000
So I'm going to set the damage value to one use CT damage and select abilities.

10:18.000 --> 10:19.350
Dot Firebolt.

10:20.200 --> 10:24.790
Take our damage type and set it to damage fire.

10:25.520 --> 10:25.910
Like.

10:25.910 --> 10:30.290
So now we also have melee and ranged damage.

10:30.410 --> 10:33.740
So we're going to need to go into our enemies abilities.

10:33.740 --> 10:42.380
So ability system, enemy abilities and we're going to have to go into gar enemy Firebolt and change

10:42.380 --> 10:52.070
its damage, setting the value to one using CT damage and the firebolt curve and setting its damage

10:52.070 --> 10:53.180
type to fire.

10:55.630 --> 11:01.810
We should also go to GA melee attack and set its damage type.

11:01.810 --> 11:10.120
We're going to set that to physical set damage to one and scale it by CT damage using the melee curve.

11:11.340 --> 11:14.520
And we'll go to ranged attack and set this one.

11:14.520 --> 11:22.890
This will be damage types physical damage one using the CT damage curve table and the abilities ranged

11:22.890 --> 11:23.640
curve.

11:23.760 --> 11:28.770
So with that now, all the abilities should be causing damage.

11:30.890 --> 11:33.890
And my firebolt is causing damage.

11:34.930 --> 11:38.290
And our spear goblins are causing damage.

11:38.290 --> 11:43.080
And we can also check to make sure the slingshot goblins will cause damage.

11:43.090 --> 11:44.620
I think they will, though.

11:48.140 --> 11:50.510
I'm just going to bring in a goblin slingshot.

11:57.600 --> 11:59.310
And it does cause damage.

12:06.480 --> 12:07.230
Excellent.

12:07.320 --> 12:09.470
So we have that change, right?

12:09.480 --> 12:14.340
And we're now ready to start implementing debuffs.

12:14.520 --> 12:22.560
And for debuffs, I'd like my gameplay ability at least, or a damage gameplay ability to have a number

12:22.560 --> 12:32.520
of parameters for damage because damage will now be associated with debuffs and debuff chances and debuffs

12:32.520 --> 12:36.000
and damage types will have a 1 to 1 relationship.

12:36.180 --> 12:44.460
So we're going to have gameplay tags for each debuff type and those will correspond to our damage types.

12:44.490 --> 12:50.940
We can add those to or gameplay tags which I see there's an include for here in aura firebolt.

12:50.970 --> 12:57.030
We no longer need, so I'm going to close all the tabs and open aura gameplay tags.

13:01.440 --> 13:07.470
And we'll have a set of debuff types that correspond to damage types, much like we have damage types

13:07.470 --> 13:08.670
to resistances.

13:08.700 --> 13:10.680
These will all be tied together.

13:10.950 --> 13:14.070
So right here where we have damage types.

13:14.670 --> 13:17.090
And up here we have resistances.

13:17.100 --> 13:21.600
We're also going to have debuffs associated with each damage type.

13:21.900 --> 13:26.490
Now, I think the resistances should now be right down here next to the damage types.

13:26.490 --> 13:28.170
I'm going to drag them down.

13:30.070 --> 13:34.990
And we're also going to have our debuff gameplay tags right here as well.

13:35.140 --> 13:45.640
So I'm going to make an gameplay tag called debuff Underscore and we'll have one associated with fire.

13:45.670 --> 13:48.040
I'm going to call it Burn.

13:49.450 --> 13:56.020
I'm going to have another one associated with lightning called debuff underscore stun.

13:56.800 --> 14:00.130
So lightning damage will have a chance to stun.

14:00.310 --> 14:03.340
Now we have two more arcane and physical.

14:03.460 --> 14:09.130
Now I don't have names for those, so I'm just going to call them debuff arcane and debuff physical.

14:16.070 --> 14:18.140
And we can go ahead and make those tags.

14:18.140 --> 14:21.500
Before we do, though, I'm going to make another T map here.

14:21.590 --> 14:27.710
Just like damage types to resistances, we're going to have damage types to debuff tags.

14:28.340 --> 14:30.860
We'll call it damage types to debuffs.

14:32.110 --> 14:34.190
So let's do two things now.

14:34.210 --> 14:38.800
Let's make those new debuff tags and let's add them to our map.

14:40.700 --> 14:42.880
I'm going to find my resistances.

14:42.890 --> 14:43.820
Here they are.

14:43.820 --> 14:48.830
And I'm just going to make the four new debuff tags right here.

15:00.770 --> 15:04.280
And I'll go ahead and make a comment that says debuffs.

15:06.200 --> 15:09.290
So we're going to have first debuff.

15:09.470 --> 15:16.850
We'll start with arcane and the tag will be debuff dot arcane.

15:17.240 --> 15:22.310
And we're going to say debuff for arcane damage.

15:22.790 --> 15:24.350
We'll just do it like that.

15:26.630 --> 15:38.180
Next we'll have debuff underscore burn and this will be debuff dot burn and we'll say debuff for fire

15:38.180 --> 15:38.930
damage.

15:39.860 --> 15:43.430
Our next one will be debuff physical.

15:45.250 --> 15:52.630
The f name will be debuff physical and the f string will say debuff for physical damage.

15:54.730 --> 15:57.880
Looks like that one was the lightning gameplay tag, but that's fine.

15:58.120 --> 16:03.280
Our next one is going to be debuff stun.

16:04.080 --> 16:05.820
The tag will be debuff.

16:06.290 --> 16:11.490
Dot stun and the string will say debuff for lightning damage.

16:14.760 --> 16:17.400
So now we have the four debuff tags.

16:17.430 --> 16:21.270
Now let's add those to our team map and we're going to do those.

16:21.570 --> 16:27.870
We'll do it right here where we're associating damage types to resistances.

16:27.900 --> 16:30.270
We can just copy these four lines.

16:31.950 --> 16:37.140
Except instead of damage types to resistances, we're going to use damage types to debuffs.

16:40.300 --> 16:45.580
And for arcane we'll map it to debuff arcane.

16:49.700 --> 16:50.630
For lightning.

16:50.630 --> 16:53.600
We'll map it to debuff stun.

16:53.840 --> 16:57.110
For physical we'll map it to debuff physical.

16:57.530 --> 17:00.950
And for fire we'll map it to debuff burn.

17:02.230 --> 17:09.040
And with that now our gameplay tags not only has debuff tags, but it also has the ability to look up

17:09.040 --> 17:14.050
the debuff by damage type, which is really useful.

17:14.470 --> 17:20.380
So I'll go ahead and put this comment here that says Map of damage types to debuffs.

17:22.660 --> 17:26.170
So now we have debuff gameplay tags.

17:26.860 --> 17:32.890
So our next step is to associate our abilities with debuffs.

17:33.040 --> 17:35.410
So an ability has a damage type.

17:35.410 --> 17:41.800
It's now going to have statistics related to debuffs such as debuff chance and so on.

17:42.100 --> 17:44.950
And we'll handle implementing that next.
