By "automatic blunt pass-through" do you mean that the layer just passes the force down without interference? Do non-rigid STRUCTURAL_ELASTICITY_WOVEN_THREAD garments muffle blows at all?
It looks like mlpf equals three different things at once.
... Is there some way to see the "stored fat" number? Do the fatness description strings point this out?
Also: tell us what you know about the mysterious "factors" in the momentum equation. Could the "unknown" part at the end be the squareness of the striking plane?
...It is the strength minus the attribute rust to strength, plus the curse bonuses to strength (i.e. being a vampire). This is how the game remembers your original strength if the curse is only temporary or is removed somehow.
Can I also assume that (str-soft)*curse is just the unit's net STRENGTH attribute?
I've punched limbs off in the DBZ mod before; at least, I've punched a hand or maybe an arm off.
Ah, the former is indeed what happened, but I think I may have fixed that due to ridiculous "cracked muscle".
Another thing to add to wrestling is that tissues with other than [TISSUE_SHAPE:LAYER] such as hair strands and feathers are vulnerable to COMPRESSIVE force. Possibly others too, but I've never experimented with joints made from hair.
Interesting. I didn't notice that before because the game doesn't tell you that you broke their hair or eyebrows if you pinch their head. Only the most recently damaged layers in the part are described. Having muscle torn as a result of a spear stab implies that the skin and fat were also torn.
This thread is relevant to my interests so I am posting to watch.
Any idea how upright spikes factor into falling damage? My thoughts that it basically just generates a few attacks using the spike as a weapon seems likely since the game apparently levitates a chunk of the landing materiel and beats people with it.
I'm also kinda curious how it determines those factors for skill and strength when it's the game beating someone with something instead of having a critter or trap to draw stats from.
Babies (which is a form of insanity in DF)Wait, what?
So if I fell onto a floor from a few tiles up onto a pile of upright featherwood sporks my fate would still be as grim as if I landed on a pile of adamantine spikes, because damage appears to be at 800 times what it probably should be?Yes, it would be even more overpowered than shooting a spork out of a
Interesting. Now to mod in sporks as a spear item...because that would make me giggle.
I am not a math wise. But by reading some from Urist Da Vinci.
this can sound like a silly question, but, an equal material multi-layering part, will be pierced by the same bolt because the bolt don´t lose momentum?
That could explain why those pesky goblins keep severing my dwarves with wooden/rusty bolts? One poor armed ranged goblin do a real mess in most of my games.
I want to find a correct layering for protect- create creatures.
So, right now exist a fix to this weird behavior of projectiles?
or a fixed vanilla raw files.
Pardon the (possible) thread necromancy, but this seemed to be the most applicable thread. So as a newer modder I was wondering how the projectile vs. armor calculations used PROJECTILE CONTACT_AREA.
As an example if CONTACT_AREA is 30 in the RAWs should I:
plug [30] as the CONTACT_AREA variable
or 30% as [0.30]
or as 30% multiplied by PROJECTILE_SIZE [0.3*(x)]
To clarify I am trying to calculate Projectile Absorbs The Force of Collision and Armor Absorbs The Force of Collision from the formulas found on the DF2012 Wikia page Material_Science.
P.S.: Thanks to Zivilin, Urist Da Vinci and others for their !!SCIENCE!!
P.P.S.: Oh and I am aware of when you should use a Body Parts CONTACT_AREA instead (derp).
From my tests I have concluded the density of the armor protects against blunt damage. When attacking an armor with a blunt weapon there are several impact yield checks (only made against armors, not against naked dwarves or bronze colossus).
...
But as all the standard metals would go through all the armors this should not be something to worry much about unless you are modding.
Uh... Did you read this thread and try using some of the equations?
1. I used a disassembler and WinDbg to read the game's code, because my own arena testing could not eliminate all of the randomness from the combat system.
2. You are neglecting the effects of IMPACT_FRACTURE.No I am not. In my observations impact_fracture didn´t have any impact at all on the formulas above explained.
...
For blunt defense, there is:
1. A check on the yielding of the weapon vs the attack momentum, to prevent soft meaty fists from punching bronze colossuses etc.
2. A momentum cost to dent the layer volume, using the layer's impact yield.
3. A momentum cost to initiate fracture in the layer volume, using the difference between the layer's impact fracture and impact yield.
4. A momentum cost to complete fracture in the layer volume, which is the same as step 3.
...
So it sounds like we could theroetically make a custom block materiel called pillowtanium or something made out of feathers giant sponge and plump helmets and line the floors or our baby catching chutes with them.
Or perhaps use it to make a metal called Nerficite that we make all the danger room spears out if. the possibilities are endless!
Ah, the former is indeed what happened, but I think I may have fixed that due to ridiculous "cracked muscle".
If the strain is 0-24999 then the words "shattering", "chipping", "fracturing" are used.
If the strain is 25000+ then the words "tearing" and "tearing apart" are used.
Chipping is less than 25% of the surface area of the body part.
Shattering and Tearing Apart imply complete destruction of the layer, whereas Fracturing and Tearing are incomplete damage.
Ah, the former is indeed what happened, but I think I may have fixed that due to ridiculous "cracked muscle".
If the strain is 0-24999 then the words "shattering", "chipping", "fracturing" are used.
If the strain is 25000+ then the words "tearing" and "tearing apart" are used.
Chipping is less than 25% of the surface area of the body part.
Shattering and Tearing Apart imply complete destruction of the layer, whereas Fracturing and Tearing are incomplete damage.
Is the strain the only value that leads to the word changes? I want to make certain creatures have a steel like skin, but still use the "tearing" and such. I assume that means I can copy all of the steel values except for the strain values, and then just keep the skin strain values?
Is the strain the only value that leads to the word changes? I want to make certain creatures have a steel like skin, but still use the "tearing" and such. I assume that means I can copy all of the steel values except for the strain values, and then just keep the skin strain values?
Not exactly - copy the steel values, but then change all the strain values to something like 25001. Steel skin wouldn't be damaged under blunt impacts if the strain was 50000+, as mentioned in this thread - it would simply be ignored and bypassed.
Not exactly - copy the steel values, but then change all the strain values to something like 25001. Steel skin wouldn't be damaged under blunt impacts if the strain was 50000+, as mentioned in this thread - it would simply be ignored and bypassed.
Using this I keep getting dented skin instead of cut or bruised. Any ideas? Not a huge problem, but it's just a little weird when looking at a dwarfs wounds.
Don't dents show up on unmodded dwarf skin too? Or is have I just been playing a modded game too long??
I remember seeing wound lists that mention denting the outermost layer. So dents might be what it's supposed to do, the stronger values might just make it more common compared to weaker flesh.
One quick (and potentially dumb) question: "If the weapon has a smaller contact area than the layer, the layer's volume is reduced by the ratio of areas." -Urist Da Vinci.
How is this expressed as an equation?
Ah, thank you... Doesn't that lead to odd behavior with armor volume and area being equal?
As an example if I double armor volume the armor area scales to match exactly so thicker armor only offers better mass for deflection purposes (but not for YIELD or FRACTURE calculations, because the ratio keeps the effective contact area constant?). Derp, well it also has an effect vs. a weapons penetration value (unless that uses the effective contact area as well?)
Posting to watch, this is great! So, if you modded dwarves to be really fat, like rolling blobs of fat with beards, and then made superslade floors, and dropped them from really high up, they would probably explode or get hurt really badly?
(This is my superslade entry, in inorganic_metal, needs improvement. Help would be appreciated, but not necessary:)
...
Do you have any idea about falling rock calculations? Not for the trap, but just if I drop a boulder from high up on a creature what will happen?
Exactly what I wanted to know. Do you know from about how high up for the boulder to reach the speed needed?
I figured I would ask here since it pertains to what I was asking earlier, and since you are the one who wrote the killitwith script. I am trying to create a boulder high in the air and have it drop with the possibility of it hitting someone. Testing in adventure mode I am able to create a boulder, then borrowing from your script I turn it into a projectile and let it fall, but it is not hitting my unit. After a short time later (I pass the time by sitting on the ground and then standing up again) it just falls to the ground, but there is never any combat log or injury, even with using slade boulders at a high distance.
Do you have any idea if there is any other flags that need to be checked to calculate projectile damage (or any that shouldn't be checked?)
--Calculates combat info for weapons/armor on a creature. Alpha version!
--Future goal is to calculate info for body part weapons, wounded tissue layers
--ranged weapons
--misc objects?
unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit under cursor! Aborting!")
return
end
print("Creature size (base/current): ", unit.body.size_info.size_base, unit.body.size_info.size_cur)
print("Creature strength (base): ", unit.body.physical_attrs.STRENGTH.value) --should update to use curse strengths etc.
print(" ")
for k,v in pairs(unit.inventory) do
--print(v.mode)
--enum-item Hauled 0
--enum-item Weapon 1
--enum-item Worn 2
--enum-item InBody 3
--enum-item Flask 4
--enum-item WrappedAround 5
--enum-item StuckIn 6
--enum-item InMouth 7
--enum-item Shouldered 8
--enum-item SewnInto 9
vitype=df.item_type[v.item:getType()]
print(vitype)
material=dfhack.matinfo.decode(v.item)
matdata=material.material.strength
vmatname=material.material.state_name.Solid
--print(vmatname, v.item.subtype.name) --WOULD ENABLE THIS BUT BUG ON QUIVERS, OTHER ITEMS W/O SUBTYPES!
vbpart=unit.body.body_plan.body_parts[v.body_part_id]
print(vbpart.name_singular[0].value)
if vitype=="WEAPON" then
print(vmatname, v.item.subtype.name)
v.item:calculateWeight()
effweight=unit.body.size_info.size_cur/100+v.item.weight*100+v.item.weight_fraction/10000
actweight=v.item.weight*1000+v.item.weight_fraction/1000
if v.item.subtype.flags.HAS_EDGE_ATTACK==true then
print("shear yield, shear fracture: ", matdata.yield.SHEAR, matdata.fracture.SHEAR)
print("Sharpness: ", v.item.sharpness)
end
print("NAME", "EDGE", "CONTACT", "PNTRT", "WEIGHT", "VEL", "MOMENTUM(+100%/-50%)")
for kk,vv in pairs(v.item.subtype.attacks) do
vvel=unit.body.size_info.size_base * unit.body.physical_attrs.STRENGTH.value * vv.velocity_mult/1000/effweight/1000
vmom=vvel*actweight/1000+1
vedge="blunt"
vcut=""
if vv.edged==true then
vedge="edged"
vcut=100
end
print(vv.verb_2nd, vedge, vv.contact, vv.penetration, actweight/1000, math.floor(vvel), math.floor(vmom))
end
end
if vitype=="ARMOR" or vitype=="HELM" or vitype=="GLOVES" or vitype=="SHOES" or vitype=="PANTS" then
print(vmatname, v.item.subtype.name)
actvol=v.item:getVolume()
v.item:calculateWeight()
actweight=v.item.weight*1000+v.item.weight_fraction/1000
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
deduct=vbca/10
if matdata.strain_at_yield.IMPACT >= 50000 or v.item.subtype.props.flags.STRUCTURAL_ELASTICITY_WOVEN_THREAD==true or v.item.subtype.props.flags.STRUCTURAL_ELASTICITY_CHAIN_METAL==true or v.item.subtype.props.flags.STRUCTURAL_ELASTICITY_CHAIN_ALL==true then
vbcb=0
vbcc=0
end
print("Full contact blunt momentum resist: ", math.floor(vbca+vbcb+vbcc))
print("Contact 10 blunt momentum resist: ", math.floor((vbca+vbcb+vbcc)*10/actvol))
print("Unbroken momentum deduction (full,10): ", math.floor(deduct), math.floor(deduct*10/actvol))
print("Volume: ", actvol)
print("Contact area: ", actvol)
print("Penetration: ", actvol)
print("Weight: ", actweight/1000)
vshyre=matdata.yield.SHEAR
vshfre=matdata.fracture.SHEAR
if v.item.subtype.props.flags.STRUCTURAL_ELASTICITY_WOVEN_THREAD==true and vmatname ~= "leather" then
if vshyre>20000 then vshyre=20000 end
if vshfre>30000 then vshfre=30000 end
end
print("shear yield, shear fracture: ", vshyre, vshfre)
end
print(" ")
end
What about armor levels, how are they used in combat?I don't understand this question. There is an [ARMORLEVEL:X] token where X is 1,2, or 3 that is used by the AI to decide if a certain armor is a better choice to wear, and other effects. It doesn't appear to have a combat benefit.
What about armor levels, how are they used in combat?
Namely, what would be difference between mail shirt and breastplate when slashed\stabbed in upper body? Apart from mail being elastic.
Do the TISSUE_MAT_STATE tokens have any impact in combat? They only appear on generated creatures tissues (specifically the powder ones).
I'm not sure what values it can take. The string dump lists these:
SOLID
LIQUID
POWDER
SOLID_POWDER
PASTE
SOLID_PASTE
PRESSED
SOLID_PRESSED
ALL_SOLID
But creatures from extracted raws don't have the last five and include GAS.
--Calculates combat info for weapons/armor. Alpha version!
--Future goal is to calculate info for body part weapons (using attack info), wounded tissue layers
--ranged weapons
--misc objects?
unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit under cursor! Aborting!")
return
end
print("Creature size (base/current): ", unit.body.size_info.size_base, unit.body.size_info.size_cur)
print("Creature strength (base): ", unit.body.physical_attrs.STRENGTH.value) --should update to use curse strengths etc.
print(" ")
for k,v in pairs(unit.inventory) do
--print(v.mode)
--enum-item Hauled 0
--enum-item Weapon 1
--enum-item Worn 2
--enum-item InBody 3
--enum-item Flask 4
--enum-item WrappedAround 5
--enum-item StuckIn 6
--enum-item InMouth 7
--enum-item Shouldered 8
--enum-item SewnInto 9
vitype=df.item_type[v.item:getType()]
print(vitype)
material=dfhack.matinfo.decode(v.item)
matdata=material.material.strength
vmatname=material.material.state_name.Solid
--print(vmatname, v.item.subtype.name) --WOULD ENABLE THIS BUT BUG ON QUIVERS, OTHER ITEMS W/O SUBTYPES!
vbpart=unit.body.body_plan.body_parts[v.body_part_id]
print(vbpart.name_singular[0].value)
if vitype=="WEAPON" then
print(vmatname, v.item.subtype.name)
v.item:calculateWeight()
effweight=unit.body.size_info.size_cur/100+v.item.weight*100+v.item.weight_fraction/10000
actweight=v.item.weight*1000+v.item.weight_fraction/1000
if v.item.subtype.flags.HAS_EDGE_ATTACK==true then
print("shear yield, shear fracture: ", matdata.yield.SHEAR, matdata.fracture.SHEAR)
print("Sharpness: ", v.item.sharpness)
end
print("NAME", "EDGE", "CONTACT", "PNTRT", "WEIGHT", "VEL", "MOMENTUM(+100%/-50%)")
for kk,vv in pairs(v.item.subtype.attacks) do
vvel=unit.body.size_info.size_base * unit.body.physical_attrs.STRENGTH.value *
vv.velocity_mult/1000/effweight/1000
vmom=vvel*actweight/1000+1
vedge="blunt"
vcut=""
if vv.edged==true then
vedge="edged"
vcut=100
end
print(vv.verb_2nd, vedge, vv.contact, vv.penetration, actweight/1000, math.floor(vvel), math.floor(vmom))
end
actvol=v.item:getVolume()
print("Blunt deflect if layer weight more than:", actvol * matdata.yield.IMPACT / 100 / 500)
end
if vitype=="ARMOR" or vitype=="HELM" or vitype=="GLOVES" or vitype=="SHOES" or vitype=="PANTS" then
print(vmatname, v.item.subtype.name)
actvol=v.item:getVolume()
v.item:calculateWeight()
actweight=v.item.weight*1000+v.item.weight_fraction/1000
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
deduct=vbca/10
if matdata.strain_at_yield.IMPACT >= 50000 or v.item.subtype.props.flags.STRUCTURAL_ELASTICITY_WOVEN_THREAD==true or
v.item.subtype.props.flags.STRUCTURAL_ELASTICITY_CHAIN_METAL==true or v.item.subtype.props.flags.STRUCTURAL_ELASTICITY_CHAIN_ALL==true
then
vbcb=0
vbcc=0
end
print("Full contact blunt momentum resist: ", math.floor(vbca+vbcb+vbcc))
print("Contact 10 blunt momentum resist: ", math.floor((vbca+vbcb+vbcc)*10/actvol))
print("Unbroken momentum deduction (full,10): ", math.floor(deduct), math.floor(deduct*10/actvol))
print("Volume/contact area/penetration: ", actvol)
print("Weight: ", actweight/1000)
vshyre=matdata.yield.SHEAR
vshfre=matdata.fracture.SHEAR
if v.item.subtype.props.flags.STRUCTURAL_ELASTICITY_WOVEN_THREAD==true and vmatname ~= "leather" then
if vshyre>20000 then vshyre=20000 end
if vshfre>30000 then vshfre=30000 end
end
print("shear yield, shear fracture: ", vshyre, vshfre)
end
print(" ")
end --end of unit inventory loop
--printall(unit.body.body_plan.attacks) --wait for next DFHack version?
--print(" ")
print("BODY PART ATTACKS (some assumptions!)")
print("NAME", " ", "SIZE", "CONTACT", "PNTRT", "WEIGHT", "VEL", "MOMENTUM(+100%/-50%)")
for k,v in pairs(unit.body.body_plan.body_parts) do
if v.flags.STANCE==true or v.flags.GRASP==true then
--ASSUME THAT ALL GRASP/STANCE PARTS ARE COMBAT
partsize = math.floor(unit.body.size_info.size_cur * v.relsize / unit.body.body_plan.total_relsize)
contact = math.floor(partsize ^ 0.666)
partweight = math.floor(partsize * 500 / 100) --bone, change to 8250 for bronze colossus etc.
vvel = 100 * unit.body.physical_attrs.STRENGTH.value / 1000 --some assumptions
vmom = vvel * partweight / 1000 + 1
print(v.name_singular[0].value, partsize, contact, partsize, partweight/1000, vvel, vmom)
end
end
An amusing footnote is that organic creature punches and kicks use the "bone" material of the hand/foot for attack purposes. This also determines the part weight during combat, so unless your hand is made of a single material, it will hit with a different weight than you'd see if you severed the hand and examined it. Fingers, gloves, and gauntlets don't count for anything. Not only do heavy/large body parts hit for more momentum, there is no penalty in the "swing speed" or "vel" for doing so. Giant sponges "push" with their single massive body part. Since body part sizes/weights don't benefit melee (equipped) weapon usage, a giant or colossus will do far more damage with its natural attacks than it will with any equipped weapon.
...by make them platinum you mean just the solid density (aka weight?) you can just change the bone_template for materials to have bone as heavy has platinum all the time, it will then quickly transfer to all bone bearing creatures.
Hmmm, your discovery concerning natural attacks has given me a hilarious idea. I wonder how hard it would be to mod in platinum bones for all creatures.
...by make them platinum you mean just the solid density (aka weight?) you can just change the bone_template for materials to have bone as heavy has platinum all the time, it will then quickly transfer to all bone bearing creatures.
Hmmm, your discovery concerning natural attacks has given me a hilarious idea. I wonder how hard it would be to mod in platinum bones for all creatures.
well if you really wanted to inject platinum bones, make a custom Tissue_Template that is a copy of the BONE_TEMPLATE however instead of [TISSUE_MATERIAL:LOCAL_CREATURE_MAT:BONE] change it to INORGANIC:PLATINUM
Add in your new tissue in the STANDARD_TISSUES body detail plan "[ADD_TISSUE:PLAT:PLAT_BONE_TEMPLATE]"
then change the VERTEBRAE_TISSUE_LAYERS body detail plan and overwrite all ARG4:# with PLAT:#
done now all creatures that use those two body detail plans have platinum for bones
I'm assuming that whips use their full weight to add to their momentum unlike a real flexible weapon would use. Is this correct?
--Calculates combat info for weapons/armor. Alpha version!
--Future goal is to calculate info for body part weapons (using attack info), wounded tissue layers
--ranged weapons
unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit under cursor! Aborting!")
return
end
print("Creature size (base/current): ", unit.body.size_info.size_base, unit.body.size_info.size_cur)
print("Creature strength (base): ", unit.body.physical_attrs.STRENGTH.value) --should update to use curse strengths etc.
print(" ")
for k,v in pairs(unit.inventory) do
--print(v.mode)
--enum-item Hauled 0
--enum-item Weapon 1
--enum-item Worn 2
--enum-item InBody 3
--enum-item Flask 4
--enum-item WrappedAround 5
--enum-item StuckIn 6
--enum-item InMouth 7
--enum-item Shouldered 8
--enum-item SewnInto 9
vitype=df.item_type[v.item:getType()]
print(vitype)
material=dfhack.matinfo.decode(v.item)
matdata=material.material.strength
vmatname=material.material.state_name.Solid
--print(vmatname, v.item.subtype.name) --WOULD ENABLE THIS BUT BUG ON QUIVERS, OTHER ITEMS W/O SUBTYPES!
vbpart=unit.body.body_plan.body_parts[v.body_part_id]
print(vbpart.name_singular[0].value)
if vitype=="WEAPON" then
print(vmatname, v.item.subtype.name)
v.item:calculateWeight()
effweight=unit.body.size_info.size_cur/100+v.item.weight*100+v.item.weight_fraction/10000
actweight=v.item.weight*1000+v.item.weight_fraction/1000
if v.item.subtype.flags.HAS_EDGE_ATTACK==true then
print("shear yield, shear fracture: ", matdata.yield.SHEAR, matdata.fracture.SHEAR)
print("Sharpness: ", v.item.sharpness)
end
print("NAME", "EDGE", "CONTACT", "PNTRT", "WEIGHT", "VEL", "MOMENTUM(+100%/-50%)")
for kk,vv in pairs(v.item.subtype.attacks) do
vvel=unit.body.size_info.size_base * unit.body.physical_attrs.STRENGTH.value *
vv.velocity_mult/1000/effweight/1000
vmom=vvel*actweight/1000+1
vedge="blunt"
vcut=""
if vv.edged==true then
vedge="edged"
vcut=100
end
print(vv.verb_2nd, vedge, vv.contact, vv.penetration, actweight/1000, math.floor(vvel), math.floor(vmom))
end
actvol=v.item:getVolume()
print("Blunt deflect if layer weight more than:", actvol * matdata.yield.IMPACT / 100 / 500)
else
if v.mode==1 then
--item held in hands treated as misc weapon
--1000 velocity mod, power math for contact and penetration
print(vmatname, "(misc weapon)") --v.item.subtype.name quiver bug
actvol=v.item:getVolume()
v.item:calculateWeight()
actweight=v.item.weight*1000+v.item.weight_fraction/1000
effweight=unit.body.size_info.size_cur/100+v.item.weight*100+v.item.weight_fraction/10000
misccontact=math.floor(actvol ^ 0.666)
miscpene=math.floor((actvol*10000) ^ 0.333)
print("NAME", "EDGE", "CONTACT", "PNTRT", "WEIGHT", "VEL", "MOMENTUM(+100%/-50%)")
vvel=unit.body.size_info.size_base * unit.body.physical_attrs.STRENGTH.value/effweight/1000
vmom=vvel*actweight/1000+1
vedge="blunt"
print("strike", vedge, misccontact, miscpene, actweight/1000, math.floor(vvel), math.floor(vmom))
print("Blunt deflect if layer weight more than:", actvol * matdata.yield.IMPACT / 100 / 500)
print(" ")
end
end
if vitype=="ARMOR" or vitype=="HELM" or vitype=="GLOVES" or vitype=="SHOES" or vitype=="PANTS" then
print(vmatname, v.item.subtype.name)
actvol=v.item:getVolume()
v.item:calculateWeight()
actweight=v.item.weight*1000+v.item.weight_fraction/1000
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
deduct=vbca/10
if matdata.strain_at_yield.IMPACT >= 50000 or v.item.subtype.props.flags.STRUCTURAL_ELASTICITY_WOVEN_THREAD==true or
v.item.subtype.props.flags.STRUCTURAL_ELASTICITY_CHAIN_METAL==true or v.item.subtype.props.flags.STRUCTURAL_ELASTICITY_CHAIN_ALL==true
then
vbcb=0
vbcc=0
end
print("Full contact blunt momentum resist: ", math.floor(vbca+vbcb+vbcc))
print("Contact 10 blunt momentum resist: ", math.floor((vbca+vbcb+vbcc)*10/actvol))
print("Unbroken momentum deduction (full,10): ", math.floor(deduct), math.floor(deduct*10/actvol))
print("Volume/contact area/penetration: ", actvol)
print("Weight: ", actweight/1000)
vshyre=matdata.yield.SHEAR
vshfre=matdata.fracture.SHEAR
if v.item.subtype.props.flags.STRUCTURAL_ELASTICITY_WOVEN_THREAD==true and vmatname ~= "leather" then
if vshyre>20000 then vshyre=20000 end
if vshfre>30000 then vshfre=30000 end
end
print("shear yield, shear fracture: ", vshyre, vshfre)
end
print(" ")
end --end of unit inventory loop
--printall(unit.body.body_plan.attacks) --wait for next DFHack version?
--print(" ")
print("BODY PART ATTACKS (some assumptions!)")
print("NAME", " ", "SIZE", "CONTACT", "PNTRT", "WEIGHT", "VEL", "MOMENTUM(+100%/-50%)")
for k,v in pairs(unit.body.body_plan.body_parts) do
if v.flags.STANCE==true or v.flags.GRASP==true then
--ASSUME THAT ALL GRASP/STANCE PARTS ARE COMBAT
partsize = math.floor(unit.body.size_info.size_cur * v.relsize / unit.body.body_plan.total_relsize)
contact = math.floor(partsize ^ 0.666)
partweight = math.floor(partsize * 500 / 100) --bone, change to 8250 for bronze colossus etc.
vvel = 100 * unit.body.physical_attrs.STRENGTH.value / 1000 --some assumptions
vmom = vvel * partweight / 1000 + 1
print(v.name_singular[0].value, partsize, contact, partsize, partweight/1000, vvel, vmom)
end
end
I would add that flexible skin/fat/muscle layers, which bypass blunt damage rather than being destroyed, can't be severed by blunt damage. This allows the bones to be smashed without the limb popping off. I suppose repeated pounding with a morningstar (which has a small amount of edge attack) would eventually sever a person's arm in DF - untested.
I would add that flexible skin/fat/muscle layers, which bypass blunt damage rather than being destroyed, can't be severed by blunt damage. This allows the bones to be smashed without the limb popping off. I suppose repeated pounding with a morningstar (which has a small amount of edge attack) would eventually sever a person's arm in DF - untested.
I've actually done a load of arena testing with that particular weapon due to the fact that it is highly unique in the sort of damage it does and it came up in another thread. I originally believed it was impossible for it to sever anything but teeth but then I realized this was simply because I had been doing all my tests on organic creatures that can feel pain. The injuries that morningstars cause tend to be so severe that the creatures collapse and are killed long before that little bit of edged damage can add up enough to actually sever a body part. You have to use it on something like a bronze colossus to see a morningstar sever large appendages. It only occurs after pages and pages of combat.
Tested in the arena with a horde of allied human morningstar users vs a single human husk. The husk quickly ended up as a heavily pulped (but still going!) limbless head/upper body/lower body. Theory confirmed.
Do you know how the game determines attack type and severity for flying objects?
Specifically, I am interested in knowing how to choose the most appropriate ammo for different circumstances (or overall if it's all the same except for density or something) for minecart shotguns.
Like, does a silver bar do roughly the same amount and type of damage as a flying silver serrated disc (I don't know if they weigh the same, let's say they do)? Etc.?
2a. If the item has defined attacks (i.e. a trap component, weapon, or certain tools) then one of those is chosen.Does that mean that hurling live animals with, say, syndrome venom bite attacks would effectively cause them to randomly insta-bite and infect people they hit as they hurtle past at 100 mph?
Quote2a. If the item has defined attacks (i.e. a trap component, weapon, or certain tools) then one of those is chosen.Does that mean that hurling live animals with, say, syndrome venom bite attacks would effectively cause them to randomly insta-bite and infect people they hit as they hurtle past at 100 mph?
Or that if you hurl dragons or clowns, you basically have a mortar (chance of area effect attacks upon impact with creatures)?
As you said weapons fired from traps have a set speed, but how about Projectile weapons, will the projectiles have that speed, its max speed or something other than that?Well I know that minecart shotguns depend on the cart's speed. 50 impulse ramps = about 75 range, 10 impulse ramps = about 25 range for the same cargo.
/Zorbeltuss
As you said weapons fired from traps have a set speed, but how about Projectile weapons, will the projectiles have that speed, its max speed or something other than that?
/Zorbeltuss
--Calculates combat info for weapons/armor. Alpha version!
--Future goal is to calculate info for body part weapons (using attack info), wounded tissue layers
--ranged weapons
unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit under cursor! Aborting!")
return
end
print("Creature size (base/current): ", unit.body.size_info.size_base, unit.body.size_info.size_cur)
print("Creature strength (base): ", unit.body.physical_attrs.STRENGTH.value) --should update to use curse strengths etc.
print(" ")
for k,v in pairs(unit.inventory) do
--print(v.mode)
--enum-item Hauled 0
--enum-item Weapon 1
--enum-item Worn 2
--enum-item InBody 3
--enum-item Flask 4
--enum-item WrappedAround 5
--enum-item StuckIn 6
--enum-item InMouth 7
--enum-item Shouldered 8
--enum-item SewnInto 9
vitype=df.item_type[v.item:getType()]
print(vitype)
material=dfhack.matinfo.decode(v.item)
matdata=material.material.strength
vmatname=material.material.state_name.Solid
--print(vmatname, v.item.subtype.name) --WOULD ENABLE THIS BUT BUG ON QUIVERS, OTHER ITEMS W/O SUBTYPES!
vbpart=unit.body.body_plan.body_parts[v.body_part_id]
print(vbpart.name_singular[0].value)
if vitype=="WEAPON" then
print(vmatname, v.item.subtype.name)
v.item:calculateWeight()
effweight=unit.body.size_info.size_cur/100+v.item.weight*100+v.item.weight_fraction/10000
actweight=v.item.weight*1000+v.item.weight_fraction/1000
if v.item.subtype.flags.HAS_EDGE_ATTACK==true then
print("shear yield, shear fracture: ", matdata.yield.SHEAR, matdata.fracture.SHEAR)
print("Sharpness: ", v.item.sharpness)
end
print("NAME", "EDGE", "CONTACT", "PNTRT", "WEIGHT", "VEL", "MOMENTUM(+100%/-50%)")
for kk,vv in pairs(v.item.subtype.attacks) do
vvel=unit.body.size_info.size_base * unit.body.physical_attrs.STRENGTH.value *
vv.velocity_mult/1000/effweight/1000
vmom=vvel*actweight/1000+1
vedge="blunt"
vcut=""
if vv.edged==true then
vedge="edged"
vcut=100
end
print(vv.verb_2nd, vedge, vv.contact, vv.penetration, actweight/1000, math.floor(vvel), math.floor(vmom))
end
actvol=v.item:getVolume()
print("Blunt deflect if layer weight more than:", actvol * matdata.yield.IMPACT / 100 / 500)
else
if v.mode==1 then
--item held in hands treated as misc weapon
--1000 velocity mod, power math for contact and penetration
print(vmatname, "(misc weapon)") --v.item.subtype.name quiver bug
actvol=v.item:getVolume()
v.item:calculateWeight()
actweight=v.item.weight*1000+v.item.weight_fraction/1000
effweight=unit.body.size_info.size_cur/100+v.item.weight*100+v.item.weight_fraction/10000
misccontact=math.floor(actvol ^ 0.666)
miscpene=math.floor((actvol*10000) ^ 0.333)
print("NAME", "EDGE", "CONTACT", "PNTRT", "WEIGHT", "VEL", "MOMENTUM(+100%/-50%)")
vvel=unit.body.size_info.size_base * unit.body.physical_attrs.STRENGTH.value/effweight/1000
vmom=vvel*actweight/1000+1
vedge="blunt"
print("strike", vedge, misccontact, miscpene, actweight/1000, math.floor(vvel), math.floor(vmom))
print("Blunt deflect if layer weight more than:", actvol * matdata.yield.IMPACT / 100 / 500)
print(" ")
end
end
if vitype=="ARMOR" or vitype=="HELM" or vitype=="GLOVES" or vitype=="SHOES" or vitype=="PANTS" then
print(vmatname, v.item.subtype.name)
actvol=v.item:getVolume()
v.item:calculateWeight()
actweight=v.item.weight*1000+v.item.weight_fraction/1000
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
deduct=vbca/10
if matdata.strain_at_yield.IMPACT >= 50000 or v.item.subtype.props.flags.STRUCTURAL_ELASTICITY_WOVEN_THREAD==true or
v.item.subtype.props.flags.STRUCTURAL_ELASTICITY_CHAIN_METAL==true or v.item.subtype.props.flags.STRUCTURAL_ELASTICITY_CHAIN_ALL==true
then
vbcb=0
vbcc=0
end
print("Full contact blunt momentum resist: ", math.floor(vbca+vbcb+vbcc))
print("Contact 10 blunt momentum resist: ", math.floor((vbca+vbcb+vbcc)*10/actvol))
print("Unbroken momentum deduction (full,10): ", math.floor(deduct), math.floor(deduct*10/actvol))
print("Volume/contact area/penetration: ", actvol)
print("Weight: ", actweight/1000)
vshyre=matdata.yield.SHEAR
vshfre=matdata.fracture.SHEAR
if v.item.subtype.props.flags.STRUCTURAL_ELASTICITY_WOVEN_THREAD==true and vmatname ~= "leather" then
if vshyre>20000 then vshyre=20000 end
if vshfre>30000 then vshfre=30000 end
end
print("shear yield, shear fracture: ", vshyre, vshfre)
end
print(" ")
end --end of unit inventory loop
--printall(unit.body.body_plan.attacks) --wait for next DFHack version?
--print(" ")
print("BODY PART ATTACKS (some assumptions!)")
print("NAME", " ", "SIZE", "CONTACT", "PNTRT", "WEIGHT", "VEL", "MOMENTUM(+100%/-50%)")
for k,v in pairs(unit.body.body_plan.body_parts) do
if v.flags.STANCE==true or v.flags.GRASP==true then
--ASSUME THAT ALL GRASP/STANCE PARTS ARE COMBAT
partsize = math.floor(unit.body.size_info.size_cur * v.relsize / unit.body.body_plan.total_relsize)
contact = math.floor(partsize ^ 0.666)
partweight = math.floor(partsize * 500 / 100) --bone, change to 8250 for bronze colossus etc.
vvel = 100 * unit.body.physical_attrs.STRENGTH.value / 1000 --some assumptions
vmom = vvel * partweight / 1000 + 1
print(v.name_singular[0].value, partsize, contact, partsize, partweight/1000, vvel, vmom)
end
end
print(" ")
print("BODY PART DEFENSE (some assumptions/bugs!)")
print("Volume/Contact/Thickness/Blunt_Momentum_Resistance(full contact)")
for k,v in pairs(unit.body.body_plan.body_parts) do
if (v.flags.SMALL==false and v.flags.INTERNAL==false) or v.flags.TOTEMABLE==true or false then
--change the final "or false" to "or true" to list all body parts!
--(or just change the whole statement to "if true then" instead of checking the flags
partsize = math.floor(unit.body.size_info.size_base * v.relsize / unit.body.body_plan.total_relsize)
partthick = math.floor((partsize * 10000) ^ 0.333)
contact = math.floor(partsize ^ 0.666)
print(v.name_singular[0].value)
for kk,vv in pairs(v.layers) do
layername = vv.layer_name
matdata=nil
for x,y in pairs(unit.body.body_plan.materials.mat_type) do
--Temporary kludge
material=dfhack.matinfo.decode(y, unit.body.body_plan.materials.mat_index[x])
if material.material.id==layername then
matdata=material.material.strength
break
end
if material.material.id=="" then --kludge for bronze colossus
matdata=material.material.strength
break
end
end
if matdata~=nil then
modpartfraction= vv.part_fraction
if layername == "FAT" then
modpartfraction = unit.counters2.stored_fat * modpartfraction / 2500 / 100
end
if layername == "MUSCLE" then
--should update to consider strength bonus due to curses etc.
modpartfraction = unit.body.physical_attrs.STRENGTH.value * modpartfraction / 1000
end
layervolume = math.floor(partsize * modpartfraction / v.fraction_total)
layerthick = math.floor(partthick * modpartfraction / v.fraction_total)
if layervolume == 0 then
layervolume = 1
end
if layerthick == 0 then
layerthick = 1
end
vbca=layervolume*matdata.yield.IMPACT/100/500/10
vbcb=layervolume*(matdata.fracture.IMPACT-matdata.yield.IMPACT)/100/500/10
vbcc=layervolume*(matdata.fracture.IMPACT-matdata.yield.IMPACT)/100/500/10
deduct= math.floor(vbca/10)
if matdata.strain_at_yield.IMPACT >= 50000 then
vbcb=0
vbcc=0
end
fullbmr= math.floor(vbca+vbcb+vbcc)
print(" ",vv.layer_name, layervolume, contact, layerthick, fullbmr)
else
--temporary material kludge until I get tissue access
print(" ",vv.layer_name,"ERROR-material")
end
end
end
end
Exactly what I wanted to know. Do you know from about how high up for the boulder to reach the speed needed?
26+ z-levels, which should take 41 ticks to fall from start to finish. Average humanoid creatures can walk ~4 tiles in that time.
fall_threshold -- Seems to be able to hit units further away with larger numbers
min_hit_distance -- Seems to be unable to hit units closer than this value
min_ground_distance -- No idea (seems to be always less than the fall threshold, usually by just 1, but sometimes more)
fall_counter -- No idea (changes during projectile movement, but only sometimes)
fall_delay -- No idea (varies wildly from projectile to projectile)
hit_rating -- I think this is how likely it is to hit a unit (or to go where it should maybe?)
unk22 -- No idea (seems to usually be at 100, but not always)
I was wondering if you had any idea what modifying these numbers actually does to the projectile. I can experiment with it, but figured I would ask before I start playing around in arena mode....
I'm revisiting falling projectiles and I have noticed in the arena, that simply dropping a granite boulder from +3 z-levels above a Dwarfs head causes a mortal wound, if not killing them outright. Only tried it a few times, and the Dwarfs were always lying down (just pressed 's' to make frames pass while controlling them), so not sure if that could make a difference.
...
I was wondering if you had any idea what modifying these numbers actually does to the projectile. I can experiment with it, but figured I would ask before I start playing around in arena mode.
...
My apologies for this being a little off topic but I figured this thread is likely to be one of the best places to ask this question. I've seen a lot of science which has been done on weapon and armor types and materials but very little on weapon and armor quality. My own limited testing with weapon quality was rather primitive but it seemed to suggest that quality is not as important a factor as weapon material and type as far as performance goes. Is there anyone who has looked into this subject in any any detail?
For instance I am curious if a piece of bronze artifact armor would be better in most instances than a piece of iron armor that was crafted at the lowest quality level.
http://dwarffortresswiki.org/index.php/DF2012:Armor#Quality_and_strange_moods
http://dwarffortresswiki.org/index.php/DF2012:Weapon#Quality_and_strange_moods
ARMOR
bronze breastplate
Full contact blunt momentum resist: 557
Contact 10 blunt momentum resist: 21
Unbroken momentum deduction (full,10): 30 1
Volume/contact area/penetration: 257
Weight: 21.2025
shear yield, shear fracture: 172000 241000
ARMOR
iron breastplate
Full contact blunt momentum resist: 836
Contact 10 blunt momentum resist: 32
Unbroken momentum deduction (full,10): 27 1
Volume/contact area/penetration: 257
Weight: 20.1745
shear yield, shear fracture: 155000 310000
So it looks like artifact bronze armor would be weaker than no-quality iron armor. The lower blunt resistance is due to the smaller gap between IMPACT_FRACTURE and IMPACT_YIELD, i.e. bronze is brittle. In fact, copper has slightly better blunt resistance than bronze. Both bronze and iron armors have better shear fractures than copper or silver, so they would still protect against those edged weapons. They originally came straight from Toady's mouth, though.Toady could easily forget something like a multiplier then later being multiplied by another multiplier, such that what he thought was a 2x and 3x bonus is in fact a 0.2x and 0.3x bonus or whatever. Just because he said it doesn't mean it's what actually happens. If he had perfect knowledge of his own code, bugs wouldn't exist.
Gotta love this thread. Thanks for working that out. :)
...
On different note, your brought up how denser armor's protect better against blunt attacks which is something I have always found interesting. Given that denser armor is heavier and thus encumbers the wearer more would it be worth throwing something like a gold artifact chest plate over some masterwork steel chain on a dwarf with decent armor user skill? It seems like it would be good for protecting against blunt attacks but the weight would be brutal.
The density of most metal armors will cause wood weapons and some other soft (low IMPACT_YIELD) materials to deflect. However, punches/kicks (which are treated as bone for attack purposes) and metal blunt weapons will get through your gold breastplate with no trouble. The extra weight would slow you down, probably making it hard to dodge. Gold armor would only really be useful against elves or giant sponges.
If you go to the momentum cost equations earlier in this thread, you can see how you want to have high values of IMPACT_FRACTURE and IMPACT_YIELD rather than density.
Density is kg/m^3 in the raws right now, I think.[SOLID_DENSITY:7850]
What about the strength values? I.E. IMPACT_FRACTURE, TORSION_YIELD, COMPRESSIVE_FRACTURE, etc? Are they in mPa or something?KPa
..., and/or looking up more proper values? Advice on more realistic game logic to use for combat would be appreciated too. ...
What about the strength values? I.E. IMPACT_FRACTURE, TORSION_YIELD, COMPRESSIVE_FRACTURE, etc? Are they in mPa or something?KPa
1. Use an energy basis (DF uses a momentum basis, which has a few drawbacks)
2. Look for food processing books online. Keywords "specific cutting force" or "work of fracture" to get idea of requirements to cut meat/bone/etc.
3. If you have a mace or hammer, you might try to can-opener fight an armored opponent. Otherwise, people with swords/daggers usually aim for gaps/weak points rather than try to stab through the armor. Then again, if the enemy's armor is junk (leather or thin weak metal) you could stab through it.
4. For real metals, you will likely only be able to find a yield strength and an ultimate tensile strength (i.e. fracture), as well as other properties. These are generally measured using a tensile testing apparatus. There is no such thing as a "torsional strength" in common practice.
--Calculates combat info for weapons/armor. DFHack 0.34.11-r5 version
--Future goal is to calculate info for body part weapons (using attack info), perhaps ranged weapons
unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit under cursor! Aborting!")
return
end
print("Creature size (base/current): ", unit.body.size_info.size_base, unit.body.size_info.size_cur)
print("Creature strength (base): ", unit.body.physical_attrs.STRENGTH.value)
if unit.curse.attr_change ~= nil then
--print("cperc",unit.curse.attr_change.phys_att_perc.STRENGTH)
--print("cadd",unit.curse.attr_change.phys_att_add.STRENGTH)
curstrength=((unit.body.physical_attrs.STRENGTH.value * unit.curse.attr_change.phys_att_perc.STRENGTH)/100 +
unit.curse.attr_change.phys_att_add.STRENGTH)
if curstrength > 5000 then curstrength=5000 end
else
curstrength=unit.body.physical_attrs.STRENGTH.value
end
print("Creature strength (current): ", curstrength)
print("Wrestle/Charge rating: ", math.floor(curstrength/100+unit.body.size_info.size_cur/100))
race=df.global.world.raws.creatures.all[unit.race]
print(" ")
for k,v in pairs(unit.inventory) do
--print(v.mode)
--enum-item Hauled 0
--enum-item Weapon 1
--enum-item Worn 2
--enum-item InBody 3
--enum-item Flask 4
--enum-item WrappedAround 5
--enum-item StuckIn 6
--enum-item InMouth 7
--enum-item Shouldered 8
--enum-item SewnInto 9
vitype=df.item_type[v.item:getType()]
print(vitype)
material=dfhack.matinfo.decode(v.item)
matdata=material.material.strength
vmatname=material.material.state_name.Solid
--print(vmatname, v.item.subtype.name) --WOULD ENABLE THIS BUT BUG ON QUIVERS, OTHER ITEMS W/O SUBTYPES!
vbpart=unit.body.body_plan.body_parts[v.body_part_id]
print(vbpart.name_singular[0].value)
if vitype=="WEAPON" then
print(vmatname, v.item.subtype.name)
v.item:calculateWeight()
effweight=unit.body.size_info.size_cur/100+v.item.weight*100+v.item.weight_fraction/10000
actweight=v.item.weight*1000+v.item.weight_fraction/1000
if v.item.subtype.flags.HAS_EDGE_ATTACK==true then
print("shear yield, shear fracture: ", matdata.yield.SHEAR, matdata.fracture.SHEAR)
print("Sharpness: ", v.item.sharpness)
end
print("NAME", "EDGE", "CONTACT", "PNTRT", "WEIGHT", "VEL", "MOMENTUM(+100%/-50%)")
for kk,vv in pairs(v.item.subtype.attacks) do
vvel=unit.body.size_info.size_base * curstrength * vv.velocity_mult/1000/effweight/1000
vmom=vvel*actweight/1000+1
vedge="blunt"
vcut=""
if vv.edged==true then
vedge="edged"
vcut=100
end
print(vv.verb_2nd, vedge, vv.contact, vv.penetration, actweight/1000, math.floor(vvel), math.floor(vmom))
end
actvol=v.item:getVolume()
print("Blunt deflect if layer weight more than:", actvol * matdata.yield.IMPACT / 100 / 500)
else
if v.mode==1 then
--item held in hands treated as misc weapon
--1000 velocity mod, power math for contact and penetration
print(vmatname, "(misc weapon)") --v.item.subtype.name quiver bug
actvol=v.item:getVolume()
v.item:calculateWeight()
actweight=v.item.weight*1000+v.item.weight_fraction/1000
effweight=unit.body.size_info.size_cur/100+v.item.weight*100+v.item.weight_fraction/10000
misccontact=math.floor(actvol ^ 0.666)
miscpene=math.floor((actvol*10000) ^ 0.333)
print("NAME", "EDGE", "CONTACT", "PNTRT", "WEIGHT", "VEL", "MOMENTUM(+100%/-50%)")
vvel=unit.body.size_info.size_base * curstrength/effweight/1000
vmom=vvel*actweight/1000+1
vedge="blunt"
print("strike", vedge, misccontact, miscpene, actweight/1000, math.floor(vvel), math.floor(vmom))
print("Blunt deflect if layer weight more than:", actvol * matdata.yield.IMPACT / 100 / 500)
print(" ")
end
end
if vitype=="ARMOR" or vitype=="HELM" or vitype=="GLOVES" or vitype=="SHOES" or vitype=="PANTS" then
print(vmatname, v.item.subtype.name)
actvol=v.item:getVolume()
v.item:calculateWeight()
actweight=v.item.weight*1000+v.item.weight_fraction/1000
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
deduct=vbca/10
if matdata.strain_at_yield.IMPACT >= 50000 or v.item.subtype.props.flags.STRUCTURAL_ELASTICITY_WOVEN_THREAD==true or
v.item.subtype.props.flags.STRUCTURAL_ELASTICITY_CHAIN_METAL==true or v.item.subtype.props.flags.STRUCTURAL_ELASTICITY_CHAIN_ALL==true
then
vbcb=0
vbcc=0
end
print("Full contact blunt momentum resist: ", math.floor(vbca+vbcb+vbcc))
print("Contact 10 blunt momentum resist: ", math.floor((vbca+vbcb+vbcc)*10/actvol))
print("Unbroken momentum deduction (full,10): ", math.floor(deduct), math.floor(deduct*10/actvol))
print("Volume/contact area/penetration: ", actvol)
print("Weight: ", actweight/1000)
vshyre=matdata.yield.SHEAR
vshfre=matdata.fracture.SHEAR
if v.item.subtype.props.flags.STRUCTURAL_ELASTICITY_WOVEN_THREAD==true and vmatname ~= "leather" then
if vshyre>20000 then vshyre=20000 end
if vshfre>30000 then vshfre=30000 end
end
print("shear yield, shear fracture: ", vshyre, vshfre)
end
print(" ")
end --end of unit inventory loop
--printall(unit.body.body_plan.attacks) --wait for next DFHack version? r5 caste_attack data bugged!
--print(" ")
print("BODY PART ATTACKS (some assumptions!)")
print("NAME", " ", "SIZE", "CONTACT", "PNTRT", "WEIGHT", "VEL", "MOMENTUM(+100%/-50%)")
for k,v in pairs(unit.body.body_plan.body_parts) do
if v.flags.STANCE==true or v.flags.GRASP==true then
--ASSUME THAT ALL GRASP/STANCE PARTS ARE COMBAT
partsize = math.floor(unit.body.size_info.size_cur * v.relsize / unit.body.body_plan.total_relsize)
contact = math.floor(partsize ^ 0.666)
partweight = math.floor(partsize * 500 / 100) --bone, change to 8250 for bronze colossus etc.
vvel = 100 * curstrength / 1000
vmom = vvel * partweight / 1000 + 1
print(v.name_singular[0].value, partsize, contact, partsize, partweight/1000, vvel, vmom)
end
end
print(" ")
print("BODY PART DEFENSE")
print("Volume/Contact/Thickness/Blunt_Momentum_Resistance(full contact)")
for k,v in pairs(unit.body.body_plan.body_parts) do
if (v.flags.SMALL==false and v.flags.INTERNAL==false) or v.flags.TOTEMABLE==true or false then
--change the final "or false" to "or true" to list all body parts!
--(or just change the whole statement to "if true then" instead of checking the flags
partsize = math.floor(unit.body.size_info.size_base * v.relsize / unit.body.body_plan.total_relsize)
partthick = math.floor((partsize * 10000) ^ 0.333)
contact = math.floor(partsize ^ 0.666)
print(v.name_singular[0].value)
for kk,vv in pairs(v.layers) do
tisdata=race.tissue[vv.tissue_id]
--printall(tisdata)
layername = vv.layer_name
material=dfhack.matinfo.decode(tisdata.mat_type,tisdata.mat_index)
--tissue has a mat_state, could it name properly
matdata=material.material.strength
modpartfraction= vv.part_fraction
if tisdata.flags.THICKENS_ON_ENERGY_STORAGE == true then
modpartfraction = unit.counters2.stored_fat * modpartfraction / 2500 / 100
end
if tisdata.flags.THICKENS_ON_STRENGTH == true then
modpartfraction = curstrength * modpartfraction / 1000
end
layervolume = math.floor(partsize * modpartfraction / v.fraction_total)
layerthick = math.floor(partthick * modpartfraction / v.fraction_total)
if layervolume == 0 then
layervolume = 1
end
if layerthick == 0 then
layerthick = 1
end
vbca=layervolume*matdata.yield.IMPACT/100/500/10
vbcb=layervolume*(matdata.fracture.IMPACT-matdata.yield.IMPACT)/100/500/10
vbcc=layervolume*(matdata.fracture.IMPACT-matdata.yield.IMPACT)/100/500/10
deduct= math.floor(vbca/10)
if matdata.strain_at_yield.IMPACT >= 50000 then
vbcb=0
vbcc=0
end
fullbmr= math.floor(vbca+vbcb+vbcc)
print(" ",vv.layer_name, layervolume, contact, layerthick, fullbmr,material.material.state_name.Solid)
end
end
end
Will this be updated? I want to know how exactly pulping works...
Toady One There have been a lot of DF Talky, pressy and taxy things going on (with all the events scheduled for later, this may end up being one of the busier months on record non-programming-wise), but I managed to get most of the way through pulping as well as making some strides toward the definitive hydra test. For pulping, I just need to hit a bunch of things in the arena now to get the numbers to feel correct. Once a key body part is pulped, associated corpses won't be able to be re-animated. If a dwarf gets hit enough times to have a part pulped and still survives, which is reasonably extreme, they can still recover, since pulping isn't actually a state of being, just an accumulation of enough serious wounds -- if enough of the serious wounds heal, the dwarf can recover, but it's likely to be a mess of multiple horrifying fractures and nerve damage and so on. The "hit points" for animated creatures that were a band-aid for the damage problem have been removed.
Take the text, save it as a .lua file, stick it in \hack\scripts and punch in the filename as a command in the DFHack console. The simplest thing in the world.
Some things may need to be reverified for 0.40.01 considering that two years of Toady's coding have occurred. I can confirm that the dependance of edged damage on the SHEAR values has not changed.
Attack momentums/velocities are likely different after the combat/movement speed split.
FAKE EDIT: preliminary pulping testing suggests that body parts and all their contained parts will be broken (red) if dealt a body-part-size related amount of blunt damage. However the system is not balanced as small parts burst easily. My arena martial artist kicked someone repeatedly in the lower body until it exploded in gore, which instantly killed them. The corpse was in one piece.
Relevant Toady quote:QuoteToady One There have been a lot of DF Talky, pressy and taxy things going on (with all the events scheduled for later, this may end up being one of the busier months on record non-programming-wise), but I managed to get most of the way through pulping as well as making some strides toward the definitive hydra test. For pulping, I just need to hit a bunch of things in the arena now to get the numbers to feel correct. Once a key body part is pulped, associated corpses won't be able to be re-animated. If a dwarf gets hit enough times to have a part pulped and still survives, which is reasonably extreme, they can still recover, since pulping isn't actually a state of being, just an accumulation of enough serious wounds -- if enough of the serious wounds heal, the dwarf can recover, but it's likely to be a mess of multiple horrifying fractures and nerve damage and so on. The "hit points" for animated creatures that were a band-aid for the damage problem have been removed.
Also throwing liquids has been nerfed, so "water guns" are possibly obsolete. The creature just gets splattered on a body part. This is likely due to the implementation of spitting.
ACTUAL EDIT: Giant Sponges can be pulped to death (i.e. their single body part "collapses")! This is probably a good place to start in understanding pulping.
What about the strength values? I.E. IMPACT_FRACTURE, TORSION_YIELD, COMPRESSIVE_FRACTURE, etc? Are they in mPa or something?KPa
What about the strength values? I.E. IMPACT_FRACTURE, TORSION_YIELD, COMPRESSIVE_FRACTURE, etc? Are they in mPa or something?KPa
Where does this come from? Rather, where are the values found for this? I couldn't find anything related to iron and 155 mPa.
...
[MATERIAL_TEMPLATE:STONE_TEMPLATE]
...
Used for blunt-force combat, measured in KPa. Data scattered around the net (used compressive strength). All very spotty.
[IMPACT_YIELD:120000] used marble
...
Used for cutting calculations in combat, measured in KPa. Data scattered around the net (used tensile strength). All very spotty.
[SHEAR_YIELD:15000] used marble
...
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?
...iron:
There's a twisted logic in there somewhere, just take my word for it.
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
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?
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)
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....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.
I do have a couple of questions:
...
...
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?
...