WEBVTT

00:07.180 --> 00:08.110
Welcome.

00:08.110 --> 00:11.680
So now we're affecting the enemy's health with a gameplay effect.

00:11.710 --> 00:17.170
We know that this is just a placeholder gameplay effect as we want damage to be related to all of our

00:17.170 --> 00:21.970
other attributes to make combat a true RPG experience.

00:22.000 --> 00:29.080
We also saw that our character is just using the default attribute values that aura starts out with,

00:29.080 --> 00:35.320
but in a real RPG, different character types start out with different attributes, and these character

00:35.320 --> 00:39.190
types are often separated into different character classes.

00:39.220 --> 00:42.580
Now we're not talking about classes in a programming sense.

00:42.580 --> 00:49.570
We're talking about classes in an RPG sense where different character classes have different strengths

00:49.570 --> 00:50.980
and weaknesses.

00:51.010 --> 00:56.920
So to properly initialize our enemy attributes, we should give some thought to how we plan on doing

00:56.920 --> 00:57.580
so.

00:57.730 --> 01:01.100
Aura will soon be leveling up and getting stronger.

01:01.120 --> 01:07.700
We also have enemy class level, a member variable, and for an enemy to spawn in at a different level,

01:07.700 --> 01:09.290
that should mean something.

01:09.320 --> 01:13.250
A higher level enemy should start out with higher attribute values.

01:13.340 --> 01:19.730
So we need to think about how to initialize attributes for a character based on its character class.

01:19.760 --> 01:27.350
For this project, I'd like to have three separate character classes Warrior, Ranger and Elementalist.

01:27.680 --> 01:34.760
Your RPG games you plan on making may have more classes than this, but for this course, three is plenty

01:34.760 --> 01:40.850
and it gives you enough of an example that you can expand upon this with more classes if you like.

01:41.530 --> 01:47.730
The warrior class will be mainly concerned with melee attacks, sword swings, spear thrusts.

01:47.740 --> 01:49.570
That's what melee means.

01:49.660 --> 01:57.130
Rangers will use ranged attacks such as a slingshot, and the Elementalist will use magical spells.

01:57.160 --> 02:04.390
Aura herself is an elementalist as her attacks are all magical spells, so our characters should have

02:04.390 --> 02:10.120
a way to easily set their character class and that should determine what their starting attributes should

02:10.120 --> 02:10.720
be.

02:10.930 --> 02:14.560
Their starting level should also affect their starting attributes.

02:14.740 --> 02:20.650
Loading in a character with a certain character, class and level is something that really pertains

02:20.650 --> 02:22.000
to enemy characters.

02:22.030 --> 02:27.910
Aura is going to start off with the base stats unless we're loading her progress in from disk, in which

02:27.910 --> 02:32.770
case she'll start off with the stats that she had when she last saved the game and we'll get to that

02:32.770 --> 02:34.210
later on in the course.

02:34.300 --> 02:40.360
So we need to think about how we're going to initialize an enemy character's starting attributes and

02:40.360 --> 02:42.950
for that matter, its starting abilities too.

02:43.070 --> 02:48.890
We'll want a way to distinguish between different character classes in an RPG sense.

02:49.010 --> 02:54.410
We could easily create an enum with enum constants for each character class.

02:54.710 --> 02:57.890
We could call this a character class, for instance.

02:58.250 --> 03:05.120
Now we'll need some sort of asset that stores data for each class and the values for its default attributes

03:05.120 --> 03:08.600
based on its level, a data asset comes to mind.

03:08.630 --> 03:11.480
This can be our character class info.

03:11.510 --> 03:16.130
Now in the data asset, we'll have data for each character class.

03:16.220 --> 03:23.210
That data can be in the form of a data table, another data asset or really anything else we decide.

03:23.600 --> 03:30.140
Now we've seen that gameplay effects can use curve tables to scale effect magnitudes based on level.

03:30.770 --> 03:36.200
Curved tables are nice because they're a single asset that can have multiple curves.

03:36.380 --> 03:42.950
So we could create a curve table called primary attributes, for example, and it could have curves

03:42.950 --> 03:46.250
for each of the primary attributes based on level.

03:47.120 --> 03:53.840
So each character class specified with our character class enum could have a curve table with curves

03:53.840 --> 03:55.970
for each of its primary attributes.

03:55.970 --> 04:01.040
Storing the starting values that can scale up as an enemy's level increases.

04:01.340 --> 04:06.470
Now we'll also want to apply a gameplay effect to initialize these attributes.

04:06.500 --> 04:12.860
We'll also want gameplay effects to set the secondary attributes that are based on the primaries and

04:12.860 --> 04:18.310
also an effect for the vital attributes once all other attributes have been set.

04:18.320 --> 04:25.550
And finally, any abilities that the enemy character class has should also be in this data asset so

04:25.550 --> 04:28.400
those can be granted at the beginning of the game.

04:29.080 --> 04:33.220
Now, some of the enemies may have the same abilities and effects.

04:33.740 --> 04:40.190
For instance, we may create a death ability or a hit react and each enemy will share those ability

04:40.190 --> 04:41.030
classes.

04:41.030 --> 04:47.780
So the data asset should also have any abilities and gameplay effects that all enemies should be given.

04:48.110 --> 04:52.740
So now we have an idea of how we wish to initialize our enemy attributes.

04:52.760 --> 04:54.370
We have a game plan.

04:54.380 --> 05:00.430
First, we need to create a data asset that stores information for all character classes.

05:00.440 --> 05:03.290
We can call this character class info.

05:03.830 --> 05:08.570
Next, we need an enum that has constants for each character class type.

05:08.570 --> 05:11.030
We can call this a character class.

05:11.330 --> 05:16.780
Then we'll want a curve table that stores curves for each of the primary attributes.

05:16.790 --> 05:23.720
We can have a different curve table for each character class, such as Warrior Primary attributes,

05:23.720 --> 05:28.880
Ranger primary attributes, and Elementalist primary attributes, for example.

05:29.180 --> 05:36.020
Now we need gameplay effects to apply the primary, secondary and vital attributes for our enemies.

05:36.030 --> 05:43.740
We also need an array of abilities that all enemies will share and an array of shared effects as well.

05:44.040 --> 05:48.450
And we'll also have arrays of abilities that are unique to each enemy.

05:48.480 --> 05:50.310
These will be empty for now.

05:50.580 --> 05:58.140
And finally, we need a function to call that can take in the data asset and then initialize these attributes

05:58.140 --> 05:59.910
using that data asset.

05:59.940 --> 06:07.800
This function could be on our aura ability system library and it can take in the data asset, the ability

06:07.800 --> 06:14.580
system component and the character's level, and it can apply all of the initial gameplay effects to

06:14.580 --> 06:16.740
initialize the character's attributes.

06:16.740 --> 06:20.550
So we know the next steps to implement a character class system.

06:20.640 --> 06:23.100
We'll implement these in the videos to come.

06:23.370 --> 06:24.270
I'll see you soon.
