WEBVTT

00:06.970 --> 00:07.960
Welcome.

00:08.050 --> 00:15.880
So now that we know how we can use modifiers to apply modifications to attributes and that those modifications

00:15.880 --> 00:23.440
themselves can be backed by other attributes, this opens a very important door when it comes to RPG

00:23.590 --> 00:29.520
style attributes, and that is the door to derived attributes.

00:29.530 --> 00:36.490
In other words, attributes that depend either partially or entirely on other attributes.

00:37.030 --> 00:42.850
Now, in our game project, every single one of our attributes is going to be functional.

00:42.850 --> 00:45.910
It's going to affect the game in some way.

00:45.910 --> 00:54.400
That's important and it helps from a game design perspective to lay out what all the attributes in the

00:54.400 --> 00:55.870
game should be doing.

00:55.870 --> 01:02.740
Now, we won't be discussing all of them just yet, but we'll discuss most of them right now because

01:02.740 --> 01:10.040
we're going to design more attributes and decide which attributes are dependent on other attributes.

01:10.130 --> 01:18.050
Now, so far, we've decided to categorize some of our attributes as primary attributes.

01:18.500 --> 01:26.750
And in our game, the primary attributes are going to be the independent attributes that don't depend

01:26.750 --> 01:28.910
on any other attributes.

01:28.910 --> 01:37.520
These are the attributes that are stand alone and we can increase them or reduce them based on various

01:37.520 --> 01:39.350
mechanics in our game.

01:39.350 --> 01:45.980
But it's these attributes that in some way or another, all other attributes depend on.

01:46.340 --> 01:51.980
These are the four primary attributes we've created, starting with strength.

01:52.160 --> 01:59.720
Now, every attribute affects the game in some way, and we need to decide how the attributes affect

01:59.720 --> 02:00.110
the game.

02:00.110 --> 02:03.380
And this is a decision made at the design level.

02:03.380 --> 02:10.010
You could come up with different ways that I come up with and ultimately in a game development team,

02:10.010 --> 02:17.810
there's some sort of design process, some sort of meeting or series of meetings where those in charge

02:17.810 --> 02:24.140
of designing the game agree upon the mechanics of how each attribute affects the game.

02:24.140 --> 02:29.330
And for this game, project decisions had to be made, so I made them.

02:29.330 --> 02:37.490
But I understand that you may have ideas for how you'd like your attributes to affect your game, so

02:37.490 --> 02:40.520
don't take these as chiseled in stone.

02:40.550 --> 02:42.110
Don't take them as gospel.

02:42.110 --> 02:49.370
I've just made some design decisions because they had to be made and you may have other ideas and you'd

02:49.370 --> 02:52.100
like to implement them differently and that's totally fine.

02:52.100 --> 02:58.970
And at this stage as a game developer, I think you're capable of making those decisions and implementing

02:58.970 --> 03:01.970
things in your own way if you so choose.

03:01.970 --> 03:08.360
But do feel free to copy my design and just follow along exactly.

03:08.360 --> 03:14.960
If you don't feel like sitting down and making those design decisions just yet for your own game in

03:14.960 --> 03:18.590
this game, strength is going to increase physical damage.

03:18.830 --> 03:20.960
Now, we haven't gotten to damage yet.

03:20.990 --> 03:26.930
We're not implementing it at this point in the course, but when we do, we'll have different types

03:26.930 --> 03:27.620
of damage.

03:27.620 --> 03:29.330
Physical being one of them.

03:29.330 --> 03:38.810
And strength is going to be an attribute that will add some kind of bonus to attacks which cause physical

03:38.810 --> 03:39.560
damage.

03:39.560 --> 03:45.470
Now, that's not the only thing strength can affect in the game, but this is going to be the defining

03:45.470 --> 03:52.340
characteristic of strength, the description given to strength when you hover over it and your attribute

03:52.340 --> 03:57.200
menu intelligence is going to increase magical damage.

03:57.200 --> 04:01.640
Resilience is going to increase armor and armor penetration.

04:01.640 --> 04:08.270
Now, I know we haven't created those yet, but that's how I'm going to define resilience and vigor

04:08.270 --> 04:13.640
is going to increase health the most vital of all the attributes, perhaps.

04:13.640 --> 04:17.120
So these are the decisions I've made for the primary attributes.

04:17.120 --> 04:18.980
But what about other attributes?

04:18.980 --> 04:21.500
What about secondary attributes?

04:21.500 --> 04:29.150
In this game project secondary attributes are going to more closely affect gameplay mechanics, mostly

04:29.150 --> 04:36.350
combat, and these will be attributes that are derived either partially or wholly from other attributes.

04:36.350 --> 04:40.700
The secondary attributes I've decided to create are as follows.

04:40.730 --> 04:41.780
Armor.

04:41.930 --> 04:44.900
Armor is going to depend on resilience.

04:44.900 --> 04:50.900
As resilience increases, armor is going to increase by a certain amount that we decide.

04:50.930 --> 04:57.500
The definition of armor is that it reduces damage taken and improves block chance.

04:57.530 --> 04:59.930
Next, we'll have armor penetration.

04:59.960 --> 05:06.680
Armor penetration is going to be dependent on resilience and it's going to ignore a percentage of.

05:06.700 --> 05:10.690
Enemy armor and also increase the critical hit chance.

05:10.690 --> 05:19.360
So as we attack an enemy, if we have a high armor penetration, that value is going to cause us to

05:19.360 --> 05:26.620
ignore some of the armor of the enemy we're attacking, allowing us to cause more damage and also increase

05:26.620 --> 05:28.960
the chance to get a critical hit.

05:29.820 --> 05:30.270
Next.

05:30.270 --> 05:33.390
We have blockchains which will be dependent on armor.

05:33.420 --> 05:38.790
Notice this is a secondary attribute that depends on another secondary attribute.

05:38.790 --> 05:43.320
So these don't have to all depend solely on primary attributes.

05:43.350 --> 05:47.220
Blockchains will be the chance to cut incoming damage in half.

05:47.220 --> 05:51.420
So in our damage calculations, we'll take blockchains into account.

05:51.420 --> 05:56.400
And if we get a successful block, we're going to reduce the incoming damage by half.

05:57.380 --> 05:59.180
Next is critical hit chance.

05:59.210 --> 06:02.330
Notice armor penetration increases this.

06:02.510 --> 06:05.390
So this will be dependent on armor penetration.

06:05.390 --> 06:09.470
And as armor penetration increases, so does critical hit chance.

06:09.470 --> 06:14.030
And this will be the chance to double the damage, plus a critical hit bonus.

06:14.030 --> 06:18.830
So if we get a successful critical hit, our damage will be doubled.

06:19.070 --> 06:21.290
Next, we have critical hit damage.

06:21.290 --> 06:24.500
This will also be dependent on armor penetration.

06:24.500 --> 06:28.820
And this is the bonus damage added when a critical hit is scored.

06:29.300 --> 06:31.520
Next is critical hit resistance.

06:31.520 --> 06:37.400
This will be dependent on armor and this will reduce the critical hit chance of attacking enemies.

06:37.400 --> 06:43.850
So as an enemy may have a high critical hit chance if we have a high critical hit resistance, we can

06:43.850 --> 06:45.620
sort of balance that out.

06:46.550 --> 06:48.140
Next is health regeneration.

06:48.140 --> 06:50.500
And this will be dependent on vigor.

06:50.510 --> 06:55.490
So vigor increases health, yes, but it also increases other things.

06:55.490 --> 07:00.050
Health regeneration will be the amount of health regenerated every one second.

07:00.050 --> 07:05.450
So a periodic infinite gameplay effect should come to mind here, right?

07:06.110 --> 07:12.620
Next we'll have mana regeneration and I'll have mana regeneration dependent on intelligence, and this

07:12.620 --> 07:15.620
will be the amount of mana regenerated every second.

07:16.570 --> 07:22.750
Then we'll have our max health, which will be dependent on vigor, and this will be the maximum amount

07:22.750 --> 07:23.950
of health obtainable.

07:23.950 --> 07:25.990
Now, we already have this attribute.

07:26.020 --> 07:28.480
We called it one of our vital attributes.

07:28.480 --> 07:34.540
But I'd like to now consider this to be a secondary attribute, as I'd like it to be dependent on one

07:34.540 --> 07:37.510
of our primary attributes, the vigor attribute.

07:38.470 --> 07:40.600
And finally we'll have Max Mana.

07:40.600 --> 07:43.640
And this will now be dependent on intelligence.

07:43.660 --> 07:46.960
This will be the maximum amount of mana obtainable.

07:46.990 --> 07:50.860
So as our intelligence goes up, so will our max mana.

07:51.130 --> 07:56.770
So as you can see, we have quite a few secondary attributes that we're going to add to our attribute

07:56.770 --> 07:57.520
set.

07:58.060 --> 08:03.930
And adding attributes to an attribute set is something that we now have experience doing.

08:03.940 --> 08:06.670
So this is going to be your quest.

08:06.910 --> 08:12.760
Your quest is to add all the secondary attributes to your attribute set.

08:12.790 --> 08:18.970
Now you can come up with your own or you can use the list that we just went over, complete all the

08:18.970 --> 08:21.580
boilerplate steps for each attribute.

08:21.610 --> 08:28.630
Now, this involves declaring the variable, adding the rep notify and your uproperty and defining that

08:28.630 --> 08:29.320
function.

08:29.320 --> 08:31.110
Make sure it's a new function.

08:31.120 --> 08:38.630
Also adding the attribute accessors macro for each of the attributes and in your rep, notify use the

08:38.630 --> 08:46.910
gameplay attribute rep notify boilerplate macro and also add each attribute to get lifetime replicated

08:46.910 --> 08:51.020
props so you can register it as a replicated variable.

08:51.020 --> 08:56.180
So pause the video and add all of your new secondary attributes now.

08:59.240 --> 08:59.690
Okay.

08:59.690 --> 09:07.580
So since this is mostly boilerplate, in fact, it's all boilerplate, I'm going to add all of the attributes

09:07.730 --> 09:12.570
and time lapse the video as this is all repetition at this point.

09:12.590 --> 09:17.710
So if you like, you can follow along, pause or slow the video down.

09:17.720 --> 09:21.770
But these steps will all be repetition.

11:21.690 --> 11:22.260
Okay.

11:22.260 --> 11:24.360
I think I'm just about done.

11:24.510 --> 11:33.330
And just to recap on all that I did here, I first added our secondary attributes and I made sure to

11:33.330 --> 11:39.060
have a multi-line comment to show where these secondary attributes began.

11:39.210 --> 11:48.900
So I added the secondary attributes here, giving them both the property and attribute accessors, making

11:48.900 --> 11:58.050
sure that the properties have on rep for the rep notify for each of these attributes and that's something

11:58.080 --> 12:03.030
to double check as it's really easy to copy and paste and forget one of these steps.

12:03.030 --> 12:06.540
So I have the on rep rep notifies for each one.

12:06.930 --> 12:12.650
I then declared the rep notifies for each one and defined them.

12:12.660 --> 12:19.890
I also moved my max health and max mana here into the secondary attributes out of the vital attributes.

12:19.890 --> 12:26.560
So now our vital attribute is only consist of health and mana currently and max health and max mana.

12:26.590 --> 12:31.990
I'm going to consider them secondary attributes as they will be dependent on other attributes.

12:32.110 --> 12:38.650
Next, I went into the CPP file and added the definitions for each rep.

12:38.650 --> 12:46.690
Notify using the boilerplate gameplay attribute rep notify so we can inform the ability system of the

12:46.690 --> 12:53.440
replication and of course added each of the secondary attributes here and get lifetime replicated props,

12:53.650 --> 12:56.470
making sure to specify each one.

12:56.470 --> 13:00.970
And now we have those attributes set to replicate.

13:01.000 --> 13:03.400
So really for key steps.

13:03.400 --> 13:04.150
Right?

13:04.150 --> 13:06.430
First declare the variable.

13:06.670 --> 13:11.110
Next use the rep, notify or create one.

13:11.110 --> 13:18.490
Make sure the rep notify has the gameplay attribute rep notify macro and then add that rep notify to

13:18.490 --> 13:20.080
get lifetime replicated props.

13:20.080 --> 13:21.340
So it's replicated.

13:21.340 --> 13:28.600
And now we have our new secondary attributes and these are going to be based on the other attributes.

13:28.600 --> 13:35.920
We know how we can apply an effect that's based on other attributes, but we want these attributes to

13:35.920 --> 13:38.710
always be affected by any other attribute.

13:38.740 --> 13:44.710
We want them to change when they're backing attributes are changed, and we're going to do that next.

13:44.710 --> 13:47.380
So great job and I'll see you soon.
