Bay 12 Games Forum

Please login or register.

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

Author Topic: Modding material properties vs. how the properties are used by the game[0.34.11]  (Read 46436 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 #30 on: October 30, 2013, 02:17:11 am »

It turns out that the velocity of the ground attacks when falling (which is multiplied by the ground weight to get the momentum) is:

vel = (speed_z - 50000)/1000

where speed_z is the "new" speed of the falling creature, from 0 to 270000. This produces similar blunt impact momentums to melee weapons over 2-5 z-level falls.

However, the code that handles the "falling on spears" part seems to be the same code that handles projectiles, and perhaps other traps (hence the "spinning" and "strikes" in the combat logs for traps). This code still uses the pre-minecart projectile system. The bug is that falling on spikes inputs the speed_z in the spot where a velocity of 1000 for the typical crossbow bolt would go.

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?

Interesting.   Now to mod in sporks as a spear item...because that would make me giggle.
Yes, it would be even more overpowered than shooting a spork out of a railgun crossbow.

Etherdrinker

  • Bay Watcher
  • ☼Etherdrink☼
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #31 on: October 30, 2013, 09:27:34 pm »

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.

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 #32 on: October 31, 2013, 09:16:03 am »

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.

Yes, you are right. In real life, cutting/fracturing a layer of material would cause the bolt to slow down, because it is losing kinetic energy and momentum. Dwarf Fortress doesn't consider this, so in most cases the bolt will go through all layers if the layers are equal. Eventually the bolt would run out of Penetration (default for a bolt is 2000), and then it would have to start dealing blunt damage. This calculation might make sense if the weapon was being pushed through a target by the strength of a creature's arm, but not for bolts that have to rely on momentum.

I suggest decreasing SHOOT_FORCE and SHOOT_MAXVEL on the crossbows and bows. Several mods also do this.

Unrelated, about traps:

The velocity of a weapon trap attack is always 200, so the momentum is:

momentum=200*(weapon weight)

The mechanism quality doesn't seem to change the momentum of a hit (but does affect trap accuracy). Note that creatures will swing heavy weapons slower, but traps swing all weapons at a fixed speed. A weapon trap swings an axe about 10x faster than a dwarf could. Therefore, weapon traps will perform better when equipped with the heaviest weapons you have available.
« Last Edit: October 31, 2013, 09:20:09 am by Urist Da Vinci »
Logged

Etherdrinker

  • Bay Watcher
  • ☼Etherdrink☼
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #33 on: October 31, 2013, 11:52:54 pm »

So, right now exist a fix to this weird behavior of projectiles?

or a fixed vanilla raw files.

CryptoCactus

  • Bay Watcher
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #34 on: November 01, 2013, 08:56:45 am »

So, right now exist a fix to this weird behavior of projectiles?

or a fixed vanilla raw files.

Broken Arrow is one such mod. Basically, just go into your raws, edit crossbows and bows to have SHOOT_FORCE:27 and SHOOT_MAXVEL:200, and increase relevant ammos to have an EDGE of 5.

I always do this, and it work great imo. It doesn't exactly "fix" the physics, since that's something Toady would have to do, but it does make ranged weapons behave more like bows and crossbows and less like .50cal rifles.
Logged
[REFERENCE]Creature Errors - Starvation, immortals, unbreedables, pet problems:
http://www.bay12forums.com/smf/index.php?topic=136374.0

My unofficial Modest Mod update:
http://www.bay12forums.com/smf/index.php?topic=105871.msg5021367#msg5021367

Lukander

  • Bay Watcher
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #35 on: November 26, 2013, 11:57:29 am »

  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).
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 #36 on: November 27, 2013, 09:54:06 pm »

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

Uh... Those equations on the wiki were ones that we developed from the Projectile thread, and were based on empirical research (arena testing and such).

The equations and discoveries in this thread are based upon my reading a disassembly of the game code to see what it actually does. Please just forget what was written on the wiki and read this thread instead.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #37 on: November 27, 2013, 10:06:28 pm »

It'd be better to edit the wiki

Lukander

  • Bay Watcher
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #38 on: November 27, 2013, 11:11:44 pm »

  I will give this thread precedence over the wiki entry, and thank you for the reply (I had figured this threads data was more relevant and correct given the method of acquiring it). Just grabbing at different sources to try for some special armor properties for modded armor.

P.S.: though as more information leaks I agree with the idea of editing the wiki. Thank you both Urist Da Vinci and Putnam. Welp, no more borderline thread derailment from me : )
Logged

MetalRocks

  • Bay Watcher
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #39 on: December 08, 2013, 06:44:20 am »

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

+The first thing is that the impact_yield value of the weapon must have a minimum value of 2500: If the impact yield value of the weapon material is less than that it wont go thrugh any armor.

+Then there is another check of the impact yield of the weapon against the density of the armor.
Minimum impact_yield of the weapon to go through the armor = ((INTEGER(armor density/1000)+1)*1250)
e.g.: If the armor has material density of 3234 then ((INTEGER(3234/1000)+1)*1250) = ((3+1)*1250) = 5000 would be the minimum impact yield value to go through the armor, or else there will be no damage.

+Then there is another check for the impact to go with full force or to be weak.
Minimum impact_yield to go with full force through the armor = ((INTEGER(armor density*3/1000)+1)*1250)
e.g.: If the armor has a material density of 3400, then ((INTEGER(3400*3/1000)+1)*1250) = ((10+1)*1250) = 13750 would be the minimum impact yield value to go through the armor with full force, or else go wimp.

So an artifact lead warhammer (has 35000 impact_yield) would not go through a platinum (needs 81250 impact_yield) or silver armor (needs 40000 impact_yield) with full force.

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.
Logged
"Face each battle, each foe, as though it is your last.

One day it will be"

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 #40 on: December 08, 2013, 01:39:44 pm »

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.

MetalRocks

  • Bay Watcher
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #41 on: December 08, 2013, 02:32:15 pm »

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.

I am not refuting your formulas, which I have not tested. I just wanted to make an addition from my own observations against different size creatures, with different weapons and different armors. Mine might be only useful for armored humanoids, but it works.

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.
Logged
"Face each battle, each foe, as though it is your last.

One day it will be"

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 #42 on: December 14, 2013, 04:47:12 am »

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

Back here, I made this assertion, which turns out to not be true. After looking into MetalRocks' observations, I re-examined the code and my notes.

This appears to be the actual behavior:


I didn't notice it before because it reuses some of the code for blunt momentum costs, except that it conflates momentum and weight.

In this case the weight units are such that a normal steel or iron battle axe weighs 6280. The weight of the portion of an adamantine plate armor layer under a bolt's contact area is 1, whereas the layer weight for steel plate would be 78. Dense or thick armors have a better chance of being able to completely negate a blunt attack using this code, especially if the blunt attack is made with a soft implement.

Warhammers (size 400, recorded as 40 in the code) that have a material IMPACT_YIELD of 2499 or less will not be able to "defeat" even a layer weight of 1, due to rounding, and will always deflect. Likewise for bolts (size 150 => 15) and IMPACT_YIELD of 6666, provided the bolts can't cut the layer.

Given what I discovered about falling damage earlier in this thread, it may be possible to create "soft ground" that deals no falling damage - at least until you are going fast enough to explode!

Thanks, MetalRocks, for your testing!

Greiger

  • Bay Watcher
  • Reptilian Illuminati member. Keep it secret.
    • View Profile
Re: Modding material properties vs. how the properties are used by the game
« Reply #43 on: December 15, 2013, 11:29:09 am »

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!
Logged
Disclaimer: Not responsible for dwarven deaths from the use or misuse of this post.
Quote
I don't need friends!! I've got knives!!!

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 #44 on: December 15, 2013, 02:30:08 pm »

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!

It turns out that Nerficite weapons with IMPACT_YIELD:1 will deflect off any armor/clothing, no matter the material, but hit unarmored tissues normally. Similarily, floors made of the metal will only protect clothed/armored body parts from falling damage. Babies in DF don't wear clothing, so the baby chutes concept is out.

Interesting that a bronze colossus wearing bronze armor is possibly more protected than an equivalently-fatter bronze colossus.
Pages: 1 2 [3] 4 5 ... 10