# RPG attributes and statistics

Discussion in 'Game Design' started by calmcarrots, Oct 27, 2014.

1. ### calmcarrots

Joined:
Mar 7, 2014
Posts:
654
Ugh so I am so confused on how to do this. So here's the problem. Lets say we have a:
Level 20 Warrior Character
- Strength = 50 (Determines attack damage)
- Vitality = 45 (Determines health total)
- Focus = 20 (Determines how much mana and magic attack damage)
- Has a level 23 sword that does 45 - 60 base damage

Here's the problem. If the character levels up and adds a point to strength then how does that affect the sword damage? How would vitality affect health? etc. Would it increase by (strength value)%? How is this done?

EDIT: I found this article. It explains stats pretty well but I still don't understand the ID system at all. How does one implement it and what is it good for? Also, what other ways could someone do stats like this? Any suggestions?

Last edited: Oct 27, 2014

Joined:
Jun 14, 2013
Posts:
1,718
In my experience, it's done by adding weapon damage to base strength. Same with defense, add armor defense to base defense. If a point of strength = a point of attack damage, then yes 1 strength will only increase damage by one.

3. ### calmcarrots

Joined:
Mar 7, 2014
Posts:
654
Awesome! So it is simpler than I thought. I also updated the original post with another question. If you have an answer to that, then that would be even better. Thanks

4. ### RockoDyne

Joined:
Apr 10, 2014
Posts:
2,234
This has the old problem of having no right answer. Pokemon is a decent example that avoids linear relations http://bulbapedia.bulbagarden.net/wiki/Damage#Damage_formula The important part for this conversation is basically strength/defense*actiondamage. This way makes increases in stats much less efficient (at higher numbers) than the attack that was used.

5. ### calmcarrots

Joined:
Mar 7, 2014
Posts:
654
That is such a random equation. I think for simplicity, i will go with Misterselmo's suggestion. If there are any balance issues, then I will try that equation out. Thanks man

6. ### RockoDyne

Joined:
Apr 10, 2014
Posts:
2,234
You would probably want to hack it down so that is is simpler, but you don't want to take this lightly.

I bring it up because linear 'damage = attack - defense' equations are a nightmare to balance. First issue is it can give you negative numbers. That's not difficult to clamp, but you still have the fact that there will be a minimum level to even be able to do anything to an enemy. The next issue is the difference between a fight that lasts 10+ rounds and a fight that lasts three is two levels. Difficultly is either damn near (or outright) impossible or a cakewalk, with mildly challenging being when you are at the exact level that the boss/enemy was meant to be fought at.

calmcarrots likes this.
7. ### calmcarrots

Joined:
Mar 7, 2014
Posts:
654
I have stripped the equation and made it into something more simple and a bit more balanced. Lets say we have a:
Level 5 Character
- Weapon with base dmg 20
- Weapon level 12
- Strength of 7

And an enemy thats:
Level 6
- Defense of 9

My simpler equation is (4 x BaseWeaponDMG) x (WeaponLvl / MaxLvl) x (STR / 5) x rand [0.8, 1.1]
(max level is 80)

If we plug in the numbers....... we get a total of 16.8 x rand[0.8, 1.1]. The enemy would have 108 health (equation is (Lvl X Defense X 2) ). That would mean the player would have to hit the enemy ~6.4 times. This would be fitting when there are about 20 enemies on screen right? I tried it with bigger and smaller numbers and it seemed like a balanced number considering the amount of enemies. I will try this out and see if my game has any balance issues or not.

Joined:
Jun 14, 2013
Posts:
1,718
No, the system works. It will get you through a small game no problem. Pokemon has a finely (I mean, obsessively) complex, refined damage system. There are formulas, etc.

You can say complex is good... but I also once saw a Magicarp defeat 6 elite pokemon in a battle. So complex is actually a never-ending balancing nightmare. If you're a Japanese game designer who works for 17 hours straight until a single attack does the *perfect* amount of damage at each level... do it.

If you wanted damage numbers to get bigger, faster than a linear growth rate (for show) you would have to rethink it.

Ryiah and calmcarrots like this.
9. ### calmcarrots

Joined:
Mar 7, 2014
Posts:
654
Yes see I haven't played pokemon and I dint understand some of the terms such as the STAB and things like that. I will continue to work on it until its perfect and I will do some research into pokemon. Thanks for the advice it is greatly appreciated

10. ### calmcarrots

Joined:
Mar 7, 2014
Posts:
654
Also I think I'm going to use an exponential function so stats are pretty high towards end game and that could give the player a lot of creativity in designing their damage loadout

11. ### RockoDyne

Joined:
Apr 10, 2014
Posts:
2,234
If it's used simply, like in a zelda system, then it's not a huge problem. You wouldn't likely get the attack stat above ten though.

Bare in mind I've played enough games where this was the underlying math, and it was pretty clear that they weren't aware of the calculus involved in balancing it.

Joined:
Jun 14, 2013
Posts:
1,718
Yeah, keep the numbers low.

13. ### AndrewGrayGames

Joined:
Nov 19, 2009
Posts:
3,821
You're missing some things.

First, how much HP does your Lv.6 enemy have? The reason I ask is...

How long should it take a Lv.20 player to defeat a Lv.6 enemy? This is a deeper question that you will have the answer to, not me. The way most games work, is after a certain point the Lv.6 enemy can only inflict scratch damage, but the higher-leveled player can one-shot the enemy. Of course, if you're running something like a D20 system, this might not be tenable, you may want a flatter challenge curve.

What I've been taught is that, to balance encounters the 'Time to Defeat' of a given enemy is the thing you really want to design.

Time to Defeat(Defender) = HP(defender) / Damage Per Unit Time (attacker)

...Damage Per Unit Time is...

DPUT = Attack Power / Attack Frequency

...Thus...

Time to Defeat = HP / (Attack Power / Attack Frequency)

This is important, because the enemy with the longer TTD wins the match; if your Lv.6 enemy can be defeated in 3 turns, but your Lv.20 enemy can be defeated in 20, you've got a margin of 17 turns, assuming every turn is an attack. That's a huge margin! Is it correct, according to your vision?

From what you've shown above, you've already got a reasonably complex attack power calculation, and HP is a flat property of the defender. Attack Frequency can be either a property of the attacker, or a constant depending on your game rules (e.g. everyone can make one action per turn.)

Another question, is how do you want Defense to figure in? Is Defense merely subtracted from the final attack power? Or, is Defense instead a coefficient that scales the damage accordingly? (e.g. a Lv.6 enemy with perfect defense for physical attacks should take 'scratch damage', or the minimal allowable damager per attack.) Speaking of, what is the absolute damage floor? Some systems allow for attacks to deal 0 damage (or, register 0 damage attacks as a type of 'miss'.) Other systems never allow attacks to deal less than 1 damage.

Another thing is to designate a damage floor for attacks and abilities, to ensure that even if a player is as lazy as can be, that you have at least a minimal control over the enemy's TTD (after all, player attacks determine enemy TTD in part!) Chrono Trigger did this, as you can read about here.

14. ### JeremyBenson11

Joined:
May 9, 2013
Posts:
37
This an age old philosophy questions. In truth it doesn't matter. RPGs have a couple of basic principles seen across the board. Health, magic, damage. as long as the game is balanced you can do what ever you want. You could have strength add to the base damage, you could add a str modifier to the base damage.

In the end you could add your strength to your weapon damage, multiply by 8, subtract 2, and divide by 5 if you want...

when it boils right down to it the ultimate principle doesn't have to be the question How do you do this? but rather the answer of how you did it...

really all that matters is what numbers you want the player to see and how you show them... and how they affect your characters/monster's stats... When it's balanced, and runs smooth, you've got a good RPG no matter what you did...

I like big numbers, like ff7. Weapons range from 50 dmg in the beginning to several thousand by the end... This is more appealing to me then say dnd style d4 roll on a dagger...

Really it doesn't matter what you do to get those numbers out, but rather how smooth they are under the hood...

The reason I say it doesn't matter is because when developers understand they can do what ever they want they'll come up with unique systems like materia in ff7

Last edited: Oct 27, 2014
Alverik and calmcarrots like this.
15. ### BeefSupreme

Joined:
Aug 11, 2014
Posts:
279
One thing I've learned from over-designing things is that complex systems tend to function similarly to simple systems, just with a lot of unnecessary complication.

Alverik, GarBenjamin and RJ-MacReady like this.
16. ### PJRM

Joined:
Mar 4, 2013
Posts:
303
A good example:
Take a look at D&D 3.5 books. It explain and gives you an idea of how to create your own formula.

Joined:
Jun 14, 2013
Posts:
1,718
You might even say it is the goal of any complex system to imitate the simplicity of a non-complex system.

Brainswitch and GarBenjamin like this.

Joined:
Jun 14, 2013
Posts:
1,718
That's perfect. For WoW. I think of a game where attacks do not occur at a constant rate and then TTD means less than nothing. Take a beat em up/rpg hybrid. Take a situation where range is a factor... Like across a river or up a cliff face from the melee enemy.

You could always base your damage off of real life, if you're struggling, as well. I bet a 3 pound hammer swung with 10 pounds of force (30) does about half as much 'damage' as a 3 pound hammer swung with 20 pounds of force.

Real life tends to be 'flat', and I think the scale methods are the result of what your describing, more precise control over time in rpg battles.

19. ### BeefSupreme

Joined:
Aug 11, 2014
Posts:
279
I think a well designed system should identify and simulate elements that make a tangible difference to the user. I mean, if I make a racing game and simulate interaction with the vehicle's tires down to the tiniest pebble in the road, but the user never notices, all I've really done is waste time and CPU cycles (Yeah, I know there are hardcore racing sim fans who want every piece of gravel simulated, but that's not the point).

P.S. You've been looking extra wizardly lately. Well done.

Joined:
Jun 14, 2013
Posts:
1,718
Now I just need to figure out how to change my status from Member to Community Wizard

BeefSupreme, Ryiah and calmcarrots like this.
21. ### calmcarrots

Joined:
Mar 7, 2014
Posts:
654
Awesome thanks guys. I will definitely do some more research into this and I will post back once I have a nice equation that works well so that others can use. Also, @Asvarduil your answer was fantastic. Thanks all

22. ### calmcarrots

Joined:
Mar 7, 2014
Posts:
654
Ah ok so I have spent almost 3 hours on this. I have come up with something that is very easy to rework if there are any balance issues. So here is what I did:
1. Create a graph that maps out the ideal weapon damage for each level of a weapon. For example, the average weapon damage for a level 32 sword would be 480. (this is an averaged amount!!). You could figure out what averaged damage any other sword by doing 480 / 32 = 15. Then we multiply (Sword_LVL * 15) = A.W.D. (averaged weapon damage). The number 15 is the slope of the graph btw.

2. Find a minimum and maximum damage for the level 32 sword. That would be the equation:

Min_dmg = (AWD * 2) / Rand [2.1, 2.9]
Max_dmg = (AWD * 2) - Min_dmg

If rand[2.1, 2.9] came out to be 2.4 then the min and max amount of dmg for a level 32 sword could possibly be:

Min_dmg = 400
Max_dmg = 560

Notice how the average of the two dmg values equal the AWD which is 480. The min and max dmg values could be very different if rand[2.1, 2.9] output a different value within that range. (I found 2.9 a good max because after that, the difference between the dmg values would be too big).

3. Now we calculate damage dealt to an enemy. So we choose a random number between the min and max dmg values.
x = rand[ Min_dmg, Max_dmg ]
If we have a modifier that increased damage by 20% (mod = .2) then we apply that now. so.....
x += (x * mod)
Now if our strength value was 26 (str = 26) (this value was also found by a graph that scales similar to the weapon graph), then we can add that extra value to our damage output......
x += str

The variable x is our final damage output. Now we can do what @Asvarduil suggested and figure out how long an enemy would take to defeat. What we do to figure this out is create another graph with a new slope. If we want a level 32 enemy to die in 15 hits from a level 32 sword (which the AWD is 480) then we can multiply the AWD by 15. That equals (in this case) 7200 hp for a level 32 enemy. We can vary this 15 hit HP level by adding a defense and maybe some resistance to damage types.

This system is very great because if a weapon didn't do enough damage, you can just change the slope of the graph and everything fixes itself. Same thing can be applied to the enemy health graph. Now you don't even have to touch the equation, just the graph. This means you are only adjusting about 2 numbers instead of a formula.

Can you guys give me your opinion of the system I created? Any suggestions / changes / criticisms? So far it works really well and I could balance anything I want in the game by changing the slope of the graph.

EDIT: You can also change the graph equation into an exponential equation or to basically any equation you can think of. This gives everything so much flexibility with almost little to none work anywhere else.

23. ### Jaimi

Joined:
Jan 10, 2009
Posts:
6,208
Instead of leveling up stats like strength, why not just level up the skills? IMO, Stats should be relatively static, and skills should increase -- steadier aim gives you a better hit with a bow... So damage would be calculated by: (base weapon damage + state bonus) * skill multiplier.

24. ### calmcarrots

Joined:
Mar 7, 2014
Posts:
654
Did you happen to read my last post? Also, skills don't really work in the game that I am doing. Stats seems very appropriate. Also, I mentioned this in the last post, using a graph instead of these complex equations really makes it easy to balance. There aren't any problems if I use stats and graphs together. So far, I have a basic system implemented and it works great. Thanks for the suggestion though

Joined:
Jun 14, 2013
Posts:
1,718
So what did you end up doing?

26. ### calmcarrots

Joined:
Mar 7, 2014
Posts:
654
I ended up using the graph to map the values of the ideal player statistics that I want the player to have. The equation used to read the graph was a mix of your suggestion and Asvarduil's. It works really great right now and the balance is pretty well. Just a few things to change on the graph and it would be perfect

Btw thank you so much for all your help. This graph idea has really created an awesome system that I can implement in other things such as loot drops, enemy variety, and enemy difficulty. Thanks!

Joined:
Jun 14, 2013
Posts:
1,718
Can I see the graph you used? Curious how it looks.

Joined:
Jun 14, 2013
Posts:
1,718
I like this idea, I'm fuzzy on the details of it all but it seems like something I would probably use. Especially the ability to visualize the whole thing.

calmcarrots likes this.
29. ### Jaimi

Joined:
Jan 10, 2009
Posts:
6,208
Yes I did - you talked about a weapon level, as opposed to a skill level. Maybe this was not your intent, but that meant a player would not get better unless he got a better sword and his stats went up. This is why I responded as I did.
It's your game, do it as you want to to make it fun of course. But for me, I find it more natural when it's the skill that goes up (because that's what happens in reality). If you base your damage solely on stats (even in a graph), what you are modeling is the player basically becoming godlike because of his very nature - ie, he can punch an elephant to death with one blow at high level. If it's based on the weapon, then he doesn't get better until he finds the "knife of the gods, level 72" or something, at which point merely shaking the dagger at a rhinoceros would kill it. In both these cases, the player can switch from a sword (that he has been using exclusively) to a spear, and somehow wield this with remarkable ease, even though he has never even touched one before.
However, if you based your damage (and damage avoidance) on skills instead, I think you get a richer experience, and what you are modeling is the player learning to use that specific weapon better -- the player damages the rhino simply because he knows how best to strike, and how to avoid and parry attacks. Increasing stats would be something that would happen relatively slowly. All my opinion, of course.

30. ### calmcarrots

Joined:
Mar 7, 2014
Posts:
654
Oh ok I see what you mean. Yes, my system is a bit weird but I took inspiration from Torchlight 2. As you level up in that game, so do the monsters. The monsters drop weapons that are around the level of the player and the player kinda has no choice but to use the newer weapons against the higher leveled enemies and bosses. That is why I am doing what I am right now. As I progress further into my game, and if this system does become into what you have claimed, then I will definitely change it into something like yours. Thanks very much for the suggestion

31. ### calmcarrots

Joined:
Mar 7, 2014
Posts:
654
Yes, when I get back home on my pc. It's honestly a pretty basic equation that is plotted on the graph. But it so useful!

Joined:
Jun 14, 2013
Posts:
1,718
It really doesn't matter how skilled you are with a knife against a Rhinoceros, does it? And I'd like to see someone parry a bull elephant tusk.

33. ### AndrewGrayGames

Joined:
Nov 19, 2009
Posts:
3,821
It involves suspension of disbelief, a strong grasp of quantum mechanics, and possibly hard-light lasers powered by lasers powered by magic fueled by the hopes and prayers of a now-extinct race of sapient squirrels.

Joined:
Jun 14, 2013
Posts:
1,718

calmcarrots likes this.
35. ### Jaimi

Joined:
Jan 10, 2009
Posts:
6,208
That picture never gets old.

Anyway, yes, it might be pretty challenging to parry an elephant tusk. But apparently not THAT hard.

36. ### calmcarrots

Joined:
Mar 7, 2014
Posts:
654
So here is a terrible example of a graph of ideal weapon damages according to level (this is the best I can do on paint haha)

Anyways, to setup a proper graph, just say that, pretend, you want a level 50 weapon to do an average of about 600 damage. Put that point on the graph and figure out the function (simple alg 2). After that, you can just plug in a level into the function and it should give you an appropriate function.

You can change the function into any of these: linear, quadratic, polynomial, exponential, logarithmic, or sinusoidal.
With any of these functions, you can really control how your game progresses by simply using that function and setting a maximum damage point and a maximum weapon level. Then you can figure out the min and max damages with the formulas I posted above. Lastly, if the damage is unbalanced, then you can simply change the function or the limits on the graph.

These graphs can also be used to determine how much a level 26 enemy should have. You could have a graph for enemy bosses, enemy orcs, enemy spider, etc. Then in each of those categories, a graph for their defense or maybe their speed. Just add a little randomization in the function and scale the graphs to balance your game. Super simple

If you are wondering, I am using a linear function with the function being y = 15x. I just change that function to an exponential at one point if I want to make it even more interesting and nothing about my game will be ruined.

37. ### AndrewGrayGames

Joined:
Nov 19, 2009
Posts:
3,821
Question: why is that ideal? Just because it's like what Final Fantasy does, doesn't mean it's a good fit for your game.

Also, creating a curve for weapon damage only goes so far. You can plot an ideal weapon damage for a given level, but remember: it's only one part of the encounter design. Weapon damage is one tool you're giving the player. Also consider other things. What if you have a Lv.50 sword that gives 66% normal damage, but is capable of attacking twice in a round (e.g. the Falcon Sword in Dragon Warrior III?) Does that synergize with anything else in your game (for instance, a buff that causes your melee strikes to deal additional damage in another form?)

What I'm trying to say is, as good as this is, look at your setup holistically. What does this sort of weapon damage curve mean for your enemies' tuning? There is an upper bound to the amount of HP you can code (e.g. the 'MaxValue' constants on integer and long...or, Int32 and Int64 as they're otherwise known.)

These are the parts where your design is going to start hitting the realities of actually making it happen. You may wind up down-tuning your curve to ensure that you can write enemies with HP that doesn't break the game. Be aware!

calmcarrots likes this.
38. ### calmcarrots

Joined:
Mar 7, 2014
Posts:
654
That was an example but I see your point. Even if I don't use this for weapon damage, it can be used for a lot of different things. I will take your claim with serious consideration and as I progress further into the game, I will post back and let you know just how well this system works. Thanks!

39. ### Gigiwoo

Joined:
Mar 16, 2011
Posts:
2,981
How about spikes? Schell describes how flow works best when it oscilates up and down (i.e. a bit more difficult, then a bit easier). A design using purely exponential growth constrains you a bit. You may consider using a linear growth with plateaus and spikes - which is how WoW does it. Maybe like this:

Gigi

#### Attached Files:

• ###### path4314_curved.png
File size:
2.9 KB
Views:
1,060
Last edited: Oct 30, 2014
calmcarrots likes this.
40. ### Gigiwoo

Joined:
Mar 16, 2011
Posts:
2,981
(Couldn't get this 2nd image to post for some reason... )

Or maybe exponential leading up to the peaks and then restarts...

Gigi

calmcarrots likes this.

Joined:
Jun 14, 2013
Posts:
1,718
Then you could avoid some balancing issues. For example, staggering different skills and stats would mean depending on the current level, different attacks would be the most effective. Certainly would give you something to do, if your goto ability seems to suddenly not be cutting the mustard.

Joined:
Sep 10, 2013
Posts:
288
It is solved through home cooked equations.
The character is an object, the equipped items are separate objects.
You have a calculation that adds the character + all the items to produce the final values + other bonuses (maybe because of race or proffesion?).

How you mix the different values with each other and how you come up with the final result completely depends on you.
I highly recommend that you get one or more core rulebooks for pen and paper RPG games, wrap your head around their systems. Some old ones can probably found online for free these days You can also study simple board games that got characters with items and attributes if you need an even softer learning curve.

It is all about math in the end, about coming up with your own equations that produce values within ranges that you find acceptable for your game.

43. ### calmcarrots

Joined:
Mar 7, 2014
Posts:
654
Very nice graph. That would probably a lot better than a simple linear equation. What is the function called? so I can do some research on it. I looked up spike graphs and schell but nothing showed up. Link please?

44. ### AndrewGrayGames

Joined:
Nov 19, 2009
Posts:
3,821
It's sort of an ascending Sin/Cos wave (uses the Sine function in trigonometry, but it appears to be mixed into an ax+b linear equation.)

I think the other reason @Gigiwoo is offering this up, is because this fits with the classic 'flow channel' model of game difficulty balancing...

The 'Flow Channel' is an area of optimal challenge, where players are fully engaged, and neither too bored nor anxious.

However, there's another version of this graph that I can't find, with difficulty figured in. In that graph, the flow channel's shape resembles the ascending wave function shown above.

Gigiwoo, RJ-MacReady and calmcarrots like this.
45. ### calmcarrots

Joined:
Mar 7, 2014
Posts:
654
Awesome thanks. I will look this up and see if I get any similar results.

46. ### Gigiwoo

Joined:
Mar 16, 2011
Posts:
2,981
As the other image is copyrighted, I typically roll my own. Here's one I've used that shows cycling from 'almost' too easy to 'almost' too hard. There's LOTS of ways to weave this into your designs.

Gigi