Advertisement Jump to content
Sign in to follow this  

Need Help coming up with damage calculation formulas

This topic is 3831 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am a newbie in the field and is working on a pet project; online browser based, turn based, text rpg based on the Naruto anime/manga series. I want the battles to last 5-10 rounds. Assuming the players have the same stats, I want the damage dealt to be in the range of 1000-2000. People will have varying amount of health points, considering that there are missions that award health points. Here are the stats that the players are going to train. Offense/Defensive stats Accuracy: Intelligence: Resolve: Speed: Strength: Genjutsu Offense: Ninjutsu Offense: Taijutsu Offense: Weapon technique Offense: Genjutsu Defense: Ninjutsu Defense: Taijutsu Defense: Weapon technique Defense: Battles are going to be carried out through the use of "jutsu." Jutsus have levels and each jutsu class (genjutsu, ninjutsu, etc) should have it's own damage calculation. I have never designed a battle, so please I am looking for suggestions and help. Also, if there's somewhere I can search for someone I can pay to come up with the formulas, I'd be more than grateful. Thanks in advance.

Share this post

Link to post
Share on other sites
I would write a simplified prototype to simulate battles for say, a few hours, taking out specific statistical information. For example, if it is observed that a relatively higher share of winners have high "Weapon technique Offense" attribs, it may be an indicator that this attrib is too powerful compared to others.

For the rest, you should be putting in an initial idea. People here will try their best to help you but won't do your work from scratch.

A damage system I really liked for a board game (but likely not so useful for a computer generated game) is the one used in Doom: The Board Game. Players have various dices and roll them depending on weapon. Each face is multidimensional so for example, high damage implies less range.

How is the game supposed to work? Does it feel like a dice-based game? Is it purely mathematical? Any already shipping similar examples? How do you want the game is perceived? What's the role of randomized numbers?

Share this post

Link to post
Share on other sites
Well, that's very easy.

private function computeDealtDamage() : int { return 1500; }

Would that work? I suspect not. You need more detailed objectives. First, how much specialization do you encourage? If damage is computed based on skills 'a' and 'b', then you can have:
damage = a + b;     // Specialization is neutral
damage = a*a + b*b; // Specialization is encouraged
damage = a * b; // Specialization is discouraged

You can design a system that encourages specialization along certain lines but not along others. That would be the first question.

The second question is how you want things to 'feel'. See, if every skill affects the gameplay in the same way, then the only difference is their name, which is quite pointless. For instance, if you have skills 'strength' and 'dexterity', then:
damage = str * dex; // Boring!
damage = max (0, (dex - opp.dex) * str); // Better!
damage = max (0, (dex - opp.dex) * max(wep.str * str, wep.dex * dex)); // Excellent![/quote]

The first case is "You need both strength and dexterity, with the optimum being str = dex at any point in time", which is not fun. The second is "Dexterity works by attempting to outmaneouver your enemy, optimum is to have (dex - opp.dex) = str" which is funnier since now the optimization depends on the opponents you encounter. The third is "Once you hit, the damage dealt can be either crushing, based on the weapon's strength bonus, or stabbing, based on the weapon's dexterity bonus", which is fon both because it depends on opponents and because it depends on equipment choices.

So, you need to think about how every stat will come into play (chance-to-hit, damage dealt, etc) and then adapt the mathematical formula to handle it.

Share this post

Link to post
Share on other sites
There are three "tools" that I use when designing a combat system.

The first is Intransitive Relationships. A technical way of saying Scissors/Paper/Rock like games.

This is a game where there is no "best" move, like in the game Scissors/Paper/Rock. In it Scissors beats Paper (because scissors can cut the paper), Paper beats Rock (because paper can wrap up the rock) and that Rock can beat Scissors (because the scissors can't cut the rock).

The second is Damage Reduction vs Number of Attacks (I don't know the technical way of saying that :D ).

In this, if you have two types of defence (one that reduces each hit by a percentage of the amount of damage and the other that reduces the damage by a pre-set value) and two types of attack (one that is slow but does a large amount of damage and the other that does lots of small but individually weak attacks).

The amount of damage each attack type does to each defence type is different.

With the percentage attacks, either attack type is the same as the other, but, with the pre-set value defence, then the slow but powerful attacks will win

This is because with the percentage defence, the damage reduced scales with the amount of damage done, but with the pre-set value defence, the damage reduced scales with the number of attacks.

This means you can create interesting balances between different attacks and defences. If the damage over time of the multiple weak attacks is higher than the damage over time of the slow but powerful attacks then you would want to use the quick attacks against opponents that have percentage damage reduction and use the slow attacks against opponents that have the pre-set damage reduction.

Things get interesting when you combine the two defences in the one opponent (maybe it has percentage DR against one type of attack and pre-set DR against another type of attack).

The third tool is actually related to the second tool. It is called "Overkill". Again it deals with fast weak attacks vs slow powerful attacks. But, instead of defences it deals with the number of opponents.

If you have lots of weak opponents, it is better to have lots of fast weak attacks. This means that you can eliminate multiple opponents before they can do damage to you. So you take less damage and kill more enemies.

But if you had lots of weak opponents, but only had slow but powerful attacks, then you could only kill one opponent at a time and they would be able to deal lots of damage to you in the time it would take you to kill them.

These tools allow you to create interesting choices that the player has to make (the plan for a series of choices is called a strategy) and a game is a series of choices (so allowing the player to have varied and interesting strategies is important for games).

These tools need to be applied before you create a set of Stats, or set a value on the amount of damage the players are going to be doing. This is because the Stats you use and the amount of damage that is done needs to reflect your decisions about how the combat system will work, and not having the combat system reflect the stats you come up with.

Share this post

Link to post
Share on other sites
Thanks for the feed back, like I said, it's going to be a turn-based, text based, browser game.

Specialization is encouraged, but then again. The players decide what they want to specialize in, so one cannot really "predict" which way they'll lean

As for the fighting styles, yes they are going to be different in that.

1. Each specialty is trained differently
2. I want each technique to be dependent on two or more of the generalized stats (Accuracy, speed, strength etc ... which are also trained differently)

3. The techniques also have have differences, so the jutsu will have different "jutsu strength"

for example, I want ninjutsu to have relatively high "jutsu strength" because most of the jutsu are going to be simple damage damage type.

Genjutsu on the other hand I don't need those to have high jutsu strength, because it's going to have effects where the opponent can't move, so I don't want the victims of such situations to be trapped, and killed quickly.

here's an example of one of the forumalas I came up with (general)

jtsus=11; (jutsu strength, in case you were wondering)
jtsul=2; (jutsu level)

with the "rndm" multiplier, I was also wondering if there's a way I can restrict it, because it goes from 0-1 and causes the damage dealt to range from 100 - 9000, which I think is a VERY wide range.

[Edited by - elabarley on July 24, 2008 10:42:07 AM]

Share this post

Link to post
Share on other sites
Original post by elabarley
...the damage dealt to range from 100 - 9000, which I think is a VERY wide range.

Actually, that's only a wide range if you want it to be a wide range. If, for example, a character from Golden Sun would have done 9000 damage, then that would've been a massive overkill. Concerning an average Final Fantasy game (preferably VII - X), this is a fairly normal number. You see, it really depends on what you define as much. If it's normal in your game for enemies to have 19.000.000 Hit Points, 100-9000 isn't a very wide range at all. This should also be taken into account.

My Two Cents,
- Stijn

Share this post

Link to post
Share on other sites
Original post by stenny

If it's normal in your game for enemies to have 19.000.000 Hit Points, 100-9000 isn't a very wide range at all. This should also be taken into account.

My Two Cents,
- Stijn

Well, it depends on what you consider as "range" but personally, if 2 people were fighting over time I really will not like player A to deal "9000" on his/her first hit and deal "100" on the second hit using the same jutsu.

That's the effect the rand gives it, and I don't want static hits either.

Share this post

Link to post
Share on other sites
Like that. Well, a way to give bounds to your rand would be:

int Random(int LoBound, int HiBound)
return (rand() % (HiBound - LoBound)) + LoBound;

Again, it all depends on the formule though. I'd go for a basic formula...something like this:

Random(0, Luck / 10);

The higher your luck is, the bigger the outcome of Luck / 10 is (20 / 10 = 2, 40 / 10 = 4). It is then thrown into the Random() function. So, the random damage lies somewhere between 0 and Luck / 10. You can change around 10 to see what outcomes you prefer.

Off course, this is a very basic formula. Maybe you need more variables or flexibility, but it's a start.

- Stijn

Another thing you could do is take e.g. 10% of the calculated damage, and base your random damage on that number. The more damage, the more randomdamage.

Share this post

Link to post
Share on other sites
There are 3 factor in determining the damage:
1) Player Skill (in this case it is the player choosing the best attacks vs a given defence rather than twitch skills).

2) Character Skill (this is the various stats and skill values you give the characters and it is what the player will use to make their choices)

3) Randomness

So any damage formula would take the shape of:
(Player Skill * PSWeighting) * ((Character Skill * CSWeighting) + (Randomness * RandWeighting))

Player skill will most likely be an X faxtor that you can't specifically code into your formula which means it will come down to: (Character Skill * CSWeighting) + (Randomness * RandWeighting)

The value that is the Player Skill will depend on the amount of strategic choices the player has, and the PSWeighting will be on how much those choices can influence the outcome of the attack.

How you arrive at the Character Skill value will be different depending on your system and the CSWeighting is a balancing factor that allows you control over how much this will influence the outcome of the attacks.

The Randomness is a value between 0 and 1, and the RandWeighting is the value of how much randomness you want in the output of the attack/damage value.

How you compute the Character Skill (and it's weighting) will be the major factor in what strategies and choices are available to the players (and so ultimately effects the Player Skill value).

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!