login

Author Topic: Has anyone experimented with a "blood loss" damage model?  (Read 30533 times)

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Has anyone experimented with a "blood loss" damage model?
« on: November 16, 2008, 03:37:32 AM »
I was thinking ... and I know, I shouldn't do that ... when I start thinking, insurance companies go bankrupt.

But seriously, I was thinking, because I need to finish up the RCM/Native package, and I wondered if anybody had done any experiments with a bleeding damage model, and/or if anybody would care to.

It wouldn't need to be complex.  Just a simple "x-2 points/unit time bleeding" added along with "x points damage".  (I say x-2, in that very minor wounds should not bleed significantly.  About two points of slack should cover the ability of blood to clot in a shallow wound, while arterial bleeding would not be so cooperative.)  The net effect being that a character hit by a weapon would eventually go down, as continued attempts to stay in the fight with an arrow sticking out of you would cause blood loss.  To really make it elaborate, have them first flag as unconscious, and then only flag as dead if the fight goes on for a while.  It cannot, however, just check current health - that would result in exponential decay (the more blood they lost, the faster they would bleed), and cause everyone to go down from a scratch.

I thought of that while looking at a scar on my thumb - shop accident a few years ago, cut it nearly off on a bit of sheet metal - and remembering that a cut maybe an inch and a half long was completely debilitating ... not because the cut was serious, but because I lost about a pint of blood over the next five minutes, while trying to stop the bleeding with direct pressure.  If I had tried to stay in a fight, I would have been effective for about four minutes before going down from blood loss.  Even blunt trauma causes blood loss, although it is often internal - medical texts even list common volumes of expected blood loss from various broken bones, assuming reasonable emergency procedures, and the numbers are often several pints for a major broken bone.  Then I compared that to M&B, where a badly wounded character can still run around for an hour as long as nobody catches him.  It's rather hard to balance things for realism with this obvious flaw ... simply increasing damage to account for expected shock and bleeding doesn't really get the effect.

If anybody cares to run a test on this, and/or thinks they could program it ... speak up.  (Note - it has to run the check in very little code.  If the game pauses every ten seconds to run the bleeding calculation, people will notice.)  I'll try to come up with the appropriate numbers to plug into a formula, if somebody with programming skill can create the formula.

Offline KON_Air

  • Craftsman
  • **
  • Posts: 110
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #1 on: November 16, 2008, 05:10:16 AM »
It really doesn't need experimenting just tweaking, the sole problem is detecting "a critical hit" that would cause that serious bleeding to worth bleeding in gameplay mechanics,

work flow is like that;

hit detection: trickiest part as players may get themselves into positions that they can take damage in every step (ie. frame, milisecond). And there is no possibilty of detecting what kind of damage they are taking. The only way to do it, is to contiuniously compare their health to their health in previous check and store how much damage they took in between.What can be done as far as I know is making bleeding as a result of a "critical hit" and decide what to do according to the severity of the hit.

execution: if bleeding deliver blunt damage, if battle goes on longer then survival time limit kill that agent.

Or at least that's what I'm going to do Modplosion, only for player and won't kill anyone (that is expect player :P).

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #2 on: November 16, 2008, 05:21:16 AM »
There isn't really such a thing as a "non-critical" hit ... if it does more than two or three points of damage, it's critical in the sense of being medically significant.  How critical it is ... that will be roughly equivalent to the number of points of damage in the first place.  No need to repeat that calculation, just re-use the "damage taken" number.

But having it only affect the player would be pointless.  I was just looking for a way to make it where guys who take an arrow don't either completely shrug it off or completely go down ... something in the middle, where they take an arrow and go down from bleeding in about two minutes, but in two minutes they can still knock you in the head with a mace.  (This is the biggest problem with handgun wounds in modern police work - too much time between when the wound is inflicted and the time blood loss becomes debilitating.)

So no, that's not what I was looking for.  Not at all.

Offline Fisheye

  • Blues Brother
  • Moderator
  • *****
  • Posts: 427
  • My scalp's so bright, I gotta wear shades.
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #3 on: November 16, 2008, 05:54:41 AM »
KON's method works for all troops, he was just using the player as an example.

Offline KON_Air

  • Craftsman
  • **
  • Posts: 110
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #4 on: November 16, 2008, 07:12:51 AM »
Some times I wonder why do I even bother...

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #5 on: November 16, 2008, 07:54:14 AM »
KON's method works for all troops, he was just using the player as an example.

OK, well ... that was not specified.  In fact, the opposite was specified.  I couldn't really imagine why the opposite was specified, but I figured somebody knew more about this than me, so I just accepted that the code in question was specifically for the player.

--------------------------------------

Still, I don't follow that whole "critical hit" logic.  I mean, small wounds bleed little.  Larger wounds bleed more.  Huge wounds just pour blood.  Points damage taken (above a minimum - anything more than one or two points) equals points bleeding (times some constant) per unit time (whatever unit of time).

Unless you mean that "bleeding" only happens sometimes, only on certain hits... but that seems bizarre.  I mean, oil leaks on automobiles would only occur from certain hits, but humans have arteries running to every major body part and so pretty much bleed no matter where you cut them (relative more to the length and depth of the injury than the location).

Offline KON_Air

  • Craftsman
  • **
  • Posts: 110
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #6 on: November 16, 2008, 08:07:19 AM »
Because it is a "game" not a simulation of "Ron Losey's bizzare world in which you can die due to blood loss by cutting your finger".

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #7 on: November 16, 2008, 09:03:28 AM »
Because it is a "game" not a simulation of "Ron Losey's bizzare world in which you can die due to blood loss by cutting your finger".

More specifically, you could pass out from blood loss by cutting your finger mostly off and then trying to fight for thirty minutes (instead of getting out of the fight and trying to stop the bleeding, like a sane person would do) ... but that distinction is irrelevant at the moment, since such details would have to be worked out after the code was in place.

What is relevant is that a number of people ask me for realistic damage modeling.  The delay between serious wounding and the time that this wounding becomes debilitating from blood loss is a real and significant factor (that has been much studied and discussed in the last 30 years or so, particularly in the area of law enforcement shootings).  It is also a logical factor when considering the apparently massive overkill required to stop someone quickly, as opposed to the relatively minor damage that will stop them eventually.  I would be interested in setting up a code sequence which could be used to statistically simulate this delay as accurately as is possible, given the (painfully limited) scope of the game engine.

I mean, attempting to make combat in the game as near to realistic simulation as possible IS what I do for the mod community.  And there are a fair number of people who expect that of me.  So the whole "because it's a game" routine may be fine for whatever someone else is building, but it is unacceptable in the desired application.  (The "Realistic Combat Model" fan club would tar and feather me for saying something like that.)



So ... KON_Air, thanks for submitting your suggestions.  However, they do not fit the desired criteria, and I do not feel that my target audience would be satisfied with the results.  Good luck with what you are trying to implement in "Modplosion".


Meanwhile, the original question still stands ... who wants to write code for this, and/or thinks they know how to do it?  Who thinks they can make it work without bogging down the game or crashing something, and get it where it can be tweaked for accuracy (without a major programming feat for every adjustment)?  Thoughts on how to place such a code (as a general check, or a scripted damage on every weapon, or whatever)?  I really am very open to suggestions, as long as they produce the desired result.

Offline KON_Air

  • Craftsman
  • **
  • Posts: 110
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #8 on: November 16, 2008, 09:53:47 AM »
Why don't you just do us a favour, learn python and just stop bothering us with impossible requests?

Offline Winter

  • I am Tek Jansen!
  • Administrator
  • *****
  • Posts: 476
  • MBX Forum owner
    • View Profile
    • Street of Eyes: The Writing of Ryan A. Span
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #9 on: November 16, 2008, 10:51:34 AM »
1. It's unnecessary.

2. It's a stupidly clunky concept to create with the module system.

3. It's unnecessary.

4. ???

5. It's unnecessary.

Seriously, Ron, if somebody with absolutely no programming background and a terrible aversion to code (i.e. me) can learn how to mod in M&Bscript, you have no excuse for making posts like this.

Regards,
Winter

Offline Fisheye

  • Blues Brother
  • Moderator
  • *****
  • Posts: 427
  • My scalp's so bright, I gotta wear shades.
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #10 on: November 16, 2008, 11:50:42 AM »
FWIW Ron, I believe KON's solution is 99% close to what you had in mind, if you say it's simply just no good then there is basically not much room for further discussion, that's why these guys are being so short and snappy in their responses.

grailknighthero

  • Guest
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #11 on: November 16, 2008, 12:33:06 PM »
I think it would be interesting, and agree with fisheye in that kon_airs way is the way I would do it for all agents.  The severity of the wound would be determined by the amount of damage taken, and values assigned in slots to determine the future blood loss and the current health (so in the next call of the trigger the agent's health can be checked against its past health).  I would work on it, but I am not sure on the impact on performance, because every .1 seconds or so the health of every agent would need to be checked.  This would cause a performance hit, and a performance hit which I cannot afford with my mod.  I also don't have the time because my mod and school work and life is eating up all of my time.  Best of luck though, interesting idea, and perhaps fujiwara would like it in ONR, and perhaps he can do it.

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #12 on: November 17, 2008, 12:11:13 AM »
Let's see...

"Necessary" is a moot point.  What is "necessary" - oxygen, water, food, sleep, protection from the environment, and minimal interaction with said environment - doesn't really include computer games anyway.  Even sociologists who argue that entertainment is necessary for a society to reduce vandalism would not really claim that it needs to be good quality entertainment - lower-class adolescent teenage males are generally entertained by watching basketball on television, so a well-designed screen saver would probably keep them off the street.  The whole idea of mods for computer games is about an artistic vision for what you would like to see in the game.  In that respect, the quest for realistic detail is one in which a number of people in this mod community have put great interest and tremendous work.  So no, it's not "necessary", but it would be greatly appreciated by a significant number of people (if and only if it could be made to work efficiently).

As for my skills, give me a break.  I only recently picked up 3D graphics.  While my ability to make sense of Python code is slowly growing, consider I am someone with effectively no computer background (beyond just using them).  It's not just an aversion to code - it's zero training in computer programming, except what I just pick up around here.  So don't think of it as whining ... think of it as a compliment to your skill set, that I figure there might be people around here who can do the seemingly impossible, if I will just ask.


And yes, I probably should have just got with Fujiwara and planned this out off-forum, and if and when we had something working, it could have suddenly appeared as a surprise new feature in OnR.  But Fujiwara has been busy, both with the port to 1.0x and some unrelated things ... so I figured I would pass the idea around elsewhere.  Should we get such a model working and accurately reflecting reality to my satisfaction, it would most certainly end up in OnR, among other places.  (I do the combat model for OnR - Fujiwara refers to what I do with the numbers as my "magic".)  But only if it works, and works extremely well.

--------------------------

The basic effect that KON_Air described - running a check to see if a character had been significantly wounded - would, I agree, create an effect similar to what I was describing (plus or minus enough tweaking to get the desired numbers).  And yes, I suspect with relative certainty that running a health check on every character every second is going to create a massive lag.  I figure KON_Air can get away with running that check on only the player, as he described, but I don't really want to think about what it would do to 70 guys on the field at once.  (The morale scripts that do this sort of thing are bad enough.)  Therefore, while I agree that the idea is potentially valid, it's not exactly what I was looking for.  The desired solution is going to have to be a lot lighter.  That's just all there is to it.

A damage script attached to each weapon might be a little better, since the script would only be running on those characters that had been significantly wounded... or it might be worse, since some characters could have several wound scripts running at once.  It would offer the bonus that some weapons could cause more bleeding than others, by running slightly different scripts, and hit detection would not be an issue (since the hit would be what triggered the script).  I doubt my old computer could handle it either way - that's a LOT of code to leave active all the time.  And that lag is likely going to be unacceptable again.  If it was that easy, there would be no need for the question in the first place.

I was hoping that somebody would have a brilliant idea for getting around this, with some slick idea for an uber-efficient way to collect wound data and apply blood-loss damage relative to that, without bogging down the whole game.  But that's going to require more than just basic programming skill - somebody is going to need a strange brand of genius (and/or insanity) to cook up a solution like that.

If it was easy, anybody could do it.  (Heck, if it was easy, even I could do it.)

grailknighthero

  • Guest
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #13 on: November 17, 2008, 09:12:56 AM »
Can we get the agent who was just wounded by a weapon?  If so, that would be great, not just for this reason.

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #14 on: November 17, 2008, 09:49:36 AM »
Can we get the agent who was just wounded by a weapon?  If so, that would be great, not just for this reason.

Not that I'm aware of ... except for the long way, as KON_Air was doing.

However, weapons can be flagged to run a script - i.e. do (whatever) to target.  This has been used for special effects in some of the mods using magic effects.  With a little experimentation, it should be possible to modify that to flag a target (for whatever reason).  on hit ... assign whatever to target.  That script should be able to retrieve the data of how many actual points of damage the target just took, if you knew which variable to check.  Tragically, to do this, it would have to be run on literally every weapon and every hit ... which means someone would have to come up with an extremely streamlined script, to prevent this immediately bogging down the game.  (Also true if you were thinking of using this for other functions as well.)

Note that the mods using this effect for magic were all arranged around small fights - you can do a lot of that if there are only a couple of troops on the screen.  It would lag, if not totally crash the system, if you ran those kind of effects on a hundred troops and horses at once.  I'm certainly not the first one to see potential in this trick ... and certainly not the first one to see problems as a result.

Which brings us back to where we started ... what is possible and what is suitably efficient are very different critters.  That's why I couldn't do this myself.