Skip to main content
GameDev.net gamedev.net
🔒 Locked

Creating RPG Formulas?

Started by Jamison73 Mar 13, 2008 at 11:31 AM 2 replies 4.1k views
Original Post
Jamison73
Jamison73
How do developers come up with combat formulas? Is there some sort of math or statistics they base it on? Pure playtesting? Specifically I'm looking at Oblivions combat formulas here: http://www.uesp.net/wiki/Oblivion:The_Complete_Damage_Formula In this formula "BaseArmorRating * ( 0.35 + 0.0065 * OpponentArmorSkill) * ArmorHealth/MaxArmorHealth" How would one determine the numbers 0.35 and 0.0065? Thanks, Jamison
Telastyn
Telastyn
Constants like that are generally based on playtesting, with the ratio between them based on the relative value the designer wants to give them (in this case between skill and not skill). The goal here being a 100 armor skill yields the 'max' armor value. That is probably fixed, with the ratio between them scaled on playtesting.

The actual formula/operations tend to be based on design about how things are supposed to work/scale. OpponentArmorSkill might be squared in the formula to make that ramp up much more than the current linear rate for example...
JimmyDeemo
JimmyDeemo
I don't think there are any set rules, but more likely your formula will be balanced depending on how you feel that game plays.

One idea would be to make any tweakable values be read from a file. This will mean you can tweak and test them without having to re-compile your project.
Kylotan
Kylotan
Mathematics! Get an understanding of how you want the gameplay to change as values rise and fall, and how you want the stats to change, and a feel for the range of different possible values due to typical variation and random factors. The numbers are determined by that.

That formula is quite simple really, when you break it down. The last part, "ArmorHealth/MaxArmorHealth" is merely a percentage of what condition the armour is in. That is applied as a scaling factor to the first half of the equation. So in other words, if your armour is half destroyed, it gives you half the benefit. All well and good.

The first part, "BaseArmorRating * ( 0.35 + 0.0065 * OpponentArmorSkill)" is a little more complicated. Multiplication is typically scaling one value by another - in this case, it's scaling the BaseArmorRating by the OpponentArmorSkill, because you want the opponent's armour skill to have an effect on their protection. But numbers mean nothing without units - how does one point of armour skill compare to armour rating? You can't know that without knowing the conversion rate. But when you write a combat formula, you get to decide the combat rate, ie. you decide how much use 1 point of armour skill gives you. This in turn is probably going to be decided by how many armour skill points someone can get - if your game measures armour skill on a scale of 1 to 3, then you want 3 to give up maximum protection. But if it measures on a scale of 1 to 100, you probably want a score of 3 to give 3% protection.

In Oblivion, skills are percentages, or near enough. So the best characters would have 100 armor skill, and the worst would have 0. To treat a value from 0 to 100 as a percentage, you'd divide by 100 first, which equals multiplying by 0.01. So you'd expect to see "BaseArmorRating * (0.01 * OpponentArmorSkill)" there. If you have zero armour skill, you'd get no protection from your armour, and if you have 100 armour skill, you'd get your full base armour protection.

But, the designers probably figured that was a bit draconian - after all, even someone with no skill should still get some benefit from wearing thick plate mail or whatever. How much benefit is again entirely up to the designers, but they chose 35% - ie. someone with no skill still gets 35% of the benefit from their armour. So, the scaling factor needs a +0.35 in there. But this would mean that someone with 100 skill would now get 135% benefit from the armour, which is wrong. Therefore, they need those 100 skill points to only cover the range from 35% to 100%, ie. 65% of the range. So, the previous multiplier of 0.01 needs scaling down to 65% of its original value, to 0.0065. This now gives us "BaseArmorRating * ( 0.35 + 0.0065 * OpponentArmorSkill)".

Hope that helps!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.