Game Development Community

Randomized Damage Calculation

by Brad Reiss · in General Discussion · 05/13/2002 (4:36 pm) · 4 replies

Let's start off by saying one thing: I know absolutely no C++. I was hoping someone who does can put this cool damage calculation idea I had to use. Ok here goes...

Picture a basic pistol: The player goes around with his pistol shooting other players and doing a fixed amount of damage, let's say 20 for the purpose of simplicity. While this method will suffice, there are better ways to calculate damage then having a fixed amount. You can assign a variable to the damage of the pistol such as a random number between 10-30. That way, the pistol could do a different amount of damage to the target each time it is shot. But there's more! You can assign different variable damage based on the player's distance from the target he is shooting at. Here's an example of a damage chart you can make:

PISTOL:
Long Range= rand. # between 5-15
Medium Range= rand. # between 16-30
Close Range= rand. # between 31-50

To make this even more fun, you can add little random damage events, such as "Overkill" which will multiply the amount of damage done by 2X or 3X, or a "Miss" in which no damage is done at all.(like in RPG's) This will make your game a helluva lot more fun!

This is just my basic idea, feel free to add to it or criticize it.

#1
05/13/2002 (4:59 pm)
When a bullet hits a player it calls a "damage" function which sends a static value that is deducted from the player.

Just randomize that value, and viola! Random damage!

I've been thinking of implementing a semi-realistic "damage" that actually will move the player around accordingly.

Get hit in the head and well... you die fast. If you live (a helmet shot) then you can get knocked to the side (or fall down)

Get hit in the chest or legs, and if it hits a bone you take more damage and get knocked on your ass. Miss a bone, and you are wounded but don't get moved that much.

Most games that are out now tend to ignore that getting shot point blank can send you flying if it catches bone, as well as making the wound a lot worse. Wouldn't be difficult at all to implement, but it would require a few random values and limits for damage and force as well as some decent hitboxes.

This is something I'm amazed that Soldier of Fortune 2 doesn't have. You'd think with the "our violence owns your ass" approach of game development, they might try to innovate a bit.
#2
05/13/2002 (5:48 pm)
I prefer "realistic" damage to randomized damage.

My implementation will combine a damage multiplier system that will provide different damages and penetration values for different projectiles and objects/surfaces with a system that determine the kinetic energy coefficient of the projectile a the specific point on the path.
The damage applied by the projectile will be determined by the projectiles damage multipliers and the projectiles kinetic energy. This value will be further modified by a locational damage system, surface hardness multiplier (armor effectiveness), ect.

Havoc
#3
05/13/2002 (6:39 pm)
If you're going for realism you're going to have to go for some randomness.

If you don't, you won't be able to "accurately" model collisions with vital organs or bone. And just by watching CSI you should know that's about as random as it comes :p
#4
05/14/2002 (2:57 pm)
Actually, the real limit is that the player cant aim accurately enough for locational damage with individual organs to be a real question. Simply the delay inherent in having 32 ticks per seconds, plus internet latency means that you are not going to be able to aim for, say, a liver shot, with enough precision that anyone will ever notice whether you randomize or actually calculate the colliison. With the system that I have, you actually COULD manage to EFFICIENTLY do colision with individual organs. But, as I have said, there isnt a point.

So, I am just going to figure out where a player is hit, then randomly determine if it hits a bone, organ, artery, etc. :)