Welcome.
So now that we know how we can use modifiers to apply modifications to attributes and that those modifications
themselves can be backed by other attributes, this opens a very important door when it comes to RPG
style attributes, and that is the door to derived attributes.
In other words, attributes that depend either partially or entirely on other attributes.
Now, in our game project, every single one of our attributes is going to be functional.
It's going to affect the game in some way.
That's important and it helps from a game design perspective to lay out what all the attributes in the
game should be doing.
Now, we won't be discussing all of them just yet, but we'll discuss most of them right now because
we're going to design more attributes and decide which attributes are dependent on other attributes.
Now, so far, we've decided to categorize some of our attributes as primary attributes.
And in our game, the primary attributes are going to be the independent attributes that don't depend
on any other attributes.
These are the attributes that are stand alone and we can increase them or reduce them based on various
mechanics in our game.
But it's these attributes that in some way or another, all other attributes depend on.
These are the four primary attributes we've created, starting with strength.
Now, every attribute affects the game in some way, and we need to decide how the attributes affect
the game.
And this is a decision made at the design level.
You could come up with different ways that I come up with and ultimately in a game development team,
there's some sort of design process, some sort of meeting or series of meetings where those in charge
of designing the game agree upon the mechanics of how each attribute affects the game.
And for this game, project decisions had to be made, so I made them.
But I understand that you may have ideas for how you'd like your attributes to affect your game, so
don't take these as chiseled in stone.
Don't take them as gospel.
I've just made some design decisions because they had to be made and you may have other ideas and you'd
like to implement them differently and that's totally fine.
And at this stage as a game developer, I think you're capable of making those decisions and implementing
things in your own way if you so choose.
But do feel free to copy my design and just follow along exactly.
If you don't feel like sitting down and making those design decisions just yet for your own game in
this game, strength is going to increase physical damage.
Now, we haven't gotten to damage yet.
We're not implementing it at this point in the course, but when we do, we'll have different types
of damage.
Physical being one of them.
And strength is going to be an attribute that will add some kind of bonus to attacks which cause physical
damage.
Now, that's not the only thing strength can affect in the game, but this is going to be the defining
characteristic of strength, the description given to strength when you hover over it and your attribute
menu intelligence is going to increase magical damage.
Resilience is going to increase armor and armor penetration.
Now, I know we haven't created those yet, but that's how I'm going to define resilience and vigor
is going to increase health the most vital of all the attributes, perhaps.
So these are the decisions I've made for the primary attributes.
But what about other attributes?
What about secondary attributes?
In this game project secondary attributes are going to more closely affect gameplay mechanics, mostly
combat, and these will be attributes that are derived either partially or wholly from other attributes.
The secondary attributes I've decided to create are as follows.
Armor.
Armor is going to depend on resilience.
As resilience increases, armor is going to increase by a certain amount that we decide.
The definition of armor is that it reduces damage taken and improves block chance.
Next, we'll have armor penetration.
Armor penetration is going to be dependent on resilience and it's going to ignore a percentage of.
Enemy armor and also increase the critical hit chance.
So as we attack an enemy, if we have a high armor penetration, that value is going to cause us to
ignore some of the armor of the enemy we're attacking, allowing us to cause more damage and also increase
the chance to get a critical hit.
Next.
We have blockchains which will be dependent on armor.
Notice this is a secondary attribute that depends on another secondary attribute.
So these don't have to all depend solely on primary attributes.
Blockchains will be the chance to cut incoming damage in half.
So in our damage calculations, we'll take blockchains into account.
And if we get a successful block, we're going to reduce the incoming damage by half.
Next is critical hit chance.
Notice armor penetration increases this.
So this will be dependent on armor penetration.
And as armor penetration increases, so does critical hit chance.
And this will be the chance to double the damage, plus a critical hit bonus.
So if we get a successful critical hit, our damage will be doubled.
Next, we have critical hit damage.
This will also be dependent on armor penetration.
And this is the bonus damage added when a critical hit is scored.
Next is critical hit resistance.
This will be dependent on armor and this will reduce the critical hit chance of attacking enemies.
So as an enemy may have a high critical hit chance if we have a high critical hit resistance, we can
sort of balance that out.
Next is health regeneration.
And this will be dependent on vigor.
So vigor increases health, yes, but it also increases other things.
Health regeneration will be the amount of health regenerated every one second.
So a periodic infinite gameplay effect should come to mind here, right?
Next we'll have mana regeneration and I'll have mana regeneration dependent on intelligence, and this
will be the amount of mana regenerated every second.
Then we'll have our max health, which will be dependent on vigor, and this will be the maximum amount
of health obtainable.
Now, we already have this attribute.
We called it one of our vital attributes.
But I'd like to now consider this to be a secondary attribute, as I'd like it to be dependent on one
of our primary attributes, the vigor attribute.
And finally we'll have Max Mana.
And this will now be dependent on intelligence.
This will be the maximum amount of mana obtainable.
So as our intelligence goes up, so will our max mana.
So as you can see, we have quite a few secondary attributes that we're going to add to our attribute
set.
And adding attributes to an attribute set is something that we now have experience doing.
So this is going to be your quest.
Your quest is to add all the secondary attributes to your attribute set.
Now you can come up with your own or you can use the list that we just went over, complete all the
boilerplate steps for each attribute.
Now, this involves declaring the variable, adding the rep notify and your uproperty and defining that
function.
Make sure it's a new function.
Also adding the attribute accessors macro for each of the attributes and in your rep, notify use the
gameplay attribute rep notify boilerplate macro and also add each attribute to get lifetime replicated
props so you can register it as a replicated variable.
So pause the video and add all of your new secondary attributes now.
Okay.
So since this is mostly boilerplate, in fact, it's all boilerplate, I'm going to add all of the attributes
and time lapse the video as this is all repetition at this point.
So if you like, you can follow along, pause or slow the video down.
But these steps will all be repetition.
Okay.
I think I'm just about done.
And just to recap on all that I did here, I first added our secondary attributes and I made sure to
have a multi-line comment to show where these secondary attributes began.
So I added the secondary attributes here, giving them both the property and attribute accessors, making
sure that the properties have on rep for the rep notify for each of these attributes and that's something
to double check as it's really easy to copy and paste and forget one of these steps.
So I have the on rep rep notifies for each one.
I then declared the rep notifies for each one and defined them.
I also moved my max health and max mana here into the secondary attributes out of the vital attributes.
So now our vital attribute is only consist of health and mana currently and max health and max mana.
I'm going to consider them secondary attributes as they will be dependent on other attributes.
Next, I went into the CPP file and added the definitions for each rep.
Notify using the boilerplate gameplay attribute rep notify so we can inform the ability system of the
replication and of course added each of the secondary attributes here and get lifetime replicated props,
making sure to specify each one.
And now we have those attributes set to replicate.
So really for key steps.
Right?
First declare the variable.
Next use the rep, notify or create one.
Make sure the rep notify has the gameplay attribute rep notify macro and then add that rep notify to
get lifetime replicated props.
So it's replicated.
And now we have our new secondary attributes and these are going to be based on the other attributes.
We know how we can apply an effect that's based on other attributes, but we want these attributes to
always be affected by any other attribute.
We want them to change when they're backing attributes are changed, and we're going to do that next.
So great job and I'll see you soon.