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

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #45 on: December 06, 2008, 09:22:25 AM »
OK ... good show.  I'll plug this into an older version of OnR and test it as soon as I get a chance.

Couple of questions:

1.  Does it flag everybody as wounded?  Everybody as dead?  Or does it wash them through the surgery skill to determine survival rate after collapse from blood loss?  (The latter being the most desirable option.)

2.  Does it work on horses too?  (If not, it needs to.)

Amarillo

  • Guest
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #46 on: December 07, 2008, 06:40:13 AM »
Consider this a test version for balancing purposes. Agents can only be killed from blood loss at the moment. The agent_set_hit_points command eventually sets the agents hitpoints to zero but this won't actually kill the agent. Thefore we have to use the agent_deliver_damage_to_agent command, which unfortunately seems to kill 100% of the time. This means only surgery can save those who colapse from blood loss at the moment, but I'm pretty sure there is a workaround.

Horses are affected and will have their HP reduced to zero, but only enemy horses will actually be knocked out using the current implementation. This is easy to fix though.

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #47 on: December 07, 2008, 07:22:32 AM »
Letting the surgery skill settle the problem seems a fair solution to me.

However, I plugged this into an older version of OnR, and tested it ... I couldn't get it to do anything, at least not that I could observe.  Did I do something wrong?  Does it only work in Native at the moment, or only on M&B 1.0x?  (The version of OnR that I used for the test was for .90x.)  I mean, I believe you, that it worked for you ... so now where did I screw up?

(Side note ... that is, where did I screw up in relation to implementing this scrap of code ... not "How did my life come down to this?" ... I already know how I screwed up that part.)

And I'm likely to be busy most of the day tomorrow, so I may not get back to this for just a bit....

Amarillo

  • Guest
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #48 on: December 07, 2008, 10:30:43 AM »
I'm using the 1.010 module system, but I don't think that should cause any problems. Make sure that  agent slots 8, 9 and 12 are not used for something by OnR. If they are, just change the following lines above the new scripts to some avaliable slots.

Code: [Select]
slot_agent_bleed = 8
slot_agent_rate  = 9    # rate of blood loss
slot_agent_hp    = 12

Also, for debug purposes the code will print a message regularly if an agent is bleeding.

Offline Conners

  • Master
  • *****
  • Posts: 533
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #49 on: December 13, 2008, 05:48:46 AM »
Bleeding in combat sounds like a really fun addition :D (....unless you are the one bleeding :p)!

Small idea: What if the bleeding was partially random? A wound might gush out blood at first, but then it would supposedly slow down as you had less blood in that area to bleed out (this may not be the best example).

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #50 on: December 13, 2008, 06:52:51 AM »
Connors:
Generally blood loss from trauma wounds is pretty consistent.  About the only things that change rate of blood loss are the heart rate/blood pressure of the victim (i.e. lay down and try to be calm to slow bleeding), and first aid procedures (direct pressure on the wound, pressure points on arteries, and/or tourniquet).  Both of these generally require your undivided attention to make them effective, and so aren't going to have much effect as long as there are people on the field trying to kill you.

The human circulatory system is a closed circuit.  As long as the heart is working, blood pressure remains pretty constant across the system until it actually runs out of blood (at which time blood pressure drops very fast, and the victim generally goes into severe hemorrhagic shock more or less immediately).  That drop in blood pressure is generally fatal, at least without the facilities of a modern hospital ... there is certainly not much that could be done on the field before military medics started carrying blood plasma for I.V. transfusion.

Loss of other body fluids would be slightly more random.  For example, hits to the digestive system would cause rapid loss of various fluids, until those organs were drained.  However, no matter how large of a medical complication this might be in two or three days, it's not going to have much effect immediately.  That is, unless you can tear those systems apart badly enough to either cause massive bleeding, or disable from pain, or cripple enough bones, nerves, and muscles to be debilitating.  And in that case, you're back to either bleeding or hit points of damage from the initial wound to simulate that kind of trauma.

So no, I seriously vote against your "small idea" for biological reasons.

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

However, if we're just testing stuff ... it might be interesting to put a variation on the number.  For example, x points of damage (assuming x to be over the minimum threshold - I think it was 3 in this code, for the time being) produces x plus or minus 5 points of blood loss.  Simulate that slight randomness that results from things like maybe the arrow hit the main artery and maybe it just cut some minor stuff.  That is actually an issue in real incidents - in police shootings, for example, bullets either hitting a nerve, artery, or organ, or missing it by a hair, make the difference between a serious injury and a minor one... even though the wounds look more or less identical from the outside.

Granted, bullets (and practice-tip arrows, and screwdrivers, and other small-diameter puncture wounds) are a lot worse about that randomness than edged weapons.  Also, truncheons tend to be more random about that sort of thing than blades, since the difference between lacerating an artery and just flattening the heck out of it is often pure chance.  But still, if we're not getting much lag from this code, it could help.  Make the ratio between injury and bleeding a little less mechanical, and so a little less predictable ... the illusion of a computation more complex than it is.

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

Unrelated:  Fujiwara didn't get back with me on which slots were open in OnR, so I couldn't really test it under the conditions I wanted.  However, the word is that we are good for incorporating this into OnR as soon as is feasible.

Amarillo

  • Guest
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #51 on: December 13, 2008, 04:13:45 PM »
You can find out what agent slots are used by looking in the constants file, assuming that Fujiwara uses the same conventions as the native module. Or you could just set the numbers to something really high until he can help you with this.

Perhaps the problem is caused by something different. Have you tried the code with a fresh native module?

I actually considered some sort of randomization but decided against it since the damage is slightly random already, but I like the idea of some small wounds not causing blood loss 100% of the time so I'll probably add it soon.

One more thing; it is possible to find out what kind of armor the agent is carrying. Does anyone have any ideas how to use this information to modify damage/bleeding in any interesting way?

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #52 on: December 13, 2008, 09:02:15 PM »
Armor type shouldn't really matter that much.  Either it was effectively penetrated (causing that degree of injury/bleeding), or it was deformed in a way that caused injury (less than the other, likely, but still relative to the damage), or it was effective in preventing injury.  And none of those possibilities really change that much relative to the armor type.

I will try it on .90x RCM-Native, when I get some time.  However, I specifically wanted to balance it on OnR, because I knew the troop types, weapon conventions, and such, and so had a better idea of what I was seeing.  I'll mess with it some more in a little while.

Offline Conners

  • Master
  • *****
  • Posts: 533
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #53 on: December 14, 2008, 06:23:24 AM »
Connors:
Generally blood loss from trauma wounds is pretty consistent.  About the only things that change rate of blood loss are the heart rate/blood pressure of the victim (i.e. lay down and try to be calm to slow bleeding), and first aid procedures (direct pressure on the wound, pressure points on arteries, and/or tourniquet).  Both of these generally require your undivided attention to make them effective, and so aren't going to have much effect as long as there are people on the field trying to kill you.

The human circulatory system is a closed circuit.  As long as the heart is working, blood pressure remains pretty constant across the system until it actually runs out of blood (at which time blood pressure drops very fast, and the victim generally goes into severe hemorrhagic shock more or less immediately).  That drop in blood pressure is generally fatal, at least without the facilities of a modern hospital ... there is certainly not much that could be done on the field before military medics started carrying blood plasma for I.V. transfusion.

Loss of other body fluids would be slightly more random.  For example, hits to the digestive system would cause rapid loss of various fluids, until those organs were drained.  However, no matter how large of a medical complication this might be in two or three days, it's not going to have much effect immediately.  That is, unless you can tear those systems apart badly enough to either cause massive bleeding, or disable from pain, or cripple enough bones, nerves, and muscles to be debilitating.  And in that case, you're back to either bleeding or hit points of damage from the initial wound to simulate that kind of trauma.

So no, I seriously vote against your "small idea" for biological reasons.

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

However, if we're just testing stuff ... it might be interesting to put a variation on the number.  For example, x points of damage (assuming x to be over the minimum threshold - I think it was 3 in this code, for the time being) produces x plus or minus 5 points of blood loss.  Simulate that slight randomness that results from things like maybe the arrow hit the main artery and maybe it just cut some minor stuff.  That is actually an issue in real incidents - in police shootings, for example, bullets either hitting a nerve, artery, or organ, or missing it by a hair, make the difference between a serious injury and a minor one... even though the wounds look more or less identical from the outside.

Granted, bullets (and practice-tip arrows, and screwdrivers, and other small-diameter puncture wounds) are a lot worse about that randomness than edged weapons.  Also, truncheons tend to be more random about that sort of thing than blades, since the difference between lacerating an artery and just flattening the heck out of it is often pure chance.  But still, if we're not getting much lag from this code, it could help.  Make the ratio between injury and bleeding a little less mechanical, and so a little less predictable ... the illusion of a computation more complex than it is. You certainly do know your stuff.
I'll have to commit this to memory for the sake of writing... and possibly a situation where I'm actually helping a bleeding person.

Scary o_o.

....Very scary O_O

Sorry :(. My suggestion was uneducated, and based more on RPG systematics than human biology.

---

So my idea is useful :)?

This'll certainly be better than multiple combatants falling unconscious at the exact same moment, I'd guess.
« Last Edit: December 14, 2008, 06:29:28 AM by Conners »

Amarillo

  • Guest
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #54 on: December 14, 2008, 07:17:28 AM »
Fist thing first. If you use a fresh 1.01 module and it still does not work we might be able to figure out what is wrong with the code. If it does work we have to investigate what have changed between v0.9 and v1.0.

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #55 on: December 14, 2008, 09:51:45 AM »
Wait ... you said it worked for you, right?  Then we know it works on a clean 1.0x module.  The questions involve making it work on one of the versions that use RCM numbers, so I can figure out how we want to tweak it.

Which I will get to, ASAP ... but that may be a while, because I'm going to be excessively busy for about a week.

Amarillo

  • Guest
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #56 on: December 15, 2008, 10:49:01 AM »
I was actually interested in knowing if you were able to correctly insert the code in to the module or not, and that the code had survived the transition form my editor to the forum to your editor. I'm in no hurry to get this done however, so I apologize if you felt like I was trying to rush you about it.

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #57 on: December 15, 2008, 07:31:51 PM »
Actually, I would love to see it done quickly too.  Tragically, I have a stack of final exams to grade, and more than a couple of minutes over here is hard to justify at the moment.

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #58 on: December 25, 2008, 11:49:54 PM »
OK, finally got back to this.  Had some errors, but they were my mistake ... I fixed it.  (Amazing how frustrating a little typo can be.)

Anyway, the current data set is brilliant ... but it's at least 3 times too fast.  Set blood points per hp to about 300.  Further tweaks forthcoming - that's just first round rough estimate.

Also, I haven't played with it enough to be sure, but I think that 100% of enemy downed from blood loss are killed.  Should be a way to lower that ... say, if bleeding is less than (x), target is rendered unconscious instead of dead.  (Value of x yet to be determined.  I would start with about 40, if I read the code right.)

Of course, the final version will presumably have the feedback level lowered ... but the extra data is great for tweaking it for now.  That helped a lot, actually.

Anyway, got it working now.  I love it.  It's brilliant.  Absolute masterpiece.

Amarillo

  • Guest
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #59 on: December 28, 2008, 04:36:54 PM »
Glad you like it.

Blood loss rate: This is set under the scripts constants with "blood_per_hp"
Feedback: If you want to remove this now you can comment out the lines between "#debug start" and "#debug end" in the "bleed" script by putting a # first on each line.
Death: The only solution I can think of is adding troops of the same kind that bled to death to the parties after the battle, but I have not been able to figure out how to do this correctly in multiparty battles. I will keep working on it and see if I can find a solution.