ID:2298681
 
Problem description:
Firstly let me say, my math is absolutely terrible, I sucked at math in school and I suck at math now I'm a 23 year old man, I know for some people a damage calculation might not be a big deal but jesus christ help me, this calculation is fine as long as 2 people of the same level are fighting but otherwise you WILL get pretty much 2 shot by the higher level I'm not really too sure what to do lol

Code:
damage = round(((((rand(1,5)+M.Level.Level))+(M.Strength.Level + M.GetStatBonus("Strength"))))-((rand(1,5)+target.Level.Level)+(target.Durability.Level+target.GetStatBonus("Durability")/2)/5),0.5)


Might be easier to read like this:

damage = round(((((rand(1,5)+M.Level.Level))+(M.Strength.Level + +(target.Durability.Level+target.GetStatBonus("Durability")/ 2)/5),0.5)

I recommend that you use round (a, 0.1)
Damage with more than 3 houses, ignore round (a, 0.1), use (a, 1)
Excel is your best friend with that kind of stuff: You put a few column for attacker stats and a few for defender stats and then you can get another column that has the calculation going on. I'm about to make one for your problem, give me some time, mate.

Edit 1: Besides, what are the basic values for strength, durability and the bonuses in your game? Just to get a real check on it.

Edit 2: You know that adding a 1.5 random to attack, then one on defense pretty much cancels each other out, right? Instead, add a random multiplier to the whole formula after the calculation, like:
damage=rand(0.6,1.5)*damage

And if the numbers go too crazy you can always adjust that.
var/atk = attacker.attack
var/def = defender.defense
var/base_dmg = atk**2 / (atk + def)


This is a really neat one.

Given the defender's defense is zero, the base_dmg will be equal to the attackers attack.

Given the defense is equal to the attack, the base_dmg will be half of the attacker's attack.

How big or small these numbers are doesn't really matter as long as you scale hit points proportionally to attack and defense until you reach a desired duration/speed of combat.

Want to add some randomness to it?

var/mult = 1
if(prob(crit_rate))
mult = weapon_strength*2
else
mult = weapon_strength - rand() * weapon_variance
var/atk = attacker.attack
var/def = defender.defense
var/base_dmg = ceil(round(atk**2 / (atk + def) * mult,0.5))


A good base weapon_strength would be between 0.5 and 2.0 (1.0 would be ideal as a baseline). A good weapon_variance would be between weapon_strength/2 and 0.0. The higher the variance, the more randomness will apply to each attack. The higher the weapon_strength, the stronger attacks will be in general.

You could also add a dodge_rate variable to evade all damage, and even a secondary miss check for characters with status effects like blindness.

The base damage of atk squared over the sum of atk and def is really widely used. It works well particularly for RPG systems that assume a 255 or 999 stat cap.