Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 [3] 4

Author Topic: Reversing combat damage  (Read 6892 times)

Roses

  • Bay Watcher
    • View Profile
Re: Reversing combat damage
« Reply #30 on: October 05, 2016, 11:38:54 am »

I do have a rough system that basically assigns combat scores to units based on their equipment, stats, etc... and then does some randomization for assigning wounds and such, but I was hoping to make it more consistent with in-game fights. (Ideally we would find out how the world gen battles are simulated and use that same code, but I don't foresee that happening)
Logged

Aedom

  • Bay Watcher
    • View Profile
Re: Reversing combat damage
« Reply #31 on: October 07, 2016, 10:31:46 am »

Here's another one of the interesting cases that I'm currently analyzing.  In this case, a kick attack (which does blunt damage) was performed on a toe.  The nail was shattered.  The interesting part is that the skin was "torn apart", flavor text usually reserved for edged attacks.  The sniffer shows that indeed the nail and the skin layers took cutting damage.  I am starting to suspect when subsequent layers are tested, the previous layer is treated as the strike material, and the stress mode (blunt or edged) might be picked dynamically based on the material/tissue properties.  I suspect this kind of interlayer damage mechanic would only make sense for blunt damage inputs.  Another alternative is that there is an unknown feature that can translate blunt damage back into cutting damage in some cases.


Spoiler (click to show/hide)
« Last Edit: October 07, 2016, 01:18:08 pm by Aedom »
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Reversing combat damage
« Reply #32 on: October 07, 2016, 04:02:38 pm »

I have seen instances where I blunt attack breaks a bone and the subsequent injuries are treated as a piercing attack (edged attack really since there are only the two) but usually that information is included in the combat log. Maybe since it was a toe nail it didn't warrant a combat log report? I suppose it would be worth checking if the nail could do the damage to the skin you are seeing.
Logged

Aedom

  • Bay Watcher
    • View Profile
Re: Reversing combat damage
« Reply #33 on: October 12, 2016, 12:46:02 pm »

Does anybody know in what units the strike velocities are reported by Da Vinci's combat.lua script? 

I used the same code to track this number in my sniffer, and I have a .net engine, driven by raws, that correctly produces it in comparable scenarios. I am aiming to be able to cover all the upper bound cases, for "normal" attacks, before adding in those scaling factors.  Now that I'm doing my wrap-up analysis and getting ready to present a model, I realize this is a major hole in my knowledge.
 
The velocities are calculated as a result of the object's mass, the attacker's strength, and the attacker's size, so it isn't obvious to me how to pin distance units to this calculation based on the inputs alone.


An example:

An "average" dwarf can perform a slash move using a copper sword at velocity = 26.  I have been assuming that this was in m/s, so that works out to 58 mph.  I know that golfers can easily swing 100 mph and baseballs can be thrown well upwards of that.  This seems like a reasonable assumption.
« Last Edit: October 12, 2016, 01:17:36 pm by Aedom »
Logged

Aedom

  • Bay Watcher
    • View Profile
Re: Reversing combat damage
« Reply #34 on: October 12, 2016, 12:49:50 pm »

I have seen instances where I blunt attack breaks a bone and the subsequent injuries are treated as a piercing attack (edged attack really since there are only the two) but usually that information is included in the combat log. Maybe since it was a toe nail it didn't warrant a combat log report? I suppose it would be worth checking if the nail could do the damage to the skin you are seeing.

I'm still thinking about this.  It seems unlikely that the nail damage was hidden from the combat log.  I say this because hair typically has this pattern.  Damage to hair is typically not ever reported via the combat log.  My understanding is that this is triggered by the HAIR_TEMPLATE having [COSMETIC].  The NAIL_TEMPLATE does not have this attribute. 

While nothing I just said is hard evidence, it suggests to me that something more interesting is going on.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Reversing combat damage
« Reply #35 on: October 12, 2016, 03:17:07 pm »

I'm not entirely sure that the velocities reported can be taken as a straight m/s, but lacking any other information I would say that is fine.
Logged

Grimlocke

  • Bay Watcher
  • *kobold noises*
    • View Profile
Re: Reversing combat damage
« Reply #36 on: October 15, 2016, 04:20:46 pm »

I have seen instances where I blunt attack breaks a bone and the subsequent injuries are treated as a piercing attack (edged attack really since there are only the two) but usually that information is included in the combat log. Maybe since it was a toe nail it didn't warrant a combat log report? I suppose it would be worth checking if the nail could do the damage to the skin you are seeing.

I'm still thinking about this.  It seems unlikely that the nail damage was hidden from the combat log.  I say this because hair typically has this pattern.  Damage to hair is typically not ever reported via the combat log.  My understanding is that this is triggered by the HAIR_TEMPLATE having [COSMETIC].  The NAIL_TEMPLATE does not have this attribute. 

While nothing I just said is hard evidence, it suggests to me that something more interesting is going on.

If I remember correctly, strand-like layers with a material with [IMPACT_STRAIN_AT_YIELD:50000] or higher will be ignored combat-wise, its not just not reported but remains undamaged entirely. This is how the ridiculous invincible 'walking hair' zombies happened.
Logged
I make Grimlocke's History & Realism Mods. Its got poleaxes, sturdy joints and bloomeries. Now compatible with DF Revised!

Aedom

  • Bay Watcher
    • View Profile
Re: Reversing combat damage
« Reply #37 on: October 20, 2016, 04:18:03 pm »

Hey everybody.  I've been silent for a while, so I'll just post a teaser to give you an idea of my progress. 

This is a screen shot of the list of combat simulation tests that I've been developing for my engine, and the output is within acceptable levels of variation from recorded arena data.  They act like spot checks for all the numerical dynamics we are uncovering.

Spoiler (click to show/hide)

I'm still adding and exploring features, but I think you can see my general method.  Once I have an engine with capabilities on these test points, which are meant to be low bounds, then I can set about formalizing everything into a comprehensive mathematical model that doesn't live only in my code.  Said model documentation will either live here or on the wiki in a simplified form.

Finally, here is some sample combat log output from my program.  I think it is very comparable to DF's output.  Currently, I have a constructive model regarding all the mechanics you can see here.  I still have lots of ancillary features to add, but the broad strokes are there, as you can see.  I am currently only targeting the first strike consequences for a body part.  Cumulative damage will be added as a separate stage of the analysis project.

Spoiler (click to show/hide)


« Last Edit: October 21, 2016, 02:58:44 pm by Aedom »
Logged

Aedom

  • Bay Watcher
    • View Profile
Re: Reversing combat damage
« Reply #38 on: October 21, 2016, 02:46:47 pm »

In other forum threads regarding combat damage, there is a common topic of "strain" and, so far, I haven't been able to find any canonical definitions for DF's concept of strain. I will describe my interpretation of this number, which I give a high confidence since my engine uses it to produce output which agrees with DF. It has been working for me, and I use this to calculate dynamic strain (a value different for each strike), as opposed to the static strain that is implied from reading on forums. 

Spoiler (click to show/hide)

Anywho, I just wanted to share this tidbit, because it is a topic that comes up quite a bit, without any known definitive answers.  Again, this will all be formalized, I hope you aren't put off by the little bit of c# code I gave to illustrate the calculation. 

The only thing that this dynamic strain influences in my simulation is that it acts like an extra test before triggering the blunt bypass.  If the stricken layer has STRAIN_AT_YIELD > 50k, then I check to see if the dynamic strain is greater than the STRAIN_AT_YIELD.  If it is, then I trigger the blunt bypass case.  If it is not, then there is no blunt bypass.  This is how you can get wooden sword slashes and stabs that only "dent" the skin.  If it only used the statically defined material property, then it would not be possible to dent the skin.

I also did some major deviations regarding the momentum deductions as damage passes through the layers, but I gotta stop myself somewhere :)

For completeness, you can find the referenced Da Vinci thread here : http://www.bay12forums.com/smf/index.php?topic=142372.0

« Last Edit: October 21, 2016, 03:00:45 pm by Aedom »
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Reversing combat damage
« Reply #39 on: October 24, 2016, 08:33:51 pm »

It's looking good, just wanted to say that almost all the work DaVinci did was several versions ago, and before much of the attack prepare and recovery, multiple types of attacks, pulping, and several other things. So it's not surprising that you are finding different results and I hope you haven't been following his work too religiously. I was always hoping he would come back and do another pass at the combat mechanics, since he actually delved into the code itself and found the actual equations that were used, but your work seems to be just as good, if not better, since you have taken it a step further and have reproduced the results.
Logged

Aedom

  • Bay Watcher
    • View Profile
Re: Reversing combat damage
« Reply #40 on: November 04, 2016, 01:35:22 pm »

I've haven't forgotten about this project, I have just been real busy with work.  There will be more to come as soon as I can get to it :)
Logged

Aedom

  • Bay Watcher
    • View Profile
Re: Reversing combat damage
« Reply #41 on: November 16, 2016, 04:26:42 pm »

I am only now starting to pick this back up.  The short break allowed me to quickly find a pesky bug that I had been looking for :)

At this point, my combat clone passes a battery of 414 automated tests, testing everything from my raw parser to the finer points of how damage moves through the layers.  I am also generating the combat log text in a manner that is basically identical to DF.

Remaining goals:
 * Discover exact set of rules for how persistent damage (injuries) feeds back into future tissue/material layer performance
 * Add the "coupe" feature where body parts can be jammed into other body parts.
 * Tracking extraneous body state that doesn't directly affect the material simulation (pain, blood, nausea, etc..)
 * Of course testing the engine in wider variety of scenarios, including novel creatures I wouldn't have imagined.  I might use modded raws for this kind of testing.

Once I achieve the stated goals, then I'll have a framework for doing all these calculations, that is able to be fed from the same set of raws that DF consumes.  It is at that point that I will consider my df combat clone to be complete and I'll be ready to formalize and generalize all my findings.  In addition to documentation, this framework and its components could be used to create a great many modder-friendly applications.

Thanks for sticking with us if you are still watching :)
« Last Edit: November 18, 2016, 11:54:07 am by Aedom »
Logged

Aedom

  • Bay Watcher
    • View Profile
Re: Reversing combat damage
« Reply #42 on: November 18, 2016, 11:53:11 am »

Does anybody know of any resources regarding the  "jamming A through B" feature.  I would be interested in anything regarding momentum/stress passing through the layers as well as any info about the resulting wound/contact areas.  I have noticed several interesting outputs around this feature, including a case where the contact area actually increased when jamming a rib through a lung.

Another interesting development regarding this, is that I previously had the belief that a part could only be jammed into other parts "AROUND" it, by first defeating all the layers in that part.  However, if you use the sniffer to examine the wounds on the jammed parts, you can see that they consistently don't take enough damage to actually defeat all the layers in the part being jammed.   They consistently all take a little bit of cutting and denting damage.  I haven't analyzed nearly enough situations to confidently make this claim, but the data is starting to suggest a cap on damage to the jammed part at ~20%.

One thing that does look pretty solid, is that in order to make a part jam into another part, you must at least qualify for the middle tier of material stress result.  For example, if you are doing a blunt attack, then you at least need to be able to initiate a fracture in that rib, in order to get it to jam into the lung.  At this point, the damage seems to always be converted to edge damage, but I wouldn't be surprised if I find some edge cases that take material properties into account.  This is easy to see if you spend some time with wooden whips.  Eventually you'll see a combat line, where the apparent damage to the internal body parts was treated just like it was extra tissue layers.  This only happens because each layer was never technically defeated, only dented or bruised.

It also interesting to note that if you examine jammed parts in the the analyzer, then you can see what appear to be round-off errors on the strain.  The strain is usually taken directly from the material properties, but for these cases you can see that there is an extra small component (0 < x < 10) that seems to be added.  I have noticed this previously, but now I can see that it happens often in the jamming scenario.  It isn't consistent, but may end up being consistent, if we can uncover the rule.  Another explanation is that it might just be small bug in one branch of DF code.  No user is supposed to see this data, and the "error" is small enough to be all but meaningless.

Currently working towards a description of when things are jammed (according to what rule).  So far, I've been able to reproduce all the effects you have seen on this thread without using any random number generation.  I've been pushing that as far back in the development as I can, for obvious reasons.  However, that may very well be why I have been unable to describe the jamming condition.

« Last Edit: November 18, 2016, 03:19:46 pm by Aedom »
Logged

Aedom

  • Bay Watcher
    • View Profile
Re: Reversing combat damage
« Reply #43 on: November 18, 2016, 03:39:37 pm »

*redacted*
« Last Edit: November 18, 2016, 03:54:52 pm by Aedom »
Logged

Aedom

  • Bay Watcher
    • View Profile
Re: Reversing combat damage
« Reply #44 on: November 22, 2016, 11:48:23 am »

Today's mystery is regarding the wound contact size for blunt attacks.  Wounds have contact area, as well as a "layer wound area".  I haven't fully sussed out the difference yet.  What I find interesting is the case of a blunt strike when the weapon contact area < tissue layer contact area.  When this case happens, you can see a discrepancy between the weapons contact area, and the resulting wound's contact area.  Usually the wound is 1 contact area larger, but I've found cases where it deviated as much as 8/22. I've even found a case where this term seems to be negative.  It always seems to be capped at a percentage of the striker contact area.  I'd guess with a hard-limit of 25% of that for the absolute value.

Contrast with the same situation but with edge damage, and the wound contact area always uses the weapon contact area as an upper bound.

Does anybody know of any features that would result in a blunt weapon making a slightly larger wound than the actual weapon contact area?

I'm starting to see a pipeline.  The jamming condition happens depending on the calculated damage.  The calculated damage comes about as a result of the material stress mechanics + these wounding event transforms, which seem to play a minor role, by tweaking strike contact areas.
« Last Edit: November 22, 2016, 02:30:11 pm by Aedom »
Logged
Pages: 1 2 [3] 4