Bay 12 Games Forum

Please login or register.

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

Author Topic: Combat mechanics (pulping) and material/creature properties [0.40.xx]  (Read 42503 times)

Roses

  • Bay Watcher
    • View Profile
Re: Combat mechanics (pulping) and material/creature properties [0.40.xx]
« Reply #45 on: January 08, 2015, 11:42:47 am »

So I am starting to look to my next big project (without my old one even being done yet, because I get easily distracted) and was wondering if you would like to provide your input. Basically you already have all the information in your combat calculator, I am just looking for a way to pit two groups of units against eachother artificially. That is to say, the game doesn't do anything, we just take all the numbers and compute the victors, with semi-realistic wounds being distributed to, at least, one of the sides. My thoughts are either,

1. Make it full turn based simulation where UNIT A picks UNIT B to attack, picks a body part to attack, picks a type of attack, and then the blow is calculated. UNIT B can then counter attack (assuming UNIT A isn't fast enough to go twice). Repeat until a lethal blow is dealt.
2. Just create a *combat number* and compare the number of UNIT A to UNIT B, the unit with the higher number wins, and the amount of wounds they take is related to the difference in the numbers.

What do you think about the feasibility of this?
Logged

Grimlocke

  • Bay Watcher
  • *kobold noises*
    • View Profile
Re: Combat mechanics (pulping) and material/creature properties [0.40.xx]
« Reply #46 on: January 08, 2015, 12:55:41 pm »

...
The idea behind that 49999 strain value was to use it to make edged weapons pass through more blunt force, since it's used to determine how much of the momentum is turned into blunt force when an edged attack fails. With the stock values this was next to nothing resulting in the armor either completely deflecting a blow or being cut to pieces. Which is not how armor works.

It interestingly still deflects weaker blunt hits as it is now, blunt weapon behaviour actually seems pretty much the same.

Uh... IIRC the strain is only used to determine the amount of momentum passed to the next layer, NOT the edged->blunt conversion. I have always seen 100% of remaining edged momentum converted to blunt momentum. The stock (vanilla) value of 100000 for strain on plant fiber would enable the "blunt bypass" feature because it is more than 50000, making the armor not fracture under blunt damage but also making the armor provide less protection.

For example if you punch someone in a steel helm, [IMPACT_STRAIN_AT_YIELD:940], and the punch doesn't blunt fracture the steel helm, only 940/50000=0.0188=1.88% of the momentum is passed to the skin layer. If the strain is 50000+, it doesn't bother checking if the helm fractures, it just passes the momentum to the next layer. "Blunt bypass" exists so that cloth/skin/fat/muscle sends blunt damage directly to the bones without being broken. For example if you give skin [IMPACT_STRAIN_AT_YIELD:49999], it will tear under blunt damage.

Combat calculator excerpt with your raws, on a human:
Code: [Select]
[DFHack]# combat
Creature size (base/current/racial):    5180    5398    7000
Creature strength (base/current):       1000    1000
Wrestle/Charge rating:  63

ITEMS

fiber   padded coif
Full contact blunt momentum resist:     181
Contact 10 blunt momentum resist:       2
Unbroken momentum deduction (full,10):  18      0
Volume/contact area/penetration:        907
Weight:         13.7864
shear yield/fracture:   10000   10000

steel   helm
Full contact blunt momentum resist:     798
Contact 10 blunt momentum resist:       70
Unbroken momentum deduction (full,10):  34      3
Volume/contact area/penetration:        113
Weight:         8.8705
shear yield/fracture:   430000  720000

fiber   cloak
Full contact blunt momentum resist:     75
Contact 10 blunt momentum resist:       2
Unbroken momentum deduction (full,10):  7       0
Volume/contact area/penetration:        378
Weight:         5.7456
shear yield/fracture:   10000   10000

silk    cloak
Full contact blunt momentum resist:     7
Contact 10 blunt momentum resist:       0
Unbroken momentum deduction (full,10):  0       0
Volume/contact area/penetration:        378
Weight:         1.89
shear yield/fracture:   20000   30000

BODY PART ATTACKS
NAME    EDGE    SIZE    CONTACT PNTRT   WEIGHT  VEL     MOMENTUM(+500%/-50%)
PUNCH   blunt   77      18      77      0.385   100     39      bone
PUNCH   blunt   77      18      77      0.385   100     39      bone
KICK    blunt   116     23      116     0.58    100     59      bone
KICK    blunt   116     23      116     0.58    100     59      bone
SCRATCH edged   23      8       23      0.115   100     12      nail
                shear yield/fracture:   115000  130000
SCRATCH edged   23      8       23      0.115   100     12      nail
                shear yield/fracture:   115000  130000
BITE    edged   5       2       5       0.025   100     3       tooth
                shear yield/fracture:   115000  130000

BODY PART DEFENSE
Volume/Contact/Thickness/Material/Blunt_Momentum_Resist/Shear_Yield/Frac
upper body
        SKIN    15      95      3       skin    0       20000   20000
        FAT     166     95      37      fat     3       10000   10000
        MUSCLE  834     95      186     muscle  16      20000   20000
lower body
        SKIN    15      95      3       skin    0       20000   20000
        FAT     166     95      37      fat     3       10000   10000
        MUSCLE  834     95      186     muscle  16      20000   20000
neck
        SKIN    1       20      1       skin    0       20000   20000
        FAT     16      20      17      fat     0       10000   10000
        MUSCLE  83      20      86      muscle  1       20000   20000
head
        EYEBROW 8       42      4       hair    0       60000   120000
        EYEBROW 8       42      4       hair    0       60000   120000
        HAIR    4       42      2       hair    0       60000   120000
        HAIR    4       42      2       hair    0       60000   120000
        SKIN    4       42      2       skin    0       20000   20000
        FAT     44      42      22      fat     0       10000   10000
        MUSCLE  226     42      113     muscle  4       20000   20000
right upper arm
        SKIN    3       32      2       skin    0       20000   20000
        FAT     33      32      21      fat     0       10000   10000
        MUSCLE  83      32      54      muscle  1       20000   20000
        BONE    83      32      54      bone    33      115000  130000
left upper arm
        SKIN    3       32      2       skin    0       20000   20000
        FAT     33      32      21      fat     0       10000   10000
        MUSCLE  83      32      54      muscle  1       20000   20000
        BONE    83      32      54      bone    33      115000  130000
right lower arm
        SKIN    3       32      2       skin    0       20000   20000
        FAT     33      32      21      fat     0       10000   10000
        MUSCLE  83      32      54      muscle  1       20000   20000
        BONE    83      32      54      bone    33      115000  130000
left lower arm
        SKIN    3       32      2       skin    0       20000   20000
        FAT     33      32      21      fat     0       10000   10000
        MUSCLE  83      32      54      muscle  1       20000   20000
        BONE    83      32      54      bone    33      115000  130000
right hand
        SKIN    1       17      1       skin    0       20000   20000
        FAT     13      17      16      fat     0       10000   10000
        MUSCLE  33      17      40      muscle  0       20000   20000
        BONE    33      17      40      bone    13      115000  130000
left hand
        SKIN    1       17      1       skin    0       20000   20000
        FAT     13      17      16      fat     0       10000   10000
        MUSCLE  33      17      40      muscle  0       20000   20000
        BONE    33      17      40      bone    13      115000  130000
right upper leg
        SKIN    7       59      2       skin    0       20000   20000
        FAT     83      59      29      fat     1       10000   10000
        MUSCLE  208     59      74      muscle  4       20000   20000
        BONE    208     59      74      bone    83      115000  130000
left upper leg
        SKIN    7       59      2       skin    0       20000   20000
        FAT     83      59      29      fat     1       10000   10000
        MUSCLE  208     59      74      muscle  4       20000   20000
        BONE    208     59      74      bone    83      115000  130000
right lower leg
        SKIN    6       51      2       skin    0       20000   20000
        FAT     66      51      27      fat     1       10000   10000
        MUSCLE  166     51      68      muscle  3       20000   20000
        BONE    166     51      68      bone    66      115000  130000
left lower leg
        SKIN    6       51      2       skin    0       20000   20000
        FAT     66      51      27      fat     1       10000   10000
        MUSCLE  166     51      68      muscle  3       20000   20000
        BONE    166     51      68      bone    66      115000  130000
right foot
        SKIN    1       23      1       skin    0       20000   20000
        FAT     19      23      18      fat     0       10000   10000
        MUSCLE  50      23      46      muscle  1       20000   20000
        BONE    50      23      46      bone    20      115000  130000
left foot
        SKIN    1       23      1       skin    0       20000   20000
        FAT     19      23      18      fat     0       10000   10000
        MUSCLE  50      23      46      muscle  1       20000   20000
        BONE    50      23      46      bone    20      115000  130000
skull
        BONE    186     32      122     bone    74      115000  130000
[DFHack]#

Hmmm seems I once more fundamentally misunderstood the way this game works. Oh well I'll get there eventually, thanks for clearing some of this up.

I guess this is how medieval alchemists felt :P

And it's also about time I start using DFhack I suppose. Empiric testing has its limits.


EDIT: Ok, some experimenting later I have the following raws modifications:

Spoiler (click to show/hide)

I then placed some of my test dummy creature (a human copy with all the stat variation removed and the immobile tag added) wearing a steel helmet and a coif, some wearing only a helmet and some wearing only a coif.

I then bonked them over the head with a steel maul. The first group did not get hurt from regular attacks and died from heavy attack, the last two groups died from regular attacks.

Oddly enough the DFhack combat script yields the following:

Spoiler (click to show/hide)

I had figured 'unbroken momentum deduction' means the momentum left after failing to break a layer, but this does not seem to be the case.
« Last Edit: January 08, 2015, 03:09:03 pm by Grimlocke »
Logged
I make Grimlocke's History & Realism Mods. Its got poleaxes, sturdy joints and bloomeries. Now compatible with DF Revised!

Sergarr

  • Bay Watcher
  • (9) airheaded baka (9)
    • View Profile
Re: Combat mechanics (pulping) and material/creature properties [0.40.xx]
« Reply #47 on: January 08, 2015, 03:20:15 pm »

So I am starting to look to my next big project (without my old one even being done yet, because I get easily distracted) and was wondering if you would like to provide your input. Basically you already have all the information in your combat calculator, I am just looking for a way to pit two groups of units against eachother artificially. That is to say, the game doesn't do anything, we just take all the numbers and compute the victors, with semi-realistic wounds being distributed to, at least, one of the sides. My thoughts are either,

1. Make it full turn based simulation where UNIT A picks UNIT B to attack, picks a body part to attack, picks a type of attack, and then the blow is calculated. UNIT B can then counter attack (assuming UNIT A isn't fast enough to go twice). Repeat until a lethal blow is dealt.
2. Just create a *combat number* and compare the number of UNIT A to UNIT B, the unit with the higher number wins, and the amount of wounds they take is related to the difference in the numbers.

What do you think about the feasibility of this?
Ultimately not really useful because we still don't know the formula that determines chances to hit.

Any attempt at "quick combat" approximation would fail horribly without accounting for hit chance.
Logged
._.

Roses

  • Bay Watcher
    • View Profile
Re: Combat mechanics (pulping) and material/creature properties [0.40.xx]
« Reply #48 on: January 08, 2015, 03:42:06 pm »

So I am starting to look to my next big project (without my old one even being done yet, because I get easily distracted) and was wondering if you would like to provide your input. Basically you already have all the information in your combat calculator, I am just looking for a way to pit two groups of units against eachother artificially. That is to say, the game doesn't do anything, we just take all the numbers and compute the victors, with semi-realistic wounds being distributed to, at least, one of the sides. My thoughts are either,

1. Make it full turn based simulation where UNIT A picks UNIT B to attack, picks a body part to attack, picks a type of attack, and then the blow is calculated. UNIT B can then counter attack (assuming UNIT A isn't fast enough to go twice). Repeat until a lethal blow is dealt.
2. Just create a *combat number* and compare the number of UNIT A to UNIT B, the unit with the higher number wins, and the amount of wounds they take is related to the difference in the numbers.

What do you think about the feasibility of this?
Ultimately not really useful because we still don't know the formula that determines chances to hit.

Any attempt at "quick combat" approximation would fail horribly without accounting for hit chance.

Well it's not impossible to come up with our own hit chance calculation based on whatever variables we think are relevant. Heck, if we wanted we could create completely new rules concerning cutting/denting/bruising etc... This isn't to process combats on screen more quickly, but to be able to artificially send your units off on quests, and thus have them succeed or fail based on their skills, stats, and gear.
Logged

Sergarr

  • Bay Watcher
  • (9) airheaded baka (9)
    • View Profile
Re: Combat mechanics (pulping) and material/creature properties [0.40.xx]
« Reply #49 on: January 08, 2015, 03:48:31 pm »

That combat script appears to not calculate properly the high COVERAGE armor, it shows the same resistance for contact area 10 even though it should have much more.

Same about the armor in different places. As you've told, the gauntlets should be much thinner than greaves, and yet the combat calculator shows the same result for contact area 10...
Logged
._.

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: Combat mechanics (pulping) and material/creature properties [0.40.xx]
« Reply #50 on: January 08, 2015, 09:48:15 pm »

That combat script appears to not calculate properly the high COVERAGE armor, it shows the same resistance for contact area 10 even though it should have much more.

Same about the armor in different places. As you've told, the gauntlets should be much thinner than greaves, and yet the combat calculator shows the same result for contact area 10...

The most recent version (October 2014) is on page 1: http://www.bay12forums.com/smf/index.php?topic=142372.msg5767755#msg5767755
Feel free to suggest changes. The contact 10 part was for stock warhammer friendliness.

...
I had figured 'unbroken momentum deduction' means the momentum left after failing to break a layer, but this does not seem to be the case.

You may have found a bug in my script. There are 2 types of deductions at the end of the layer code, before the next layer is damaged:
a) momentum equals momentum*strain/50000, for when a layer is not broken/fractured by blunt damage
b) a flat deduction of 10% of the momentum cost required to yield (shear or impact), regardless of if the layer was destroyed or not.

Deduction (b) is the reason why multiple layers are generally only as good as the strongest layer - the system would work better if layers would use up the attacking momentum faster. As-is, smashing a steel helm with a war hammer only requires 70 momentum, but the momentum hitting the skin below is decreased by 3, not 70.

It looks like I named the output after (a), but wrote the code for (b).

Grimlocke

  • Bay Watcher
  • *kobold noises*
    • View Profile
Re: Combat mechanics (pulping) and material/creature properties [0.40.xx]
« Reply #51 on: January 09, 2015, 02:18:50 pm »

That combat script appears to not calculate properly the high COVERAGE armor, it shows the same resistance for contact area 10 even though it should have much more.

Same about the armor in different places. As you've told, the gauntlets should be much thinner than greaves, and yet the combat calculator shows the same result for contact area 10...

The most recent version (October 2014) is on page 1: http://www.bay12forums.com/smf/index.php?topic=142372.msg5767755#msg5767755
Feel free to suggest changes. The contact 10 part was for stock warhammer friendliness.

...
I had figured 'unbroken momentum deduction' means the momentum left after failing to break a layer, but this does not seem to be the case.

You may have found a bug in my script. There are 2 types of deductions at the end of the layer code, before the next layer is damaged:
a) momentum equals momentum*strain/50000, for when a layer is not broken/fractured by blunt damage
b) a flat deduction of 10% of the momentum cost required to yield (shear or impact), regardless of if the layer was destroyed or not.

Deduction (b) is the reason why multiple layers are generally only as good as the strongest layer - the system would work better if layers would use up the attacking momentum faster. As-is, smashing a steel helm with a war hammer only requires 70 momentum, but the momentum hitting the skin below is decreased by 3, not 70.

It looks like I named the output after (a), but wrote the code for (b).

That seems to be the case, I did put the impact yield at 1 after all.

And the 10% deduction is mostly the reason I used materials which don't break at all, that way I can have a layer absorb any percentage of blunt impact I like.
Logged
I make Grimlocke's History & Realism Mods. Its got poleaxes, sturdy joints and bloomeries. Now compatible with DF Revised!

Tomsod

  • Bay Watcher
    • View Profile
Re: Combat mechanics (pulping) and material/creature properties [0.40.xx]
« Reply #52 on: January 17, 2015, 07:49:05 am »

Well, that is some grandiose reverse engineering! It took me two days to parse everything into my head. There are some things that raise questions still:
1. The formula for weapon momentum caps base velocity at 5000, but it can't possibly be true? E.g. if we take the offered example values for human with a steel axe, velocity would equal 10000, and the cap would be glaringly noticeable.
2. What are the default values for "factors" in momentum cost formulae? Here you mention the range of 1000~2000, but from your script it seems to be 100; the latter also more closely correlates with observed behavior (e.g. with factors=1000 it would cost about 7 momentum for bolts to pierce armor of same material, i.e. steel bolts would cut through steel armor like butter).
I'll meanwhile try to put all this info on the wiki, at least the gist of it.
Logged

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: Combat mechanics (pulping) and material/creature properties [0.40.xx]
« Reply #53 on: January 17, 2015, 01:30:57 pm »

Well, that is some grandiose reverse engineering! It took me two days to parse everything into my head. There are some things that raise questions still:

1. The formula for weapon momentum caps base velocity at 5000, but it can't possibly be true? E.g. if we take the offered example values for human with a steel axe, velocity would equal 10000, and the cap would be glaringly noticeable.

2. What are the default values for "factors" in momentum cost formulae? Here you mention the range of 1000~2000, but from your script it seems to be 100; the latter also more closely correlates with observed behavior (e.g. with factors=1000 it would cost about 7 momentum for bolts to pierce armor of same material, i.e. steel bolts would cut through steel armor like butter).

I'll meanwhile try to put all this info on the wiki, at least the gist of it.

1. I forgot a "divide by 1000" somewhere in there, probably because I was originally using the real weight (6.28) instead of the in-game code weight (6280). Actual vel is more around 10 rather than 10000. I ought to redo the equations for hand calculations.

2. I left a few of the "multiply by 1000 and then divide by 1000" situations out of the script, as by default that is equivalent to multiplication by 1. Also, the script gives blunt momentum costs for armor because those are independant of the weapon material, while the shear momentum costs depend on the relative SHEAR properties. What you are not seeing is the absence of the shear momentum costs.



For reference, here is a line from my disassembly notes:
Quote
(i.e. 0x18 or 24 on a 6280 axe => 0x96 150 momentum, then add 1 later)
During that experiment, for that random test subject, the in-game vel was 24, the in-game weight was 6280, and this together gave a momentum of 151. Those were the values stored in memory as seen by the debugger.

Tomsod

  • Bay Watcher
    • View Profile
Re: Combat mechanics (pulping) and material/creature properties [0.40.xx]
« Reply #54 on: January 18, 2015, 12:00:52 pm »

1. I forgot a "divide by 1000" somewhere in there, probably because I was originally using the real weight (6.28) instead of the in-game code weight (6280). Actual vel is more around 10 rather than 10000. I ought to redo the equations for hand calculations.
Uh huh. So, in current units, the velocity cap would be 5 million? Okay, thanks.

2. I left a few of the "multiply by 1000 and then divide by 1000" situations out of the script, as by default that is equivalent to multiplication by 1.
Well yes, that's what I meant. The line in question looked like that:
Code: [Select]
vbcb=actvol*(matdata.fracture.IMPACT-matdata.yield.IMPACT)/100/500/10Comparing to the "blunt cost 2" formula it has "/10" instead of "factors/1000", so I figured factors default to 100.
Also, the script gives blunt momentum costs for armor because those are independant of the weapon material, while the shear momentum costs depend on the relative SHEAR properties. What you are not seeing is the absence of the shear momentum costs.
I was unclear, sorry for that. What I meant is, if factors=100 both in blunt and shear formulae, then the blunt ones correlate with the script, and the shear ones correlate with observed bolt behavior. Of course, they are not the same thing, but I assumed factors are shared here?

Also a rogue thought: since armor behaves so layer-like here, is there any chance it accumulates damage also (like with wound expanding)? That would explain some evidence of several mail shirts providing better protection, which doesn't make sense otherwise.
Logged

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: Combat mechanics (pulping) and material/creature properties [0.40.xx]
« Reply #55 on: January 18, 2015, 03:34:08 pm »

...

1. The content of the square brackets, pre-cap, should be around 10 (as an order of magnitude). The cap on the velocity is still 5000 (10000 if you include the possible later multiplication by up to 2).

In order to exceed vel 5000, your modded creature needs a strength of over 50000 (default 1000), OR a weapon speed mod of over 50000 (default 1000), OR some combination of the two. This is unlikely to occur without a deliberate modding attempt.

2. The "/10" is part of an undocumented "volume/10" thing that was tacked on. When the raws say [SIZE:150] for a bolt, the game uses "15" for the volume. My equations equivocate the two volumes, perhaps. Toady's code is also inconsistent on this matter.

3. Armor does not accumulate damage. Any "damage" that it takes (i.e. being penetrated by a bolt) is effectively instantly healed before the next attack, by virtue of the damage numbers being discarded without being saved in any way.

Steel bolt vel 42, momentum 49, contact 5.
Steel armor blunt momentum cost (steel on steel is blunt!) 1781 for contact 252, 35 for contact 5.
49>35 therefore bolt punches a hole in the armor and does edged damage to layers below.

Also since "steel on steel is blunt", a steel mail shirt will convert the attack from an edged attack to a blunt attack without breaking, passing on a momentum 49, contact 5 blunt attack to the layers below. This is because of the flexibility (STRUCTURAL_ELASTICITY_CHAIN_ALL).

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Combat mechanics (pulping) and material/creature properties [0.40.xx]
« Reply #56 on: April 10, 2015, 03:41:39 pm »

What exactly is the notation used for STRAIN_AT_YIELD? Being a dimensionless value and never between 0 and 1, I figure it's parts-per, but parts-per what and with what reference?

(This is actually more asking about the strain value in general than STRAIN_AT_YIELD, which I understand to be the amount of strain an object has undergone once it's at its YIELD point, but whatever, STRAIN_AT_YIELD is the only time it shows up in the raws)

The notes say that it is 1000 * % change in shape when the yield strength is reached.  So the units are just a percentage, more or less.  The values in the code that seem to come up most often are 25000 and 50000 (so 25% deformed and 50% deformed at yield), and it relates to things being pushed out of the way in combat (if they can strain 50%+) and combat text (it uses torn at 25%+ vs shattered).  Like a lot of the combat stuff right now, it's sort of cobbled together -- it looks like it is using the number in a smoother way for calculating bruise percentages.  Were you interested in that sort of thing?

If I remember, I used the young's modulus to get the numbers I could.  That's where the units come from (reverse calculated from stress and young's modulus stress/strain ratio) -- I thing strain is a unitless percentage, but it has been a long time since I've looked.

Some info on strain.
« Last Edit: April 23, 2015, 03:26:18 pm by Putnam »
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Combat mechanics (pulping) and material/creature properties [0.40.xx]
« Reply #57 on: June 11, 2015, 04:07:39 pm »

So I am starting to look at how to add wounds, and the numbers I should use and I was wondering if you could provide any help/insight? Right now there are a great deal of numbers that I am looking at and they are basically split into two groups, the wound numbers and the layer numbers.

For each wound part
contact_area
contact_perc
surface_perc
strain
effect_type
effect_perc1
effect_perc2
edged_curve_perc

For each layer
layer_wound_area
layer_cut_fraction
layer_dent_fraction

What I am basically looking for is a way to visualize the numbers. For instance, a simple cut across the arm, what would its numbers be? A bad burn? A hole through the gut? I've been reading through this and the 34.xx version thread to see if I can get a good handle on these things, but for reason it's still not quite clicking in my head.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Combat mechanics (pulping) and material/creature properties [0.40.xx]
« Reply #58 on: June 11, 2015, 04:12:48 pm »

You could always just cut someone with a long sword and look at the wound

Roses

  • Bay Watcher
    • View Profile
Re: Combat mechanics (pulping) and material/creature properties [0.40.xx]
« Reply #59 on: June 11, 2015, 04:16:44 pm »

That's the next step. But figured I would ask before I delve into investigating individual wounds.
Logged
Pages: 1 2 3 [4] 5