Combat damage equation

Posted by Lerkista on Mon 07 Nov 2005 01:35 AM — 5 posts, 22,971 views.

#0
To the mud coders, how do you manage damage??

i've str,dex,con,weapon value and armor value, (other stats like int,charisma don't count to calculate the damage)

i've put a max stats of 50 points, 50 for weapon value, and 250 for armor value

So what would be a good way to handle the damage??

Dex i consider that only affects the hit or miss factor, so maybe not to use it on damage

The main problem i have is to consider the other's player armor, the stats that are involved are
Player1 - str and weapon
Player2 - con and armor

Since the armor is higher than weapon, doing a str+weapon - con-armor don't work because with the max values the result are always <0, so i'm stuck with that formula

Any ideas??
USA #1
It depends on how much damage you expecting. It makes a large difference if players start off with 5hp compared to 1000hp. Try taking a look at some existing codebases such as ROM, SMAUG, or Circle.
#2
Smaug, rom, etc uses to many variables, for example weapon mastery, armor mastery, etc, i want something simpler but fair

The amount of HP of the players can be adjusted without problem, but now the maximum is 442hp, 42+level*8, so a level 1 starts with 50hp

Having the damage formula everything else can be adjusted
Australia Forum Administrator #3
Take a look at this post of mine, it might give you some ideas:


http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=5959


For a formula I think you need to consider:

  • How much damage the weapon does.

    A lot depends on your figures, like Zeno said. Is 10 damage a lot or a little? Assuming that they are wielding a weapon that does 20 damage, then you could factor in strength, by saying something like "for every 10 strength you get 1 more damage from the weapon".

    So, damage could be:

    weapon damage + (strength / 10)

  • How much the armor deflects.

    A simple formula could be that for every 10 armor you reduce the attack by 2% (not 2). By having armor cause a percent reduction you never get to negative numbers.

    Since you have 250 (max) armor, then 250 X (2 / 10) = 50%, giving a max reduction of 50%.


So, a fight might go:

  • Weapon: 20 damage per hit
  • Strength: 30 (adds 3 damage)
  • Defender: 100 armor (reduces damage by 20%)


So, total damage received is:

23 * (100 - 20)/100 = 18.4 damage
Australia Forum Administrator #4
An example of a damage reduction formula for armour as used in World Of Warcraft game is at:

http://www.worldofwar.net/guides/damagereduction.php

Their formula is:


Damage-Reduction = armor / (armor + 85*level + 400)


... with maximum reduction capped at 75%.

You might need to tweak this depending on your armour and level ranges, but it works for them. That page also shows a graph of how the armour reduction levels out.