Damage calculation

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Damage calculation

Post 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).
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Post 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
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
Dr Wahl
Warrior
Warrior
Posts: 317
Joined: 09 Apr 2006, 06:15
Location: Washington

Post 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?
Image
User avatar
Modanung
Grand Knight
Grand Knight
Posts: 1719
Joined: 20 May 2005, 15:51
Location: Groningen, The Netherlands
Contact:

Post 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.
If you're looking for 3D FOSS games be sure to check out LucKey Productions on itch.io
User avatar
Rotonen
TMW Adviser
TMW Adviser
Posts: 3154
Joined: 08 Sep 2004, 19:48
Location: Bern, Switzerland

Post 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.)
This message used to be meaningful.
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Post 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.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Post 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.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
Rotonen
TMW Adviser
TMW Adviser
Posts: 3154
Joined: 08 Sep 2004, 19:48
Location: Bern, Switzerland

Post by Rotonen »

I'm for "blunt / sharp / pierce" instead of that multitude of weapon types. Simple enough and makes sense.
This message used to be meaningful.
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Post 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.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
Tarm
Warrior
Warrior
Posts: 336
Joined: 25 Mar 2006, 00:16
Location: Here

Post 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.
"I'm selfdestructive baby
But a friendly one" - Spiritual Beggars.
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Post 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)
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
jerzyjerzy
Peon
Peon
Posts: 5
Joined: 08 Nov 2007, 16:07

Bug or what?

Post 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
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Post by Crush »

jerzyjerzy, you are offtopic here.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
voodoo.child
Peon
Peon
Posts: 1
Joined: 17 Nov 2007, 14:50

Post 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))
User avatar
Modanung
Grand Knight
Grand Knight
Posts: 1719
Joined: 20 May 2005, 15:51
Location: Groningen, The Netherlands
Contact:

Post 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
If you're looking for 3D FOSS games be sure to check out LucKey Productions on itch.io
Post Reply