Page 1 of 2

Damage calculation

Posted: 29 Dec 2006, 03:22
by Crush
The posibility to attack other creatures is currently being implemented into TMWServ. So it is the time now to think about the damage calculation formulas.

How should damage be calculated? What aspects should affect the damage and in what way?

Exact formulas appreciated. Please don't spin off too much. Before making suggestions you should read the proposed Core game systems on the wiki (mainly attributes and skill system proposals).

Posted: 30 Dec 2006, 19:02
by Crush
Not many ideas yet.

I wrote a draft on the wiki about how damage calculation could work. I would like you to read it and say what you think about it:
http://wiki.themanaworld.org/index.php/ ... alculation

Posted: 30 Dec 2006, 19:24
by Dr Wahl
IMO, I think that physical strength should account for a large portion of the physical attacks. Weapons should also be a large chunk as well. A critical hit should be calculated in as well, maybe something like a %20 chance (for newly created characters), then things like restrictive armor (i.e. chainmail) might reduce the chance of a critical hit, and less restrictive armor (i.e. cotton shirt) might increase the chance of a critical hit. I plan on drawing up an entire formula, but I wanted to get this down on the forum first. Any comments?

Posted: 30 Dec 2006, 23:33
by Modanung
I think strength, agility/swiftness and dexterity/precision should influence all attacks, but it depends on the weapon type how they do.
So something like the following:
Hammer damage = weaponlvl^(strength / weight) + hammer_skill + rand(0,precision) + rand(0,weight)^2
Axe damage = weaponlvl^(strength / weight) + axe_skill + rand(0,precision)^2 + rand(0,weight)
Sword damage = (weaponlvl * sword_skill) * (strength / weight) + rand(0,precision + swiftness)
Dagger damage = (weaponlvl * dagger_skill) * (precision/weight) + rand(0,swiftness) + strength
Bow attacks = (weaponlvl + arrowlvl) * bow_skill * precision + rand(0, strength)

On the other hand swiftness may also just allow for faster movement and shorter delays between attacks.

Posted: 31 Dec 2006, 07:17
by Rotonen
I have no objections to elemental damage having healing properties on something that is mostly of the same element (probably a magically boosted player or an elemental).

Additionally biological damage should also be a side-effect of various other damagetypes. (You get hit by fire, you get a burn. You get hit by a hammer, you get at least a bruise if not bone damage. This should mostly apply to critical hits and could lead into critical critical hits.)

Posted: 31 Dec 2006, 12:10
by Crush
Rotonen wrote:I have no objections to elemental damage having healing properties on something that is mostly of the same element (probably a magically boosted player or an elemental).
When you are referring to the damage calculation of magical attacks in my article: When the caster has an element modifier of higher than 2 his attacks would heal every target. Not only those of the same element. But those of other elements would in fact be healed more. Sure you want that?

Beings that are so "elemental" that they are healed by attacks of the same element are possible, too. You just need a being with a negative elemental modifier.

Posted: 04 Jan 2007, 00:26
by Crush
Modanung wrote:I think strength, agility/swiftness and dexterity/precision should influence all attacks, but it depends on the weapon type how they do.
So something like the following:
Hammer damage = weaponlvl^(strength / weight) + hammer_skill + rand(0,precision) + rand(0,weight)^2
Axe damage = weaponlvl^(strength / weight) + axe_skill + rand(0,precision)^2 + rand(0,weight)
Sword damage = (weaponlvl * sword_skill) * (strength / weight) + rand(0,precision + swiftness)
Dagger damage = (weaponlvl * dagger_skill) * (precision/weight) + rand(0,swiftness) + strength
Bow attacks = (weaponlvl + arrowlvl) * bow_skill * precision + rand(0, strength)

On the other hand swiftness may also just allow for faster movement and shorter delays between attacks.
Although it sounds like a good idea to calculate the damage with a different formula for each weapon type you should keep in mind what a balancing nightmare it could become when the damage calculation formulas are that much different for every weapon.

So I think that every weapon should use the same damage forumla and the damage should depend on as few factors as possible. It just keeps the game simple, easy to understand and thus easy to balance.

Dexterity is for hitting
Agility is for dodging
Strength is for damage

I think we should stick to that.

Posted: 04 Jan 2007, 06:00
by Rotonen
I'm for "blunt / sharp / pierce" instead of that multitude of weapon types. Simple enough and makes sense.

Posted: 04 Jan 2007, 16:40
by Crush
We could do the difference between blunt and sharp weapons with different armor values.

Leather, for example, offers quite good protection against sharp weapons because it is really hard to cut through. But it provides almost no protection against blunt weapons like maces and the like because it changes its form very easily on impacts.

A plate armor on the other hand might take a lot of blows with a mace until it is deformed so much that the wearer is seriously hurt, but a strongly thrusted lance could pierce it with one blow.

So we could give armors different defence values for blunt, slicing and piercing attacks.

Posted: 04 Jan 2007, 20:36
by Tarm
The problem with a blunt/sharp/pierce damage model is those weapons that fall in between. A rapier as an example have both sharp and pierce damage. Halberd is another one. RPGs usually solve this with different attacks like a character can slice or stab. Some have slicing damage as ordinary attacks and piercing for critical hits. With maces you can have blunt damage as a ordinary attack and crushing for critical hits.

The easiest way imho is still damage bonuses on certain weapons. Say spears or lances have a negative armour bonus and broadswords higher base damage but no bonus.

Posted: 05 Jan 2007, 04:02
by Crush
So you want the equip defence to be percentual modified by a modifier of the weapon?

With the formulas in my article this won't work well, because the damage is divided by the armor value. That means it would make no difference if you reduce the armor by 50% or increase the damage by 100%. The result would be the same.

A solution would be to get rid of the multiplication and division and use the classical rpg formulas where damage is the sum of the characters attack power and his weapons attack power and the defence is deducted from every attack:

damage = weapon_damage + strength + rand(0, weapon_skill)

HP loss = (Damage * element_modifier) - vitality - (equip_defence / armor_modificator)

Bug or what?

Posted: 08 Nov 2007, 16:23
by jerzyjerzy
I have problem with damage. When I up dexterity to 50 (lvl57) then I dont decrease the value of arrows when I use bow. This is fine for me but my hit damage enemy is 50-60 points (sick!) What ever my sword and bow have max 60 points of enemy damage. My fist have 50 points damage of enemy. Whats wrong? I have:
Lvl 58
Strength 32
Agility 32
Vitality 25
Intelligence 5
Dexterity 50
Luck 20
(Sword) (Bow)
Attack 155 Attack 125
Defense 66
% Accuracy 108
% Evade 94
% Reflex 1

Posted: 08 Nov 2007, 16:27
by Crush
jerzyjerzy, you are offtopic here.

Posted: 17 Nov 2007, 15:03
by voodoo.child
I believe weapons should have a minimum and maximum damage.

so instead of:
<quot>
damage = weapon_damage + strength + rand(0, weapon_skill)
</quot>

let's have
damage = rand(f(min_weapon_damage), f(max_weapon_damage))

where f is a function like:
f(damage) = (damage + weapon_skill^0.75) * (1 + sigmoid(strength))

Posted: 17 Nov 2007, 18:35
by Modanung
voodoo.child wrote:I believe weapons should have a minimum and maximum damage.
Well, with Crush's last damage formula the minimum damage would be:
weapon_damage + strength

And maximum damage:
weapon_damage + strength + weapon_skill