# 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.

## 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 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 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 neutraldamage = a*a + b*b; // Specialization is encourageddamage = 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. 
 0 
 Share this post Link to post Share on other sites 
 
 
 Edtharan    607 Edtharan Member 607 Posted July 24, 2008 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 winThis 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. 0 Share this post Link to post Share on other sites elabarley    122 elabarley Member 122 Posted July 24, 2008 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 leanAs for the fighting styles, yes they are going to be different in that.1. Each specialty is trained differently2. 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)Aaccuracy=1000;Aintel=1000;Aresolve=1000;Aspeed=1000;Astrength=1000;Aninoff=5000;Anindef=5000;Agenoff=5000;Agendef=5000;Ataioff=5000;Ataidef=5000;Awepoff=5000;Awepdef=5000;Baccuracy=1000;Bintel=1000;Bresolve=1000;Bspeed=1000;Bstrength=1000;Bninoff=5000;Bnindef=5000;Bgenoff=5000;Bgendef=5000;Btaioff=5000;Btaidef=5000;Bwepoff=5000;Bwepdef=5000;jtsus=11; (jutsu strength, in case you were wondering)jtsul=2; (jutsu level)rndm=rand(1);batlx=(jtsus)*(jtsul)*(Bintel/Aintel)+((Bninoff*10)-(Anindef*8))*rndmwith 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] 0 Share this post Link to post Share on other sites stenny    142 stenny Member 142 Posted July 24, 2008 Quote: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 0 Share this post Link to post Share on other sites elabarley    122 elabarley Member 122 Posted July 24, 2008 Quote: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,- StijnWell, 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. 0 Share this post Link to post Share on other sites stenny    142 stenny Member 142 Posted July 24, 2008 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[EDIT]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. 0 Share this post Link to post Share on other sites Edtharan    607 Edtharan Member 607 Posted July 25, 2008 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) RandomnessSo 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). 0 Share this post Link to post Share on other sites 
 Sign in to follow this   Followers 0 
 Go To Topic Listing Game Design and Theory Advertisement 
 Advertisement What is your GameDev Story? In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us. (You must login to your GameDev.net account.) Share My Story Popular Tags 2D 3D Advice C# C++ Character Concept Design DX12 GameMaker Gameplay General Graphics Mobile Music OpenGL Open Source Optimization PC Pixel SFX Unity Unreal VR Vulkan Popular Now 27 Anyone who wants to write a little game engine? By DaTueOwnerStarted Friday at 09:12 PM 16 OpenGL Textures, Pixel Alignment And Texture Mistakes. What Am I Doing Wrong? By babaliarisStarted Friday at 06:34 PM 10 Managing pointers upon object destruction in C++ By too_many_starsStarted Friday at 08:21 AM 10 A Functional Impass - Advise me on how to proceed? (C#) By A4LStarted Friday at 03:32 AM 11 MMORPG Brilliant Game Idea. By Tara LouiseStarted Thursday at 12:03 AM Advertisement Forum Statistics Total Topics 634100 Total Posts 3015527 GameDev.net GameDev.net Articles GameDev.net Event Coverage GameDev.net Forums GameDev.net Blogs GameDev.net Gallery GameDev.net News GameDev.net Projects GDNet Chat All Activity Search In Everywhere This Forum This Topic More options... Find results that contain... All of my search term words Any of my search term words Find results in... Content titles and body Content titles only Home Forums Game Design Game Design and Theory Need Help coming up with damage calculation formulas 
 
 
 × Existing user? Sign In Sign Up Browse Back Articles & Tutorials Back All Categories Audio Business Game Design Industry Programming Visual Arts Columns Back GameDev Unboxed Event Coverage Back All Events Game Developers Conference Power Up Digital Games Conference GameDev.Market Links News Podcasts Back All Podcasts Game Dev Loadout Archive Community Back Beginners Back Beginners Group Beginners Forum Beginners Resources Blogs Calendar Chat Forums Back All Forums Audio Business Game Design Programming Visual Arts Community GameDev Challenges Affiliates Topical Workshops Gallery Groups Back For Beginners GameDev Challenges All Groups Projects Back All Projects Games Game Assets Game Mods Developer Tools Store Forums Back All Forums For Beginners Audio Back Music and Sound FX Games Career Development Business Back Games Career Development Production and Management Games Business and Law Game Design Back Game Design and Theory Writing for Games Programming Back Artificial Intelligence Engines and Middleware General and Gameplay Programming Graphics and GPU Programming Math and Physics Networking and Multiplayer Visual Arts Back 2D and 3D Art Critique and Feedback Community Back GameDev Challenges GDNet Lounge GDNet Comments, Suggestions, and Ideas Coding Horrors Your Announcements Hobby Project Classifieds Indie Showcase Affiliates Back NeHe Productions AngelCode Topical Workshops Careers Back Contractors Hobby Projects Game Jobs Back Browse on GameDev.Jobs Post a Job Members Back Subscriptions Chat Guidelines Leaderboard Online Users Awards Search Back All Activity My Activity Streams Back Latest Topics Featured Blogs Search Important Information By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.   I accept GameDev.net 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! 
 $('body').click(function (e) { var container =$("#pagecontainer"); if (($(e.target).parent().prop('nodeName') == 'BODY') && (container.has(e.target).length === 0) && (e.button == 0) && (!$(e.target).hasClass('ipsDialog'))) { window.open('https://ad.doubleclick.net/ddm/trackclk/N129002.1825GAMEDEV.NET/B11085475.236262913;dc_trk_aid=433791501;dc_trk_cid=90245747;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;tfua='); ga('send','event','Advertisement','Click','3q_fb_gamedev_skin_2019_1'); } }); $(document).ready(function() { setInterval(function() { window.googletag.pubads().refresh(); }, 30000); });$(document).ready(function() { if (ipsSettings.memberID > 0) { ga('send','event','User','View','Member'); } else { ga('send','event','User','View','Guest'); } });