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

grailknighthero

  • Guest
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #30 on: November 21, 2008, 11:56:22 PM »
Very interesting Amarillo.

Amarillo

  • Guest
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #31 on: November 25, 2008, 11:31:25 AM »
I tried this as a proof of concept:

* One trigger that checks for damage twenty times per second.
* Tested applying ~33% of the damage to bleeding damage.
* Bleeding damage reduces health by one point every ~2 seconds until consumed.


Results:

* The triggers does not affect frame rates even with 100 agents plus horses in the battle.
* Bleeding has little effect on enemies since they tend to get killed before bleeding out, even in sieges. The player's troops on the other hand, will suffer more casualties since they usually have to withstand several waves of enemies.
* The trigger used to knock out an enemy form blood loss will make the XP award a bit strange since it is impossible to know who is responsible for the kill. It also seems to kill rather than wound the agent 100% of the time.


Discussion:

This is obviously a very primitive implementation that would have to be improved in many ways, but I think it can serve as a base for a discussion about how to proceed. One idea would be to randomise both the total hit points that will be lost from a wound and how fast this loss will be, and combine this with a temporary (current battle only) loss of weapons proficiency and attributes so a wound actually makes a difference. (Or to start work on a hitpointless system.) I can imagine that everyone in this thread has spent some time thinking about the problems with the current damage system while paying and modding M&B, and I would be very intersted to hear your thoughts about this.

Ron Losey: Is this similar to what you had in mind?

« Last Edit: November 25, 2008, 02:46:05 PM by Amarillo »

Foxhound

  • Guest
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #32 on: November 25, 2008, 04:23:06 PM »
So are you trying for a reality mod or Dmg over time mod/yay blood >:D aww i died  :'(

My two cents ;)
Yeah so what you were saying with the dmg over time and that you would have to stop to take care of the wound, that then you would have to add the ability to leave the battle or "pull out" bleeding men before they die

you are going to need animations for the blood

Another way of doing this is taking each part of the body and looking at how much you would bleed and what weapon was used, but then you also need to include the skill you have at that weapon(thus increasing the Chance of hitting a vital area)way too much programming and lag  ???

Will there be bleeding off the battle field aka if they are wounded they need to rest(camp or town) and if you don't do this they will die (forever  :'( )
  going with this all men that "die"(or only that "die" of bleeding) on that battle field go into the wounded pile and must be          healed like in the ways listed above above

Then you also can add a "medic class" that can increase or even stop the bleeding of men without camping( :idea: if someone could make a medic animation for carrying and patching people up you could even have him on the battle field mending people that depending on the wound they can be put back in the battle with wounds/HP drop)

You can add a "wounded" animation where they walk slower, and have a slower reactions to things

And there are my 2 cents

Lord Nalfein

  • Guest
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #33 on: November 25, 2008, 05:00:24 PM »
From what i've read, the basic problem you have is wounding. I know you bleed form almost every cut you receive, but there are some you don't. Say you need to take 5 damage to start bleeding, then not every hit makes you bleed. But then you get into arteries. If you get hit in the neck or heart, you should die quickly. The arteries in the legs and arms will kill you a little slower but still rather fast. Getting shot in the calf would make you move slower (don't know if your going for that) and a hit to the arm would likely make you drop your weapon. Arrow wounds would be hard though, as you don't always bleed from one. The arrow might plug the wound, or it might be a glancing blow and make a long gash.

My thoughts are too long to post, but another question is: Would you bleed more from a long gash or from a wound that went to the bone?

grailknighthero

  • Guest
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #34 on: November 25, 2008, 07:37:08 PM »
Amarillo, the only problem with causing stat losses is that it can only work for named Characters, or troops in which there will only be 1 present on the battlefield.

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #35 on: November 25, 2008, 07:58:02 PM »
Amarillo:
Yeah, that's exactly what I had in mind.

Write up the code.  I anticipate the numbers to balance out about 0.1 points of bleeding damage per point of weapon damage every ten seconds or so.  (i.e. 20 points - a serious wound - would be 2 points every ten seconds, two to three minutes before you would go down).  But I'll mess with the exact numbers after seeing it in a game.  The trigger should not need to check more than once per second, tops ... could be less often.  (But that comment about ten seconds was math, not programming ... we don't want visible waves of people falling once every ten seconds.)

Try to set it up so that it only counts weapon hits greater than 3 points of damage.  That will eliminate the factor of continuous blood loss from scratches that would clot and stop bleeding on their own.

Also, it would be really nice to rig it so that they are rendered unconscious by blood loss, but then switch to "dead" if they continue to lay there and bleed.  Since a person bleeds a lot less when they are not moving, it should be a lot slower than the initial problem.  Say, if they get to -100 at the previous bleeding rate, they are listed dead. Otherwise, they are wounded.  Not sure if you can do that or not, but it would be a nice touch.

Do make sure it applies to horses too.  That is important.

Foxhound:
I was going to assume that, when the battle ended, somebody would have time to apply some pressure to wounds.  Most blood loss issues can be handled with a little direct pressure, provided you have time to do that (i.e. nobody is trying to kill you).

The idea was just to stop people from fighting at full strength for five minutes on their last two hit points.  That and to work a delay into the effect between wounding and actual disability ... i.e. a wounded person can still get off a couple more shots before going down.

Nalfein:
Generally speaking, the only wounds that don't bleed significantly are very small wounds.  Regardless if the wound is long and shallow or narrow and deep, the odds of hitting a large artery or a series of smaller arteries and veins is about the same.  Really sharp weapons draw more blood than dull ones, but they also do more tissue damage, and so should have higher damage numbers to begin with.

The only time I have ever heard of arrows actually slowing bleeding, it was a simple point (i.e. not a cutting broadhead).  The only thing using those type of tips in M&B are the crossbows, and they are set to pierce damage, and therefore much lower damage numbers overall, to represent their weakness in damaging muscle, nerves, and arteries.  Even then, if the victim moves around at all, bleeding usually resumes immediately.  So the lower overall numbers should cover that effect relatively well.

"Would you bleed more from a long gash or from a wound that went to the bone?" ... actually, a cut from anything larger than a scalpel is probably going to go to the bone on most areas of the body.  I mean, you can cut yourself "to the bone" in an accident with a kitchen knife (done that a few times, and so has every other person who frequently cooks anything more elaborate than macaroni and cheese).  A solid hit with anything machete or larger will go through several bones as well.  The question for our model is, "how long can you keep fighting with your left triceps completely severed just above the elbow, before you go into shock and collapse?" (Answer: about two minutes, likely.)  Even an arrow, with any kind of effective broadhead, makes a hole at least an inch and a half wide - so it is a long, wide tear as well.  The only thing that is going to make any of these better is armor, which might actually prevent the weapon from passing through meat, or at least slow it down a lot.  Methinks you are generally underestimating the kinds of wounds that a weapon leaves.

Then the really amazing part is how much of this kind of damage a person can survive and fully recover from, provided they don't bleed to death first.  I know too many people who crawled out of car crashes or industrial accidents with just awful injuries, and then were back to fully operational in a few weeks.

As for slowing you down or dropping a weapon, I don't think we can get the game to do that.  However, a wound to the leg would likely either completely stop the person (i.e. actually broken bones), or else they probably would not really notice for a couple of minutes.  If they go down completely, well, then they are down - if a person hits the ground with a broken leg, he's probably not going to keep fighting from the ground.  If not, trying to model the effects of adrenalin on pain reception is quite beyond the scope of this project.

Actual damage to the heart usually puts most people into shock immediately.  However, any hit that goes deep into the chest is going to read like 40 points of damage or more ... so the only change this would make is to make sure they go down within a short period of time.  It really doesn't matter if the wound was heart, lung, liver, or major arteries.  Same with neck wounds - they're listed as head, so hits to the neck are double damage anyway.

Side note:
This is intended to be used with Realistic Combat Model (RCM) numbers.  They already do not work like Native, where the player can solo everything.  I make no promises of any of this even appearing sane if applied to a damage model based on M&B Native.  It will, however, put the player under some pressure to end the battle, rather than waiting forever on the last guy on the field... your troops can't just stand there forever, looking casually at the arrows sticking out of their bodies.  It will also get rid of that effect where some guy on a horse with only two points left is running around all over the place and nobody can catch him... his wounds would eventually disable him (or his horse).



Edit:
grailknighthero:  your post while I was writing....

Yeah, I wondered about that, but wasn't going to say anything, because I figured he must have worked it out.  If it's a problem, I'll leave it to you guys who know what you're doing to figure out....

Foxhound

  • Guest
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #36 on: November 26, 2008, 02:49:45 PM »
Yeah but how do you like my other ideas?
and like you were saying about not being able to fight with your last two health, you will have to make a way to pull people out of combat so you don't lose men just because that annoying mounted guy is all the way across the map from you and your men

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #37 on: November 26, 2008, 07:16:15 PM »
Yeah but how do you like my other ideas?
and like you were saying about not being able to fight with your last two health, you will have to make a way to pull people out of combat so you don't lose men just because that annoying mounted guy is all the way across the map from you and your men

To be honest, you're getting the cart WAY ahead of the horse.

I figure that all bleeding will get stopped with bandages as soon as the fight is over.

I also figure that, if you really want to pull back and care for your wounded, that's what the "retreat" command is for.  Other than that, part of the point was that you could wound someone and just wait for him to bleed out.  It makes hit-and-run tactics a lot more viable, for both you and them.

The blood animations are already quite enough to deliver the message "this person looks pretty bad."  Since the game doesn't really support animation of blood spots on the ground, we really can't go anywhere with specialized graphics.

For wounded animation, well, to be honest, adrenalin usually keeps people on their feet for a while after they've been hit.  It's quite common for people to feel no pain at all for several seconds after a major injury.  It could get VERY complex to estimate the degree of "acting wounded" that might actually occur.

But all of that is still way ahead of where we are now ... First the code, then the tests, then we worry about stuff like that.


Foxhound

  • Guest
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #38 on: November 27, 2008, 02:48:22 AM »
don't you lose something if you retreat? and what i had said, why lose to that one guy all the way across the field, but hey i am just thinking out the future  :D
I have new idea i have is assigning a random numbers genorator to each hit depending on the weapon and maybe skill(this is thought out with very little scripting experience ;) ) soo yeah just ideas to help you formulate your own

I also think that this is a very good topic that future games should look at(if we find a way lol), because most games now don't deal with this, because of all the problems we have came up with, while also balancing it so that the entire game doesn't focus on bleeding.

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #39 on: November 27, 2008, 03:59:24 AM »
Well, "most games" have no regard whatsoever for anything related to realism.  They take their standard from the old D&D pen-and-paper games, where game balance was based on some obscure arbitrary standard that had nothing to do with any standard of physics or biology whatsoever.  Even if they add various things like bleeding or fatigue, it is based on some standard developed by Martians that obviously has nothing to do with how humans (or any other known organism) really react to damage.

M&B started that way (and Native is still somewhat there), but since the early experiments with combat realism in Onin-no-Ran, some of us have managed to get a surprising degree of realism out of the M&B game engine (even if it took some odd games with statistics to get it there).  A few of us had a vision that said real combat is more exciting than cartoon combat, so we should shoot for making the game as close to reality as possible ... and in general, the idea has been a brilliant success - much more so than I ever dreamed, that day that I told Fujiwara to give me the source code and 48 hours, and I would rewrite the bloody thing or die trying.  (Side note - I don't put myself on those kind of schedules any more - too much chance of burnout.  Of course, I don't have anything to prove now ... everybody who hasn't been living under a rock has heard of my "Realistic Combat Model" now.)  We've gone through several versions of M&B since that day, but the dream of realistic combat physics is still very much alive, especially among the historical mods.

So the idea of a blood loss model, and subsequently a delay between wounding and disability, would be a nice touch to add to this model.  Maybe not the most necessary addition, but a good one ... if it can be made to work.  No doubt it will take some detail work, even after the basics are in place.  But I'm not worried - they said somewhat realistic damage numbers would make the game unplayable, and it did exactly the opposite.  I'm sure this sort of thing can be incorporated and balanced as well.

But all of this still hinges on these guys who know what the heck they're doing, assuming they can write and test the code for it.  Me tweaking the numbers, and then everybody chipping in with ideas, all comes after that part.  Tragically, my actual skills at this stuff are a good deal less than what many people assume ... I had effectively zero game mod skills when I first started working with OnR as a historian.  (Now, I do limited things with Python, and my skills with graphics ... well, most of the weapons and helmets in OnR are my work.  But that still doesn't mean I can handle stuff like this.)

So I am still depending on somebody to set up the code ... then we'll see where we can go with it.  One step at a time.

Amarillo

  • Guest
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #40 on: November 27, 2008, 09:48:55 AM »
I think all of the features you requested are possible to add. An agent who bleed to death will always be killed, but I suspect we can calculate how many agents survive and then add this number of wounded troops to the party.

One question: I got the impression form your post that bleeding never should stop (makes sense to me),  is this correct?

Amarillo, the only problem with causing stat losses is that it can only work for named Characters, or troops in which there will only be 1 present on the battlefield.

Thank you for pointing this out, I had completely forgotten. There is still a chance that it is possible to implement but the solution would most likely become quite complicated so lets skip this, for now.

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #41 on: November 27, 2008, 05:16:02 PM »
Well, stopping blood loss should require some medical attention.  So it should not stop on its own.  We may, later, wish to implement a function where wounded individuals would stop fighting and attempt to control bleeding (and/or others who would help them) ... but that's a thing for what we might want to do later, not an immediate issue.  Even if we do, it can be a function that adds a negative to bleeding damage - we don't need a timer on it, if that's what you're asking.

"killed" as in removed from the field ... we can cook up something so that some of them will only be disabled.  Run it through the same function as the number who survive fatal wounds because of the surgery skill.  That should be simple enough.

Foxhound

  • Guest
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #42 on: November 30, 2008, 07:52:03 PM »
Yay you took one of my ideas
here is a new one(i will stop if you ask :() you heal on field if you stand still (with no one trying to kill you) and use a bandage, and make bandages available for purchase(in large bulk) from all towns
maybe also have it equipped as a weapon

Offline Ron Losey

  • Master
  • *****
  • Posts: 4418
    • View Profile
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #43 on: November 30, 2008, 10:48:37 PM »
The bandage idea is not going to work, just because it would apply to all troops, not just the player/named NPC characters.  Therefore, there is no way to count them being used.

As I said, we may later want to add things like doing basic first aid on yourself or others, but that is AFTER the basics are working.  No need in planning that part until the first part is working and thoroughly tested.

Amarillo

  • Guest
Re: Has anyone experimented with a "blood loss" damage model?
« Reply #44 on: December 06, 2008, 08:51:35 AM »
Update: Added some randomization.

The triggers for bloodloss are done. For every HP lost the agent lose one "blood point" every second. When the defined number of blood points are lost the agent lose one hitpoint (defined by blood_per_hp).

Paste this at the very bottom of your module_scripts.py:
Code: [Select]
### constants ###
# Agent slots, make sure these slots are not used for something else
slot_agent_bleed = 8
slot_agent_rate  = 9    # rate of blood loss
slot_agent_hp    = 12

# Various constants
absolute = 1
true     = 1
false    = 0
player   = 0

# Bleeding
blood_per_hp  = 300
dmg_threshold = 3
dmg_low_range = 6
dmg_hi_range  = 12

bloodScripts = [
    ("monitor_health",
    [
        (try_for_agents,":agent_id"),
            (agent_is_alive,":agent_id"),
            (store_agent_hit_points,":current_hp",":agent_id",absolute),
            (agent_get_slot,":old_hp",":agent_id",slot_agent_hp),
            (try_begin),
                (gt,":old_hp",":current_hp"), # Damage taken
                (agent_set_slot,":agent_id",slot_agent_hp,":current_hp"),
                (store_sub,":new_rate",":old_hp",":current_hp"),
                (gt,":new_rate",dmg_threshold),
               
                #debug start
                (str_store_agent_name,s1,":agent_id"),
                (assign,reg1,":new_rate"),
                (try_begin),
                    (agent_is_human,":agent_id"),
                    (display_message,"@{s1} recived {reg1} damage"),
                (else_try),
                    (display_message,"@{s1}s horse recived {reg1} damage"),
                (try_end),
                #debug end
               
                (val_sub,":new_rate",dmg_threshold),
                (store_random_in_range,":mul",dmg_low_range,dmg_hi_range),
                (val_mul,":new_rate",":mul"),
                (val_div,":new_rate",10),
               
                #debug start
                (assign,reg1,":new_rate"),
                (display_message,"@damage reduced to {reg1}"),
                #debug end
               
                (agent_get_slot,":old_rate",":agent_id",slot_agent_rate),
                (val_add,":new_rate",":old_rate"),
                (agent_set_slot,":agent_id",slot_agent_rate,":new_rate"),
            (else_try),
                (eq,":old_hp",0), # Init agent
                (agent_set_slot,":agent_id",slot_agent_hp,":current_hp"),
            (try_end),
        (try_end),
    ]),
   
    ("bleed",
    [
        (try_for_agents,":agent_id"),
            (agent_is_alive,":agent_id"),
            (agent_get_slot,":rate",":agent_id",slot_agent_rate),
            (gt,":rate",0),
            (agent_get_slot,":blood",":agent_id",slot_agent_bleed),
            (val_add,":blood",":rate"),
            (store_div,":hp_loss",":blood",blood_per_hp),
            (try_begin),
                (gt,":hp_loss",0), # the agent has lost enough blood to lose hitpoints
                (store_agent_hit_points,":hp",":agent_id",absolute),
                (val_sub,":hp",":hp_loss"),
               
                #debug start
                (str_store_agent_name,s1,":agent_id"),
                (assign,reg1,":rate"),
                (assign,reg2,":hp"),
                (try_begin),
                    (agent_is_human,":agent_id"),
                    (display_message,"@{s1} is bleeding: rate = {reg1}, HP = {reg2}"),
                (else_try),
                    (display_message,"@{s1}s horse is bleeding: rate = {reg1}, HP = {reg2}"),
                (try_end),
                #debug end
               
                (try_begin),
                    (gt,":hp",0),
                    (agent_set_hit_points,":agent_id",":hp",absolute),
                    (agent_set_slot,":agent_id",slot_agent_hp,":hp"),
                    (store_mul,":tmp",":hp_loss",blood_per_hp),
                    (val_sub,":blood",":tmp"),
                    (agent_set_slot,":agent_id",slot_agent_bleed,":blood"),
                (else_try),
                    (call_script,"script_get_enemy_agent",":agent_id"),
                    (agent_deliver_damage_to_agent,reg0,":agent_id"),
                (try_end),
            (else_try),
                (agent_set_slot,":agent_id",slot_agent_bleed,":blood"),
            (try_end),
        (try_end),
    ]),
   
    ("get_enemy_agent",
    [
        (store_script_param,":target_agent_id",1),
        (try_begin),
            (agent_is_ally,":target_agent_id"),
            (agent_is_human,":target_agent_id"),    # a horse agent can not cause damage
            (assign,reg0,":target_agent_id"),
        (else_try),
            (get_player_agent_no,reg0),
        (try_end),
    ]),
]

scripts.extend(bloodScripts)


Paste this at the very bottom of your module_mission_templates.py:
Code: [Select]
# blood loss
monitor_health = (
    0.05, 0.0, 0.0,
        [],
        [
            (call_script,"script_monitor_health"),
        ])

bleed = (
    1.0, 0.0, 0.0,
        [],
        [
            (call_script,"script_bleed"),
        ])

# add triggers to all mission templates
for template in mission_templates:
    template[-1].append(monitor_health)
    template[-1].append(bleed)
« Last Edit: January 13, 2009, 12:24:28 PM by Amarillo »