Advanced Stat System

Hey everyone! I wanted to share with you how my stats system is going and splain it a bit to you.
My system is based on Pillars of Eternity II character stats but a little bit more simplified. If you wanna see how it works here is a link:

Basically you have the basic attributes (Might, Constitution, Dexterity, Perception, Intellect and Resolve) that modifie the defenses, Action Stats and passive stats which have a base value depending on the class (for now the default is a fighter). This process is done in Awake.
fe6abed599cbfb86c9f544e91e820dd2
Those stats are also modified by weapons, for example a normal sword adds a modifier to damage of 19% over the base damage of the player.

44b6c62d7c9d3ba1d1875dab1fcf47f9

Both the player and the enemies have this script.

Then, in combat each IDamageable object has a function called CalculateHitProbability to see how much damage you deal. This is how it works:

1 - Calculates a random number between 1 and 100 both included. Let’s call it “score”

2 - Then we substract the enemy deflection to the player’s accuracy(for the enemy is the other way around).

3 - then we get the attack roll which is: attackRoll = score + (player’s accuracy - enemy deflection)

If the attack roll is less than 25 it is a MISS.
If it is between 25 and 50 it is a GRAZE hit and the damage is divided by 2
If it is between 50 and 100 it is a Normal Hit
If it is greater than 100 it is a CRIT hit and it deals the damage * 1.25

b075369899ada881ea58bd359d82b761
In the future I’m planning to use different defenses for different types of attack (for example Will instead of deflection)
This also applies to special abilities like the power attack and AoE damage.

Hope you like it and if you have any tips or questions just go for it :smiley: .

Privacy & Terms