Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 8 9 [10]

Author Topic: Modding material properties vs. how the properties are used by the game[0.34.11]  (Read 46712 times)

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #135 on: July 13, 2014, 01:10:54 am »

Oh boy.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #136 on: July 14, 2014, 03:36:17 pm »

The raw comments suggest that the strain_at_yield values are releated to young's/bulk/shear modulus, but they... aren't. At least, I cannot find any relation whatsoever. So are those just arbitrary values?

scamtank

  • Bay Watcher
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #137 on: July 14, 2014, 03:38:32 pm »

I was breaking my mind over this 2 years ago. Someone with an education in numbers knew and told me how the two translated into the other, but damn if I can find the proof anywhere anymore.

There's a twisted logic in there somewhere, just take my word for it.
Logged

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #138 on: July 14, 2014, 08:32:40 pm »

The raw comments suggest that the strain_at_yield values are releated to young's/bulk/shear modulus, but they... aren't. At least, I cannot find any relation whatsoever. So are those just arbitrary values?

E=σ/ε
Young’s modulus = stress/strain
Young’s modulus = yield_stress/strain_at_yield
...
strain_at_yield = yield_stress/Young’s modulus
εy = σy/E

But that doesn't work directly...

...
There's a twisted logic in there somewhere, just take my word for it.
iron:
   [TENSILE_YIELD:155000] kPa
   [TENSILE_FRACTURE:310000]
   [TENSILE_STRAIN_AT_YIELD:73] young's modulus 211 GPa

So 155,000,000/211,000,000,000 = 0.000734597
If you then multiply by 100000 (arbitrary!) you get 73

Sergarr

  • Bay Watcher
  • (9) airheaded baka (9)
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #139 on: July 28, 2014, 02:52:17 am »

0.40.05 is out and I think it changed many things related to DF physics. Can you please investigate further?
Logged
._.

Pirate Bob

  • Bay Watcher
  • [ETHIC: TORTURE_FOR_SCIENCE: ACCEPTABLE]
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #140 on: July 31, 2014, 01:24:18 pm »

0.40.05 is out and I think it changed many things related to DF physics. Can you please investigate further?
This inquiry requires DFHack, which is not ready for the new version yet.  Urist has said he plans to investigate when it is.
So would I, but at the moment we don't have structures or DFHack for 0.40.01
My gut feeling is that body parts seem MUCH weaker, like this: https://www.youtube.com/watch?v=nfmM59S_5EE

First off, this is truly fantastic!  Sorry I didn't notice this before, or I would have commented long ago.  I can't say I understand it all yet (I will have to start playing with spreadsheets and real numbers when I get a chance) but this looks like you have a complete model for DF combat, which I had thought was too impossibly complicated to be possible.  I guess hacking the raw code helps...

I do have a couple of questions:

1) I see that sharpness enters into all calculations of edged weapons penetrating layers.  Does that mean that adamantine, with 10x the sharpness of other metals, should penetrate armor with 10 times less momentum?  We may never have tested this with bolts, as usually adamantine has much lower momentum due to its low density, but I can easily run this test.

2)  It isn't clear to me where the observed behavior that armor is only effective if its SHEAR_YIELD and/or SHEAR_FRACTURE is greater than or equal to that of the projectile comes out of these equations.  Am I missing something, or is this separate?  I have only skimmed this thread so far, so if its in there, feel free to tell me to just look harder.

3)  I see there are a few "unknowns" and "factors".  Do you think there are any cases where large-scale testing could help determine these?

4)  I have observed that I get slightly different rates of deflection off different body parts when using your uniarmor (uniform thickness, no overlap) to cover both parts.  In particular, I used targets with 2-part bodies, and found deflection at slightly higher force off the upper body than the lower body.  Can the material properties of the tissue layers underneath impact deflection off armor?  If the question I am asking is not clear enough, can post a detailed description of the data I have and how it was obtained (either here or elsewhere).

I think what I really should do is just download your lua script and go through that.  Is it safe to assume that all relations described in the thread are included in it?  Knowing the exact equations you found for 34.11 will be immensely helpful for testing 40.05, as it is far easier to test if a known equation is true than to try to guess equations from data.  Also, I suspect that the armor/layer end of things (which appears to be the bulk of the work here) has not changed, and only the way velocities are determined for weapons has changed. 

I also can do tests of melee weapons, and have already run a few.  I believe all that changed with melee is that Toady applied your binary patch which changed a 10,000 to 100,000 in the mass calculations.  Therefore, you should still be able to make accurate predictions for melee?  Do you have any suggestions of tests I could run to check if melee is still following your predictions?

Thanks so much for doing this!  Extremely fine work!
« Last Edit: July 31, 2014, 01:36:46 pm by Pirate Bob »
Logged

scamtank

  • Bay Watcher
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #141 on: July 31, 2014, 03:29:46 pm »


1) I see that sharpness enters into all calculations of edged weapons penetrating layers.  Does that mean that adamantine, with 10x the sharpness of other metals, should penetrate armor with 10 times less momentum?  We may never have tested this with bolts, as usually adamantine has much lower momentum due to its low density, but I can easily run this test.

2)  It isn't clear to me where the observed behavior that armor is only effective if its SHEAR_YIELD and/or SHEAR_FRACTURE is greater than or equal to that of the projectile comes out of these equations.  Am I missing something, or is this separate?  I have only skimmed this thread so far, so if its in there, feel free to tell me to just look harder.

3)  I see there are a few "unknowns" and "factors".  Do you think there are any cases where large-scale testing could help determine these?

1.) Nah. More than anything, sharpness determines how much momentum the blow loses when it defeats a layer. The default MAX_EDGE:10000 on most metals is enough to halve the effect. A value of 5000 would leave the penetration entirely on the mercy of the yields and the chaotic little variables.

2.) What's there to argue? If your little bolt can't muster the shear yield to dent or shear fracture to saw through the layer, it needs to go the way of the bludgeon. That equation isn't tilted in any way by the bolt's fancy material properties, it's only the total momentum against the impact values and volume of the defending layer. So if you can't make the cut, you either need to be really really big, really really heavy or go really really fast. Bolts usually don't get to debate the first two.

There's also the matter of losing momentum as you go through the layers that's really bad for dull bolts. The gist of it is this: when you defeat a layer that takes X momentum to break, your projectile doesn't lose that X amount of momentum, as weird as it is. Instead, you look at the very first stage of contact, the denting costs. You pick either SHEAR 1 or IMPACT 1, whichever is higher, and then take 10% of it. That's how much momentum you lose when you cut or shatter the layer, be it a breastplate or a slab of beef.

The impact blunting is mostly about the armor's thickness and its impact yield with the bolt's properties contributing nothing, so unless the armor is spectacular, it loses to shear blunting - the ratio of the opposing shear yields with the total effect discounted by sharpness. If you have a shitty bolt that goes at the speed of light, it can still shatter a breastplate like a bullet, but every layer of skin and meat along the way drags it down bit by bit due to its dull edge.

3.) Check this out:
In the momentum equation, "factors" is just a few "x 1.25" boosts to the base size, one of which only happens if the attacker is berserk/enraged/tantruming, and the others don't seem to be used in normal combat.

In the momentum equation, "unknown" is more interesting. It mostly shares a function with the "factors" from the layer cost equations, except that the layer cost factors also include the were-creature special material rules. The limits for weakness/strength against materials appear to be a multiplication or division of 100. I know some of the factors that the function looks at, but this is by no means a complete list:
Spoiler (click to show/hide)

Logged

Pirate Bob

  • Bay Watcher
  • [ETHIC: TORTURE_FOR_SCIENCE: ACCEPTABLE]
    • View Profile

Thanks for clarifying!  I looked at the equations again, and realized I was misreading them.  As you explain, the set for edged weapons are responsible for the SHEAR_YIELD and SHEAR_FRACTURE checks I was referring to, and if these are passed by the armor then the blunt calculations are used.  This is reassuring, as the three blunt equations added together are proportional to (2*IF-IY), which is the observed dependence for bolts.

There is still one thing that I may have missed - did Urist ever give details on how the layer volume is calculated?  I assume that it is just the layer thickness time the contact area, but (at least for projectiles) there is some weird rounding which occurs, and I wonder if he sorted this out for the general case? 

I looked at his lua script, and it appears for armor
Code: [Select]
actvol=v.item:getVolume()
vbca=actvol*matdata.yield.IMPACT/100/500/10
vbcb=actvol*(matdata.fracture.IMPACT-matdata.yield.IMPACT)/100/500/10
vbcc=actvol*(matdata.fracture.IMPACT-matdata.yield.IMPACT)/100/500/10
...
print("Contact 10 blunt momentum resist: ", math.floor((vbca+vbcb+vbcc)*10/actvol))
It appears from this that item volume is divided out when calculating momentum resist for contact 10, and layer thickness does not enter at all.  Either I must be missing something (likely) or melee attacks use a different mechanism than projectiles, as projectile momentum resist is proportional to round100(layer thickness * contact area), where round100(x) = x rounded down to the nearest 100, with a min of 100.

Sorry in advance if I'm being dense again!

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #143 on: July 31, 2014, 09:38:41 pm »

...
I do have a couple of questions:
...
1. It "costs" less momentum for adamantine to cut other materials both because of the higher MAX_EDGE and because the SHEAR values of adamantine are far above other materials. If you hack up a giant sperm whale with an adamantine edged weapon, the amount of damage you can cause is mostly limited by the contact area and penetration of the weapon. You won't get the same performance from a copper sword.

By the way, "sharpness" is a combination of weapon quality and MAX_EDGE, and ranges from 50% to 100% of the MAX_EDGE. Quality doesn't matter for blunt weapons, and didn't matter for the old "railgun" crossbows+bolts.

2. As scamtank points out, I HATE the fact that DF protective layers use their full momentum costs when defending themselves, but if broken only subtract 10% of the yielding momentum. IRL breaking stuff uses up energy, so the attack should slow down. This is the main thing that prevents wearing multiple layers of armor from mattering (currently only the strongest layer really counts). I might do a binary patch eventually on this (such as a test patch for 0.34.11?) to see how combat plays out with 100% subtraction.

3. Long story short, getting some of the status effects like nausea really cripples offense and defense.

4. The game doesn't check layers underneath when processing the upper armor or tissue layers.

...
There is still one thing that I may have missed - did Urist ever give details on how the layer volume is calculated?  I assume that it is just the layer thickness time the contact area, but (at least for projectiles) there is some weird rounding which occurs, and I wonder if he sorted this out for the general case? 
...

All body parts have a volume (used for weight and used with strengths to determine momentum costs), a contact area, and a thickness (in the same units as a weapon's penetration value). Weapons or creature body part attacks also have a contact area. Armor items use the same number for volume, contact area, and thickness, which leads to silly armor thicknesses for large creatures. Somewhere in this thread I posted equations for some of these.

weapon CA > layer CA (i.e. two handed sword vs. neck): the full volume of the layer is used.

weapon CA < layer CA (i.e. bolt vs. upper leg): the "layer volume" used in the calculations depends on the ratio of the contact area of the weapon to the contact area of the body part. Also, the word "Chipping" is only used when less than 25% of the area of the body part has been damaged.

The armor/clothing UBSTEP, LBSTEP, COVERAGE, LAYER_SIZE, etc. tokens are used in combination with the unit's race and the body part to determine the item's size and volume. I never explored what happens if your custom race has an asymmetrically oversized right hand or right foot - which foot determines the boot size, or does it instamagically scale?
Pages: 1 ... 8 9 [10]