Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 3 4 [5] 6 7 ... 10

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

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 #60 on: December 29, 2013, 09:38:35 pm »

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:)
...

See this post earlier in the thread: http://www.bay12forums.com/smf/index.php?topic=131995.msg4714538#msg4714538
Your very large numbers in the material definition will be ignored or may cause errors/unintended results. I recommend just using the cap values.

Creatures explode when they hit a surface while moving fast, regardless of the distance moved/fallen. See http://www.bay12forums.com/smf/index.php?topic=120502.0 . But yes, slade floors cause more falling damage than featherwood floors.

Roses

  • Bay Watcher
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #61 on: January 16, 2014, 11:26:26 am »

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?
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 #62 on: January 16, 2014, 09:15:17 pm »

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?

In addition to hitting someone with a fast-moving heavy blunt projectile, the boulder will also give the creature a downwards velocity into the floor.

IF the boulder weighs more than the creature AND the boulder is moving at a speed that normally causes creatures to explode, it will cause the creature to hit the floor and explode. Otherwise the creature just smacks into the floor for more blunt damage.

Is that what you wanted to know?

Roses

  • Bay Watcher
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #63 on: January 16, 2014, 09:25:45 pm »

Exactly what I wanted to know. Do you know from about how high up for the boulder to reach the speed needed?
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 #64 on: January 17, 2014, 11:13:37 pm »

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.

Roses

  • Bay Watcher
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #65 on: January 22, 2014, 12:48:47 am »

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?)
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Modding material properties vs. how the properties are used by the game
« Reply #66 on: January 22, 2014, 11:19:10 am »

Stupid idea maybe: Have you tried using ProjectileExpansion with this? If the boulder counts as a projectile, you can have it emit clouds when it hits the ground. These would affect the unit standing there as well.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

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 #67 on: January 22, 2014, 10:17:08 pm »

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?)

A brief check with DFHack in the arena reveals:

Falling creature has following flags enabled (true):

no_impact_destroy
piercing
parabolic
unk9


Falling ITEM has following flags enabled:

no_impact_destroy
bouncing
piercing
parabolic
unk9
no_collide


Please note that the names of the flags were assigned by DFHack researchers, and may not represent all the actual uses of the flags.

Roses

  • Bay Watcher
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #68 on: January 22, 2014, 11:28:17 pm »

Hmm thought I tried all of those, but maybe I left the no_collide on false because it seemed like I would want it to collide. Will try again. Thanks.
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 #69 on: January 26, 2014, 03:32:06 pm »

For the less mathematically inclined, here is a early version of a DFHack lua script:

Code: (test.lua) [Select]
--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

Questions/comments/suggestions are welcome.

Di

  • Bay Watcher
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #70 on: January 28, 2014, 11:55:29 am »

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.
Logged
Quote from: Creamcorn
Dwarf Fortress: Where you meet the limit of your imagination, moral compass, sanity and CPU processor.
http://www.bay12forums.com/smf/index.php?topic=103080.0 Fix sober vampires!
http://www.bay12forums.com/smf/index.php?topic=91442.0 Dwarven Cognitive Science

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 #71 on: January 28, 2014, 08:52:11 pm »

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.

If the weapon that is doing the slashing/stabbing can cut the armor material, then no real difference.

If the weapon can't cut the armor material and does blunt damage instead, the breastplate provides superior blunt protection (to the wearer). However, if the blunt damage is enough to break the breastplate then the cutting will resume on the flesh below. The mail sucks at blunt protection, but it won't break under blunt damage, instead passing on only blunt damage to the flesh below. This means that mail-wearers can be less likely to have their arms and legs cut off in certain situations (but the bones will still be broken!).

Vattic

  • Bay Watcher
  • bibo ergo sum
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #72 on: February 15, 2014, 06:00:19 pm »

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.
Logged
6 out of 7 dwarves aren't Happy.
How To Generate Small Islands

This is not a link

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #73 on: February 15, 2014, 06:15:00 pm »

I think it should be the same states as the rest.

The impact should be as expected from, say, forgotten beasts made entirely out of powder.

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 #74 on: February 16, 2014, 03:06:48 am »

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.

Non-solid tissues (i.e. liquids, gases, powders) don't use the strength material properties at all - the body part automatically fails on defense, breaking away some or all of the layer. In vanilla Iron Men, only the iron tissue layer provides protection.

Punch/kick attacks from vanilla Fire Men "pass through" other creatures, causing no harm.

A bronze colossus modded in the arena to be made of liquid water was able to cause serious blunt damage with its natural attacks. However, any weapon was capable of damaging the liquid water colossus.
Pages: 1 ... 3 4 [5] 6 7 ... 10