damage equations..how should i go about making them?
how do u make good damage equations? what i want is some thing that can range from no more then half a persons hp to no less then a tenth of it, any generic way to ensure that ?
Do you want damage to decrease linearly or nonlinearly? I.e., a sword cut while at full health doesn''t hurt much, but that same cut while near death may feel a hell of a lot worse! Do you want to implement this sort of variable health system where the damage taken depends on the current state of health (and thus all the previous damage taken)... or do you just want a simple linear relationship?
Cheers,
Timkin
Cheers,
Timkin
All you need to specify then is the rate of change of health with respect to damage. Let's call it dHealth_dDamage and we assume that it is a negative quantity (i.e., positive damage causes a loss in health). Then you can convert damage taken into health lost, according to
Health_Change = dHealth_dDamage * Damage Taken
Then you can update the health of the character using
Health(current) = Health(last) + Health_Change
If you want to impose constraints on how much health can be lost before they're unconscious, simply check for this after updating the current Health. So,
IF Health(current) < critical_threshold
THEN Character.state = unconscious
... or something to that effect! I hope this has helped!
Cheers,
Timkin
[edited by - Timkin on September 5, 2002 12:08:21 AM]
Health_Change = dHealth_dDamage * Damage Taken
Then you can update the health of the character using
Health(current) = Health(last) + Health_Change
If you want to impose constraints on how much health can be lost before they're unconscious, simply check for this after updating the current Health. So,
IF Health(current) < critical_threshold
THEN Character.state = unconscious
... or something to that effect! I hope this has helped!
Cheers,
Timkin
[edited by - Timkin on September 5, 2002 12:08:21 AM]
hrmm i mean like how should i mess with the players attributes to calculate damage such as str * weapon * agility or something what are normal caclulations for that? the values range from 10 to 255 each and i wont have more then 5 attributes to calculate it with (havent set that in stone yet but i dont want to have to use a zillion attributes to calc some damage)
a more convincing damage model would be to increase/decrease damage by a random number dependant on how near death, so when you''re weak and bleeding a slight tap may finish you off but a painful stab might do little extra damage.
********
A Problem Worthy of Attack
Proves It''s Worth by Fighting Back
********
A Problem Worthy of Attack
Proves It''s Worth by Fighting Back
spraff.net: don't laugh, I'm still just starting...
quote:
Original post by vaneger
hrmm i mean like how should i mess with the players attributes to calculate damage such as str * weapon * agility or something what are normal caclulations for that? the values range from 10 to 255 each and i wont have more then 5 attributes to calculate it with (havent set that in stone yet but i dont want to have to use a zillion attributes to calc some damage)
This is more of a game design question than a maths/physics question. Ask yourself what factors you believe are important in damage output. For example, will the characters strength affect the damage done? Does agility affect damage done or how often the character hits? You''ll need to know which factors affect damage in your model. There are many ways to incorporate these factors into a model. You can either write out equations that incorporate these relationships or simply write down some tables of numbers. It''s really up to you.
As to what is found in other games... there is no fixed method that everyone uses.
Cheers,
Timkin
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement