Welcome back.
So we now have some gameplay effects and they're assigned here in our data asset character class info.
Now the thing is that these primary attribute gameplay effects have no modifiers, and we've seen that
with modifiers.
We can have curved tables that allow us to scale the modifier magnitude by a value based on what the
curve table returns using a lookup by level.
Let's go to our Elementalist primary attributes gameplay effect and take a look.
Now this is a gameplay effect with instant duration policy and we have no modifiers, but we're going
to add a modifier for each of our primary attributes, so we should have four of them total.
And for each one I'd like to use a curve table.
And for those curve tables, I'd like to have different values based on level so that when we spawn
in an enemy, we can apply this gameplay effect at the level specified.
Now we can create curve tables in a number of ways and we can store the data in a number of ways.
So here's what I'd like to do for our default attributes for the enemy.
We're going to have a folder here for our curve tables.
I'm going to right click and make a new folder and call this curve tables.
And here in curve tables we're going to make a new curve table.
So first we'll go to Miscellaneous Choose Curve Table.
And we've been using linear curve tables, but what do these interpolation types actually mean?
Well, linear means between each x y value pair.
In other words, each key in the curve.
The curve is a straight line in between those values.
But if we choose, say, cubic, then we'll get a smoother curve in between those key values and constant
gives us no interpolation whatsoever from one value to the next.
We just have horizontal straight lines.
We're going to choose cubic for this and we're going to create our curve table.
And I'm going to call this CT underscore primary attributes, underscore elementalist, and these will
be the primary attributes for the Elementalist.
Now, let's go ahead and open up this curve table and for the curve, we're first going to rename it
from curve to a new name.
And this is going to be for our strength primary attribute.
Now for the names, I'd like to keep the same name as the gameplay tag associated with that particular
attribute.
So for strength, we would say attributes dot primary dot strength.
And we can put in some values.
Now, here's the cool thing about interpolation types.
We don't have to have a value for each level.
We can choose a value for every five levels or every ten levels.
And if we attempt to retrieve the value from the curve at any particular level or X value, we'll get
the interpolated value on the curve.
For instance, if I right click here on the curve and select Add key, I now have a key and I can choose
a value of say, one for the X and what value for the strength for an Elementalist.
What I'd like to have at level one now we're thinking in terms of an enemy elementalist character.
I think for an elementalist a low value for strength like five should do.
Now I can't see anything now, but if I come up here and click on Zoom to Fit, all of a sudden that
key is now in the middle.
Now it says one second here.
These curve table X values are interpreted as units of time in seconds by default, but they don't have
to be time values.
In our case, the x axis represents level.
But in the curve table asset, they're listed as seconds.
Now we can add another value by right clicking and selecting add key.
And with that key selected, I'm going to change its X value.
Now, as I said, we don't have to do every single discrete integer.
I can skip to level five, for example, and at level five for the Elementalist.
Let's say I'd like my strength to be seven.
And if I zoom to fit, we can kind of see what's going on here.
In fact, I might have to scroll out to see really what's happening.
And if I click and drag to select all the points, right click and select Auto.
Well, now we can get a smooth curve because this particular curve table has a cubic interpolation type.
That means we can get a mathematical graph that is at the mathematical level, a cubic function.
So if your math savvy, that probably means something to you.
If you're not and that doesn't make any sense, don't worry about it.
Cubic can be thought of as a smooth curve like this.
Now I'm going to add another key, and for this one I'm going to set the X value to ten.
And I'd like my strength at level ten to be, let's say 9.5.
Now I can click on Zoom to Fit, and actually this dropdown to the left has normalized view mode.
If I click on that, then we'll normalize to all keys involved here.
Now as you can see the curve smoothly interpolates from one value to the next.
So if I query this curve and said, Hey, what's the strength value at level two, then it would give
me the value here on the curve at level two, which is 5.219 roughly.
So this can save us some time if we want to shape out the curve by shape and just interpolate between
major values.
And then I don't have to go in here and put in a value for each and every single level.
Now I'm going to go back from normalized view mode to absolute view mode, and that will allow me to
move by right clicking and dragging.
I can move around and I'm going to add a new key.
The last one was at level ten.
This one will be at level 15 and I'd like my strength to bump up to about 12.5 at that level.
Now it's going to be linear, but at the end of all this, we can make this all very smooth by highlighting
all of them right clicking and choosing auto and we'll have nice smooth curves.
And of course we can click and move these up and move them around if we like as well.
So far this is looking relatively linear.
So cubic is maybe overkill, but that's okay.
These are only going to be queried when the primary attribute values are modified once at the beginning
of the enemy's lifetime anyway.
So we've got values for strength up to level 15.
Let's add a new key.
This one can be level 20 and I'm going to bump the strength up to 14.
This is an elemental list, kind of like a wizard or sorcerer.
So we really don't care much about strength.
It's not going to do a whole lot for the character involved.
So that gives us values up to level 20.
And if I really want, I can add one last key.
Let's go up to level 40 and at level 40, I'm going to bump that strength up to say 25 like so.
And I can highlight all these points.
And select auto.
And now we see what our curve looks like.
So now we have a curve for strength for the Elementalist.
Now adding points like this is a good, nice visual way to do it, and that's how we're going to add
the other curves for the Elementalist primary attribute curve table.
And then we'll learn another way to do it.
So after getting the curve, looking approximately how we like it and we can even click on the handles
and adjust the curve however we like.
We can now add our second curve and rename this curve to attributes.
Dot primary dot intelligence.
Now, intelligence is more important for the elementalist.
We're going to right click add a key, and this will be for level one.
And we're going to start the elementalist at a higher intelligence, let's say 15 for level one, and
then we're going to add another key.
This will be for level five and we'll bump the intelligence up to about 19.
We'll add another key.
This will be for level ten.
We'll bump the intelligence up to 21.
We'll add another key.
This can be for level 20.
Notice we're going from ten straight to 20.
And for 20, let's do a value of about 25.
What kind of tapering off?
A little.
And from 20, we'll have another key that goes straight up to 40.
And at 40, let's do 35.
Let's actually go up to about 40 intelligence.
We'll have a curve that looks like this.
We'll highlight them all and select auto.
So we have a smooth looking curve.
So there's our intelligence.
Notice that interpolation is saving us a lot of time entering in those values, especially if we just
want this to follow a specific trend and not have manually entered points per level.
Let's add another curve and rename this curve to attributes dot Primary dot Resilience.
For resilience, I'm going to go ahead and add a key.
This will be for level one and we'll give it a value of 11.
And I just want to see what this looks like.
If I just add one key right here at level 40 and give it a value of, say, 20.
Here's what that curve would look like.
And we can highlight both keys, give it an auto smoothing, and now we just have this trend that smoothly
goes up from level one and value 11 to level 40 at value 20.
And we can see what the value would be at any point along the curve.
We can do the same thing for vigor.
I'm going to click curve, rename the curve to attributes dot primary dot vigor.
We'll right click and add a key.
This will be for level one.
The value of vigor can be, oh, let's say seven.
I'm going to click on Zoom to fit and add a new key after.
This can be for level 40.
And what should the vigor be for our elementalist at level 40?
Let's put it at say, 14 and I'm going to zoom on out, highlight both of these right click and use
an auto curve.
And here is the curve from level one to level 40.
And I can always go to normalized view mode to see that curve.
And again, we can adjust the shape of the curve.
Let's say we want it to go up very quickly and then taper off.
We could do that or just have a very slow build up at first, but then start to ramp up faster towards
level 40.
That's another possibility.
Just depends on how you'd like that attribute to increase as those enemies level up.
So now we have a curve table that we can use for the elementalist for strength, intelligence, resilience
and vigor.
And now we can go to our primary attributes, Elementalist, and we can add those modifiers.
So I'm going to add four of them one, two, three, four.
The first one, the attribute is going to be strength.
It's going to be override.
The modifier magnitude will be scalable float and I'll put a one here and use the curve table.
CTE Primary Attributes Elementalist.
We're going to select the curve attributes Dot primary dot strength.
And now we have our modifier set up and we're going to do the same thing for the other attributes for
the next one.
We've already got strength, so let's do intelligence.
It's going to be override modifier.
Magnitude will be scalable float.
We'll set that magnitude to one.
We'll use the primary attributes Elementalist curve table.
And for the curve, we'll select intelligence.
Let's move on and do resilience.
So we'll select resilience, Set this to override.
We'll set our magnitude to one, choose the Elementalist curve table and pick the resilience curve.
And finally, we have our last modifier.
This will be vigor setting it to override.
We're going to set scalable float magnitude to one, choose the Elementalist curve table.
And for the curve we'll use vigor.
And we've now taken care of our elementalist primary attributes.
We're going to save that.
Okay, so this isn't really anything new.
We've already made curve tables before.
But we need curve tables for the warrior and the ranger classes as well.
So the question is, do we have to do this whole process again for those classes?
And the answer is actually no.
We can create these in different ways.
And I'm going to show you two additional formats that our curve table data can exist in.
Now for our curve table, let's go back out into the folder that our Primary Attributes curve table
exists in.
We'll go ahead and save all, and I'd like to export this in a different format.
You see curve tables, much like data assets can be exported in the form of CSV or comma separated values
and Json data.
Let's export this curve table as a CSV and before we do, I'm going to take my project folder structure
here and I'm going to make a new folder right here and this will be called Data.
So here in data I'd like to export that curve table as a CSV.
To do that, we find the asset in the asset browser, right click on it and at the top we can export
as CSV or Json.
I'm going to export as CSV and I'm going to go into my Ora folder and into data and I'm going to export
it here into data.
Let's choose a file name.
Now this is our CT underscore primary attributes.
Underscore elementalist.
Let's click save.
Now we can take a look in our data folder and look at this.
We have a comma separated values file.
Now Csvs can be opened in just a text editor like Notepad, and they can also be opened as spreadsheets
in Excel, for example.
So notice I have the Excel icon.
That means if I double click on it by default, it's going to open as a spreadsheet here in Excel and
notice that we see our names of the rows and the very first row determines our x axis values.
In other words, our time, or in our case we're using these as levels.
So at level one, strength is five, intelligence is 15 and so on.
And notice that some of these are empty.
They don't have any values there.
We only went up to level 20, it looks like, for resilience.
Now showing this in CSV format, especially in a spreadsheet, is really nice because we can look at
the values and alter them here.
Let's say that I'd like to fill out these values, right?
Let's say that perhaps I'd like to specify values at each of these points.
It looks like my intelligence goes to 40 at level 20, but I'm going to change this.
I'm going to set it to 35 here and 45 there, and I'm going to enter in some new values for resilience.
Let's do 15, 17, 24, 32 and 40 here for vigor.
We're going to go from 7 to 9 to 13 to 16 to 20 to 24.
Okay.
So we've changed all of these values.
I'm going to click Save now before we go in and update our curve table in the Unreal Editor to reflect
these, I'm also going to show you how you can open the CSV as a text file.
You can simply right click on it and choose open with and you can open it with notepad.
You can open it with notepad plus plus.
If you have that, if I open it with notepad, here's what it looks like.
It's just comma separated values and those values are the same as what we see in the spreadsheet.
Notice the x axis value has the first entry with three dashes, and that's because it doesn't matter
what that first entry is.
Again, this is the x axis values.
And then here we have the rows, starting with the row name and then the values corresponding to those
x axis values.
So if you don't want to use a spreadsheet or you don't have Excel or some kind of spreadsheet software,
you can literally edit this in notepad or notepad plus plus or really any software package that can
read text data.
Okay.
So what we've done is we've changed our spreadsheet, we've now changed the values.
I'm going to go ahead and save this file and back in Unreal Engine, I'm going to open up my curve table
and we have a button right here that says Re-import the curve table from the source file.
All changes will be lost.
This action cannot be undone.
We can choose that file that we've changed and then that will change the curve table.
We also have the option to go to asset and selecting Re-import and it's showing that CT primary attributes
Elementalist file.
So we have two options here.
Now, if I click this re-import button, I have the option to choose the file.
I'm going to choose the file we changed and saved and click open.
And now notice that our curve table is different.
It now has those values that we've added and they're no longer interpolated in a cubic manner.
That's okay.
Now notice that if we select all the values now, right click, we can't choose auto anymore.
It's now forced to be linear.
So that's an important quality when it comes to importing these from a CSV, we can no longer have auto
interpolation.
It's now linear between each point.
So that's something to be aware of.
So now we know how to export our curve tables as csvs and we've seen that we can re-import the data
into our curve table from a CSV.
We can also create curve tables straight from CSV files.
Let's see how that works.
Here's what I'm going to do.
I'm going to take this CSV file I'm going to go to save as and I'm going to save this as a new file
called CT Primary Attributes Underscore Ranger and click Save.
Now for the Ranger, I can change the values around.
Let's say the Ranger should have a slightly higher strength.
We can start at a strength of six for level one, nine for level five, 14 for level ten, perhaps 18
for 15.
Level 20 can have a value of 26, and level 40 can have a value of 34.
For intelligence, we can be a little bit lower.
Let's start off at 12.
At level five, we'll go to 15, then 17, then 24, then 27, then 32.
For resilience, we'll be a little higher.
Let's do 13.
15.
17, 23, 27, 32.
We'll do.
33.
Vigor can be a bit higher as well.
We'll go from 11 to 15, 17, 25, 31 and 35.
Okay.
And we'll go ahead and save that.
So now we have a different CSV for the Ranger.
We can import this directly into the engine.
So here's how we can do it.
We can make a new curve table.
So I'm going to right click and make a new curve table.
I'm going to choose Cubic, create the curve table and call this CT underscore primary attributes underscore
Ranger open this up and let's re import the curve table choosing Ranger dot csv clicking open and here
we see our curve and we can take a look at those trends.
And of course they are linear, but we saw how easy it was for us to just create a new CSV, change
the values here in the spreadsheet and create a new curve table and choose the CSV.
So that's another way to do it.
Now.
Yet another way is to use Json data.
Json is a file format for organizing data just like a comma separated list, but it has a slightly different
syntax.
Let's see what that looks like.
We're going to take our Ranger data table right click and export as Json this time.
Now we're going to call this primary attributes Ranger dot Json.
We'll click Save and we can open up that Json file.
So here it is.
My computer wants to open it automatically using notepad and that's fine.
I'm going to open it with notepad and here's what it looks like in Json format.
So the syntax is a bit different.
We have opening and closing square brackets and then each of these curves is represented by a comma
separated list of curly brackets, and each of the curly brackets have pairs in quotes separated by
colons.
And these are separated by commas within the curly brackets.
So this is another way to store the data.
So this one is ranger dot Json, but we can go ahead and save as and we can save this as primary attributes
underscore warrior dot Json and we can change the values here.
Now warriors are going to want a higher strength.
Let's start them off at a strength of 15.
At level five, we'll go up to say 21 at ten, let's do 26.
At 15 or 14.9, we'll have a value of 33.
At level 20, we'll be at 37 and at 40, let's do 42.
Now, intelligence can be relatively low.
At level one, we can have an intelligence of five.
At level five, we can be at 6.5.
At level ten, we can be at 7.9 and level 15, we can be at nine level 20, we can be at 11 and level
40, we can be at 13.
For resilience, we can have a higher value.
Let's start at 15.
We'll go up to 17, then 21, then 25, then 27, then 31.
And vigor will be higher as well.
We'll start at 11, go to 15, then 16, then 21, 25 and 29, and we'll go ahead and save this.
So now we have a Json file for the warrior and we can import this into Unreal Engine.
Now I'm going to click on import and choose our Warrior Json file.
And this time we get the option to choose what we'd like.
We can make a data table out of the Json file.
We can make a curved table float curve vector curve, linear color curve.
I'm going to choose curve table.
And when choosing the interpolation type, I'm going to choose cubic.
Click on Apply.
And now we have a new curve table.
Primary attributes Warrior.
And if I open it and select my strength, well, check it out.
We now have our curve and notice we have a cubic curve and we can once again alter the handles.
So with Json files, we're able to maintain that cubic curve, which is kind of nice.
The CSV kind of strips that quality away.
So Json is a little bit superior in that regard.
So that's just something to be aware of.
If you'd like that cubic quality that's smooth curve quality, you can use Json files.
So now that we have curve tables for Ranger and Warrior, we can go in and set up the modifiers for
those primary attribute gameplay effects.
I'm going to start with the Ranger.
I'm going to go down to the modifiers, Click plus four times and let's set these up so we'll have the
attribute.
We'll start with strength.
Set this to override.
Give it a value of one scaled by our curve table for Ranger selecting the strength Curve.
We'll go to our next modifier.
This is going to be intelligence override.
Ranger Curve.
Curve.
Table.
Intelligence Curve.
Next.
We have resilience.
Choosing the resilience curve.
And finally, we have vigor.
And we're set.
Let's set up our warrior class.
And at this point, it's repetition.
So we'll time lapse this one.
Okay, so we're set on all of our modifiers.
Now that those are all set up and ready to apply, we actually need to apply these primary attribute
gameplay effects and we have them all stored here in our data asset, which we can look up based on
our character class type.
And when we apply these effects, we can specify a level.
So this is all great.
Our next step is to actually apply these.
And before we wrap up this video, I'm just going to point out one thing.
Our secondary attributes, which we're using with Aura, is an infinite gameplay effect.
And we did that because every time Aughra's primary attributes change, we'd like those secondary attributes
to change as well.
But for our enemies, at least in this game project, I don't really plan on the enemies primary attributes
changing at runtime.
I'm going to set their primary attributes based on their level and then they're never going to change
after that.
So there's really no need to apply an infinite gameplay effect to our enemies for that reason.
If we wanted to, we could take this secondary attributes infinite effect and we could right click and
we can duplicate it and call this g underscore secondary attributes underscore enemy.
And we could use this for the enemies and for the secondary attributes enemy.
We could change it from an infinite gameplay effect to an instant gameplay effect and save that.
And then we can use that version for the enemy's secondary attributes.
So I'm going to do that.
We have secondary attributes, enemy, and then I can take the secondary attributes used by Aura, which
is this one, and stick it back into the aura folder and save all.
Now, if you did plan on changing the primary attributes of your enemies at runtime, for instance,
maybe you'd like your enemies to be able to level up, which is something I'm not going to implement.
But if you did, then you could use the infinite gameplay effect for your secondary attributes.
Since we're not, I'm going to have an instant gameplay effect for that.
So now our data asset is just waiting for us to initialize the attributes for our enemies and we're
going to handle that next.
So great job and I'll see you soon.