Bay 12 Games Forum

Dwarf Fortress => DF Dwarf Mode Discussion => Topic started by: Zivilin on September 08, 2012, 05:59:48 pm

Title: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on September 08, 2012, 05:59:48 pm
INTRODUCTION
The effectiveness of bolts made out of various materials is a common topic of discussion among the DF population [1] (http://www.bay12forums.com/smf/index.php?topic=115441.msg3558572#msg3558572) [2] (http://www.bay12forums.com/smf/index.php?topic=115683.msg3571409#msg3571409). There are a some sources which already address the effects of forging weapons and armor out of the different materials [3] (http://dwarffortresswiki.org/index.php/DF2012:Weapon#Material), as well as mention the effectiveness of various types of bolts [4] (http://dwarffortresswiki.org/index.php/Bolt). However, up till now no definitive comparison study was performed to obtain and organize a large amount of empirical data. The aim of this study is to rectify this gap by:

METHODOLOGY
The core of the experiment was based on the setup used in this Author's previous study [5] (http://www.bay12forums.com/smf/index.php?topic=115683.msg3570590#msg3570590). However, the number of single experimental cells was expanded from a 10 by 10 matrix (100 cells) to a 50 by 20 matrix (1000 cells). Increasing the amount of experimental data by an order of magnitude will improve the accuracy of the obtained results.

Each cell consists of two arena dwarfs separated by a fortification tile. One arena dwarf is the assailant (team A) whilst the other is the defender (team D). Arena dwarfs are a modified version of common dwarfs, differing from their brethren in two aspects:

Arena dwarf modifications code
Spoiler (click to show/hide)

This naturally eliminates dwarf size and skill gain as factors affecting the results of the study. The parameters of both team A and team D are shown in the table below.

| Team A| Team D
Weapon:| Cedar crossbow| None
Ammo:| 100 [varies] bolts| None
Armor:| None| Varies
Skills:| Archer: Proficient
| Marksdwarf: Proficient
| None
|

Two parameters were varied during the course of the study: the material of the bolts fired by Team A and the material of the armor donned by Team D. All major materials were tested for both these items. The complete list is given below

Bolts: Candy, Steel, Iron, Bronze, Copper, Silver, Fake bone, Wood (birch).
Armor: Candy, Steel, Iron, Bronze, Copper, Leather, None

Note: Bone bolts could not be generated in the Arena using standard setting, so a fake bone inorganic material based on the bone tissue template was created as a substitute. It is uncertain how closely fake bone bolts resemble in-game ones. The code for fake bone is provided below.

Spoiler (click to show/hide)

Note 2: Team D dwarfs armored in metal were equipped with breastplate, chain mail shirt, greaves, helm, a pair of gauntlets and pair of high boots, all made from the metal being tested. Team D dwarfs armored in leather were equipped with armor, leggings, helm, a pair of gloves and pair of high boots, all made from cow leather. Unarmored Team D arena dwarfs were left naked (no clothes as well).

Criteria
There is no generally accepted, clear criterion for judging a weapons/armors effectiveness in the DF community. The Author took the liberty of defining his own criteria, defined below:

Average of bolts fired - this criterion is based on the average number of bolts fired in order to kill a dwarf. This is a fairly unambiguous criterion ans can be easily obtained by dividing the number of bolts fired over the course of a single experiment by the number of dwarfs participating (under the tacit assumption that all dwarfs were killed). Example: if 12123 bolts were fired in a standard-sized experiment, killing all 1000 Team D dwarfs, than the Average of bolts fired is 12.12 (rounded to the second decimal)

The average of bolts fired,  while a simple and convenient general criterion, does not fully express the effectiveness of the crossbow used in a combat situation. The modus operandi of dwarven tacticians is to utilize the crossbows cover fire in order to incapacitate the enemy, and then move in with a melee unit in order to deliver an elegant coup de grace to those left unconscious and/or writhing in pain. Thus, in many cases the Marksdwarfs will not have the chance to empty their quivers and a criterion based on such an assumption is effectively useless. To remedy this, two other criteria were formed:

Lethality-N - probability that a dwarf is killed after the Nth volley. This experiment is more ambiguous. in fact, for it to be properly executed it would be required all Team A members should be given no more than N-bolts. However, due to the massive amount of time and effort required to set up even a single 1000-sample experiment, it was decided that the results from the 100 bolt tests would be used, introducing slight inaccuracy. Head shots have a more prominent effect on this criterion (because they are instantaneous) than Spine shots and Throat/Heart shots (because they are time-delayed). Example: if after 3 volleys fired in a standard-sized experiment, 100 of the 1000 dwarfs are
killed, then the 3-Lethality of Team A's weapon against team D's Armor is 10%.

Suppression-N - probability that a dwarf is incapacitated (either killed or left unconscious) after the Nth volley. One more, this is a fairly ambiguous criterion - partly because it inherits the ambiguity of lethality-N, and partly because the term "incapacitation" can be differently defined. For example, a dwarf who loses his weapon can also be called incapacitated, since his offensive power is greatly reduced. A retching and vomiting dwarf is also said to have reduced combat capability. However, it was decided that only death and unconsciousness would be included as they are the most powerful indicators of the ability of crossbow fire to suppress an attacking force. Example: if after 3 volleys fired in a standard-sized experiment, 100 dwarfs are dead and 500 dwarfs are unconscious out of the initial 1000, then the 3-Suppression of Team A's weapon against team D's Armor is 60%.

The results were gathered by running amateurish scripts of the Author's design on the gamelog files. Certain inaccuracies might have emerged due to poor programming design. If such inaccuracies are found, they will be edited and rectified at a later date. Data pertaining to other interesting criteria (wound types) were gathered, but they will not be considered in the study proper. Interesting additional data will be added as an addendum.

RESULTS
When discussing particular experiments, the phrase "Material A vs Material B" will imply "Bolts vs Armor" e.g.: "Steel vs Bronze" refers to the "Steel Bolts vs Bronze Armor" experiment.

The figure below presents the Average of Bolts Fired for various bolts and armors:

Average of Bolts Fired (per dwarf killed)
Spoiler (click to show/hide)

A number of interesting facts can be drawn from these results:


Next, Supression-1  is presented (lethality-1 had too few samples to obtain obtain results)

Probability that a dwarf is incapacitated after the first shot
Spoiler (click to show/hide)

Once more, observations are listed below:

Finally, Lethality-3 and Suppression-3 are presented (3 is the assumed number of shots a Marksdwarf can launch before an enemy reaches him/her)

Probability that a dwarf is killed after the third shot
Spoiler (click to show/hide)

Probability that a dwarf is incapacitated after the third shot
Spoiler (click to show/hide)

Observations:

CONCLUSIONS
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Sprin on September 08, 2012, 06:00:52 pm
WOW...
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on September 08, 2012, 06:03:17 pm
This addendum was compiled from additional data gained during the course of the study, but not directly related to its subject. Since I think they are pretty interesting on their own, I thought I'd share them as well, in a separate, more casual post.

Values are normalized as "percentage of total hits" unless stated otherwise.

NON-WOUND EVENTS

This covers all bolt-dwarf interactions which did not result in the latter being wounded.

Deflections
Deflections occured exclusively for Candy vs Candy, Bone vs Candy, Bone vs Steel and Wood vs Any Metal. No other deflection occurred ANYWHERE. I hypothesize that deflection requires two conditions to be satisfied:
It is certain for now that only light bolts (wood, bone, candy) appear to deflect at all. An interesting question is whether a heavy metal (e.g. iron) bolt could be made to deflect of armor without modifying the bolts weight, only, say, the armors density, or some other parameter.

Glance Offs
A bolt was reported to "glance off" a body part exactly 54 times, and each time it was off of an eyelid or eyeball. I do wonder how that works, exactly.

Misses
There were exactly 84 misses during the whole experiment, and how they happened is anybodies guess. Theoretically, the dwarfs have no maneuverability, so they can't jump away from attacks. Alas, no setup is perfect.

WOUND TYPES

This covers a part of the wound type analysis. For each direct hit (not a deflection, glance off or miss) a single, most critical wound caused by this hit was chosen. Since the process was automated, there might be some inaccuracies present in the data. The script qualified wound types in the following order of superiority:

Brain tear > Heart tear > Throat tear > Up/Mid Spine Tear > Up/Mid Spine Bruise > Low Spine Tear > Low Spine Bruise > Severe > Shatter > Fracture > Jam > Tear > Chip > Bruise

Absolute priority was given to lethal injuries (from Brain Tear to Up/Mid Spine bruise), then Lower spine injuries, and then the rest. In a majority of cases Edge and Blunt injuries rarely occur together, and the cases they do are accounted for already (e.g. A head shot causes muscle tearing, skull shattering and brain tearing, but only brain tearing is registered). Some interesting results are given:

Bruises/Tears and Chips/Jams
For each bolt type (except candy bolts) their existed a clear transition between the dominance of bruising wounds and tearing wounds. This of course is due to the armor type changing from equal to or "better" than the bolt to "worse" than the bolt. The point of transition is marked by the sudden appearance of jams, which appear to be a form of chipping damage.

Tears and bruises
Spoiler (click to show/hide)

Chips and jams
Spoiler (click to show/hide)

Misc
Hit zones
Finally, I compiled and calculated the percentages of a particular body part being hit. Reminder: this data is true for Proficient Archers and Marksdwarfs shooting from two tiles away through a fortification at enemies who can;t dodge:

Hit zones
Spoiler (click to show/hide)

Acknowledgments
I would like to thank the 56000 dwarfs which lent their crossbows to the cause of science.
I would like to double thank the 50960 dwarfs who sacrificed their lives for that very same cause.
I'd like to congratulate the surviving 5040 dwarfs and invite them to my future fortresses, since they appear to be professional survivors.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Sprin on September 08, 2012, 06:06:07 pm
WOW...
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Darnis on September 08, 2012, 06:22:34 pm
This was a triumph; Bone bolts might vary from creature to creature? This would be pretty amazing as then Forgotten beast bone bolts might be superior to Puppy Bone bolts

Great read, well organized and presented information.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: GreatWyrmGold on September 08, 2012, 06:29:45 pm
This was a triumph.
I'm making a note here: HUGE SUCCESS.
It's hard to overstate my satisfaction.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on September 08, 2012, 07:27:33 pm
Did You mean that, or was it simply that You could not resist filling in the lyrics? :P
But look at me still talking when there's Science to do.
I've experiments to run,
There is research to be done,
On the dwarfs who are still alive.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: GreatWyrmGold on September 08, 2012, 07:33:00 pm
Darnis put the song into my head.

Go ahead and leave me. I think I prefer to stay inside.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Kofthefens on September 08, 2012, 07:57:40 pm
This is phenomenal. Well done.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Viking on September 08, 2012, 08:02:40 pm
What you have done here is a thing of beauty and should be consulted for a long time.  :) Were you a dwarf, you'd have earned a royal bedroom with some gem encrusted candy furniture and such at least.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Sprin on September 08, 2012, 08:04:14 pm
WOW...
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Wrex on September 08, 2012, 08:05:32 pm
A severed gut can occur if their innards are sliced open by a projectile, then one hits the exposed intestines.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: misko27 on September 08, 2012, 08:12:57 pm
WOW..

This is a very impressive test. It reiforces my belief that silver is good. I'm a little surprised that bronze performs better then iron in several cases.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: GreatWyrmGold on September 08, 2012, 08:17:44 pm
In reality, iron replaced bronze due to price. Tin was rare.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on September 08, 2012, 08:31:29 pm
.... An interesting question is whether a heavy metal (e.g. iron) bolt could be made to deflect of armor without modifying the bolts weight, only, say, the armors density, or some other parameter.
...

...
Hit zones
Finally, I compiled and calculated the percentages of a particular body part being hit. Reminder: this data is true for Proficient Archers and Marksdwarfs shooting from two tiles away through a fortification at enemies who can;t dodge:

Hit zones
Spoiler (click to show/hide)
...

a) I'll see if I can make unedited iron bolts deflect off edited armor.

b) I looked at [BODY_DETAIL_PLAN:HUMANOID_RELSIZES] in b_detail_plan_default.txt.
Each body part has a relative size. If you divide the body part's size by the sum of sizes for all external body parts, you get percentages that are very similar to the Vitruvian dwarf (1-5% error for most main body parts, so I get 18.12% for the upper body etc.). This doesn't hold for heads, hands, and feet, but I probably made a calculation mistake when including the fingers, toes, nose, etc.

I would conclude that the chance of a body part being hit is proportional to the size of the body part relative to the sum of all body part sizes.

This also implies that dwarves don't deliberately aim for headshots when using crossbows.
A quick test in arena mode reveals that dwarves don't get free headshots when firing a crossbow at an adjacent unconscious enemy, instead using the typical random shots.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: GreatWyrmGold on September 08, 2012, 08:44:46 pm
Sad but expected.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Wrex on September 08, 2012, 08:46:31 pm
You know, you would expect them to aim for center of mass- the prefered target for ranged weapons throughout the ages. Still, from the distribution of wounds at the end of any battle, those results are entirely suspected.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on September 08, 2012, 09:38:18 pm
...
It is certain for now that only light bolts (wood, bone, candy) appear to deflect at all. An interesting question is whether a heavy metal (e.g. iron) bolt could be made to deflect of armor without modifying the bolts weight, only, say, the armors density, or some other parameter.
...

Yes, arena testing reveals that slade armor is required to "deflect" iron bolts. Less heavy/dense armors don't seem to deflect the blunt damage. Implications unknown at this time.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on September 09, 2012, 02:44:19 am
What you have done here is a thing of beauty and should be consulted for a long time.  :) Were you a dwarf, you'd have earned a royal bedroom with some gem encrusted candy furniture and such at least.

I'd like that <wistfully>

WOW..

This is a very impressive test. It reinforces my belief that silver is good. I'm a little surprised that bronze performs better then iron in several cases.

Silver is good. But only slightly better than copper, bronze, iron or steel. So its most economic to go with the cheapest/most abundant resource on the map.

As to bronze, it appears to have shear yield HIGHER than iron:

IronBronzeCopper
Solid density785082508930
Shear yield15500017200070000

(copper added for comparison)

So apparently Bronze is, according to the key parameters solid density and shear yield, "better" than iron.

While we are on the topic, I discovered an interesting anomaly in the average of fired bolts parameter (I'm shortening that to AofB). The reason the AofB plot forms two distinctive levels can be explained through type of death: the one which occur from bolt damage are:

So bolts of material equal to or "worse" to than the armor they are assaulting cannot directly tear organs or throat (They do sometimes tear muscle, skin, fat, though this mainly happens when they hit extremities, like hands or feet. Oh, and spinal nervous tissue is often teared, for some reason, even if the bolt only bruises the spine itself). Thus only head shots and spinal injuries contribute towards death rate. When the material of the bolt is "better" than the armor, than heart tearing and throat tearing (both inducing bleed out over time) is added to the death toll, significantly increasing the probability of the bolt killing the dwarf.

Here's the interesting part: Take a look at a slice of the AofB part describing how well different bolts do against iron armor:

Spoiler (click to show/hide)

There is a slight depression in the iron vs iron value as compared to the surrounding metals, right? If You remember the Chips and Jams plot, the combination of bolt and metal of the same type gave rise to "jams", a form of injury where the bolt... pushes the bone it hits/breaks into another bone or organ. Like the heart.

So jams (or should I have been calling them jammings?), these strange injuries which only occur in a narrow sweet spot of conditions, can contribute to the death toll due to bleed out due to bones being jammed into the heart occasionally. It follows that metal armors are slightly less effective against bolts made of the same metal. Still, the difference isn't all that great as to change Your dwarfs equipment.

b) I looked at [BODY_DETAIL_PLAN:HUMANOID_RELSIZES] in b_detail_plan_default.txt.
Each body part has a relative size. If you divide the body part's size by the sum of sizes for all external body parts, you get percentages that are very similar to the Vitruvian dwarf (1-5% error for most main body parts, so I get 18.12% for the upper body etc.). This doesn't hold for heads, hands, and feet, but I probably made a calculation mistake when including the fingers, toes, nose, etc.

A quirk of my data extracting program: Although hits to the fingers and toes were labelled as hand and foot hits, respectively, hits to facial feature were not. Hence, the "Other" category. e.g. A nose, ear, eye, eyelid, tongue etc. hit is defined as "Other". Only pure head shots (both fatal brain-tearing ones and those which merely shatter the skull, of tear a muscle) were defined  as hits to the "Head" region.

Yes, arena testing reveals that slade armor is required to "deflect" iron bolts. Less heavy/dense armors don't seem to deflect the blunt damage. Implications unknown at this time.

If nothing else it confirms that relative density of bolt and armor material influence deflection chance. Modders can tweak the size parameter of ammunition to decrease bolt weight and increase deflection in search of more "realistic" projectile behavior.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Wrex on September 09, 2012, 02:52:48 am
I was personally very surprised that shots were actually deflected by eyeballs of all things.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Berossus on September 09, 2012, 05:04:35 am
Impressive, i must say.
I have some additional queries though, and I hope i havent overread what i am going to ask now, if it has already been answered, forgive me.

.) Has the performance of different qualities of bolts been tested?
.) What of mood-crafted non-mundane material bolts like gold?
.) Is material/quality of the crossbow of concern? Does a steel crossbow launch bolts at higher muzzlespeed than lets say a wooden one?
.) Do different material bolts operate at the same level of efficiency for all distances? Or does lets say a steel bolt penetrate better at point blank whereas a silver bolt has higher penetration at higher distance?
.) Is material or quality a factor in accuracy?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: GreatWyrmGold on September 09, 2012, 07:15:19 am
About iron and bronze: Historically, bronze was better than iron. Iron was just more common than say, tin.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on September 09, 2012, 10:32:46 am
...
Here's the interesting part: Take a look at a slice of the AofB part describing how well different bolts do against iron armor:

Spoiler (click to show/hide)

There is a slight depression in the iron vs iron value as compared to the surrounding metals, right? If You remember the Chips and Jams plot, the combination of bolt and metal of the same type gave rise to "jams", a form of injury where the bolt... pushes the bone it hits/breaks into another bone or organ. Like the heart.
...

The image is that of iron bolts vs various armor types, unless you were firing leather bolts.

...
So jams (or should I have been calling them jammings?), these strange injuries which only occur in a narrow sweet spot of conditions, can contribute to the death toll due to bleed out due to bones being jammed into the heart occasionally. It follows that metal armors are slightly less effective against bolts made of the same metal. Still, the difference isn't all that great as to change Your dwarfs equipment.
...

A possible explanation for jamming:
-Regardless of damage type, some body parts have a chance of being around another body part (see [BODY_DETAIL_PLAN:HUMANOID_RIBCAGE_POSITIONS] for an example). The skull is 100% around the brain.
-So you bash around unarmored targets in the arena a lot and get messages like this on occasion: "You bash Dwarf 1 in the upper body with your platinum war hammer, bruising the muscle, jamming the right false ribs through the liver and tearing the liver"
-You then stab unarmored targets in the arena a lot and get messages like this on occasion: "You stab Dwarf 5 in the upper body with your steel short sword, tearing apart the muscle, shattering the right false ribs and tearing apart the liver!"
-I guess that bolts which impact a stronger ("better") armor convert to blunt damage, but some of the energy is absorbed and spread out over a larger contact area. Bolts which completely penetrate armor with lots of energy/momentum to spare will tear and shatter the underlying tissue themselves. However, bolts which just barely penetrate armor (the case where the materials are equal) will deliver focused blunt damage to underlying tissue, and the armor isn't absorbing/spreading any blunt energy.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on September 09, 2012, 11:04:50 am
I was personally very surprised that shots were actually deflected by eyeballs of all things.

Baffles me as well, though it did "glance off", not "deflect", which are different mechanisms, apparently. Also, for every bolt that glanced off tens and hundreds skewered eyeballs, so its not as if they are impervious to projectiles.

1) Has the performance of different qualities of bolts been tested?
2) What of mood-crafted non-mundane material bolts like gold?
3) Is material/quality of the crossbow of concern? Does a steel crossbow launch bolts at higher muzzlespeed than lets say a wooden one?
4) Do different material bolts operate at the same level of efficiency for all distances? Or does lets say a steel bolt penetrate better at point blank whereas a silver bolt has higher penetration at higher distance?
5) Is material or quality a factor in accuracy?

[Numbers added to better identify when answering]

1), 5) - To my knowledge, there is no way of changing quality parameters of items in arena mode (If someone knows otherwise, please chime in). As much as I would love to perform a study on the effects of quality level on crossbow performance, this seems to be an impossible venture - at least on a scale which would produce reliable results. I could train up 10 Marksdwarfs and try to set up a small scale experiment in Fortress mode, but this simply wouldn't be enough to be able to perform even basic statistical analysis and achieve meaningful results.
2) I could have tested standard (as in standard quality) gold, zinc, billon etc. bolts. However, note that a single experiment consisted of 1000 dwarfs firing at another 1000 dwarfs. That means placing 2000 dwarfs per X vs Y experiment. With only the standard materials used for bolts and armor, this gave 8x7=56 experiment blocks = 112'000 dwarfs had to be placed. And while I automated the process to the best of my ability, it still took 3 days to gather the data, and another few to organize it. HOWEVER! if You are interested in how well a particular X vs Y combination does, I can perform it with fairly little effort. I just do not think I will be performing a massive 8x7 study any time soon. As for gold bolts, I predict they would do better than silver due to its higher weight. Note that silver didn't penetrate (i.e. deal more tearing damage than bruising damage) to anything except Leather-armored dwarfs and unarmored dwarfs, so shear yield probably isn't an issue in this case.
3) I can test if crossbow material affects crossbow performance (I've heard it doesn't, buy I have seen no science), but quality tests, as I have explained above, elude my abilities.
4) This is an interesting problem which I would like to test. However, I am constrained by the abilities of the Arena and/or my own knowledge. You see, the current setup works before the defending dwarf is characterized the following properties:
To test larger distances, I would need another setup. To my knowledge, fortification can only be fired through if the marksdwarf is adjacent to the fortification tile (I haven't actually tested this - am I wrong?). So I assume that I can't just put multiple fortification in a line. If I have just one fortification next to the Marksdwarf, and then a line of floor space, then the defender has freedom of movement and can dodge, and also I cannot control the range. I can't put the defender on a tile behind a pit, because dwarfs dodge into pits. The best way would be if I could construct vertical bars in Arena mode. But I cannot. Only walls, fortifications, floors, and various ramps and magma/water tiles. If anyone has any suggestions on the design of a range test using arena mode, I am eager to hear from them.

...
Here's the interesting part: Take a look at a slice of the AofB part describing how well different bolts do against iron armor:

Spoiler (click to show/hide)

There is a slight depression in the iron vs iron value as compared to the surrounding metals, right? If You remember the Chips and Jams plot, the combination of bolt and metal of the same type gave rise to "jams", a form of injury where the bolt... pushes the bone it hits/breaks into another bone or organ. Like the heart.
...

The image is that of iron bolts vs various armor types, unless you were firing leather bolts.

Indeed, it is Iron Bolts against different armor types. I misspoke (and miswrote).

I also agree with Your analysis of the occurrence of jamming. I do still find it interesting that an increase in jamming incidents produces a decrease in chipping incidents by practically the same amount. As I understand it, chipping chiefly occurs for whips and projectiles, due to a combination of small contact area and Blunt damage type? I do find it interesting how all these systems (bolt and armor material, damage absorption by armor, edge-to-blunt conversion) interact with each other.


Also, I am sitting on a considerable amount of data on wound types which I haven't posted - there's simply so much of it. I can upload the Excel file with all gathered data, if there is any interest. Is sharing download links allowed on DF forums?
I also have 240 MB of gamelogs from 56 arena experiments, so if someone would come up with better criteria for weapon performance, I can test it out as long as it pertains to the logs. Unfortunately, excludes criteria based on reload time and such, since logs do not have timestamps counted in game ticks (or any timestamps at all, for that matter)
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: misko27 on September 09, 2012, 11:06:46 am
I was personally very surprised that shots were actually deflected by eyeballs of all things.
Fairly well known in adventure mode, where cheek stabbing barely cuts the skin. It makes sense if you think about it. Since the game doesn't allow multi-bodypart injuries, the expected "into the eye" doesn't occur. Therefore all the damage is limited too how much damage a bolt could do to a eye without even bruising the eyeball. The answer is not much, sometimes none at all, because any attack that would hurt the eyeball was prevented.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: blue sam3 on September 09, 2012, 12:09:48 pm
Quote
To test larger distances, I would need another setup. To my knowledge, fortification can only be fired through if the marksdwarf is adjacent to the fortification tile (I haven't actually tested this - am I wrong?). So I assume that I can't just put multiple fortification in a line. If I have just one fortification next to the Marksdwarf, and then a line of floor space, then the defender has freedom of movement and can dodge, and also I cannot control the range. I can't put the defender on a tile behind a pit, because dwarfs dodge into pits. The best way would be if I could construct vertical bars in Arena mode. But I cannot. Only walls, fortifications, floors, and various ramps and magma/water tiles. If anyone has any suggestions on the design of a range test using arena mode, I am eager to hear from them.

Legendary marksdwarfs ignore fortifications entirely.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: GreatWyrmGold on September 09, 2012, 12:11:23 pm
I think normal crosslords do, too. Markslords?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: rhesusmacabre on September 09, 2012, 12:41:14 pm
Elite marksdwarves. Anything with "accomplished crossbowman" and above (or equivalent).

Also, I am sitting on a considerable amount of data on wound types which I haven't posted - there's simply so much of it. I can upload the Excel file with all gathered data, if there is any interest. Is sharing download links allowed on DF forums?

For this kind of thing, yes. DFFD (http://dffd.wimbli.com/) works well for anything DF related.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: GreatWyrmGold on September 09, 2012, 01:49:59 pm
I like crosslords better.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on September 09, 2012, 02:44:02 pm
I'm wondering what else we can squeeze out of the existing data.

For one type of bolt and one type of armor, what percentage chance is there of each damage description? To simplify, choose one piercing case (Steel bolts vs Copper armor) and one blunt case (Copper bolts vs Steel armor).

I'm trying to determine how likely each individual bolt is to cause a certain type of damage (i.e. brain tear instant death (i.e. BOOM HEADSHOT) is about 0.0528*0.60=0.032 or 3.2% probability). Or even more detailed - for all steel bolts which penetrated copper greaves on the right upper leg, did they all cause the same damage or was there randomness? We can at least detect the presence or absence of extra variables using existing data.

Again, I'm not asking for a new experiment, but to look at the data collected differently.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on September 09, 2012, 04:33:35 pm
I also have independently been studying this phenomenon for several weeks, and my tests have yielded similar results.  I am glad to see that I'm not the only person crazy enough to undertake such a project, and also applaud Zivilin's results.

In addition to confirming Zivilin's results, I think I may have a few additional insights.  First of all, maybe Zivilin has already stated this and I missed it, but I have found that plate armor is completely ineffective against all metal bolts (other than candy vs. candy).  For the following tests, 864 dwarves wearing breastplates, helms, greaves, 2 gauntlets and 2 low boots were placed 2 tiles away from crossbow wielding dwarves (directly behind fortifications).  In my tests the targets are in a large open area, and can dodge [Edit - I added platinum bolts on 9/11/2012]:
Spoiler: Plate Armor Only (click to show/hide)
*note that iron vs. candy and bismuth bronze vs. silver are missing because the DF macro failed to run properly (sometimes a keypress or two is not recognized, at least running Linux).  I can fill those in later if anyone cares.

The first two columns list the metals used for ammunition and armors (if it matters the crossbows are made from the same metal as the ammunition).  All dwarves were great archers/marksdwarves and grand master armor users (with no other skills).  The third column ("hits") is the number of hits against armor, not counting hits to unarmored parts of the body and "kills" are the total number of dwarves killed. 

I wrote a perl script which analyzes gamelog.txt and records separately for each dwarf the number of hits before he is killed ("hits/kill"), first falls over ("hits/fall"), or first falls unconcious ("hits/KO").  Because I counted these separately for each dwarf, I can calculate the error as the standard deviation over all dwarves divided by the square root of the number of dwarves killed/fallen/KO'd.  This will skew the results too low for cases when not all dwarves are killed etc, as it only counts the number of shots needed for those that are killed, and those that survive would presumably take longer, but this is only an issue for candy vs. candy.   

The "%through" and "%deflected" are the percentages of hits against armor which went through or were deflected.  Note that in candy vs. candy the dwarves are still sometimes killed due to hits against unarmored body parts (neck, upper arms, etc), even through the bolts are always deflected.  Finally, to give an idea if the armor was slowing down bolts significantly without deflecting them, I counted up the fraction of hits against armor which causes chipped, fractured or shattered bones or any tears (%serious) compared with the fraction causing only bruises (%non-serious).  100% of the time (again except candy vs. candy) wounds resulted in serious injury.  I will try to perform analysis more similar to Zivilin's on my data, but I literally had everything ready to post on my own and saw, oh dear, somebody else scooped me :P.  So I am just posting what I have for now.

Now to the main point:  I also ran tests with all metals against unarmored targets, and found no significant difference in the number of shots required to kill or incapacitate armored or unarmored dwarves.  At first glance this appears to contradict Zivilin's results, not that I did not include chainmail for this test.  I had previously run tests with a chainmail shirt added to a breastplate, greaves, helm, gloves, and low boots for armored dwarves, with the following results [Edit - I added platinum bolts on 9/11/2012]:
Here, we see results similar to Zivilin's.  If the armor material is equal to or better than the bolt material (with candy>steel>iron=bronze=b.bronze>copper>silver), then there is a modest but significant increase the the survival of the targets.  More strikingly, there is a 30% chance (except for candy vs. candy and silver vs. silver) that the target receives only bruises from the hit.  With candy vs. candy things are more complicated, as the plate armor also deflects 100% of hits to protected areas, and I'm not sure why there is a difference with silver vs. silver.

Furthermore, I ran a test of steel vs. steel with dwarves wearing only a mail shirt and pants, and found that the rate of nonserious wounds increased to 37%.  Wearing 3 chainmail shirts did not further reduce serious wounds.  I will run a full test of dwarves in only chainmail overnight tonight.

I did run a test of dwarves with mail shirts, breastplate, helm, greaves, gauntlets and low boots (same as above) at a starting distance of 20 tiles from the shooters, but found no significant differences.  I can post the complete results if anyone really wants to see.

Bottom line - plate armor does nothing against bolts, and chainmail provides modest protection against them.  This is quite the opposite of what I would have expected.

I have also been pursuing adjusting the force of crossbows such that a more reasonable number of deflections occurs.  I found no difference in deflections or survival at Force=100 (standard Force=1000), and 90% deflection off equal or better metals (as define above) for Force=10.  For Force=42, there is 20-30% deflection off of steel, with heavier metals deflecting less, and 90% deflection off of candy, and no deflection off other metals.  In all cases where there was no deflection, even with Force=10, the survival rate did not change significantly.  For all these tests dwarves were wearing a full suit of armor with chainmail, as above.  Given that deflections max out at 90%, and the remaining 10% is the area covered by chainmail but not plate, I suspect that the all deflections are coming from plate armor and not chain mail, but I need to verify this.  I will post further results in this area soon.  I am hoping to find an optimum crossbow force that allows a reasonable fraction (but not 100%) of crossbow bolts to deflect off of superior armor.

I may also investigate decreasing the mass of DF bolts somewhat.  By comparing the masses of other DF weapons and armor to masses of real world objects, I estimate that one DF bolt/arrow weighs about 500 grams.  The largest weight I've found for a bolt/arrow online is ~100g.  I think the excess weight of bolts is a well known problem, so I don't think it's worth discussing here, other than as a possible parameter to tune to achieve more realistic projectile behavior.

Edit: I have posted the scripts etc. used for this testing to DFFD (http://dffd.wimbli.com/file.php?id=6895).  If anyone really wants to see all the logs, I can post that too, but its over 30 MB.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on September 09, 2012, 06:36:12 pm
I'm wondering what else we can squeeze out of the existing data.

For one type of bolt and one type of armor, what percentage chance is there of each damage description? To simplify, choose one piercing case (Steel bolts vs Copper armor) and one blunt case (Copper bolts vs Steel armor).

I'm trying to determine how likely each individual bolt is to cause a certain type of damage (i.e. brain tear instant death (i.e. BOOM HEADSHOT) is about 0.0528*0.60=0.032 or 3.2% probability). Or even more detailed - for all steel bolts which penetrated copper greaves on the right upper leg, did they all cause the same damage or was there randomness? We can at least detect the presence or absence of extra variables using existing data.

Again, I'm not asking for a new experiment, but to look at the data collected differently.

I can compile this information. This might take longer though depending on the level of detail required. For example, the head was easy:

| Tear| Fracture| Upper Spine Tear| Brain Tear| Total
Steel vs Copper| 4| 51| 198| 397| 650
Copper vs Steel| 4| 45| 301| 575| 925

Or, in percentage terms:

| Tear| Fracture| Upper Spine Tear| Brain Tear
Steel vs Copper| 0.62%| 7.85%| 30.46%| 61.08%
Copper vs Steel| 0.43%| 4.86%| 32.54%| 62.16%

This works because there are effectively only 4-5 injury messages:

Tear Muscle -> Fracture/Shatter Skull -> Tear Brain
            -> Tear Upper Spinal Nervous Tissue

However, other body parts have additional complexity: Upper legs and arms have hip bones and shoulder bones, hands and feet have finger and toes, and the upper body is a mess of ribs and organs. A single shot can shatter a [true/false/floating] rib and tear a [right lung/left lung/liver/stomach/gut/heart] - so there is a large combination of variables there.

I would suggest this, at least for the upper body: classify all types of ribs as a generic "rib" and all organs as a generic "organ". Then verify the number of time a shot caused terms such as "fracturing [generic rib] and tearing [generic organ]" or "chipping [generic rib] and bruising [generic organ]" and so on. Perhaps treat the heart separately, due to the lethal effects of it tearing.

[...]

Sorry for stealing Your thunder. If I had known this line of research was already being pursued I probably would have directed my efforts elsewhere :P But it is good to have confirmation that we have similar results. And I wouldn't have though that most of the damage damping effect is solely due to chain mail. I'll be looking forward to your results on those armor deflection tests as well.

Concerning the tests made from a distance of 20 tiles, how did You perform those, exactly? Did You use a row of fortifications and Elite Marksdwarfs, who can ignore fortifications according to the previous posters?

This my link (http://dffd.wimbli.com/file.php?id=6894) to the processed data from my experiments. I think they can be easily transformed to represent your %serious, %non-serious, %deflected and %through. I don't really have the hits/fall and only somewhat of hits/KO. I also didn't gather values on individual dwarfs, so You can't gather standard deviation from my results (I could tweak by script a bit to get them, though. It would take some time)
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on September 09, 2012, 07:42:28 pm
Sorry for stealing Your thunder. If I had known this line of research was already being pursued I probably would have directed my efforts elsewhere :P But it is good to have confirmation that we have similar results.
I am actually quite thrilled that you have been looking into this as well.  This is my first !!SCIENCE!! project, so I am very glad that someone with much more experience with DF mechanics tested this.  Before seeing your thread I was kind of worried that it might be difficult to convince people of the validity of my results.

As for the 20 tile tests, I just used a layout like this:
...
MF..................TP
MF..................TP
MF..................TP
...
where "M" is the marksdwarf, and "T" is the target.  I set up rows like this from top to bottom.  There is nothing stopping the targets from dodging or moving closer to the shooters, but they don't tend to move much as they fall over in less than 2 hits.  Still, when I say "2" or "20", those distances are approximate.  "2" is actually probably much worse, as the shooters can attack targets say 2 over, but 18 down.  I should probably put in walls so that it's 1v1.  It's on my "to do" list, but I won't get to it for a while, so if you wanted to do that let me know.

I will have a look at your processed data when I get the chance.  I kept the raw gamelogs for mine, so it might actually be easier to analyze my data using your methods, as your analysis seems more detailed in most respects.  If you're interested, I can post the gamelog files (>30 MB) or you could show me how to do your analysis if you prefer. 
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Hans Lemurson on September 09, 2012, 07:43:48 pm
I think your data clearly show that the "Totally Overpowered" nature of Crossbows lies in their ability to deliver incapacitating bruises under any circumstances.

Material matters so little in the realm of causing an injury because the non-penetrating impacts act as though the target had been hit by a sledge-hammer.

Crossbows are like freaking hammer-guns or something.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on September 09, 2012, 09:18:33 pm
Looking at the excel data, I can verify that 3.2% of survivors die per volley for volleys 1-5 in the blunt damage cases. In the piercing/tearing damage cases, an additional percentage (1.8%?) die 2 volleys after they are hit in the heart/throat and bleed out. Also in both cases an additional percentage (1.8% again?) suffocate 5 volleys after a spinal hit.

...
I can compile this information. This might take longer though depending on the level of detail required.
...

I don't think I need the info, since it appears that there is no chance of getting "just a flesh wound" on an important body part.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on September 09, 2012, 09:50:46 pm
I think your data clearly show that the "Totally Overpowered" nature of Crossbows lies in their ability to deliver incapacitating bruises under any circumstances.

Material matters so little in the realm of causing an injury because the non-penetrating impacts act as though the target had been hit by a sledge-hammer.

Crossbows are like freaking hammer-guns or something.
I would say this is only partly true.  It is true that if you are wearing chainmail you get terrible bruises etc.  The problem is that bolts go through plate armor like it's not even there.  They react sort of reasonably to chainmail (I wouldn't expect chainmail to be that effective against bolts anyway).  I need to redo my analysis to make this more clear (something more like Zivilin's), but if dwarves are wearing only plate armor, they get no bruises - all chips, tears, fractures, etc.  There are no bruises because the bolts are not slowed down at all by the armor, and instead cause tears, or worse...

@Urist Da Vinci
Quote
I don't think I need the info, since it appears that there is no chance of getting "just a flesh wound" on an important body part.
I'm not sure what you mean by "just a flesh wound", but I definitely see cases where bolts cause only bruises.  For example:
Code: [Select]
The flying {copper bolt} strikes Dwarf 580 in the lower body, bruising the muscle and bruising the guts through the small adamantine greaves!I don't know how bad bruising guts is?  I guess on the next line the dorf got sick, so maybe kind of bad?  There are also many cases where the heart/lungs/kidneys etc are bruised, which is probably not so good, but maybe not immediately fatal/incapacitating?  I'm not sure.

I definitely DO agree that part of the problem is the momentum of bolts is just ridiculously unrealistically high.  I think this is partly because bolts are too massive, and largely because the force applied by crossbows is too high.  I will investigate the force part more this week, but as I've already posted it is definitely possible to adjust it so that bolts become less deadly to armored dorfs - I'm just not sure if its possible to make it "reasonable", without completely nerfing bolts.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: omg_scout on September 10, 2012, 02:17:38 am
I find these results to be highly disappointing.

TL;DR : use any metal bolts vs armoured oponents, and pretty much anything vs unarmoured opponents.

IRL there are arrows and *ARROWS*, which makes the difference between killing the target of bouncing off his armour. Or even completely missing him. Also there are crossbows and CROSSBOWS, just look at modern military crossbows which are as deadly as professional sniper riffles, while waek ones barely kill a rabbit. And in df no matter what you shoot and no matter what you shoot with, just shoot. Shhoting anything but copper or silver is a waste of good metal. Good you make studies like that, maybe Toady will change some values a bit, to make some differences.

BTW from reallife ballistic point of view silver bolts would be useless.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: MaximumZero on September 10, 2012, 02:22:27 am
Holy ‼SCIENCE‼, Batman!
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Sus on September 10, 2012, 04:05:03 am
This, indeed, is ☼Science☼.
Of course, as an engineering major, I'm mostly interested in the practical applications, i.e. optimal bolt-making materials, which seem to be silver and steel (the latter being much more resource intensive).
Conclusion: Silver is the optimal material for bolts in terms of both availability and damage potential.1) (Fake) bone seems an adequate supplement, although the results are, of course, only approximate in that case.

In any case, I salute your impressive statistical analysis.
♪ so the ‼Science‼ gets done
and you make some neat *silver bolts [20]*
for the dorfs that are
Still Alive...♫

1) This seems to be a significant deviation from real-world physics, where iron and bronze are far superior bolt materials. Steel, of course, is quite effective in real life as well.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on September 10, 2012, 06:13:20 am
As for the 20 tile tests, I just used a layout like this:
...
MF..................TP
MF..................TP
MF..................TP
...
where "M" is the marksdwarf, and "T" is the target.  I set up rows like this from top to bottom.  There is nothing stopping the targets from dodging or moving closer to the shooters, but they don't tend to move much as they fall over in less than 2 hits.  Still, when I say "2" or "20", those distances are approximate.  "2" is actually probably much worse, as the shooters can attack targets say 2 over, but 18 down.  I should probably put in walls so that it's 1v1.  It's on my "to do" list, but I won't get to it for a while, so if you wanted to do that let me know.

I would think that doing it 1vs1 would produce more reliable results - it eliminates some randomness from the experiment. I shall be directing my time now towards testing the effect of Marksdwarf/Archer skills on crossbow performance. Some of my preliminaries have been quite surprising...

I think your data clearly show that the "Totally Overpowered" nature of Crossbows lies in their ability to deliver incapacitating bruises under any circumstances.

Material matters so little in the realm of causing an injury because the non-penetrating impacts act as though the target had been hit by a sledge-hammer.

Crossbows are like freaking hammer-guns or something.

In light of Pirate Bob's revelation about plate armor and chain mail, I redid two Copper vs Steel experiments, only one had defender dwarfs equipped with steel caps instead of helms, and the other had 6 hoods in addition to a steel helm (like the wiki Armor page advises).

There was no significant difference in the results: around 60+% of headshots cause brain tear, 30+% cause upper spinal tear, there is around 5% of skull fractures and single incidents of only muscle tears - same as helms only. It seems that head gear offers practically no protection against projectiles. Only when the materials deflect (e.g. wood/bone vs candy) do these percentages change.

So it seems You are largely correct, since any non-deflecting bolt has the same chance of getting a headshot and killing the dwarf. The chainmail factor protects from heart tears and throat tears (converting them to heart bruises and throat bruises), but there is no such way to protect the head. Only deflections can save dwarven heads, and these practically never occur in regular circumstances.

TL;DR : use any metal bolts vs armoured oponents, and pretty much anything vs unarmoured opponents.

The definitive conclusion of this study, really :P I should have used that as the title.

Conclusion: Silver is the optimal material for bolts in terms of both availability and damage potential. (Fake) bone seems an adequate supplement, although the results are, of course, only approximate in that case.

It depends on the map, in the end. I always seem to find copious amounts of tetrahedrite, so I'll usually be going all copper in the ammunition department. I prefer to keep the silver for high value furniture/crafts, and silver doesn't have all that large of an advantage over copper (also, with tetrahedrite I have 4 times less silver than copper :P )
 
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on September 10, 2012, 07:01:14 am
I would think that doing it 1vs1 would produce more reliable results - it eliminates some randomness from the experiment.
I agree totally that 1v1 is more reliable, and I will update my testing arena to allow for this when I get the chance.  Unfortunately this means rewriting all my macros, which is non-trivial...

there is no such way to protect the head. Only deflections can save dwarven heads, and these practically never ever ever occur in regular circumstances.
I think between us we have recorded ~10 million hits, and say maybe a million of these to the head, and never seen a single deflection of metal bolts.  I think this is close enough to 5 sigma that we can just say "never" :P.

Also, to state more explicitly what you're saying, chainmail does not cover the head, just the neck, ears, and maybe face?  It definitely doesn't protect the brains.  Even if it did, it would probably just convert "fracturing the skull and tearing the brain" into "jamming the skull and bruising the brain". 

Since we're talking about chainmail, I have partial results for dwarves wearing only chainmail:
Of those hits on armored areas, about 38% are converted to bruises, provided the armor is equal or better than the bolts.  Note that wearing only chainmail doesn't improve its effectiveness - because I only record %(non)serious for armored areas, I get %30 for fully armored dwarves with mail shirts as many of the hits to armor hit areas covered by plate but not chainmail.  Given my results to date, I propose that the best equipment for dwarves might be helm, breastplate, mail shirt, mail leggings, gauntlets and low boots.  I do not know how mail leggings would compare to greaves for melee combat, but they are clearly better (but still don't really do that much) against arrows, and are also much lighter.  Also, presumably high boots are preferable, but not readily available in fortress mode.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Hans Lemurson on September 10, 2012, 08:16:22 am
Wait, so am I understanding this correctly that your results indicate that wearing a Breastplate over Chainmail actually offers a NEGATIVE protection value against bolts?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on September 10, 2012, 10:45:53 am
Wait, so am I understanding this correctly that your results indicate that wearing a Breastplate over Chainmail actually offers a NEGATIVE protection value against bolts?
No, that is not correct, but I'm glad you asked.  Plate armor does nothing against bolts, but also is not negative. 

My data is somewhat confusing, because I only count %(non)serious hits against armored areas.  When dorfs are wearing full plate (breastplate, helm, boots, gauntlets, greaves), there are areas which are covered by plate, but not chainmail.  These get counted in my tallying of serious/nonserious wounds through armor, and bias the results towards more serious wounds.  I tried to explain this in my post about the chainmail only data, but I guess I wasn't clear enough.

I really need to analyze the %(non)serious as a function of body part, more like what Zivilin has done, so that it is clearer that in both cases areas protected by chainmail have some damage reduction, and that plate provides no protection.  Unfortunately its not as simple as just looking at which armor is penetrated in the logs, as it only lists one of the armors in cases where there are multiple layers, but it can be worked out from recording hits vs body part.

My current hypothesis is that chainmail converts edged damage into blunt damage if it is made from an equal or better material than the bolt.  I'd like to test this by modding bolts to do blunt damage and compairing with hits vs. chainmail at some point, but I probably won't get to this for a while.

I suspect that plate armor has a chance to deflect a blow if it is made from equal or better material and if the momentum/energy/??? of the blow is not too high.  Currently metal bolts are way too high.  I am unsure if metal armor does anything to limit the penetration of the bolt if it is not deflected.  I have some initial data suggesting it might, but again not enough to slow down supersonic javelins :P.

Regarding the bolt momentum/energy, as I indicated above, I estimate that DF bolts weight about 500 grams by comparing the weights of weapons/armors with their real world counterparts, however the weight wiki page (http://dwarffortresswiki.org/index.php/Weight) suggests that weight in Urist is equal to weight in kg, and I have confirmed that steel bolts weight 1.17 urists (117 for a stack of 100).  Does anyone know if it is true that urists=kg?  In either case this is VERY heavy for a bolt/arrow.  The bolt velocity is determined by the [SHOOT_FORCE:1000] and [SHOOT_MAXVEL:1000]  of [ITEM_WEAPON:ITEM_WEAPON_CROSSBOW].  My testing indicates that you have to reduce [SHOOT_FORCE] below 100 to have any impact on performance, which suggests that all bolt speeds are determined by [SHOOT_MAXVEL:1000] with the 34.11 parameters.  This would help explain why heavy (silver) bolts seem to perform slightly better than lighter bolts.  Note that I have not carefully confirmed this yet, so it's possible that the speed does change at higher forces but just not in a way I can detect.  Anyway, I am curious if anyone has any idea what a velocity of 1000 means in DF?  Toady had indicated "This is just to make sure a near-weightless object doesn't go faster than the string could possibly go", so it seems like it must be very fast.  Are the units tiles/tick, meters/second, urists/break?  If they are in some strange units, is there a way to convert to real-world units?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: MaximumZero on September 10, 2012, 12:30:55 pm
I wonder what the outcome would be if you used modded metals? Given lead's density, it may be hellaciously damaging (it always seems to be in my games.) Platinum should have the same effect, but moreso. Aluminum, being light and stiff, would probably turn out like candy...

[/musing]
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: andycyca on September 10, 2012, 01:25:24 pm
Hi everyone. Someone linked me to look at this study and I, having nothing better to do, typesetted it in LaTeX. Then someone suggested me to show this to the author, so here it is! (http://dl.dropbox.com/u/2891221/DF%20study%202.pdf).

(I also did the last one by OP (http://dl.dropbox.com/u/2891221/DF%20study.pdf)) I like your style, keep it up!
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on September 10, 2012, 02:29:21 pm
I wonder what the outcome would be if you used modded metals? Given lead's density, it may be hellaciously damaging (it always seems to be in my games.) Platinum should have the same effect, but moreso. Aluminum, being light and stiff, would probably turn out like candy...

[/musing]
It is my suspicion that using lead/platinum won't make much difference, as at standard metal bolts already have enough momentum to pierce (or viciously bruise, if going through chainmail) vital organs.  I actually imagine standard metal bolts going right through the dorfs and out the other side in the absence of chainmail, so making them go further out the other side should have no effect :P.

Maybe it will somewhat reduce the (modest) protection dwarves get from wearing chainmail?  I will have to test it...
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Nyxalinth on September 10, 2012, 05:12:47 pm
awesome!  Do you study this stuff for school/use it for work?

I'm not mathy enough to do this sort of thing, but I respect anyone who can and does.

Great info to have.  So overall, it's better to have crap armor like leather or copper than none at all, but you want to replace crap ASAP, which was my near-downfall recently.  I had tons of copper weapons, and my dorfs barely dented invading gobbos. If it hadn't been for the caravan, I'd have been wiped out.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: GreatWyrmGold on September 10, 2012, 06:27:47 pm
This, indeed, is ☼Science☼.
Of course, as an engineering major, I'm mostly interested in the practical applications, i.e. optimal bolt-making materials, which seem to be silver and steel (the latter being much more resource intensive).
Conclusion: Silver is the optimal material for bolts in terms of both availability and damage potential.1) (Fake) bone seems an adequate supplement, although the results are, of course, only approximate in that case.

In any case, I salute your impressive statistical analysis.
♪ so the ‼Science‼ gets done
and you make some neat *silver bolts [20]*
for the dorfs that are
Still Alive...♫

1) This seems to be a significant deviation from real-world physics, where iron and bronze are far superior bolt materials. Steel, of course, is quite effective in real life as well.
...Damn you, I just got that out of my head. Portal does have a lot of parallels to DF, though...
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: MaximumZero on September 10, 2012, 08:43:17 pm
I wonder what the outcome would be if you used modded metals? Given lead's density, it may be hellaciously damaging (it always seems to be in my games.) Platinum should have the same effect, but moreso. Aluminum, being light and stiff, would probably turn out like candy...

[/musing]
It is my suspicion that using lead/platinum won't make much difference, as at standard metal bolts already have enough momentum to pierce (or viciously bruise, if going through chainmail) vital organs.  I actually imagine standard metal bolts going right through the dorfs and out the other side in the absence of chainmail, so making them go further out the other side should have no effect :P.

Maybe it will somewhat reduce the (modest) protection dwarves get from wearing chainmail?  I will have to test it...
I was more thinking about the ability to punch through breastplates.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on September 10, 2012, 08:53:49 pm
I wonder what the outcome would be if you used modded metals? Given lead's density, it may be hellaciously damaging (it always seems to be in my games.) Platinum should have the same effect, but moreso. Aluminum, being light and stiff, would probably turn out like candy...

[/musing]
I ran platinum bolts vs. steel (helm, breastplate, chainmail, greaves, gauntlets, low boots), and found that it took only 14.4+/-0.4 hits to kill each dwarf and that all hits resulted in serious injuries (none just bruises).  So it appears your suggestion is correct, and they do in fact do significantly more damage.  They also don't seem to be slowed down much, if at all, by chainmail.  I'll do a full run soon...
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Blakmane on September 10, 2012, 11:39:42 pm
This is absolutely fantastic...

Out of interest, what are the variances/SEMs on your samples? A lot of people are talking about silver being better than iron/steel, but to me that doesn't look like it would achieve significance if you ran an ANOVA on it. Still an interesting result regardless: I had assumed silver would be a poor quality material but it is as good, if not better, than the big players.

Also, just an idea for automation: instead of setting your experiments up labouriously by hand, I wonder how easy it would be to create a macro which ran individual experimental sets on repeat, exporting the combat log in between runs. That way you could just leave the computer on and let it run for hours/days, coming back only to adjust the macro for the next condition. That'd vastly improve your sample size and reduce your workload.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: MaximumZero on September 10, 2012, 11:51:10 pm
I wonder what the outcome would be if you used modded metals? Given lead's density, it may be hellaciously damaging (it always seems to be in my games.) Platinum should have the same effect, but moreso. Aluminum, being light and stiff, would probably turn out like candy...

[/musing]
I ran platinum bolts vs. steel (helm, breastplate, chainmail, greaves, gauntlets, low boots), and found that it took only 14.4+/-0.4 hits to kill each dwarf and that all hits resulted in serious injuries (none just bruises).  So it appears your suggestion is correct, and they do in fact do significantly more damage.  They also don't seem to be slowed down much, if at all, by chainmail.  I'll do a full run soon...
Oooooh, thank you very much!

I wonder if you could do it with slade? :P
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Emufarmers on September 11, 2012, 01:30:55 am
I registered for these forums just to post how awesome this is.  Faith in humandwarfity restored, etc.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on September 11, 2012, 05:50:52 am
Hi everyone. Someone linked me to look at this study and I, having nothing better to do, typesetted it in LaTeX. Then someone suggested me to show this to the author, so here it is! (http://dl.dropbox.com/u/2891221/DF%20study%202.pdf).

(I also did the last one by OP (http://dl.dropbox.com/u/2891221/DF%20study.pdf)) I like your style, keep it up!

Splendid! Now I just need to find a DF research paper to publish these in :P

awesome!  Do you study this stuff for school/use it for work?

What, crossbow performance analysis? That would be one fun school project/job! :P If You mean setting up objective experiments, defining useful criteria and performing very very basic statistical analysis, then yes, these are the things which go into standard college-level reports (except the statistical analysis, which should be much better then what I have)

I wonder what the outcome would be if you used modded metals? Given lead's density, it may be hellaciously damaging (it always seems to be in my games.) Platinum should have the same effect, but moreso. Aluminum, being light and stiff, would probably turn out like candy...

[/musing]
I ran platinum bolts vs. steel (helm, breastplate, chainmail, greaves, gauntlets, low boots), and found that it took only 14.4+/-0.4 hits to kill each dwarf and that all hits resulted in serious injuries (none just bruises).  So it appears your suggestion is correct, and they do in fact do significantly more damage.  They also don't seem to be slowed down much, if at all, by chainmail.  I'll do a full run soon...

That is interesting, because up until now bolt material had to have a significantly larger shear yield than armor material in order to cause tears: All bolts tore unarmored and leather, bronze/iron and higher tore copper, only steel and candy tore iron/bronze, and only candy tore steel. I suppose it is logical that weight also plays a role in this.

Out of interest, what are the variances/SEMs on your samples? A lot of people are talking about silver being better than iron/steel, but to me that doesn't look like it would achieve significance if you ran an ANOVA on it. Still an interesting result regardless: I had assumed silver would be a poor quality material but it is as good, if not better, than the big players.

Unfortunately, I opted for a very simple way of obtaining my means of arrows fired: counting all occurrences of "the flying" in the gamelog and then dividing it by the number of dwarfs which took part in the experiment. So I do not have direct access to standard deviation/SEM data, and I cannot perform ANOVA. I agree that silver-iron or silver-steel comparisons would probably result in ANOVA reporting borderline significance at best. That is why the conclusion of my study is "use any metal (except candy) against metal armor, and anything against unarmored opponents".

I can make a crude estimate on the SEM value of the Average of Fired Bolts (AofB). The AofB of most tests was around 13-18. I think it is safe to assume a standard deviation of no more than 25. This would mean that 95% of all bolts fall within <18-50,18+50> -> <0,68> (since You can't use up negative numbers of bolts). SEM = standard deviation divided by the square root of samples. There were 1000 samples per experiment. square root of 1000 = around 31. SEM = 25/31 = around 0.8. So an AofB derived from 1000 samples has a 95% chance to find itself within 1.6 of the true mean, assuming that the standard deviation of the samples is 25.

Hopefully I haven't made some obvious mistake along the way.

Also, just an idea for automation: instead of setting your experiments up labouriously by hand, I wonder how easy it would be to create a macro which ran individual experimental sets on repeat, exporting the combat log in between runs. That way you could just leave the computer on and let it run for hours/days, coming back only to adjust the macro for the next condition. That'd vastly improve your sample size and reduce your workload.

Both me and Pirate Bob did use macros. Mine is a fairly simple keyboard macro and I use it to set up a 1000 dwarfs at a time. Then I change their equipment to that of the defender and run it again. Each run is about 2 minutes. After everything is set I unpause the game and wait 5-10 minutes for the slaughter to end, then copy the gamelog to its own "Y vs X" text file, which I can then run data extraction scripts on. Mine is a crude setup, but it works fairly well. I was wondering how Pirate Bob's data gathering works - it seems on a much higher level.

I registered for these forums just to post how awesome this is.  Faith in humandwarfity restored, etc.

I am honored that our research could evoke such drastic action :)
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on September 11, 2012, 07:29:56 am
awesome!  Do you study this stuff for school/use it for work?
I recently earned a Ph.D. in physics, but I'm not sure how relevant that is to "this stuff" :P. 

I wonder what the outcome would be if you used modded metals? Given lead's density, it may be hellaciously damaging (it always seems to be in my games.) Platinum should have the same effect, but moreso. Aluminum, being light and stiff, would probably turn out like candy...

[/musing]
I ran platinum bolts vs. steel (helm, breastplate, chainmail, greaves, gauntlets, low boots), and found that it took only 14.4+/-0.4 hits to kill each dwarf and that all hits resulted in serious injuries (none just bruises).  So it appears your suggestion is correct, and they do in fact do significantly more damage.  They also don't seem to be slowed down much, if at all, by chainmail.  I'll do a full run soon...

That is interesting, because up until now bolt material had to have a significantly larger shear yield than armor material in order to cause tears: All bolts tore unarmored and leather, bronze/iron and higher tore copper, only steel and candy tore iron/bronze, and only candy tore steel. I suppose it is logical that weight also plays a role in this.
I was also surprised by this for exactly the reasons you stated.  It is also possible that platinum bolts aren't causing tears through chainmail, but rather always result in chipped/broken bones due to the high force.  I will investigate this further.

Out of interest, what are the variances/SEMs on your samples? A lot of people are talking about silver being better than iron/steel, but to me that doesn't look like it would achieve significance if you ran an ANOVA on it. Still an interesting result regardless: I had assumed silver would be a poor quality material but it is as good, if not better, than the big players.

Unfortunately, I opted for a very simple way of obtaining my means of arrows fired: counting all occurrences of "the flying" in the gamelog and then dividing it by the number of dwarfs which took part in the experiment. So I do not have direct access to standard deviation/SEM data, and I cannot perform ANOVA. I agree that silver-iron or silver-steel comparisons would probably result in ANOVA reporting borderline significance at best. That is why the conclusion of my study is "use any metal (except candy) against metal armor, and anything against unarmored opponents".

I can make a crude estimate on the SEM value of the Average of Fired Bolts (AofB). The AofB of most tests was around 13-18. I think it is safe to assume a standard deviation of no more than 25. This would mean that 95% of all bolts fall within <18-50,18+50> -> <0,68> (since You can't use up negative numbers of bolts). SEM = standard deviation divided by the square root of samples. There were 1000 samples per experiment. square root of 1000 = around 31. SEM = 25/31 = around 0.8. So an AofB derived from 1000 samples has a 95% chance to find itself within 1.6 of the true mean, assuming that the standard deviation of the samples is 25.

Hopefully I haven't made some obvious mistake along the way.
This is totally correct, and your estimate of a standard deviation of 25 is quite reasonable.  I record the number of hits on each dwarf individually and then from this calculate the standard deviation and then divide by the square root of the number of dwarves.  From this I get SEM of 0.5 to 0.8, depending on the individual experiment.  Your SEM might be a bit higher for the wood/bone bolts, as it tends to be proportional to the total number of hits.

One note - since you are counting "the flying", you are actually recording the number of hits on dwarves, not the number of bolts fired.  It is likely there are few misses in your setup, but these are not recorded in any way in the gamelogs. 

Also, just an idea for automation: instead of setting your experiments up labouriously by hand, I wonder how easy it would be to create a macro which ran individual experimental sets on repeat, exporting the combat log in between runs. That way you could just leave the computer on and let it run for hours/days, coming back only to adjust the macro for the next condition. That'd vastly improve your sample size and reduce your workload.
Both me and Pirate Bob did use macros. Mine is a fairly simple keyboard macro and I use it to set up a 1000 dwarfs at a time. Then I change their equipment to that of the defender and run it again. Each run is about 2 minutes. After everything is set I unpause the game and wait 5-10 minutes for the slaughter to end, then copy the gamelog to its own "Y vs X" text file, which I can then run data extraction scripts on. Mine is a crude setup, but it works fairly well. I was wondering how Pirate Bob's data gathering works - it seems on a much higher level.
The scripts and macros I use are posted on DFFD (http://dffd.wimbli.com/file.php?id=6895).  Anyone (and especially Zivilin) should feel free to use/modify them if they desire.  It sounds like Zivilin needs some Dwarven graduate students if he is setting up each experiment individually :P.

I also started with just keyboard macros within DF.  I assume that Zivilin also figured out that one needs to manually trim out most of the superfluous commands to get the macros to run quickly.  I also found I needed to delete most of the non-dwarf creatures from the raws to speed things up.  I then wrote a perl script which modifies the raws, copies gamelog.txt to another file named with the armor/ammo used, and then sends keypresses to DF to start the next macro run.  This allows me to run a complete set of armor vs. ammo combinations with no user input.  Unfortunately the keypress part is Linux specific, but I'm sure there's something equivalent for windows if someone wants to figure it out.

My analysis also uses a perl script, and makes heavy use of perl's regular expressions to parse the log files.  In summary, scans through each line of the log, and if it contains "flying", it checks the dwarf number in the same line, and increments the number of hits on that dwarf.  Then, when it finds a death/unconcious/falls over for that dwarf, it sets the appropriate entry to the number of hits on that dwarf so far, and locks that category (so that it only counts the first unconcious/falls over).  For armor effectiveness, looks for the word "through" in each line, and if it's there, then checks for which injuries resulted, and if there were deflections.  I can post a heavily commented version of the script later if people are interested in understanding exactly how the code works, but I don't have time right now.

I registered for these forums just to post how awesome this is.  Faith in humandwarfity restored, etc.
I am honored that our research could evoke such drastic action :)
I also am similarly honored if my small contribution to this work played any part in your decision.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: MaximumZero on September 11, 2012, 08:21:22 pm
Wow. You guys are freakin' awesome. Keep up the good work, noble ‼SCIENTISTS‼
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on September 11, 2012, 10:36:41 pm
I have added platinum bolts vs. all metal armors with and without chainmail to my first post on page 3 of this thread.  They are significantly more deadly that all other bolts, presumably due to their high density.  Thanks for suggesting this MaximumZero!  I am working on slade...
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Oaktree on September 12, 2012, 01:40:03 am
This thread is explaining why my dwarf casualties seem to be fairly low compared to other forts I read about.  I keep my military cooped up when the goblins bring archer squads - until after the traps and/or my marksdwarves chop them up a bit.  And then when I do attack them with melee troops I minimize their effectiveness by attacking from a short line-of-sight (they get 1-2 shots off max) and prefer to use well-trained squads with good shield use, dodge, and/or armor use skills.

And as mentioned in the starting posts of the thread probably the most efficient of crossbow fire is suppressive.  If melee troops go in and start coup de gracing unconscious or crippled targets the marksdwarves shift fire to others instead of spending 15-20 bolts on a single goblin.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on September 12, 2012, 05:39:54 am
I wonder what the outcome would be if you used modded metals? Given lead's density, it may be hellaciously damaging (it always seems to be in my games.) Platinum should have the same effect, but moreso. Aluminum, being light and stiff, would probably turn out like candy...
[/musing]
I ran platinum bolts vs. steel (helm, breastplate, chainmail, greaves, gauntlets, low boots), and found that it took only 14.4+/-0.4 hits to kill each dwarf and that all hits resulted in serious injuries (none just bruises).  So it appears your suggestion is correct, and they do in fact do significantly more damage.  They also don't seem to be slowed down much, if at all, by chainmail.  I'll do a full run soon...
That is interesting, because up until now bolt material had to have a significantly larger shear yield than armor material in order to cause tears: All bolts tore unarmored and leather, bronze/iron and higher tore copper, only steel and candy tore iron/bronze, and only candy tore steel. I suppose it is logical that weight also plays a role in this.
I was also surprised by this for exactly the reasons you stated.  It is also possible that platinum bolts aren't causing tears through chainmail, but rather always result in chipped/broken bones due to the high force.  I will investigate this further.

If You saw my chips/jams plots, almost all X vs Y combinations have an identical percentage of chips (just under 50%). The exceptions are when the materials are the same, giving rise to jams, and when there are a lot deflections. If You found chips were higher than 50%, this would be an interesting result.

However, I do not think this would contribute to a higher death rate. By now I think it is very apparent that a ranged weapon (and probably any weapon in DF) can only cause semi-immediate death (infections and the like are not included) by hitting a particular body part with sufficient force. Lethal hits for the crossbow are limited to the head (by brain tear and upper spine tear/bruising), throat (tearing it) and upper body (middle spine tearing bruising or heart tearing). The probability of killing a dwarf is virtually the same as the probability of hitting any of these spots with lethal force. We know that generally, bolts made of materials "better" than the armor do better, because they have access to throat and heart tearing, whilst bolts made of materials worse than the armor do not, and can only cause brain or upper/middle spine damage.

I think the question here would be: why does very heavy platinum require significantly less hits to kill a dwarf, on average? What damage type is increased? My current theory would be that the small percentage of fractures of skull (around 5% of all hits to the head for most bolts) is completely eliminated, turning it into lethal damage (brain/spine tear).

Another, similar idea would be to analyze why candy bolts have such an... average AofB, worse than "better bolts vs worse armor", but better than "worse bolts vs better armor". Candy bolts must be doing less damage to one of the critical regions for this to occur.

One note - since you are counting "the flying", you are actually recording the number of hits on dwarves, not the number of bolts fired.  It is likely there are few misses in your setup, but these are not recorded in any way in the gamelogs.

Indeed? Then I assume You refer to situations where a bolt is fired and doesn't land on the tile occupied by the target dwarf? Because i do have messages "The flying {MATERIAL bolt} misses Arena Dwarf XYZ" - I understand these would be instances of a dwarf dodging a bolt which 'hit' him, not instances of a bolt flying past a dwarf?

This will make measuring the accuracy of long-range hits quite a nightmare to obtain -_-'' Hopefully, a distance of two tiles used in my current setup produces a minimal amount of complete misses.

This thread is explaining why my dwarf casualties seem to be fairly low compared to other forts I read about.  I keep my military cooped up when the goblins bring archer squads - until after the traps and/or my marksdwarves chop them up a bit.  And then when I do attack them with melee troops I minimize their effectiveness by attacking from a short line-of-sight (they get 1-2 shots off max) and prefer to use well-trained squads with good shield use, dodge, and/or armor use skills.

And as mentioned in the starting posts of the thread probably the most efficient of crossbow fire is suppressive.  If melee troops go in and start coup de gracing unconscious or crippled targets the marksdwarves shift fire to others instead of spending 15-20 bolts on a single goblin.

This does seem like the best strategy to take. If armor offers so little protection against ranged combat, then minimizing the number of shots fired at You is the only way to minimize losses.

I remember once one of my military dwarfs was caught in a goblin ambush outside of the fort. They were all melee fighters and my valiant Swordsdwarf chopped 4 of them to pieces before they fled. ome time later, another military dwarf, similarly trained and equipped, was caught by a goblin ranged ambush. He didn't stand a chance and was down by the third projectile. The  melee/ranged discrepancy does appear to be rather large.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: GreatWyrmGold on September 12, 2012, 06:38:07 am
Historical note: Bows, cross and otherwise, were extremely deadly back before guns let you kill the bowman first.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on September 12, 2012, 07:03:56 am
Historical note: Bows, cross and otherwise, were extremely deadly back before guns let you kill the bowman first.

Point taken. I am merely observing that the suppressive ability of ranged weapons necessitates conservative military tactics. That is, if You value the lives of Your dwarfs, or the time spent on their training.

Then again, there is a... tragic (or is it epic?) aesthetic in a decimated squad reaching the enemy archer division and mowing it down. Worthy of a few engravings, at the very least.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on September 12, 2012, 08:22:33 am
Historical note: Bows, cross and otherwise, were extremely deadly back before guns let you kill the bowman first.
True, but do you really think it's realistic that steel, or even candy, plate armor does literally nothing against crossbow bolts? 

The internetz and modern testing are somewhat mixed on how effective medieval armor was against arrows, but from what I have read it seems that plate armor would probably deflect arrows sometimes, but not direct hits at close range, and the protection from chainmail depends on the type of mail (riveted vs. non-riveted, thickness of weave) and the type of arrow used (broadhead vs. bodkin), but was generally worse than plate armor.

In the current version of Dwarf Fortess:
1) Plate armor does nothing at all.  It NEVER deflects bolts, and it does nothing to improve survival or reduce damage in any way (except against addy, wood, and bone bolts, which probably should be useless against armor...).
2) Chain armor seems to convert a large fraction (or maybe all? needs more testing...) of hits to blunt damage.  This does have a significant impact on survival.
3) Range has no impact on effectiveness.  Lines of marksdwarves 20 tiles away kill dwarves with the same number of hits as when they are 2 tiles away.  They of course hit less often, but that's not what we are talking about here.  More testing is required to confirm that range has no effect, as in my tests the range was not well constrained (the targets could move and the shooters could shoot at large angles).

I DO think that there is a serious problem with the way ranged weapons work right now, which needs to be addressed.  I am currently trying to see if modifying the raws can produce a more balanced result.  I am hoping to find a solution where armor does something without making dwarves invulnerable, while unarmored opponents are killed just as quickly, but I'm not sure if this is possible without changing the underlying game mechanics.  So far I have just been adjusting the force of crossbows.  Setting Force=42 (chosen totally at random  :P) approximately doubles the amount of hits required to kill steel armored dwarves, and a bit more than triples it for candy, while doing nothing for lesser/no armor.  Decreasing the force further to 26 renders candy/steel armored dwarves nearly invincible, and provides some protection for iron armored dwarves.  I will add the full tables to this post later, but I have to go to work now.

Bottom line - I wasn't able to get exactly what I wanted.  I'd like all armors provide some degree of protection, with the degree depending on the armor and bolt materials.  I definitely agree that no armor, other than maybe candy, should provide complete protection.  I will try adjusting bolt mass, contact area, and maybe others (suggestions?) to see what happens.

Also, to be clear, I'm not saying what I want is necessarily the "correct" way that armor should work.  I'd like to figure out if it is possible to tune the raws to get a situation where all armors do something (but don't convey invulnerability), because I suspect that from there it will be relatively easy to tune the effectiveness up and down with small tweaks of the raws.  This will allow wiser individuals than I to create balanced and realistic projectiles, which in my humble opinion are currently neither

[Edit]
One other very important, !!SCIENCE!!, reason for finding raws where bolts are less than 100% effective - this will then allow us to much more easily determine what factors impact effectiveness.  For example, does armor user/marksdwarf level matter?  It's impossible to say if armor never does anything, but if it's say 50% effective, then it's easy to see small changes.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: PaleBlueHammer on September 12, 2012, 08:31:14 am
Hm.  Seeing as bolts are just small, flying spears, I wonder if these results apply to spears as well?  Obviously without the benefit of being ranged, of course.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on September 12, 2012, 08:42:18 am
Hm.  Seeing as bolts are just small, flying spears, I wonder if these results apply to spears as well?  Obviously without the benefit of being ranged, of course.
I do hope to eventually test other weapons in the area for comparison, and spears are a great choice to start with for the reasons you state.  I do not think that spears will prove as deadly as bolts, because the speed of a spear attack is much slower, and the the contact area is significantly larger (at least in the DF raws). 

One problem I have is how to have the attackers not be damaged by the targets, as injured dwarves likely won't attack as well and could skew results.  Maybe have attackers in fully candy, and unarmed defenders?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: MaximumZero on September 12, 2012, 08:46:09 am
That would probably work.

Also, RE:Armor:

They were making bulletproof cuirasses in the 16-17th centuries. It was closer to scale than plate, though.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Blakmane on September 12, 2012, 10:04:42 am
Any interest in looking at shield effectiveness vs bolts? Certainly in adventure mode shields give the impression of extending lifespan... but how significant is the effect in reality? As far as I know all shield materials have the same defensive properties (although perhaps this is a myth!) so you would only have to run an iron bolts VS wooden shields cohort.

Actually, thinking about it, I wonder if metal shields would actually be worse than wooden shields, assuming all else is truly equal, because they weigh more and thus reduce speed. Might be interesting.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on September 12, 2012, 10:34:58 am
There is quite a lot of interest in bolt vs shield study. I have heard it said that shields are a zero-or-one protection: they either completely block the attack or completely let it through. If that were the case, then blocking would be a function of shielding skill alone, or possibly the defender's shielding vs the attackers marksdwarfship. However, I know of no "official" experiments were shields of different material were tested, so the issue is not certain. So there might be some very interesting results there.

In my previous study (http://www.bay12forums.com/smf/index.php?topic=115683.msg3570590#msg3570590) (in which I was still experimenting with performance criteria) shields proved to significantly increase survivability, in particular when combined with armor. They have a synergistic effect - armor helps dwarfs survive longer, giving them more chances to block with shields. But that study was iron vs iron only, and only had 100 samples.

Edit: fixed link
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on September 12, 2012, 10:58:42 am
Any interest in looking at shield effectiveness vs bolts? Certainly in adventure mode shields give the impression of extending lifespan... but how significant is the effect in reality? As far as I know all shield materials have the same defensive properties (although perhaps this is a myth!) so you would only have to run an iron bolts VS wooden shields cohort.

Actually, thinking about it, I wonder if metal shields would actually be worse than wooden shields, assuming all else is truly equal, because they weigh more and thus reduce speed. Might be interesting.
I would like to eventually run tests of various shield vs. bolt materials, unless someone else does it .  It is my belief that you are correct and shield material has no impact on blocking so the lightest material is the best choice.  To confirm this, I would see if the number of *unblocked* hits results in the same rate of death, unconciousness, serious wounds etc as for naked dwarves.  If there is a difference, then either shields would have to act as armor on top of blocking, or blocked shots would have to sometimes do damage (which I don't think is true, as it's never been reported).

Along these lines, does anyone with modding experience know how valid Zivilin's "fake bone" is, and if it would be OK for me to use similar "fake wood" and "fake leather"?  It is easiest for me to run my scripts if I can treat all materials as inorganic "metals", such that if I swap out raw files the new materials will show up in the same spot within the menus and I can select them using the same macro.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Joben on September 12, 2012, 12:59:23 pm

*snip*
Regarding the bolt momentum/energy, as I indicated above, I estimate that DF bolts weight about 500 grams by comparing the weights of weapons/armors with their real world counterparts, however the weight wiki page (http://dwarffortresswiki.org/index.php/Weight) suggests that weight in Urist is equal to weight in kg, and I have confirmed that steel bolts weight 1.17 urists (117 for a stack of 100).  Does anyone know if it is true that urists=kg?  In either case this is VERY heavy for a bolt/arrow.  *snip* Anyway, I am curious if anyone has any idea what a velocity of 1000 means in DF? 

I think it's safe to assume that urists are kilograms. Density for materials in the raws are given values that match with their real world density in grams/cubic centimeter. If you do the math for a given SIZE and MATERIAL you end up with a Urist count that is the same as a real world chunk of that material in kilograms. Steel bolts weigh 1.17 urists because they are SIZE 150 and IRL 150 cubic centimeters of steel weights ~1.17 kilograms.

The units used in SHOOT_FORCE and MAX_VEL appear to be unknown. I've asked about this a few times on the forum and never received an answer. I wonder if Toady would answer if we emailed him.

btw, have you seen the settings I use for projectile weapons? link is in the sig.

Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on September 12, 2012, 02:08:42 pm
I think it's safe to assume that urists are kilograms. Density for materials in the raws are given values that match with their real world density in grams/cubic centimeter. If you do the math for a given SIZE and MATERIAL you end up with a Urist count that is the same as a real world chunk of that material in kilograms. Steel bolts weigh 1.17 urists because they are SIZE 150 and IRL 150 cubic centimeters of steel weights ~1.17 kilograms.

The units used in SHOOT_FORCE and MAX_VEL appear to be unknown. I've asked about this a few times on the forum and never received an answer. I wonder if Toady would answer if we emailed him.

btw, have you seen the settings I use for projectile weapons? link is in the sig.
Thanks very much for the info about units!

So, I started this project round about Aug 15, and at that time did a pretty exhaustive forum search to see what information already existed (which was none).  It seems that at least two other people have been working on the same thing simultaneously since then, lol. 

I will make sure to read your results carefully this evening, although a quick glance suggests you are using similar numbers to where my testing has been taking me.  I definitely like your use of real-world data!  Would you like me to run full sets of tests using your bow/ammo parameters?

I see you never adjusted the bolt mass?  1.17 kg is clearly way too much for a steel bolt/arrow, and lowering the bolt mass would both allow adventurers to carry a more reasonable number (currently carrying more that one stack gets really heavy) and make them penetrate armor less.  I suspect that armor penetration is based on momentum (which is what it should physically be, as a deflection is a largely elastic collision), so if we reduce the mass and keep the same energy, it should decrease armor penetration without decreasing damage to unarmored targets, which should mostly depend on energy.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: GreatWyrmGold on September 12, 2012, 04:31:40 pm
Historical note: Bows, cross and otherwise, were extremely deadly back before guns let you kill the bowman first.
True, but do you really think it's realistic that steel, or even candy, plate armor does literally nothing against crossbow bolts? 

The internetz and modern testing are somewhat mixed on how effective medieval armor was against arrows, but from what I have read it seems that plate armor would probably deflect arrows sometimes, but not direct hits at close range, and the protection from chainmail depends on the type of mail (riveted vs. non-riveted, thickness of weave) and the type of arrow used (broadhead vs. bodkin), but was generally worse than plate armor.

In the current version of Dwarf Fortess:
1) Plate armor does nothing at all.  It NEVER deflects bolts, and it does nothing to improve survival or reduce damage in any way (except against addy, wood, and bone bolts, which probably should be useless against armor...).
2) Chain armor seems to convert a large fraction (or maybe all? needs more testing...) of hits to blunt damage.  This does have a significant impact on survival.
3) Range has no impact on effectiveness.  Lines of marksdwarves 20 tiles away kill dwarves with the same number of hits as when they are 2 tiles away.  They of course hit less often, but that's not what we are talking about here.  More testing is required to confirm that range has no effect, as in my tests the range was not well constrained (the targets could move and the shooters could shoot at large angles).

I DO think that there is a serious problem with the way ranged weapons work right now, which needs to be addressed.  I am currently trying to see if modifying the raws can produce a more balanced result.  I am hoping to find a solution where armor does something without making dwarves invulnerable, while unarmored opponents are killed just as quickly, but I'm not sure if this is possible without changing the underlying game mechanics.  So far I have just been adjusting the force of crossbows.  Setting Force=42 (chosen totally at random  :P) approximately doubles the amount of hits required to kill steel armored dwarves, and a bit more than triples it for candy, while doing nothing for lesser/no armor.  Decreasing the force further to 26 renders candy/steel armored dwarves nearly invincible, and provides some protection for iron armored dwarves.  I will add the full tables to this post later, but I have to go to work now.

Bottom line - I wasn't able to get exactly what I wanted.  I'd like all armors provide some degree of protection, with the degree depending on the armor and bolt materials.  I definitely agree that no armor, other than maybe candy, should provide complete protection.  I will try adjusting bolt mass, contact area, and maybe others (suggestions?) to see what happens.

Also, to be clear, I'm not saying what I want is necessarily the "correct" way that armor should work.  I'd like to figure out if it is possible to tune the raws to get a situation where all armors do something (but don't convey invulnerability), because I suspect that from there it will be relatively easy to tune the effectiveness up and down with small tweaks of the raws.  This will allow wiser individuals than I to create balanced and realistic projectiles, which in my humble opinion are currently neither

[Edit]
One other very important, !!SCIENCE!!, reason for finding raws where bolts are less than 100% effective - this will then allow us to much more easily determine what factors impact effectiveness.  For example, does armor user/marksdwarf level matter?  It's impossible to say if armor never does anything, but if it's say 50% effective, then it's easy to see small changes.
If I recall correctly, arrows could allegedly pierce plate armor if fired correctly, ie using terrain to your best advantage. Until bolt heads and better physics get added, I intend to imagine that overpowering projectiles is a way to counter the inability of the AI and engine to use arcs to maximize projectile deadliness.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Qwernt on September 12, 2012, 04:41:45 pm
Great !!Science!! (even with the lack of Magma).

On the historical nature of xbows - war science is a series of creating a weapon to be the current armor and updating armor to beat the current weapon.  xbows were designed with two main purposes: low skill requirement (vs longbow) and high power armor piercing point.  Basically, allow a bunch of untrained peasants decimate the charging knights.  And they worked beautifully for that - as long as they had the farthest range.  Problems arose when they went up against profession archers and horse archers (shorter range, but much fast reload and movement).

If you think about later armor, the bulk of the protection was from deflection, not from stopping power. IE, transfer the energy in a new direction using angles rather than diffusing energy on impact.  This approach worked weel up until the musket and early rifles projected enough energy that the metal couldn't disperse.  So we moved from deflection to flack jackets (with a "there is nothing that works anyway" period in between - IE US revolutionary war through WW1).

Very long way to say: Great Stuff and fairly realistic (except for the whole softness of the bolt material show allow less impactful energy transfer... of course we do still talk about silver bullets, don't we).
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: misko27 on September 12, 2012, 04:53:17 pm
If you think about later armor, the bulk of the protection was from deflection, not from stopping power. IE, transfer the energy in a new direction using angles rather than diffusing energy on impact.  This approach worked weel up until the musket and early rifles projected enough energy that the metal couldn't disperse.  So we moved from deflection to flack jackets (with a "there is nothing that works anyway" period in between - IE US revolutionary war through WW1).
note, A bullet proof vest was developed before WWI by a priest who wanted to defeat bullets and used spider-silk. I konow because arch-duke ferdinand was wearing one when he died. He was shot in the neck.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Miuramir on September 12, 2012, 04:53:24 pm
I think it's safe to assume that urists are kilograms. ...
...
I see you never adjusted the bolt mass?  1.17 kg is clearly way too much for a steel bolt/arrow...

Based on some quick research into historical crossbow bolts, I'm coming up with a plausible range of volumes between 4cc and 28cc.  The lower end of that range involves *very* old (Chinese, 5th Century BC) solid bronze bolts that due to corrosion are probably thinner than they started; and the upper end of that range seems only to be used for wooden bolts. 

I'd probably give wooden bolts a SIZE of 25, bolts made from a cutting-edge-capable metal a SIZE of 15, and perhaps softer metals an intermediate SIZE of 20 (this last is more handwavy as not backed much by historical evidence).  Calculate the MASS from the MATERIAL; assuming steel at around 7.8 g/cc this would give you a steel bolt at around 117g (0.12 kg, or Urists). 

Once you've got the size & mass more correct, it should be much easier to get desired results by adjusting other variables.  In particular, in an ideal world this would hopefully generate less bruising despite armor, yet still do serious puncture damage to lightly or unarmored targets. 

Realistically, you'd also want to adjust the contact area / sharpness based on the material (MAX_EDGE ?) as well; all-wooden bolts in reality are mostly designed to kill small critters by blunt trauma, and obviously even with a fire-hardened point can't be nearly as sharp as a steel tip.  I'm not clear on whether this is already taken into account elsewhere. 
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Oaktree on September 12, 2012, 05:22:55 pm
Hm.  Seeing as bolts are just small, flying spears, I wonder if these results apply to spears as well?  Obviously without the benefit of being ranged, of course.

Load a bunch of spears into a mine cart railgun and they become a ranged weapon...   :D
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: GreatWyrmGold on September 12, 2012, 05:39:12 pm
Or throw them.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on September 12, 2012, 08:21:17 pm
See pre-minecart knockback research here:
http://www.bay12forums.com/smf/index.php?topic=107575.0

I found while investigating knockback in 0.34.07 (just before the minecart release) that crossbows appear to launch bolts at constant momentum (i.e. the shoot force is the F and the delta-t is constant in the impulse "F*delta-t" for you engineers). It appeared that heavy and light bolts were imparting the same momentum on impact, measured in terms of knockback distance, but that light bolts just travelled faster (up until the shoot maxvel)(i.e. constant m*delta-v).

The knockback motion has been altered to use parabolic paths and skidding since, so I wouldn't use the same test methods.

Considering that dropped socks from above do too much damage (potentially lethal!), perhaps the bolts are being launched at the correct force and speed, but the damage calc for all projectiles is bugged?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: GreatWyrmGold on September 12, 2012, 08:44:55 pm
That would make sense.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on September 12, 2012, 09:24:26 pm
See pre-minecart knockback research here:
http://www.bay12forums.com/smf/index.php?topic=107575.0

I found while investigating knockback in 0.34.07 (just before the minecart release) that crossbows appear to launch bolts at constant momentum (i.e. the shoot force is the F and the delta-t is constant in the impulse "F*delta-t" for you engineers). It appeared that heavy and light bolts were imparting the same momentum on impact, measured in terms of knockback distance, but that light bolts just travelled faster (up until the shoot maxvel)(i.e. constant m*delta-v).

The knockback motion has been altered to use parabolic paths and skidding since, so I wouldn't use the same test methods.

Considering that dropped socks from above do too much damage (potentially lethal!), perhaps the bolts are being launched at the correct force and speed, but the damage calc for all projectiles is bugged?
Hmm...crossbows applying a constant momentum is actually very surprising.  They apply a fixed force over a fixed distance (the length of the crossbow's draw).  Therefore they *should* fire bolts with a constant kinentic energy regardless of mass.  This assumes a massless bowstring and no energy transferred into bow motion, but it seems very unlikely that Toady would include those kind of details.  Also note that it doesn't actually matter if the force applied is constant over the whole distance - the work/energy is the integral of force over distance, and will be contant so long as the applied force doesn't depend on bolt material (which would be quite illogical).

I am not saying it's not correct that DF crossbows impart bolts with constant momentum, regardless of mass.  I am saying that, in the real world, a crossbow will impart constant kinetic energy, neglecting bowstring mass and any motion of the bow itself.  Dwarf Fortress may or may not follow real world physics here.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: NCommander on September 15, 2012, 07:28:28 pm
I'm vaguely curious if dual-wielding shields increases the chases of successfully blocking them. I once had an adventurer who was pretty much unkillable with legendary shield user + misc object user. If you could post your macros/report scripts, I would be interested in running the test.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: vadia on September 15, 2012, 09:10:44 pm
See pre-minecart knockback research here:
http://www.bay12forums.com/smf/index.php?topic=107575.0

I found while investigating knockback in 0.34.07 (just before the minecart release) that crossbows appear to launch bolts at constant momentum (i.e. the shoot force is the F and the delta-t is constant in the impulse "F*delta-t" for you engineers). It appeared that heavy and light bolts were imparting the same momentum on impact, measured in terms of knockback distance, but that light bolts just travelled faster (up until the shoot maxvel)(i.e. constant m*delta-v).

The knockback motion has been altered to use parabolic paths and skidding since, so I wouldn't use the same test methods.

Considering that dropped socks from above do too much damage (potentially lethal!), perhaps the bolts are being launched at the correct force and speed, but the damage calc for all projectiles is bugged?
Hmm...crossbows applying a constant momentum is actually very surprising.  They apply a fixed force over a fixed distance (the length of the crossbow's draw).  Therefore they *should* fire bolts with a constant kinentic energy regardless of mass.  This assumes a massless bowstring and no energy transferred into bow motion, but it seems very unlikely that Toady would include those kind of details.  Also note that it doesn't actually matter if the force applied is constant over the whole distance - the work/energy is the integral of force over distance, and will be contant so long as the applied force doesn't depend on bolt material (which would be quite illogical).

I am not saying it's not correct that DF crossbows impart bolts with constant momentum, regardless of mass.  I am saying that, in the real world, a crossbow will impart constant kinetic energy, neglecting bowstring mass and any motion of the bow itself.  Dwarf Fortress may or may not follow real world physics here.
Excluding air resistance, of course.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: thiosk on September 16, 2012, 02:14:57 am
Hi everyone. Someone linked me to look at this study and I, having nothing better to do, typesetted it in LaTeX. Then someone suggested me to show this to the author, so here it is! (http://dl.dropbox.com/u/2891221/DF%20study%202.pdf).

(I also did the last one by OP (http://dl.dropbox.com/u/2891221/DF%20study.pdf)) I like your style, keep it up!

Hahaha!  Journal should be !!SCIENCE!!
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on September 16, 2012, 04:28:34 am
I'm vaguely curious if dual-wielding shields increases the chases of successfully blocking them. I once had an adventurer who was pretty much unkillable with legendary shield user + misc object user. If you could post your macros/report scripts, I would be interested in running the test.

It would be good if You could compare the results of having a single shield and weapon (the usual setup) with dual-wielding shields. Pirate Bob has already shared his scripts and macros on DFFD:

The scripts and macros I use are posted on DFFD (http://dffd.wimbli.com/file.php?id=6895).

I think You'll have to add the code for extracting "block" (hit blocked by shield) and "bat" (hit batted away by weapon) information yourself, since I don't think Pirate Bob did any tests with shields.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Owlbread on September 16, 2012, 03:53:00 pm
One advantage that wooden bolts have over other bolts is the fact that if one sets fire to them and shoots someone, they will cause the affected area to melt, causing heavy bleeding beyond the obvious organ damage and torn skin. I have only managed to do this though by being a magma man and picking up bolts, thereby setting them on fire and shooting them at a naked elf very quickly. They do not, however, cause the corpse to ignite, nor the clothing that the corpse was wearing.

At least, that's what my research showed originally. I've just tried that again and it seems that burning bolts cannot be fired. Well, if the bolt was on fire, that was what would happen. I just tried by throwing the burning bolts but again, I was unsuccessful. I think it has to stick in the wound for it to cause the area around it to melt.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on September 16, 2012, 05:16:58 pm
One advantage that wooden bolts have over other bolts is the fact that if one sets fire to them and shoots someone, they will cause the affected area to melt, causing heavy bleeding beyond the obvious organ damage and torn skin. I have only managed to do this though by being a magma man and picking up bolts, thereby setting them on fire and shooting them at a naked elf very quickly. They do not, however, cause the corpse to ignite, nor the clothing that the corpse was wearing.

At least, that's what my research showed originally. I've just tried that again and it seems that burning bolts cannot be fired. Well, if the bolt was on fire, that was what would happen. I just tried by throwing the burning bolts but again, I was unsuccessful. I think it has to stick in the wound for it to cause the area around it to melt.

I do not have any data on fire bolt damage... however, the probability of a bolt lodging seems to depend on Bolt/Armor material:

Percentage of bolts lodged
Spoiler (click to show/hide)

It is apparent that there are three 'levels' of lodging probability:

Lodging does not seem to solely depend on the shear yield parameter, since fake bone has a shear yield of 115'000 compared to silver's 100'000, but bolts made of these materials lodged differently. Perhaps weight has an effect at low (around 100'000) shear yields? Or possibly it is governed by a completely different parameter altogether. Surprisingly, copper lodges just as bad as wood and fake bone, despite being a metal. Its shear yield is lower than bone and silver (70'000), which might work towards this effect.

To return to the point, even firing wooden bolts against unarmored targets grants You a 20% chance of lodging at most (and almost no chance against armored opponents). Thus, if lodging is a requirement for a wooden fire bolt to cause fire-based damage, then their usefulness is seriously limited.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on September 16, 2012, 06:01:55 pm
One advantage that wooden bolts have over other bolts is the fact that if one sets fire to them and shoots someone, they will cause the affected area to melt, causing heavy bleeding beyond the obvious organ damage and torn skin. I have only managed to do this though by being a magma man and picking up bolts, thereby setting them on fire and shooting them at a naked elf very quickly. They do not, however, cause the corpse to ignite, nor the clothing that the corpse was wearing.

At least, that's what my research showed originally. I've just tried that again and it seems that burning bolts cannot be fired. Well, if the bolt was on fire, that was what would happen. I just tried by throwing the burning bolts but again, I was unsuccessful. I think it has to stick in the wound for it to cause the area around it to melt.

I do not have any data on fire bolt damage...
...
To return to the point, even firing wooden bolts against unarmored targets grants You a 20% chance of lodging at most (and almost no chance against armored opponents). Thus, if lodging is a requirement for a wooden fire bolt to cause fire-based damage, then their usefulness is seriously limited.

I tested flaming arrows on elephants in the arena by creating a Fire Man with an iron bow and 100 mangrove (wood) arrows. I dropped the arrow stack and would only walk back to it to pick up 5 arrows at a time, lest they all burn up before being shot. Elephants tend to survive longer under arrow fire, so I found the following:

- Regular arrow hits appear to ignore the flaming state of the arrow.
- Lodged arrow hits will transfer temperature and flaming status to and from the arrow and victim creature.
- If you ignite the victim creature prior to its death, the corpse will be on fire and burn away.

I'd suggest that some sort of minecart shotgun full of unstacked wooden bolts/arrows, which are set on fire during the launch sequence, would be a devastating antipersonnel weapon.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: GreatWyrmGold on September 16, 2012, 06:11:22 pm
How would you set them on fire? Send them through a bunch of pastured fire men?
...I want to make some sort of fire-cat now.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on September 16, 2012, 08:14:27 pm
How would you set them on fire? Send them through a bunch of pastured fire men?
...I want to make some sort of fire-cat now.

Magma, as always, is the solution:
Quote
You put the mangrove bolts [100] into the iron minecart.
You drop the iron minecart.
<<here I rode the cart towards magma and a wall>>
You are caught in a pool of lava!
You are on fire!
You are melting!
The flying ‼mangrove bolts [100]‼ strikes You in the left lower leg, chipping the bone!
A ligament has been torn and a tendon has been torn!
You are on fire!
You are melting!
You slam into an obstacle!
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: GreatWyrmGold on September 16, 2012, 08:17:23 pm
How would you do that in Fortress Mode?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on September 16, 2012, 10:54:18 pm
How would you do that in Fortress Mode?

Spill magma on tracks and drive a loaded cart through the 1/7 puddles. Use magma-safe rollers if braking is an issue. After the ignition section, the cart goes downhill 3 z-levels or hits an "exploit linear accelerator" to attain shotgun speed. This isn't a rapid fire weapon by any means, as loading all those wood bolts would take a while.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on September 17, 2012, 02:48:56 am
I'd suggest that some sort of minecart shotgun full of unstacked wooden bolts/arrows, which are set on fire during the launch sequence, would be a devastating antipersonnel weapon.

...And now I cannot envision my next fortress without a firebolt minegun shotgun at the entrance :)
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: MaximumZero on September 17, 2012, 09:18:59 pm
That would be awesome.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on September 18, 2012, 07:42:48 am
Sorry this response is rather late - I was sick this weekend and didn't get around to checking the forums or doing much else  :(.

I'm vaguely curious if dual-wielding shields increases the chases of successfully blocking them. I once had an adventurer who was pretty much unkillable with legendary shield user + misc object user. If you could post your macros/report scripts, I would be interested in running the test.
Why stop with one shield in both hands?  Why not ten?  This is a well-known expliot (http://dwarffortresswiki.org/index.php/DF2012:Exploit#Urist_McAdventurer_the_Shield-wall).

I haven't done what I would call !!SCIENCE!! on this, but at least in DF2010 when my adventurer wielded 10 or so shields nothing could hit him.  I assume this has not changed.  Wood/leather shields are the best for this, as they are lightest, and material has no influence on shield performance according to the wiki.  Confirming that material does not matter is on my long to-do list (possibly from earlier in this thread?), and if I get around to that I might as well see exactly how much having two shields improves blocking chance.  My guess is that each shield tries to block one after the other, so that
total bock chance = 1-(1-block chance)N shields.
Therefore, if you use two shields, and each gives a block chance of 30% (this is the base chance, and I have no idea how this is modified by shield user skill - more !!SCIENCE!! needed ;)), then you should have a 51% chance of blocking with two shields.

Again, this is just me guessing based on the assumptions that
1) You block with each shield independently, and using multiple has no influence on the chances of each one blocking.
2) Dwarf Fortress follows the laws of real world probability.
Neither of these is necessarily true...


...I am saying that, in the real world, a crossbow will impart constant kinetic energy, neglecting bowstring mass and any motion of the bow itself.  Dwarf Fortress may or may not follow real world physics here.
Excluding air resistance, of course.
Technically, I said that crossbows will impart bolts with constant energy.  I.e., this is the energy they will have when leaving the bow.  Air resistance doesn't have anything to do with this, unless you want to consider the minute air resistance that the bow/arrow experiences during firing :P.  Sorry I couldn't resist...

There will of course be significant air resistance during flight in the real world.  I can't yet say either way if DF considers this, although my current guess would be that it does not, as I have not yet seen any impact from changing shooter to target distance.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on September 19, 2012, 04:28:48 am
Why stop with one shield in both hands?  Why not ten?  This is a well-known expliot (http://dwarffortresswiki.org/index.php/DF2012:Exploit#Urist_McAdventurer_the_Shield-wall).

Note that by Arena rules (which I assume are based on Fortress mode) dwarves can carry only one weapon/shield per hand, so dual wielding is the most that can be tested in the Arena. I tried assuming control and picking up additional shields, but I couldn't grasp. Since there is no backpack in Arena mode, I couldn't try equipping items from the inventory.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: omg_scout on September 19, 2012, 07:20:29 am
Well multigrasping is a bug and will be removed sooner or later.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on September 19, 2012, 09:05:03 am
Just wanted to point out that the bronze colossus has some interesting raws:

Code: [Select]
[ITEMCORPSE:STATUE:NO_SUBTYPE:INORGANIC:BRONZE]
[ITEMCORPSE_QUALITY:5]

So place a modded creature in one side of each testing cell prior to a main test, where the modded creature was designed to die quickly (such as a fish out of water) and leave an item of quality (such as a high-quality crossbow or bolts) as a corpse. The catch is that you have to create the weapon-user in the test first and then possess him to pick up the item laying at his feet. Not sure if this is viable for a 1000-dwarf test.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on September 19, 2012, 09:32:00 am
Just wanted to point out that the bronze colossus has some interesting raws:

Code: [Select]
[ITEMCORPSE:STATUE:NO_SUBTYPE:INORGANIC:BRONZE]
[ITEMCORPSE_QUALITY:5]

So place a modded creature in one side of each testing cell prior to a main test, where the modded creature was designed to die quickly (such as a fish out of water) and leave an item of quality (such as a high-quality crossbow or bolts) as a corpse. The catch is that you have to create the weapon-user in the test first and then possess him to pick up the item laying at his feet. Not sure if this is viable for a 1000-dwarf test.

This is theoretically possible with my form of scripting.  I would have my perl script call one macro that places the creatures designed to die, then the script would wait until there were no more updates to gamelog.txt (from creatures dying - I already do this for my main testing).  Then it would call another macro to place the dwarves and possess them one at a time to have them pick up the items. 

This should definitely be possible.  The only potential issue is that sometimes DF seems to miss a keypress or two from complicated macros, so with something this long it would be more likely to happen.  I might want to scale back the size of such a test to maybe 100 at a time at first.

In any case, this is a brilliant idea, and much easier to do than trying to acquire the items in fortress/adventurer mode.  Thanks very much for pointing this out!

Why stop with one shield in both hands?  Why not ten?  This is a well-known expliot (http://dwarffortresswiki.org/index.php/DF2012:Exploit#Urist_McAdventurer_the_Shield-wall).

Note that by Arena rules (which I assume are based on Fortress mode) dwarves can carry only one weapon/shield per hand, so dual wielding is the most that can be tested in the Arena. I tried assuming control and picking up additional shields, but I couldn't grasp. Since there is no backpack in Arena mode, I couldn't try equipping items from the inventory.
I hadn't really thought about how to actually get dwarves to equip more than one shield in arena mode, and as you pointed out it would be difficult.  I guess if I really wanted to do it I could use Urist Da Vinci's method to get custom creatures to drop backpacks for the dwarves, and then have them pick up and take out multiple shields. 

Also, I reread NCommander's post, and realized he asked for my macros etc.  I did post a link to those on DFFD (http://dffd.wimbli.com/file.php?id=6895) at some point in this thread, but the thread is getting pretty long now.  I will post an updated version within the next few days when I post my results of varying crossbow force.  Spoiler alert - they are confusing... ???
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on October 04, 2012, 02:34:34 am
Potential new discovery:

It has been generally known, given comments made by Toady One and various testing, that the IMPACT_YIELD property of an armor material has an effect on blunt damage received. AFAIK (and general forum wisdom) was that blunt damage depended only on blunt weapon density.

Take a silver bolt, and shoot it at a dwarf wearing steel armor. According to previous research and testing, the victim will suffer blunt damage, likely chipping a bone and with a chance of instant death due to skull=>brain damage.

Now mod silver to have a reduced IMPACT_YIELD of 350 instead of 350000. These silver bolts will deflect off the steel armor, but will still penetrate wood/leather armor and cut flesh. These modded silver bolts will deflect off any armor that they can't penetrate, including Silver or Candy - it's almost as if the bolts can no longer deal blunt damage. However, since we modded the material, this may have unintended consequences for armor properties or melee combat.

Some verification testing and additional research is requested.

TLDR; SOLID_DENSITY and IMPACT_YIELD both matter for blunt damage
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on October 04, 2012, 10:16:44 am
Interesting find. I'll run a few "Copper vs Steel" scenarios with various IMPACT_YIELD values for copper. I'll concentrate on damage type and deflections.

[Edit]
And here are the results.

I have ascertained that the Bolt-Armor interaction has a binary response to changes to IMPACT_YIELD. In this case, I gradually continued to decrease copper's IMPACT_YIELD and tested it against steel armor. At 11% of its original IMPACT_YIELD, all copper11 bolts deflected off steel armor. At 12% of its original IMPACT_YIELD, all copper12 bolts behaved exactly as regular copper against steel armor. I put the tentative threshold of Copper vs Steel at 11.5% of the IMPACT_YIELD of copper.

I repeated this experiment for copper vs copper, and the threshold was 12.5% - copper12 bolts deflected of copper armor, whilst copper13 bolts behaved like regular copper.

Although IMPACT_YIELD definitely has an effect on deflections, it might not be very useful due to the binary nature of its effect on deflections.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: vadia on October 04, 2012, 07:51:31 pm
How does this thread parallel/contrast with the broken arrow thread?http://www.bay12forums.com/smf/index.php?topic=115448.msg3559195#msg3559195 (http://www.bay12forums.com/smf/index.php?topic=115448.msg3559195#msg3559195)
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on October 05, 2012, 02:16:35 am
How does this thread parallel/contrast with the broken arrow thread?http://www.bay12forums.com/smf/index.php?topic=115448.msg3559195#msg3559195 (http://www.bay12forums.com/smf/index.php?topic=115448.msg3559195#msg3559195)

Parallels:

Non-parallels (perpendiculars? Divergents?):

I know that the findings of this thread are known to the creator of the Broken Arrow thread, since A) He posted here, B) Pirate Bob, who has done the same research as me (if not more), has used the analysis methods developed here to test out how the Broken Arrow mod works (http://www.bay12forums.com/smf/index.php?topic=115448.msg3607133#msg3607133). This thread is probably a good database for comparing the modded results with those obtained from vanilla.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: misko27 on October 05, 2012, 02:27:32 am
I have a possible research topic. Are bows as effective as crossbows?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Noodz on October 05, 2012, 07:35:28 am
I do believe this is the finest scientific paper ever written in this board. And by science i don't simply mean dorf science, i mean true, systematic analysis of the game mechanics.

I wish i had to the time and expertise to creat the Annals of Dwarven Research. This thread would certainly count as one of it's finest papers.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on October 05, 2012, 08:57:56 am
I have a possible research topic. Are bows as effective as crossbows?

The only difference in the raws between crossbow+bolt and bow+arrow are the names, skills used, and the launcher size. The launcher size and strength is generally believed to not affect the projectile performance, except rate-of-fire in the case of a very heavy launcher.

The difference, if any, would likely lie in some hardcoding difference between the skills. The elven civilization (not creature) gets [IMPROVED_BOWS]. I don't exactly know what that does. It adds decorations to bows.

EDIT:

...I put the tentative threshold of Copper vs Steel at 11.5% of the IMPACT_YIELD of copper.

I repeated this experiment for copper vs copper, and the threshold was 12.5% - copper12 bolts deflected of copper armor, whilst copper13 bolts behaved like regular copper.

Although IMPACT_YIELD definitely has an effect on deflections, it might not be very useful due to the binary nature of its effect on deflections.

A bit more testing suggests that the bolt material's threshhold IMPACT_YIELD is 3.4x the number used for the armor material's density, though this relationship is only valid for vanilla bolts and changes in an unknown manner when a few other properties are varied.

I.e. Copper bolts at [IMPACT_YIELD:26500] deflect off steel armor. Copper bolts at [IMPACT_YIELD:27000] deal damage through steel armor. Steel density 7850 * 3.4 = 26690.

I.e. Vanilla aluminum bolts at [IMPACT_YIELD:70000] deflect off platinum armor. Aluminum bolts with [IMPACT_YIELD:74000] deal damage through platinum armor. 21400 * 3.4 = 72760.

I.e. Vanilla iron bolts at [IMPACT_YIELD:542500] deflect off slade armor. Iron bolts with [IMPACT_YIELD:690000] deal damage through slade armor. 200000 * 3.4 = 680000.

Amusingly, crossbows modded to have very high shoot force and maxvel ("railguns") can still have their projectiles deflect off armor and cause no harm, but if the projectile does deal damage then the victim is typically propelled backwards a huge distance. I wanted to see if impact energy was responsible for deflections. Apparently not.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: nordak on October 05, 2012, 12:06:34 pm
can we get a minecart impact study started... surely has some parallels with your research. 1000 dwarfs on track and run carts over them... should have enough results after every cart and trap of each material has been ran.... sorry just jumped on here to see if toady had tossed up an update, and found a good read.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: sayke on October 05, 2012, 12:19:48 pm
so what all variables are known to affect penetration/deflection, and can we write a function modeling their interactions?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on October 05, 2012, 01:25:33 pm
I have a possible research topic. Are bows as effective as crossbows?

The only difference in the raws between crossbow+bolt and bow+arrow are the names, skills used, and the launcher size. The launcher size and strength is generally believed to not affect the projectile performance, except rate-of-fire in the case of a very heavy launcher.

The difference, if any, would likely lie in some hardcoding difference between the skills. The elven civilization (not creature) gets [IMPROVED_BOWS]. I don't exactly know what that does. It adds decorations to bows.

I'll just add that I ran a few preliminary tests, and could find no evidence that bows differed from crossbows in any way (The statistical data for bows was significantly different from crossbow data)

I do believe this is the finest scientific paper ever written in this board. And by science i don't simply mean dorf science, i mean true, systematic analysis of the game mechanics.

I wish i had to the time and expertise to creat the Annals of Dwarven Research. This thread would certainly count as one of it's finest papers.

You are too kind. It's mainly generating tons of data and then organizing it. The only "creative" parts are designing as objective an experimental setup as possible and defining useful criteria. The rest is mechanical and dull. Of course, obtaining interesting results at the end of the process is very satisfying.

An Annals of Dwarven Research would be nice <wistfully>. As it is, I'll try incorporating whatever data fits into the wiki.

A bit more testing suggests that the bolt material's threshhold IMPACT_YIELD is 3.4x the number used for the armor material's density, though this relationship is only valid for vanilla bolts and changes in an unknown manner when a few other properties are varied.

I.e. Copper bolts at [IMPACT_YIELD:26500] deflect off steel armor. Copper bolts at [IMPACT_YIELD:27000] deal damage through steel armor. Steel density 7850 * 3.4 = 26690.

I.e. Vanilla aluminum bolts at [IMPACT_YIELD:70000] deflect off platinum armor. Aluminum bolts with [IMPACT_YIELD:74000] deal damage through platinum armor. 21400 * 3.4 = 72760.

I.e. Vanilla iron bolts at [IMPACT_YIELD:542500] deflect off slade armor. Iron bolts with [IMPACT_YIELD:690000] deal damage through slade armor. 200000 * 3.4 = 680000.


This tickled my curiosity so I tried out a few parameters:

I took copper26500 and copper27000 and tested it against steel armor. As expected, copper26500 deflected, copper27000 caused damage. Then I continued running copper26500 and copper27000 against steel while changing promising parameters:

Finally, I doubled bolt size from 150 to 300. Lo and behold, both copper26500 and copper27000 caused damage. Assuming the simplest relation possible, I repeated the test with copper13250 and copper13500 (IMPACT_YIELDs halved compared to previous), and sure enough copper13250 deflected, while copper13500 did not.

The current equation is therefore:

The threshhold of the ammo's IMPACT_YIELD is equal to 510*ARMOR_SOLID_DENSITY/AMMO_SIZE

can we get a minecart impact study started... surely has some parallels with your research. 1000 dwarfs on track and run carts over them... should have enough results after every cart and trap of each material has been ran.... sorry just jumped on here to see if toady had tossed up an update, and found a good read.

Glad You enjoyed it. Unfortunately, I cannot replicate this research for minecarts, because I do not know how to create tracks/minecarts in Arena mode. Walls, floors, fortifications and creatures is my limit, I'm afraid.

so what all variables are known to affect penetration/deflection, and can we write a function modeling their interactions?

We know some of the variables, but probably not all. We actually got the beginning of a function with the last few posts :P
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on October 05, 2012, 02:55:00 pm
...
The current equation is therefore:

The threshhold of the ammo's IMPACT_YIELD is equal to 510*ARMOR_SOLID_DENSITY/AMMO_SIZE
...
We know some of the variables, but probably not all. We actually got the beginning of a function with the last few posts :P

Now it gets even more interesting:

Arena Bird Droppings:

Create a dwarf on team #1 in the arena, wearing armor
Create an eagle on team #1 a few z-levels above the dwarf, where the eagle is created with 100 bowls (under tools) of various metals (try lead, aluminum, iron).
The eagle appears and won't attack the dwarf, but since it has no hands it drops 100 items on the dwarf from above.
You can't do this with arrows/bolts since the items [100] are treated as a single object.
Weapons strike with an attack, other objects just have blunt collisions.

Similar blunt deflection behaviour is observed with this testing, except that the falling item's density matters (in apparently linear relationship).

Why does the bolt material density not matter, but the density of a falling item does? My theory is that the bolts are launched from the crossbow at a constant impulse or a constant energy, so that the density is used twice and cancels out of the equation, leaving only bolt size. Not sure how to test this.


EDIT: removed unreproduceable science. wouldn't be good to be creating myths right now.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Oaktree on October 05, 2012, 03:11:35 pm
Is there a chance for a dwarf to dodge dropped objects?  Or do objects traveling through a tile due to being dropped or flung (e.g. off a mine cart) going to hit anything that is in a tile?  Or at least the first object encountered going down a list*.

* - I think someone indicated in one of the threads on dropping objects that with multiple objects "senior" dwarves get hit first.  Which implies the code is scanning the dwarf list from top to bottom and not randomly picking who gets hit.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: rhesusmacabre on October 05, 2012, 03:36:01 pm
You can't do this with arrows/bolts since the items [100] are treated as a single object.

You can assign many single bolts individually though.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on October 06, 2012, 12:34:14 pm
Is there a chance for a dwarf to dodge dropped objects?

I repeated Urist da Vinci's dwarf-eagle setup with ten of each, and gave the eagles around 30 separate bolts, as suggested by rhesusmacabre. The dwarves were all Grand Master Dodgers, and I didn't give them any armor (in case it somehow impedes speed/dodging - I haven't tested this yet).

All dwarves died, not one dodged. This would imply dropping items are indeed undodgeable. I suspect dodging is a... combat-specific action, and doesn't occur when the dwarf is not being targeted by an enemy.


...

Why does the bolt material density not matter, but the density of a falling item does? My theory is that the bolts are launched from the crossbow at a constant impulse or a constant energy, so that the density is used twice and cancels out of the equation, leaving only bolt size. Not sure how to test this.

EDIT: removed unreproduceable science. wouldn't be good to be creating myths right now.

I remembered the term "constant impulse" from Your earlier post concerning pre-minecart knockback research, where You found that crossbow knockback did not depend on bolt density. I hope I'm not doubling up on research already done, but I decided to see if this is the case in 34.11.

I improvised an experimental setup where I could estimate the distance a dwarf is propelled without skidding effects. I used the whole arena to make a cliff with isolated lanes:



I modded crossbows to SHOOT_FORCE = 100'000 and SHOOT_MAXVEL = 100'000, and I modded light silver and heavy silver to SOLID_DENSITY 2000 and 30'000, respectively. Referring to figure 1, The top 3 dwarves used light silver bolts, the middle 3 dwarves used regular silver bolts, and the bottom three dwarves used heavy silver bolts. All dwarves were Grand Master Marksdwarves/Archers.

The results are presented in Figure 3.


The spots marked with red circles are the spots the dwarves were at the moment the battle report informed that they were "skidding" for the first time, which I assume is their first contact with the ground.

Light silver bolts propelled dwarves the least, dropping them close the foundation of the pillar.
Regular silver bolts propelled dwarves the furthest.
Heavy silver bolts propelled dwarves... a medium distance.

Members of a given bolt weight category fell in the exact same distance, and from what I could tell, stopped skidding in the exact same spot. I later repeated the experiment with only regular silver, and veeery caaaarefully studied two of the trajectories tick by tick, and they were identical, even for the skidding part (even the moments skids were reported were identical). So results should be easily reproduced, with little to no variation between individual runs.

I have not yet formulated satisfying conclusions from this, but bolt density/weight clearly effects crossbow knockback in 34.11.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on October 06, 2012, 08:30:04 pm
...
I remembered the term "constant impulse" from Your earlier post concerning pre-minecart knockback research, where You found that crossbow knockback did not depend on bolt density. I hope I'm not doubling up on research already done, but I decided to see if this is the case in 34.11.

I improvised an experimental setup where I could estimate the distance a dwarf is propelled without skidding effects. I used the whole arena to make a cliff with isolated lanes:
...
Light silver bolts propelled dwarves the least, dropping them close the foundation of the pillar.
Regular silver bolts propelled dwarves the furthest.
Heavy silver bolts propelled dwarves a medium distance.

Members of a given bolt weight category fell in the exact same distance, and from what I could tell, stopped skidding in the exact same spot. I later repeated the experiment with only regular silver, and veeery caaaarefully studied two of the trajectories tick by tick, and they were identical, even for the skidding part (even the moments skids were reported were identical). So results should be easily reproduced, with little to no variation between individual runs.

I have not yet formulated satisfying conclusions from this, but bolt density/weight clearly effects crossbow knockback in 34.11.

Here's a thought experiment. Say you launch bolts with a constant impulse (http://en.wikipedia.org/wiki/Impulse_(physics)). The light bolts would go really fast, but there is a MAXVEL on the crossbow. Normal bolts travel slower, and heavy bolts travel really slow. The light bolts hit a dwarf with reduced momentum (because the cap stole their velocity!) whereas the normal and heavy bolts have the same momentum at impact. Using conservation of momentum you find the new velocity of the dwarf w/ embedded bolt. The heavier bolt adds to the mass of the combination, reducing the final velocity.

Using real world-mechanics:
Code: [Select]
Momentum (N-m)  Mass (kg) Velocity cap (m/s) Bolt velocity (m/s) Impact (N-m) 87kg dwarf V (m/s)
        100000         45             100000                2222       100000                758
        100000        4.5             100000               22222       100000               1093
        100000        1.6             100000               63694       100000               1129
        100000        0.3             100000              100000        30000                344

Your light bolts were 0.3 kg and propelled the dwarf 2-3 tiles (depends on rounding when he hits the ground).
Your normal bolts were 1.6 kg and propelled the dwarf 11 tiles.
Your heavy bolts were allegedly 4.5 kg, but I suspect you had an extra zero in there to get 45 kg, as the dwarf was propelled 8 tiles. Look at the final column in my table above, and divide the numbers by 100. The distance travelled horizontally depends only on initial velocity and the (identical) fall time. DF uses floating point calculations for parabolic paths and minecarts.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Oaktree on October 06, 2012, 09:39:54 pm
Is there a chance for a dwarf to dodge dropped objects?

I repeated Urist da Vinci's dwarf-eagle setup with ten of each, and gave the eagles around 30 separate bolts, as suggested by rhesusmacabre. The dwarves were all Grand Master Dodgers, and I didn't give them any armor (in case it somehow impedes speed/dodging - I haven't tested this yet).

All dwarves died, not one dodged. This would imply dropping items are indeed undodgeable. I suspect dodging is a... combat-specific action, and doesn't occur when the dwarf is not being targeted by an enemy.


That carries serious implications for dwarven defense systems incorporating falling or flung objects.  Master level goblin leaders who dodge and block weapon traps and bolts with ease are basically as vulnerable to these as a low-level recruit goblin.  I have some anecdotal evidence from seeing such a leader block or dodge crossbow bolts for a while and then get totally de-limbed by a mine cart railgun shot of serrated discs.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on October 07, 2012, 04:05:46 am
Your heavy bolts were allegedly 4.5 kg, but I suspect you had an extra zero in there to get 45 kg, as the dwarf was propelled 8 tiles. Look at the final column in my table above, and divide the numbers by 100. The distance travelled horizontally depends only on initial velocity and the (identical) fall time. DF uses floating point calculations for parabolic paths and minecarts.

This would be a very elegant explanation and I would like nothing more than for my hand to have slipped and inserted that additional zero. Unfortunately, I redid the test with careful attention to SOLID_DENSITY modding, and the results were the same as the first time. Regular silver bolts propelled dwarves 11 tiles before skidding (and then an additional 8 to full stop), whilst heavy silver bolts (a stack of 100 of which weighed in at 450 kg) propelled dwarves 8 tiles before skidding (and then an additional 5 to full stop).

I also used regular silver against dwarves clad in full heavy silver armor, for an additional 291 kg of weight. Equipped weight is apparently not included in knockback calculations, since propelled armored dwarves flew 11+8 tiles, same as their naked brethren.

I then tested out a few more metals to increase the amount of experimental data (All parameters the same as in previous post):

iron:       drop 8, skid 6
copper:   drop 9, skid 7
silver:     drop 11, skid 8
gold:      drop 10, skid 8
platinum: drop 7,  skid 5

I must say, I find these results more than a little surprising. Why would silver cause the greatest knockback is a mystery to me (for the moment). For a moment I suspected other parameters to be involved, so I modded candy to be as heavy as silver, and tested both for knockback. All candy parameters are pretty extreme when compared to regular metals, so I thought this would show different results if any of those parameters mattered. However, both test groups were propelled 11+8, so I assume SOLID_DENSITY is the only material-related parameter which matters.

That carries serious implications for dwarven defense systems incorporating falling or flung objects.  Master level goblin leaders who dodge and block weapon traps and bolts with ease are basically as vulnerable to these as a low-level recruit goblin.  I have some anecdotal evidence from seeing such a leader block or dodge crossbow bolts for a while and then get totally de-limbed by a mine cart railgun shot of serrated discs.

I'm seriously considering equipping my fortress with anvil traps (http://www.bay12forums.com/smf/index.php?topic=117360.0) :P
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: rhesusmacabre on October 07, 2012, 04:45:05 am
Toady did state while minecarts were being implemented that they, at least, could be dodged:
Quote from: http://www.bay12games.com/dwarves/#2012-04-20
If the carts aren't going super fast and the dwarf has a space, they'll almost always dodge aside, and even if there is no space, if the cart is going slow enough, they'll just stop it.

I've never actually seen it myself, but I mostly just use carts in 1-tile wide tunnels so maybe that's not surprising. Whether minecarts on tracks are treated as a special circumstance, or it also applies to other projectiles, isn't clear.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Oaktree on October 07, 2012, 08:59:10 am
Toady did state while minecarts were being implemented that they, at least, could be dodged:
Quote from: http://www.bay12games.com/dwarves/#2012-04-20
If the carts aren't going super fast and the dwarf has a space, they'll almost always dodge aside, and even if there is no space, if the cart is going slow enough, they'll just stop it.

I've never actually seen it myself, but I mostly just use carts in 1-tile wide tunnels so maybe that's not surprising. Whether minecarts on tracks are treated as a special circumstance, or it also applies to other projectiles, isn't clear.

Goblins are apparently not that good at it.  Look up the F.R.O.G.G.E.R. system - it's a defense set-up that allows intruding goblins to attempt to cross multiple tracks of high-speed mine carts.  Though I consider the implementation more of a curiousity given the amount of space it takes up.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on October 07, 2012, 02:00:55 pm
...
I then tested out a few more metals to increase the amount of experimental data (All parameters the same as in previous post):

iron:       drop 8, skid 6
copper:   drop 9, skid 7
silver:     drop 11, skid 8
gold:      drop 10, skid 8
platinum: drop 7,  skid 5

I must say, I find these results more than a little surprising. Why would silver cause the greatest knockback is a mystery to me (for the moment). For a moment I suspected other parameters to be involved, so I modded candy to be as heavy as silver, and tested both for knockback. All candy parameters are pretty extreme when compared to regular metals, so I thought this would show different results if any of those parameters mattered. However, both test groups were propelled 11+8, so I assume SOLID_DENSITY is the only material-related parameter which matters.
...

I tested the same arena layout and crossbow properties as you, and the same 5 normal bolt materials, except using cats as the test subject. All cats were propelled 11+10, regardless of material. I tested this with an ultralight creature and uberpowerful crossbow, and it indeed appears to be a knockback cap on bolt hits. Any testing results that hit the cap are probably invalid as the actual value could have exceeded the cap.

...
Finally, I doubled bolt size from 150 to 300. Lo and behold, both copper26500 and copper27000 caused damage. Assuming the simplest relation possible, I repeated the test with copper13250 and copper13500 (IMPACT_YIELDs halved compared to previous), and sure enough copper13250 deflected, while copper13500 did not.

The current equation is therefore:

The threshhold of the ammo's IMPACT_YIELD is equal to 510*ARMOR_SOLID_DENSITY/AMMO_SIZE
...

I tested this with dropped bowls, dropped bolts, and varying sizes and contact areas. The equation appears to be something like (500 + C)*ARMOR_SOLID_DENSITY/AMMO_SIZE, where C is a function of the contact area. The contact area of objects appears to be a function of their size (AMMO_SIZE), except for ammo with a defined ATTACK contact area.

A size 100 aluminum bowl deflects off steel armored dwarf at ~40000
A size 1000 aluminum bowl deflects at ~10000
A size 10000 aluminum bowl deflects at ~6400

A size 1500 iron bolt deflects off steel armor at ~2670
A size 1500 iron bolt with 10x contact area deflects at ~9000

Also, for threshold IMPACT_YIELD greater than about 10000, the difference between deflect and blunt damage on armor is binary. For thresholds 0-10000, the difference is fuzzy and also appears to depend on body part size or number of armor layers (i.e. lower leg deflects because boots+greaves, but upper leg damaged because only greaves!).

This research has useful applications because wooden arrows (i.e. from elves) kill dwarves in candy, aluminum, wood, bone, and leather armor, but heaver junk metals like pewter (i.e. artifact) or copper armor will safely deflect the arrows. The armor density needs to be at least 3000.

Armor would need to have a density of 59000 or greater to deflect bone bolts, and as shown earlier in the thread bone bolts do blunt damage through all vanilla metal armors.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: HiEv on October 14, 2012, 09:44:10 pm
Bottom line - plate armor does nothing against bolts, and chainmail provides modest protection against them.  This is quite the opposite of what I would have expected.

Just curious, but what exactly is it in the raws about chainmail that makes it protect against bolts and arrows (projectiles) vs. how plate armor is defined?  Is it the "STRUCTURAL_ELASTICITY_CHAIN_ALL" in mail shirts?  Or is it the "ARMORLEVEL:2" (chain) vs. "ARMORLEVEL:3" (plate)?

And how does that affect pants?  I noticed that testing seemed to only mention greaves ("ARMORLEVEL:3"), and not leggings ("ARMORLEVEL:1" + "METAL_ARMOR_LEVELS" = chain when made with metal; "STRUCTURAL_ELASTICITY_CHAIN_METAL").  So do greaves work while plate doesn't?  Or do leggings work better than greaves?

I'm asking because I was wondering about creating headgear, such as a mail coif, that helps protect against projectiles.  The basic helm has "ARMORLEVEL:1" and "METAL_ARMOR_LEVELS" which means that it's effectively of the "chain" armor level when made with metal, but it doesn't have "STRUCTURAL_ELASTICITY_CHAIN_METAL", and doesn't seem to protect against projectiles.  This seems to suggest that it's the "STRUCTURAL_ELASTICITY_CHAIN_METAL" that gives it the resistance to projectiles.  Is this correct?

TL;DR: Exactly what raw token(s) give(s) armor the ability to protect against projectiles?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on October 15, 2012, 04:54:59 am
TL;DR: Exactly what raw token(s) give(s) armor the ability to protect against projectiles?

I'm not 100% certain at the moment, but I will be when I finish my latest study.

My current working hypothesis is that it is indeed the [STRUCTURAL_ELASTICITY_CHAIN_ALL] tag that grants projectile protection. More specifically, I believe this tag grants the convert-EDGE-into-BLUNT-damage ability to the armor it is added to. As a result, bolts made of equal or "worse" materials than the chain mail bruise and fracture instead of tearing. This protects against 3 death conditions: Throat tear, Heart tear, and half of the Spinal tears. From what I've heard (but not tested), chain mail does not protect against blunt damage, so that same tag when added could possibly also have the effect of erasing any blunt damage protection that armor might have had. 

Another interesting consequence of Pirate Bobs results is that plate armor appears to be useless against piercing attacks (or at least "extreme" piercing attacks), even if the piercing weapon is made from a "worse" metal than the armor. I'll be testing this on spears to see if the vulnerability persists for non-crossbows. However, it is known that plate armor protects well against typical slashing attacks made by weapons of "worse" metals (e.g. copper axes deflect of of steel armor), so this is not a general vulnerability to EDGE attacks.

I'll be posting more data on these issues when I have the results.

Having headgear with chain-mail like properties is an interesting idea. Unfortunately, I half expect that it will simply cause the bolt the jam the skull through the brain instead of outright tearing it - after all, blunt attacks are known to be vastly more effective at dealing head-related deathblows. However, if it happens to convert a significant percentage of what-would-have-been-brain-or-spinal-tears into bruising and skull shattering, then I'd call that a success. Current percentages for practically all non-candy metal bolts hitting the head are 10% non-lethal damage, 30% spinal tears, 60% brain tears.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: sayke on October 15, 2012, 10:20:37 am
this is fantastic - i eagerly await the experimental results! =D
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: HiEv on October 15, 2012, 05:06:37 pm
My current working hypothesis is that it is indeed the [STRUCTURAL_ELASTICITY_CHAIN_ALL] tag that grants projectile protection. More specifically, I believe this tag grants the convert-EDGE-into-BLUNT-damage ability to the armor it is added to. As a result, bolts made of equal or "worse" materials than the chain mail bruise and fracture instead of tearing. This protects against 3 death conditions: Throat tear, Heart tear, and half of the Spinal tears. From what I've heard (but not tested), chain mail does not protect against blunt damage, so that same tag when added could possibly also have the effect of erasing any blunt damage protection that armor might have had.

This hypothesis leads to a second question for me.  Does this mean that it would be better to wear chain mail outside of plate, if that was possible?

Basically, if the chain converts edge to blunt, but does not protect against blunt damage, could you then have a plate layer under the chain which would absorb the now-blunt damage?

I guess this depends on whether Toady tests conditions on each layer sequentially, and if the conditions are modified by the previous layer(s).  If so, then this might mean that wearing chain (with the "STRUCTURAL_ELASTICITY_CHAIN_ALL" tag) outside of plate is the best armor setup in terms of protecting from all types of damage.

(It doesn't have to be plate under the mail, it's just the first thing that came to mind and it's already in the game.  If you want something more traditional, something like a gambeson (http://en.wikipedia.org/wiki/Gambeson) could be worn under the chain to absorb the blunt damage instead.  There isn't really an in-game equivalent for this already though.)
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on October 15, 2012, 06:02:27 pm
My current working hypothesis is that it is indeed the [STRUCTURAL_ELASTICITY_CHAIN_ALL] tag that grants projectile protection. More specifically, I believe this tag grants the convert-EDGE-into-BLUNT-damage ability to the armor it is added to. As a result, bolts made of equal or "worse" materials than the chain mail bruise and fracture instead of tearing. This protects against 3 death conditions: Throat tear, Heart tear, and half of the Spinal tears. From what I've heard (but not tested), chain mail does not protect against blunt damage, so that same tag when added could possibly also have the effect of erasing any blunt damage protection that armor might have had.

This hypothesis leads to a second question for me.  Does this mean that it would be better to wear chain mail outside of plate, if that was possible?

Basically, if the chain converts edge to blunt, but does not protect against blunt damage, could you then have a plate layer under the chain which would absorb the now-blunt damage?

I guess this depends on whether Toady tests conditions on each layer sequentially, and if the conditions are modified by the previous layer(s).  If so, then this might mean that wearing chain (with the "STRUCTURAL_ELASTICITY_CHAIN_ALL" tag) outside of plate is the best armor setup in terms of protecting from all types of damage.

(It doesn't have to be plate under the mail, it's just the first thing that came to mind and it's already in the game.  If you want something more traditional, something like a gambeson (http://en.wikipedia.org/wiki/Gambeson) could be worn under the chain to absorb the blunt damage instead.  There isn't really an in-game equivalent for this already though.)

I tested this a while back, and at least in the arena it doesn't matter which order you put on plate/chain armor.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on October 15, 2012, 08:27:44 pm
Slightly off topic, but as a result of some of the earlier testing I have found that the contact area of items and body parts, unless defined in an attack, is given by the following:

CONTACT_AREA = (SIZE/10)^(2/3)

This gives the following, as an example:
Code: [Select]
Thing contact area
Dwarf fist 19
Dwarf foot 25
Dwarf scratch 7
Dwarf bite 7
Dwarf upper body 100
Dwarf upper leg 63
Dwarf upper arm 34
Dwarf hand 18
Dwarf foot 24
Dwarf head 43
Dwarf finger 2

Also a bowl has a contact area of 4, while a minecart has a contact area of 250.

Compare this to war hammers having a contact area of 10, or maces 20. I'd guess that the lower of the weapon's contact area and the body part being hit's contact area is used in the combat calcs.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on October 16, 2012, 05:57:06 am
I guess this depends on whether Toady tests conditions on each layer sequentially, and if the conditions are modified by the previous layer(s).  If so, then this might mean that wearing chain (with the "STRUCTURAL_ELASTICITY_CHAIN_ALL" tag) outside of plate is the best armor setup in terms of protecting from all types of damage.

Truthfully, I wasn't even aware that it was possible to put on clothing/armor out of the Under -> Over -> Armor -> Cover sequence. But I understand what You're saying - it would be amazing if there was a... [PADDING] tag, and padded clothes could be used in conjunction with metal armor to increase protection against bludgeoning damage. For the moment I suppose no such system is implemented. For one, the mail-over-plate doesn't make a difference, as tested by Pirate Bob. For another, I tested the helm + 6 leather hoods setup mentioned on the wiki page on Armor, and it performed exactly the same as using a single helm. Then again, I used crossbows bolts for testing, so maybe a metal helm with leather padding helps against war hammers? Worth a try, I suppose.

Slightly off topic, but as a result of some of the earlier testing I have found that the contact area of items and body parts, unless defined in an attack, is given by the following:

CONTACT_AREA = (SIZE/10)^(2/3)

Information of this type is hard to find sometimes, so I at least am glad to see it, even slightly off-topic. How do You obtain an item's Contact Area? Say I have a... granite block - what is the procedure to find out it's Contact Area?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on October 17, 2012, 05:25:09 pm
Finally, here are my results from varying [SHOOT_FORCE] on crossbows.  I'm very sorry this took so much longer - I was totally confused by the results, and thought that I must have done something wrong (and I've also been too busy to figure out what was going on).  After seeing results from Urist da Vinci and Zivilin, I think I now understand.

I strongly believe that there are at least two types of deflections which can occur.  The type investigated by Urist/Zivilin I would equate roughly to an inelastic collision which destroys the projectile.  If the [IMPACT_YIELD] of the projectile is less than 3.3970 times the [SOLID_DENSITY] of the armor (using vanilla values for all other parameters), then it deflects (yes, I tested it to 4 decimal places - I was sick and bored...).  I confirmed that deflection of copper bolts with modified [IMPACT_YIELD] off steel armor occurs for [IMPACT_YIELD] greater than 26666
I believe this type of deflection occurs if the stiffness of the armor (I don't yet know which DF parameters control this) is not high enough to cause an elastic collision (which is what I assumed all deflections would be).  Rather, if the bolt material is fragile/squishy enough, the bolt is destroyed/deformed, absorbing all the energy of the collision.  In an inelastic collision, some small piece of the armor will be pushed in some distance.  Assuming the armor's stiffness is low enough that it can't provide significant resistance, then the pressure required to push the armor will be proportional to its density.  If the [IMPACT_YIELD] of the bolt is not high enough to withstand this pressure, it is destroyed.  It's a little odd that this is an all-or-nothing thing, but I guess to first order it makes sense.

My results also seem to show that if the momentum (or maybe energy? - it should be momentum based on real-world physics, but who knows...) of an incoming bolt is low enough, then it can deflect off of armor.  For these tests, I used rows of shooters 2 tiles away from rows of targets, with nothing blocking the shooters from targeting any dwarves in the target row (not ideal, but I didn't think of this at the time).  The targets wore helms, breastplates, greaves, 2 gauntlets and 2 low boots of the appropriate material.  I wanted to test deflection off rigid armor only, so I did not include chain mail.  If anything looks "out of place", please let me know - I ran a lot of tests (this is actually only a fraction), so it's possible I might have mixed up some of the data. 
Spoiler: Shoot Force 25 (click to show/hide)
Spoiler: Shoot Force 26 (click to show/hide)
Edit: added in Shoot Force 35 without chain mail. 
Spoiler: Shoot Force 35 (click to show/hide)
The [SHOOT_FORCE:35] data is actually somewhat interesting, as it seems to be right at the point where wood starts penetrating metal, and silver penetrates candy.

See two posts down for data with chain mail and discussion...
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: misko27 on October 17, 2012, 05:40:03 pm
[NOTE: NOT YET COMPLETE - this will be a largish post, and it is not finished - I am still working on inputting all the data tables.  I wanted to upload what I have so I don't lose it...]

Finally, here are my results from varying [SHOOT_FORCE] on crossbows.  I'm very sorry this took so much longer - I was totally confused by the results, and thought that I must have done something wrong (and I've also been too busy to figure out what was going on).  After seeing results from Urist da Vinci and Zivilin, I think I now understand.

I strongly believe that there are at least two types of deflections which can occur.  The type investigated by Urist/Zivilin I would equate roughly to an inelastic collision which destroys the projectile.  If the [IMPACT_YIELD] of the projectile is less than 3.3970 times the [SOLID_DENSITY] of the armor (using vanilla values for all other parameters), then it deflects (yes, I tested it to 4 decimal places - I was sick and bored...).  I confirmed that deflection of copper bolts with modified [IMPACT_YIELD] off steel armor occurs for [IMPACT_YIELD] greater than 26666


Spoiler: Shoot Force 26 (click to show/hide)
For some reason, It occured to me that citations in the Dwarven universe are alot easier, considering everyone is named urist.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on October 17, 2012, 06:27:20 pm
I strongly believe that there are at least two types of deflections which can occur.

Agreed. To be more specific, there is one type of deflection, but different mechanisms that cause it, which may model different types of interactions - like a completely inelastic collision. The Wooden bolt deflections off of metal armors can be attributed to IMPACT_YIELD deflections (Wood has a default IMPACT_YIELD of 10000). But Wooden bolts deflecting off of candy armor are obviously a different mechanism - for one thing, they're not 0% or 100%, but in between.

I'll be looking forward to the rest of the post. I do have a question though: what armor are You using in the tests? I don;t think it is full plate+mail, because I see that You have plenty of deaths happening in candy vs candy, which only happened previously in Your plate-mail only tests. Full plate + Mail produces near 100% deflections in candy vs candy (and the hits are all to the facial features not covered my helms - like teeth).


For some reason, It occured to me that citations in the Dwarven universe are alot easier, considering everyone is named urist.

Seems to me that would be confusing as hell. And difficult to give credit where credit is due :P

Presentation ceremony for the dwarven science awards:

"And the Urist Prize for Magma Science goes to... URIST!"

<Everyone stands up and start approaching the podium>

<Everyone starts tantruming>

<Last Urist standing receives award>
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on October 17, 2012, 08:09:03 pm
Edit: Zivilin pointed out that my results show less death with candy vs. candy at Shoot Force 35 than with lower forces, among other anomalies.  I went back and checked, and both of the below results include chain mail shirts on top of breastplates, helms, greaves, gauntlets and low boots.  They therefore should not be compared directly with the lower force results.  I will try to retake these sets without chain mail if I get the chance. 
I believe that these deflections which occur at low [SHOOT_FORCE] may be elastic.  This would mean that they bounce off armor without changing speed or depositing any energy.  It would require that the armor material is stiff enough to cause the needed change in momentum without deforming.  I am not sure what DF material parameters determine this stiffness yet, but my next step will be to look at how deflection changes with material to try to figure this out. 

I strongly believe that there are at least two types of deflections which can occur.
Agreed. To be more specific, there is one type of deflection, but different mechanisms that cause it, which may model different types of interactions - like a completely inelastic collision. The Wooden bolt deflections off of metal armors can be attributed to IMPACT_YIELD deflections (Wood has a default IMPACT_YIELD of 10000). But Wooden bolts deflecting off of candy armor are obviously a different mechanism - for one thing, they're not 0% or 100%, but in between.
This is exactly what I was referring to.  I was totally lost at how candy could be the worst at deflecting wood, and yet the best at deflecting everything else.  It didn't occur to me that deflection could occur by more than one mechanism until I realized that the [IMPACT_YIELD] mechanism was clearly completely different from what I had observed.

Edit:  I went to run Shoot Force 35 without chain mail, and accidentally ran the script with chain mail again.  Here is the data for that run - hopefully it should be consistent with the previous run:
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on October 17, 2012, 08:25:32 pm
...
Slightly off topic, but as a result of some of the earlier testing I have found that the contact area of items and body parts, unless defined in an attack, is given by the following:

CONTACT_AREA = (SIZE/10)^(2/3)

Information of this type is hard to find sometimes, so I at least am glad to see it, even slightly off-topic. How do You obtain an item's Contact Area? Say I have a... granite block - what is the procedure to find out it's Contact Area?

From http://dwarffortresswiki.org/index.php/Weight I see that blocks are volume 600.

Note that the weight formula is "Weight = Density * Volume /100,000", and that DF weight is equivalent to kilograms, and that DF density is given in kg/m3. Item sizes and creature body sizes are given in cubic centimeters (cm3). To convert a number from cm3 to m3, you divide it by 100^3=1,000,000. Therefore "Weight = Density * Size /1,000,000" and "Volume = Size/10".

So the contact area of the block should be 600^(2/3) = 71 (or close to that, depending on how you round numbers).
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on October 18, 2012, 05:37:59 am
If anything looks "out of place", please let me know - I ran a lot of tests (this is actually only a fraction), so it's possible I might have mixed up some of the data. 

Good job on getting all that data!

I was surprised that a SHOOT_FORCE of 26 causes deaths in candy vs candy (I'm not sure how it causes them, since the table also states that there is 100% of deflections), whilst INCREASING the SHOOT_FORCE to 35 leads to absolutely no deaths not only in candy vs candy, but also bronze, copper, iron and steel vs candy. So increasing the SHOOT_FORCE... increased deflections? Increasing it further to 42 seemed to once more cause deaths in bronze, copper, iron and steel vs candy, but still no deaths in candy vs candy.

From http://dwarffortresswiki.org/index.php/Weight I see that blocks are volume 600.

Note that the weight formula is "Weight = Density * Volume /100,000", and that DF weight is equivalent to kilograms, and that DF density is given in kg/m3. Item sizes and creature body sizes are given in cubic centimeters (cm3). To convert a number from cm3 to m3, you divide it by 100^3=1,000,000. Therefore "Weight = Density * Size /1,000,000" and "Volume = Size/10".

So the contact area of the block should be 600^(2/3) = 71 (or close to that, depending on how you round numbers).

Please excuse me if I wasn't clear enough - I more or less know how the weight and volume calculations work. What I was curious about was how do You verify what the Contact Area of an object really is? E.g. the weight formula can be easily verified - the weight of any object can be checked by opening the description of that object in-game, and then it can be compared with the results of the formula. Is there any such way to verify that the Contact Area of a block is really around 71?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on October 18, 2012, 06:50:36 am
I was surprised that a SHOOT_FORCE of 26 causes deaths in candy vs candy (I'm not sure how it causes them, since the table also states that there is 100% of deflections), whilst INCREASING the SHOOT_FORCE to 35 leads to absolutely no deaths not only in candy vs candy, but also bronze, copper, iron and steel vs candy. So increasing the SHOOT_FORCE... increased deflections? Increasing it further to 42 seemed to once more cause deaths in bronze, copper, iron and steel vs candy, but still no deaths in candy vs candy.
Thanks for catching this!  As I feared, I mixed up what conditions I used for these data sets.  I went back and looked at the logs for the SHOOT_FORCE 35 and 42 tests and found that, on top of breastplates, greaves, gauntlets, helms and low boots, they also have chain mail shirts.  I confirmed that the lower force tests did not have chain mail.  I will try to redo the higher force tests without chain mail if I get the chance.

In the mean time, I do have results for [SHOOT_FORCE:26] with chain mail on top of breastplates, greaves, gauntlets, helms and low boots:
As you can see, this makes much more sense when compared with higher forces, as there are no deaths at all for dwarves wearing candy, and steel also provides full protection against most metals.

I also have results from slade in this set, but slade is heavy enough that it causes jams, which messes up my analysis script.  The script finds hits against armor by looking for the word "through", and the phrase "jamming the X through the X" causes it to mess up.  I haven't yet figured out a way around this (and previously broke the script when trying - this was a big part of the delay).  It is possible that platinum also causes jams rarely, but I didn't find any when searching.  I noticed that slade was causing jams because the results for naked dwarves show hits through armor, and I have never seen this in any other data.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Ruhn on October 18, 2012, 11:01:50 am
I just skimmed the entire thread and am quite impressed with this research project.

I was wondering how these would factor into the test?
Bone armor
Wooden armor
Candy clothing - by itself, and in conjunction with metal armor.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Trouserman on October 18, 2012, 12:04:56 pm
I also have results from slade in this set, but slade is heavy enough that it causes jams, which messes up my analysis script.  The script finds hits against armor by looking for the word "through", and the phrase "jamming the X through the X" causes it to mess up.  I haven't yet figured out a way around this (and previously broke the script when trying - this was a big part of the delay).

I don't know how your script is structured, but if you're having difficulty modifying it to handle jams, perhaps you could instead preprocess the log by filtering out the jams.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on October 20, 2012, 07:39:07 am
I don't know how your script is structured, but if you're having difficulty modifying it to handle jams, perhaps you could instead preprocess the log by filtering out the jams.
My script is written in perl, so I believe it should be relatively easy to have it recognize the phrase "...through the [small/large/etc] [material]..." instead of just "through" to determine hits.  This should prevent confusion from jams or anything else that I haven't thought of.  I messed this up on my previous attempt (and caused the script not to work at all), but I hope to have another go this weekend.  If it doesn't work I might try filtering out jams, as you suggested.

I noticed some more strangeness with [SHOOT_FORCE:35] data.  For some reason, there are less deflections against steel for [SHOOT_FORCE:35] than [SHOOT_FORCE:26].  I reran the [SHOOT_FORCE:26] set without chain mail, with the same conditions I just used to make sure there isn't some other difference besides [SHOOT_FORCE]
Spoiler: Shoot Force 26 #2 (click to show/hide)
It appears that the difference is real, and there actually are less deflections off steel at Force 35 than Force 26.  I feel like I'm being dyslexic or something, as I am totally confused as to how this could possibly be. 

I do have one thought - maybe at lower force the targets take longer to kill after they have fallen over.  I haven't quantified this, but I've noticed there seem to be a higher percentage of deflections later in the simulation, when more dorfs are lying on the ground, and there is a higher chance of shots coming from large distance (as shooters far up the row will be shooting at the few remaining targets).  I will see if this results is reproduced for iron vs. steel using Zivilin's 1v1 cell arrangement, to rule out the distance factor.  If this doesn't work, I will try to map out the results for iron vs. steel carefully over the range between Force 25 and 40, to see if that gives any insights.

I'd guess that the lower of the weapon's contact area and the body part being hit's contact area is used in the combat calcs.
It's also possible that for this or some other reason deflection depends on body part.  Given that "inelastic" deflection was found to be all-or-nothing, it is possible that "elastic" deflection against each body part is also binary.  This would cause deflection% to change in discrete steps as projectile momentum increases.  I'd also expect that the likelihood of each body part to get hit changes if the dorf is on the ground, so this suggests a way that dorfs falling over could change deflections. 

Furthermore, I've noticed that I get a few percent differences in deflections when re-running the same data set.  Each set contains over 10,000 hits, so if all hits are equivalent and independent, the error should be less than 1 percent.  If instead deflections depend on target stance or distance, then the deflections would be correlated depending on how quickly the dorf fall over etc, and the variance between data sets would be significantly larger.

I just skimmed the entire thread and am quite impressed with this research project.

I was wondering how these would factor into the test?
Bone armor
Wooden armor
Candy clothing - by itself, and in conjunction with metal armor.
I'm glad you like our project!  There are two things which prevent me from immediately adding these armors:
1) They are not available in the arena without modding.  I'm not sure I know the proper way to add them, and I don't want to mess it up.
2) It already takes me all night to run the set I use currently.
I would like to try such things eventually though.  If you know the proper way to add them, I'd be very interested.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on October 20, 2012, 11:46:16 am
Furthermore, I've noticed that I get a few percent differences in deflections when re-running the same data set.  Each set contains over 10,000 hits, so if all hits are equivalent and independent, the error should be less than 1 percent.  If instead deflections depend on target stance or distance, then the deflections would be correlated depending on how quickly the dorf fall over etc, and the variance between data sets would be significantly larger.

I have some advice on the topic of obtaining objective data. I redid many of my experiments a few times in an attempt to identify parameters which can add unnecessary interference to the data. Using my limited modding abilities, I implemented all of my observations into a creature template, which I called the arena dwarf:

Spoiler: Arena Dwarf (click to show/hide)

Most of it is based on the standard dwarf code. The notable exceptions are as follows:

Also, I remember You once mentioned that Your macros sometimes get messed up during operation, with no apparent reason. I also had this problem, and I recently identified the reason - any mouse movement (not clicking - just movement itself). Now I unplug the mouse when running macros and I haven't had a mishap since.

There are two things which prevent me from immediately adding these armors:
1) They are not available in the arena without modding.  I'm not sure I know the proper way to add them, and I don't want to mess it up.
2) It already takes me all night to run the set I use currently.
I would like to try such things eventually though.  If you know the proper way to add them, I'd be very interested.

The only thing which is not available in arena mode without modding is bone items - wood armor and candy clothes are readily avialable. You can use the fake bone template I introduced in the first post of this thread. Adding it to the inorganic_metal.txt file should allow bone weapons/armors (admittedly, I'm not certain how close fake bone is to real bone, but I am using the parameters for bone from the material_template_default.txt file, so I assume it is pretty close)
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on October 20, 2012, 02:45:01 pm
Thanks Zivilin!  I had read about your arena dwarves before, and meant to use them, but I forgot.  I strongly suspect that you may be right that it is unconsciousness that is causing me problems.  I plan to adjust my script to count hits/deflections after dwarves fall over/are unconcious to see if it makes a difference.  If so, then I will go on to tally vs. each body part (which will be a big pain). 

First off, I reran iron bolts vs. steel armor (no chainmail) with [SHOOT_FORCE:26] using Zivilin's cell style arena (sets of enclosed shooters and targets separated by fortifications).  This time I got 49% deflections, compared to only 45% with my setup with long rows of shooters/targets.  I will add the results for [SHOOT_FORCE:35] later today.  This difference appears significant, but I am not sure if it is due to the change in shooting distance, or lots of shooters rapidly firing on a few downed dwarves that are left slowly bleeding to death.

Edit:  I ran for [SHOOT_FORCE:35], and I get 55% deflection for this case (compared to 50% before).  So while using cells does make a difference compared to rows, it does not explain why I find higher deflection off steel armor with SHOOT_FORCE 35 than 26.  I guess it's time to start messing with my analysis scripts.

Also, thanks for the tip about the mouse, but I have an old thinkpad with the knob, and no mouse.  I think my issues might have been due to the computer going into different sleep states etc, and I've turned off most of that stuff and haven't seen problems lately, but I may have missed something.   I do agree that the root cause is probably external processes interrupting dwarf fortress.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on October 20, 2012, 03:29:32 pm
...
Please excuse me if I wasn't clear enough - I more or less know how the weight and volume calculations work. What I was curious about was how do You verify what the Contact Area of an object really is? E.g. the weight formula can be easily verified - the weight of any object can be checked by opening the description of that object in-game, and then it can be compared with the results of the formula. Is there any such way to verify that the Contact Area of a block is really around 71?

I waited to answer until I could finish the work posted here: http://www.bay12forums.com/smf/index.php?topic=91166.msg3712752#msg3712752

I used a DFHack lua script to read the wound data structure and found the wound's contact area.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Sutremaine on October 20, 2012, 06:04:57 pm
Average size enforced - to be honest, I am not certain whether this changes actual dwarf size or only their descriptions, but I modded the size descriptors so that all arena dwarves are always average size
It will change their size. Most dwarves killed by drowning and then butchered will give the same amounts of meat and bone, but there will sometimes be differences. The differences between individuals are much easier to see in larger creatures such as giant sperm whales.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on October 21, 2012, 08:02:24 am
As usual, it seems Zivilin was correct about the anomalies in my results.  I modified my analysis script and found that, at force 35, for iron vs. steel, plate armor only, 100% of the hits that penetrated armor occurred when the targets where unconscious.  To make sure I didn't make a mistake, I also re-ran the test using Zivilin's Arena Dwarves, and got 100% deflections off armored areas.

I will have to update all my tables with some additional columns showing the %deflection when dwarves are conscious/unconscious.

Also, I almost fell over laughing when I read the description of an Arena Dwarf.  Most appropriate :P!
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: alcohol_dependent on October 21, 2012, 12:38:43 pm
Just wanted to pop in and ask if anyone considered changing adamantine to a higher weight. Didn't think this through much compared to the amount of data you guys are providing but it just struck me that maybe somewhere in the algorithm shoot force takes weight of the projectile into account, which would explain the weird results from adamantine vs adamantine.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on October 21, 2012, 05:00:33 pm
I waited to answer until I could finish the work posted here: http://www.bay12forums.com/smf/index.php?topic=91166.msg3712752#msg3712752

I used a DFHack lua script to read the wound data structure and found the wound's contact area.

That's digging deep. I'll have to get DFHack and see whether I am capable of using any of the tools there. Truth to tell, I am terrible at code analysis - black box experimentation suits me much better. :P Nevertheless, thank You for the information.

Average size enforced - to be honest, I am not certain whether this changes actual dwarf size or only their descriptions, but I modded the size descriptors so that all arena dwarves are always average size
It will change their size. Most dwarves killed by drowning and then butchered will give the same amounts of meat and bone, but there will sometimes be differences. The differences between individuals are much easier to see in larger creatures such as giant sperm whales.

Thanks for confirming. And it just occurred to me to kill some regular dwarves and arena dwarves in the arena and check the weights of their corpses. All arena dwarves weighed 86 urists, whilst the weights of regular dwarves clearly fluctuate. I am still not certain to what extent this affects combat (though I am certain it does).

As usual, it seems Zivilin was correct about the anomalies in my results.  I modified my analysis script and found that, at force 35, for iron vs. steel, plate armor only, 100% of the hits that penetrated armor occurred when the targets where unconscious.  To make sure I didn't make a mistake, I also re-ran the test using Zivilin's Arena Dwarves, and got 100% deflections off armored areas.

I was not certain whether unconsciousness makes opponents more vulnerable to ranged attacks as it does for melee attacks - after all, they are already known to differ in that ranged attacks do not automatically aim for headshots when the opponent is unconscious. So this is another interesting confirmation. I was wondering, when you get all the results, could You compile them in an Excel sheet (or something similar) and put them up on DFFD? With information on what armor was used, etc. It would make it easier to analyze.

Also, I almost fell over laughing when I read the description of an Arena Dwarf.  Most appropriate :P!

Isn't it? ^_^ After I read the description of the standard dwarf, that variation just popped into my head, and I could not imagine using anything else. It fits all dwarves, really :P

Just wanted to pop in and ask if anyone considered changing adamantine to a higher weight. Didn't think this through much compared to the amount of data you guys are providing but it just struck me that maybe somewhere in the algorithm shoot force takes weight of the projectile into account, which would explain the weird results from adamantine vs adamantine.

Modifying the density of candy would definitely produce significant results. I am interested in this if only to shed some light on the deflecting mechanism of candy vs candy (and other vs candy combinations). I'm certain someone will get around to it, in time. Most of my time has recently been locked up in melee tests, which I am continually failing at -_-'' I have redid the same test runs 3 times now, each time discovering a new interference. Today I finished the third run, and I discovered an hour ago that once more I have failed to consider an interfering factor. I might return to ranged testing if only to complete something successfully :)
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on October 21, 2012, 07:04:43 pm
I was wondering, when you get all the results, could You compile them in an Excel sheet (or something similar) and put them up on DFFD? With information on what armor was used, etc. It would make it easier to analyze.
I have most of my results in Google docs spreadsheets, which I could share with you any time.  I could also post them to DFFD if you want.  Is there anything in particular you want? 

I plan to re-run the large tests with arena dwarves once I get some idea of where the break point for deflections is for this case.  When I get solid data that I understand, I definitely plan to do some kind of write-up with figures, spreadsheets, etc and post it to DFFD.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on October 21, 2012, 07:32:51 pm
We must go deeper!

Code: (chkproj.lua) [Select]
local l = df.global.world.proj_list
l=l.next
    while l do
      printall(l.item)
      print("-")
      l = l.next
    end

Copy the lines of script.
Open your text editor of choice.
Paste the text and save as chkproj.lua or whatever name you want, and put it in the scripts folder of your DFhack directory. 
In the DFhack console, make sure you're in the root menu and not in liquids, dfusion or lua mode.  Type chkproj or whatever name you used for the script.

You'll see something like this:
Spoiler (click to show/hide)

The hit_rating has something to do with accuracy and gets larger as you increase dwarf skill.

The names above were chosen by the DFHack developers, so anything with "unk" is unknown. I highlighted unk22 because I figured out what it is. unk22 is never larger than the crossbow's SHOOT_MAXVEL, and varies according to bolt weight and the SHOOT_FORCE, so I think unk22 is the projectile "velocity". The pre-minecart projectiles didn't travel faster across the screen when they had a high velocity (they instead move 1 tile/tick), but the new parabolic projectiles do and they use the new xyz numbers in the data structure.

By varying material density, SHOOT_FORCE, and SHOOT_MAXVEL, I found the following algorithm:

So I tested candy, iron, platinum, gold, slade, and wood bolts using SHOOT_FORCE=2012 and SHOOT_MAXVEL=3000 and got unk22 values of (candy 3000, iron 2012, platinum 670, gold 1006, slade 67, and wood 3000).

An implication of this algorithm to a default-force, superhigh-maxvel crossbow is that a bolt which weighs 1.01 urists will be shot at velocity 1000, whereas a bolt which weighs 0.99 urists will be shot at "divide by zero" speed. This is absurd since the crossbow hasn't propelled the projectile with more force. Decreasing the bolt's weight by a negligible amount has made it orders of magnitude more dangerous. This problem wouldn't exist if Toady was using a floating point calculation for the bolt weight and shoot force.

So what happens when you compare the velocities calculated from this algorithm to the deflection data?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on October 23, 2012, 08:33:59 am
We must go deeper!

Code: (chkproj.lua) [Select]
local l = df.global.world.proj_list
l=l.next
    while l do
      printall(l.item)
      print("-")
      l = l.next
    end
...
snip!
...
So what happens when you compare the velocities calculated from this algorithm to the deflection data?
Thanks a lot for this great work Urist!  I confirmed that for iron bolts, unk22 is equal to [SHOOT_FORCE] for several values between 40 and 100 (the range I was testing).  I also confirmed that unk22 is 1000 for candy bolts even at  [SHOOT_FORCE:1].  Furthermore, this explains a result that I found a while back - if you reduce the bolt size so that the mass is more realistic (say 100 g per bolt) then there is no longer any dependence damage on [SHOOT_FORCE].  I didn't report this at the time as I thought maybe I had broken DF by doing this or something, but now it is clear that DF was rounding all bolt masses down to zero in this case, so that they always were fired with [MAX_VELOCITY]. 

I would also say that this provides pretty clear evidence that crossbows fire bolts with constant momentum, as you thought, and not with constant energy.  Looks like I owe you a dwarven ale... ;).  Understanding how the game treats bolts at this very low level will be immensely helpful in working out the full details of how deflections work.

On that note, here is a plot of deflection vs [SHOOT_FORCE] for iron bolts fired at arena dwarves (no pain->no unconciousness) wearing steel helm, breastplate, greaves, low boots, and gauntlets:
Spoiler: deflection vs. force (click to show/hide)
It jumps from 100% at force=47 to 22% at force=48, and then tails off rather smoothly from there.  I am going to try running for some different armor/ammo combinations today, but my scripts keep stalling lately for some reason, so not sure if it will work.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: GoombaGeek on October 23, 2012, 08:40:19 am
Guys.

Stop it.

I need something to do my thesis on sometime in the next decade and you're going too fast. I'll have to study and graph something real at the rate you're going.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zivilin on October 23, 2012, 05:29:26 pm
Guys.

Stop it.

I need something to do my thesis on sometime in the next decade and you're going too fast. I'll have to study and graph something real at the rate you're going.

Do not fret, by v0.51 most of this will probably be obsolete data ^_^ The field of dwarven ballistics (and other fields) will be in need of fresh blood for years to come.

On that note, here is a plot of deflection vs [SHOOT_FORCE] for iron bolts fired at arena dwarves (no pain->no unconciousness) wearing steel helm, breastplate, greaves, low boots, and gauntlets:
Spoiler: deflection vs. force (click to show/hide)
It jumps from 100% at force=47 to 22% at force=48, and then tails off rather smoothly from there.  I am going to try running for some different armor/ammo combinations today, but my scripts keep stalling lately for some reason, so not sure if it will work.

So 47/48 is the velocity deflection threshold for Iron vs Steel. We can assume that there is another discrete binary deflection mechanism which can be uncovered here, similar to the IMPACT_YIELD threshold. And an even more interesting non-binary relationship for velocities above the threshold. A study of this will probably explain how wood vs candy deflections work.

I also went back to the bolt knockback studies (http://www.bay12forums.com/smf/index.php?topic=116151.msg3671055#msg3671055) in this thread and I think they can now be reliably explained by Urist da Vinci's findings. Even though the velocity of an fired projectile is calculated using the floored weight value of the bolt, knockback calculations are done in floating-point. So it is possible to obtain a relative value of velocity of all the dwarves. I call it relative, because at the moment I have nothing to relate it to. So if a dwarf was propelled at the speed of 1829.65 (silver), then at this level of study I cannot really say what that means exactly. It is known, however, that the dwarf was propelled 11 tiles horizontally before completing a vertical free fall of 8 tiles. It is also known that the free fall time for dwarves shot with other bolts will be the same, since the vertical velocity is not affected by horizontal propulsion. It can thus be safely assumed that the speed at which a dwarf is propelled will be proportional to the distance he is propelled before hitting the ground.

Based on the furthest distance a dwarf was propelled (11 tiles, achieved by silver bolts) I estimated the distance multiplier to be 0.006012 - that is, tiles_propelled(silver)/dwarf_speed(silver) = 11/1829.65 = 0.006012. Hopefully, multiplying this by the calculated dwarf speed will give the number of tiles a dwarf will be propelled before completing an 8-tile free-fall for different bolts used.

Spoiler: Table of Results (click to show/hide)

And the estimates proved to match up with the experimental data. This explains the previously confusing event of silver bolts propelling dwarves the furthest, despite not being the heaviest type of bolt used. They simply were the heaviest bolts lighter than 2 urists (the velocity cap was set to the same value as SHOOT_FORCE - 100000 - so 0 urist and 1 urist bolts had the same velocity). Since the velocity of all bolts lighter than 2 urists was the same, the heaviest one of that group had the most momentum.

An implication of this algorithm to a default-force, superhigh-maxvel crossbow is that a bolt which weighs 1.01 urists will be shot at velocity 1000, whereas a bolt which weighs 0.99 urists will be shot at "divide by zero" speed. This is absurd since the crossbow hasn't propelled the projectile with more force. Decreasing the bolt's weight by a negligible amount has made it orders of magnitude more dangerous. This problem wouldn't exist if Toady was using a floating point calculation for the bolt weight and shoot force.

Interesting knockback implication - by increasing the velocity cap to, say, 2'000'000 (or higher) and leaving shoot force as is, crossbows with lightweight bolts (wood and candy) should become very fun knockback guns.

[Edited for fallacious formulas]
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on October 23, 2012, 08:18:34 pm
...
On that note, here is a plot of deflection vs [SHOOT_FORCE] for iron bolts fired at arena dwarves (no pain->no unconciousness) wearing steel helm, breastplate, greaves, low boots, and gauntlets:
Spoiler: deflection vs. force (click to show/hide)
It jumps from 100% at force=47 to 22% at force=48, and then tails off rather smoothly from there.  I am going to try running for some different armor/ammo combinations today, but my scripts keep stalling lately for some reason, so not sure if it will work.

So 47/48 is the velocity deflection threshold for Iron vs Steel. We can assume that there is another discrete binary deflection mechanism which can be uncovered here, similar to the IMPACT_YIELD threshold. And an even more interesting non-binary relationship for velocities above the threshold. A study of this will probably explain how wood vs candy deflections work.
...

The previous IMPACT_YIELD studies were done at SHOOT_FORCE 1000, which results in velocity 1000 in iron bolts. It also required iron to have [IMPACT_YIELD:26666] to deflect. Iron normally has [IMPACT_YIELD:542500]. Pirate Bob's test above was presumably done with unmodded iron bolts. 26666/542500 = 0.0492 = 49.2/1000. This might not be another mechanism.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: sayke on October 24, 2012, 09:48:22 am
folks, this is fantastic! who knew there were weird integer rounding effects in there?? =D now the question is, given this decidedly weird algorithm for calculating bolt characteristics, what *should* appropriate values end up being?

i realize that the ideal situation would involve toady using floating points for bolts, but until that day...!
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on October 24, 2012, 10:22:05 pm
Here are some limited results for killing Arena Dwarves wearing plate armor (helm, breastplate, greaves, low boots, gauntlets).  They are very spotty, as the simulations failed to run properly for almost half of the attempts.  I think it may have something to do with loading the arena which uses the cell format, as I started having problems when I switched arenas.  Maybe it would help if I replaced a few of the upper levels with empty space?
Spoiler: Shoot Force 50 (click to show/hide)
Spoiler: Shoot Force 60 (click to show/hide)
Not too much surprising here. One exception - bone bolts seem to deflect less than metal, at least for the results I have.
The previous IMPACT_YIELD studies were done at SHOOT_FORCE 1000, which results in velocity 1000 in iron bolts. It also required iron to have [IMPACT_YIELD:26666] to deflect. Iron normally has [IMPACT_YIELD:542500]. Pirate Bob's test above was presumably done with unmodded iron bolts. 26666/542500 = 0.0492 = 49.2/1000. This might not be another mechanism.
I kind of think this is a different mechanic, as I think silver and bone have a lower impact yield than iron, but I don't know if I want to bet against Urist da Vinci again...
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: SharkForce on October 24, 2012, 10:44:35 pm
i'm a bit late to this party, i know, but i've got a possible solution for your range:20 tests to be more reliable (ie the dwarf being shot shouldn't move at all). too bad i didn't see this back a ways, but just in case it helps...

you just need to have a nice, deep pit. unless things have changed (which i suppose you could test for at the same time), range downward for crossbows is treated the same as range in any other direction... so a dwarf that is 20 z-levels down should be at range 20.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on October 25, 2012, 06:30:26 am
i'm a bit late to this party, i know, but i've got a possible solution for your range:20 tests to be more reliable (ie the dwarf being shot shouldn't move at all). too bad i didn't see this back a ways, but just in case it helps...

you just need to have a nice, deep pit. unless things have changed (which i suppose you could test for at the same time), range downward for crossbows is treated the same as range in any other direction... so a dwarf that is 20 z-levels down should be at range 20.
The arena only has 8 z-levels, so that won't work.  Nice idea though.  We still haven't done this properly, as we need to have a situation where deflection rate etc. will actually change due to a moderate change in bolt velocity, which is not at all true with vanilla settings.  I will try this soon with maybe Shoot Force 60, iron vs. steel, or something similar.  When I get the time I want to test if/how a whole host of inputs change bolt performance.

I think Zivilin suggested a while back using a setup like this
Code: [Select]
S#________________#Twhere S is the shooter, # is a fortification, and T is the target.  If the whole thing is enclosed in walls, then the target can't move.  If the shooter is Great or better (or something like that) then they can shoot through both fortifications with no problems.  Even if they do miss sometimes, I think it is very unlikely that going through fortifications has any impact on bolt behavior once it strikes the target, and I record deflections etc. versus the number of hits, not the number of shots fired.

Edit:
I just ran iron bolts vs. steel armor with and set [IMPACT_YIELD:1085000] for iron.  I still get 100% deflections at Force=47 and 22% and Force=48, so IMPACT_YIELD does not seem to have an effect.  I DO strongly suspect that some other material paremeter(s) are responsible for the binary behavior at this force.  I'm going to go nuts and have my computer try to scan the whole force range for all materials today, and see how bad it does...
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on October 25, 2012, 09:35:42 am
...
Edit:
I just ran iron bolts vs. steel armor with and set [IMPACT_YIELD:1085000] for iron.  I still get 100% deflections at Force=47 and 22% and Force=48, so IMPACT_YIELD does not seem to have an effect.  I DO strongly suspect that some other material paremeter(s) are responsible for the binary behavior at this force.  I'm going to go nuts and have my computer try to scan the whole force range for all materials today, and see how bad it does.

OK, I took a step back and did some confirmation testing, and admit that you seem to be right and the bolt shoot_force (which in combo with shoot_maxvel only seems to alter the bolt's velocity) doesn't affect the impact yield equation.

I tried to answer the question "which parameters in the game produce changes in the impact yield equation?".

I fired a pair of copper bolts against iron armor, one of which should deflect (IY 26666), and the other which should hit (IY 26667):
Code: [Select]
If you increase       Effect
Armor density         both deflect
Armor thickness       both deflect on thicker armor piece, otherwise no change
Armor IY              no change
Armor Istrain         no change
Armor Ifrac           no change
Ammo size             both hit
Ammo contact area     both deflect sometimes
Ammo density          no change
Ammo SY               no change
Ammo Istrain          no change
Ammo Ifrac            no change
Actual bolt speed     no change
Bolt item vel         no change
Creature bodysize     no change
body part relsize     no change

ammo contact area x10 both deflect (using uniarmor)
ammo contact area x20 both deflect (using uniarmor)
ammo contact area x10 no change (using only mail)
ammo contact area x20 both deflect (using only mail)


So, the IY deflection mechanism is related to armor density, armor thickness, bolt size, bolt impact yield, bolt contact area, and the difference between mail and plate at larger contact areas.

It seems that, for larger contact areas, that mail doesn't protect against blunt damage. Mail must have some threshold that allows it to protect against point loads, but not against larger things that can change it's geometry. Furthermore, at very large contact areas the impact force is so distributed that the bolt deflects anyways on mail.

Because of the apparent armor thickness sensitivity (which might explain the 22% deflection), I propose the following to other researchers:

Use a set of armor that puts a uniform thickness of plate armor across the arena dwarf, such as this "uniarmor" which doesn't overlap:
Code: [Select]

[ITEM_ARMOR:ITEM_ARMOR_UNIPLATE]
[NAME:uniplate:uniplates]
[ARMORLEVEL:3]
[UBSTEP:1]
[SHAPED]
[LAYER:ARMOR]
[COVERAGE:100]
[LAYER_SIZE:20] alter this to change "thickness"
[LAYER_PERMIT:50]
[MATERIAL_SIZE:9]
[HARD]
[METAL]


[ITEM_HELM:ITEM_HELM_UNIHELM]
[NAME:unihelm:unihelms]
[ARMORLEVEL:1]
[METAL_ARMOR_LEVELS]
[SHAPED]
[LAYER:ARMOR]
[COVERAGE:100]
[LAYER_SIZE:20] alter this to change "thickness"
[LAYER_PERMIT:20]
[MATERIAL_SIZE:2]
[HARD]
[METAL]
[BARRED]
[SCALED]
[LEATHER]
[SHAPED]

[ITEM_PANTS:ITEM_PANTS_UNIGREAVES]
[NAME:unigreaves:unigreaves]
[ARMORLEVEL:3]
[LBSTEP:MAX]
[SHAPED]
[LAYER:ARMOR]
[COVERAGE:100]
[LAYER_SIZE:20] alter this to change "thickness"
[LAYER_PERMIT:30]
[MATERIAL_SIZE:6]
[METAL]
[BARRED]
[HARD]


[ITEM_SHOES:ITEM_SHOES_BOOTS_UNILOW]
[NAME:uni boot:uni boots]
[ARMORLEVEL:1]
[METAL_ARMOR_LEVELS]
[LAYER:OVER]
[COVERAGE:100]
[LAYER_SIZE:20] alter this to change "thickness"
[LAYER_PERMIT:15]
[MATERIAL_SIZE:1]
[METAL]
[LEATHER]
[HARD]

[ITEM_GLOVES:ITEM_GLOVES_UNIGAUNTLETS]
[NAME:unigauntlet:unigauntlets]
[ARMORLEVEL:2]
[UPSTEP:1]
[SHAPED]
[LAYER:ARMOR]
[COVERAGE:100]
[LAYER_SIZE:20] alter this to change "thickness"
[LAYER_PERMIT:15]
[MATERIAL_SIZE:2]
[SCALED]
[BARRED]
[METAL]
[HARD]

... Even though the velocity of an fired projectile is calculated using the floored weight value of the bolt, knockback calculations are done in floating-point. So it is possible to obtain a relative value of velocity of all the dwarves. I call it relative, because at the moment I have nothing to relate it to. So if a dwarf was propelled at the speed of 1829.65 (silver), then at this level of study I cannot really say what that means exactly. ...

See http://www.bay12forums.com/smf/index.php?topic=112831.msg3536975#msg3536975 for an explanation of the velocities common to minecarts and projectiles in the new system.

Velocities of falling, found in arena by stepping ahead single ticks of time while checking using my chkproj.lua code in dfhack:
Code: [Select]
time pos vel zlevel
0 0 0 0
1 0 -4900 0
2 -4900 -9800 0
3 -14700 -14700 0
4 -29400 -19600 0
5 -49000 -24500 0
6 -73500 -29400 0
7 47100 -34300 -1
8 12800 -39200 -1
9 -26400 -44100 -1
10 -70500 -49000 -1
11 30500 -53900 -2 (fell 1z and hit floor at the start of this tick)
12 -23400 -58800 -2
13 67800 -63700 -3 (fell 2z and hit floor at the start of this tick)
14 4100 -68600 -3
15 -64500 -73500 -3
16 12000 -78400 -4 (fell 3z and hit floor at the start of this tick)
17 -66400 -83300 -4
18 300 -88200 -5 (fell 4z and hit floor at the start of this tick)
19 62100 -93100 -6 (fell 5z and hit floor at the start of this tick)
20 -31000 -98000 -6
21 21000 -102900 -7 (fell 6z and hit floor at the start of this tick)
22 68100 -107800 -8 (fell 7z and hit floor at the start of this tick)
23 -39700 -112700 -8
24 0 1000 -8 (fell 8z and hit floor at the start of this tick)

Each tile is 2mx2mx3m LxWxH, and that translates to position dimensions of +/- 75000 height and +/- 50000 width. So 150000 tall and 100000 wide and long.

Bolt knockback produces dwarf velocities of 25*bolt_velocity/dwarf_weight, capped to be between 10000 and 50000. Horizontal velocities don't decay in midair.

A bronze colossus grand master wrestler can't throw anyone faster than 50000 anymore.

Minecart collisions can violate this "speed limit".
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on October 25, 2012, 12:25:35 pm
I will definitely use uniarmor for future tests.  That's a great idea!  I'm not sure if the data supports that layer size is responsible for the jumps in deflection %, as pants have 15, boot and breastplates 20, and helms 30 (so it doesn't look like 78% of the body all has the same thickness which is suddenly penetrated at [SHOOT_FORCE:47]), but having a uniform thickness and no overlaps will make the results much easier to interpret.  Maybe the 22% is the area which has overlapping armor, plus helms?  Who knows.  In any case, this armor will help sort it out.

Is it correct that adding [STRUCTURAL_ELASTICITY_CHAIN_ALL] to all pieces will turn this into uniform chain mail?  That would be nice to have eventually as well.

I noticed you didn't test [ARMORLEVEL].  Do you think that might make a difference?  I'm not really sure what it does.  I assume higher level is better, because breastplates have 3, while mail shirts have 2, but I don't really know, as helms have only 1.  Is this just a flag that says the item is armor, such that the number doesn't matter so long as it's greater than zero?

Now that I've got the hang of using scripts to edit the raws, I hope to test as many parameters as possible.  I just need to get my computer to actually run the scripts without stalling.  We'll see how things go today...
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on October 25, 2012, 09:22:54 pm
I will definitely use uniarmor for future tests.  That's a great idea!  I'm not sure if the data supports that layer size is responsible for the jumps in deflection %, as pants have 15, boot and breastplates 20, and helms 30 (so it doesn't look like 78% of the body all has the same thickness which is suddenly penetrated at [SHOOT_FORCE:47]), but having a uniform thickness and no overlaps will make the results much easier to interpret.  Maybe the 22% is the area which has overlapping armor, plus helms?  Who knows.  In any case, this armor will help sort it out.
...

Default thicknesses:
Breastplate 20
Gauntlets 20
Helm 30
Greaves 15
High boots 25
Mail shirt 15

So if you needed thickness 23+ or something to deflect, then only the feet, lower legs, and head would deflect. According to Zivilin's Vitruvian Dwarf, that is 1.38% + 1.36% + 7.13% + 7.15% + 5.28% = 22.3%

This assumes that each piece of armor gets in line and takes its turn with respect to deflecting an attack, similar to bad guys in a martial arts movie. Toady actually uses that method for heroes fighting armies in worldgen, so it's reasonable.

...
Is it correct that adding [STRUCTURAL_ELASTICITY_CHAIN_ALL] to all pieces will turn this into uniform chain mail?  That would be nice to have eventually as well.

I noticed you didn't test [ARMORLEVEL].  Do you think that might make a difference?  I'm not really sure what it does.  I assume higher level is better, because breastplates have 3, while mail shirts have 2, but I don't really know, as helms have only 1.  Is this just a flag that says the item is armor, such that the number doesn't matter so long as it's greater than zero?
...

Yes. There is another one for cloth items (i.e. trousers), and one for items that are chain only when made from metal but not when made from leather (i.e. leggings).

I don't know. According to the wiki and general knowledge, [ARMORLEVEL] is used to decide if an item is clothing and should wear, and it is also used for dwarf AI when equipping the military.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: HiEv on October 26, 2012, 10:26:12 am
I noticed you didn't test [ARMORLEVEL].  Do you think that might make a difference?  I'm not really sure what it does.  I assume higher level is better, because breastplates have 3, while mail shirts have 2, but I don't really know, as helms have only 1.  Is this just a flag that says the item is armor, such that the number doesn't matter so long as it's greater than zero?

It probably does matter, but I'm not really sure either.  Note that the [METAL_ARMOR_LEVELS] tag will give most (but not all) armor items an additional ARMORLEVEL if that item is made of metal (see the wiki (http://dwarffortresswiki.org/index.php/DF2012:Armor_token)).  So, apparently higher levels makes the item better in some way.  Whether "better" means "dwarves will want it more", "works better", something else, or maybe some combination of those is unknown.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on October 26, 2012, 10:16:00 pm
...
So if you needed thickness 23+ or something to deflect, then only the feet, lower legs, and head would deflect. According to Zivilin's Vitruvian Dwarf, that is 1.38% + 1.36% + 7.13% + 7.15% + 5.28% = 22.3%
That does seem like a plausible explanation.  I ran a full set of deflection vs (standard) plate armor at various forces.
Spoiler (click to show/hide)
It looks like whenever the deflection plateaus vs. force it is at a value of around 20%, so this seems consistent with the idea that there is a break point in deflection corresponding to 23+ thickness (assuming armor stacking as you described).

Naturally, deflection of bone and candy bolts does not depend on force, as they weigh less than one urist, so velocity is independent of force. 

I will try your uniarmor this weekend.  That should hopefully clarify things.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Sutremaine on October 27, 2012, 12:34:27 am
So, apparently higher levels makes the item better in some way.  Whether "better" means "dwarves will want it more", "works better", something else, or maybe some combination of those is unknown.
I believe it's a hangover from the days of 40d and earlier. There were three uniform presets to choose from: leather, chain, and plate. Which items the dwarf would pick up for each level of uniform was determined by the item's armour level.

It's still used to determine what's armour and what's civilian clothing, but the non-zero numbers do less than they used to. They might cause a dwarf to swap a lower-level armour piece for a higher-level one. I've seen dwarves who were formerly clad in mail suddenly end up in plate once it became available, which I found most annoying. Apart from the discoveries being made here, breastplates simply cover less of the body than mail shirts do. But I haven't done any testing on it. Should be easy enough...
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on October 27, 2012, 02:01:35 am
Removing mail and using a uniform armor thickness allowed me to isolate the remaining variables on the impact yield deflection equation.

Algorithm:
1. The projectile is hitting the creature on a body part protected by a piece of rigid armor (i.e. bolt hits steel breastplate).
2. Multiply the armor's LAYER_SIZE by the projectile's CONTACT_AREA, and round the result down to the nearest 100. The exception is that you round up to 100 instead of rounding down to zero if the result was less than 100 (i.e. 20x2=40 -> 100).
3. IMPACT_YIELD = (800/157) * ARMOR_SOLID_DENSITY * (step #2 result) / PROJECTILE_SIZE

i.e. (800/157) * 7850 * 100 / 150 = 26666
A projectile with IMPACT_YIELD less than that which was calculated will deflect.

This equation can be used to find, for example, that a platinum armor of LAYER_SIZE 399 won't deflect normal iron bolts, but if it is LAYER_SIZE 400 then the iron bolts will be deflected. Several such examples were verified during testing. The equation also works for dropped items.

Weaknesses:
- I don't understand what is happening with flexible mail armor.
- The equation only applies to projectiles that don't have a high enough SHEAR_YIELD to penetrate plate armor, so there is a chance of a blunt deflection.
- All my tests were at grand master skill levels. I don't know if skill matters.
- It appears that the 4000/785 or 800/157 or 5.0955 constant is only there to normalize the deflection criteria to iron/steel.
- For the falling object cases, I didn't check for a velocity dependance.
- For the bolt cases, velocity might involve a different deflection mechanism, or it might be part of the equation.

Insights:
- Based on the variables used, I think this is a "ricochet" equation. The force required to deform the bolt is related to the inertial resistance of the armor plate.
- I wonder if the criteria also applies to "glance" deflections off creature skin?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on October 27, 2012, 07:09:13 am
Here are some results using uniarmor instead of standard plate armor.  There appear to be no changes for deflections of metal bolt vs. steel armor.
Spoiler (click to show/hide)
Based on these results, it is clear that velocity-dependent deflection depends on momentum:
Spoiler (click to show/hide)
For this set of bolts, all masses round to 1, so the velocity is equal to the [SHOOT_FORCE] (I have also verified this for all these materials).  Therefore, momentum will be proportional to density times force.  When I plot deflection vs. momentum (force*density), the data for all five bolt types falls onto the same curve.  This shows that this type of deflection is proportional to momentum, and not energy (as then it would depend on force^2 * density).  This would be consistent with modeling an elastic collision, but then again it doesn't appear that Toady worries about making DF physics agree with the real world at this level.

Edit:
The fact that I am able to get the same result for deflection of different bolt materials plotted vs. momentum indicates that this mechanism is independent of bolt material properties other than density.  This of course means that it is independent of [IMPACT_YIELD], and is therefore different from the [IMPACT_YIELD] deflection Urist describes in the previous post.  I suppose I cannot rule out all dependence on other bolt material parameters, as some parameters might be fairly similar for all metals, but I did specifically rule out [IMPACT_YIELD] as I get no change in this behavior from doubling it (not to mention that the impact yield of steel is almost 5 times that of silver).

Also, it does not look like variations in layer thickness are responsible for the sudden drop from 1.00 to 0.20.  Since there was no change at all from minor modifications in the layer thickness (going from normal armor to uniarmor), I suspect that the layer thickness is rounded in this case as well.  Furthermore, in the full table of results for different materials, there are some deflection ratios between 0.2 and 1.0, such as copper bolts vs. iron.  Taken together, this suggests that there is not actually a binary transition for this deflection mechanism, but rather a fast change that we can't always see with integer changes in force.  If I squint at the curve, it appears that there may be an exponential decay from 1.0 to ~0.2 that begins at about momentum 370,000, and then a second (slower) decay from 0.2 to zero that starts at about momentum 440,000. 

Edit #2:
My next step is to test how armor material parameters impact the two transitions.  To test this I am measuring deflection of iron off steel for [SHOOT_FORCE] 47, 48, 60 and 65 after doubling the indicated material parameter multiplying the indicated material parameter by 10 (I realized multiplying by ten is much easier when doing string matching, as you just have to add a zero).  I will add results here as I get them.

Edit #3:
So, it seems my script to automatically go through all the material parameters wasn't working, and ended up saying that all bolts deflect all the time.  It appears that I somehow messed up the part of the script that changes force when I added in the material parameters.  I think I might take a break for a while and work on this another day.  Very sorry if anyone looked at my preliminary results and was confused.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on October 27, 2012, 05:19:01 pm
Investigating Pirate Bob's low velocity deflections for iron bolts vs steel armor:

What can cause an iron bolt at shoot force 47, which normally deflects, to hit?
- Increasing bolt weight from 1.18 to somewher less than 1.95 using bolt SIZE or bolt material SOLID_DENSITY. Increasing bolt weight to 2.01 causes the bolt to deflect again, because of how velocity is determined when the bolt is launched.
- Increasing armor IMPACT_STRAIN_AT_YIELD (bruising muscle only, and occasional deflections).
- Increasing armor IMPACT_YIELD
- Decreasing armor IMPACT_FRACTURE.

What can cause an iron bolt at shoot force 50, which normally hits (only causing bruising!), to deflect?
- Increasing armor LAYER_SIZE.
- Increasing bolt CONTACT_AREA.
- Increasing armor IMPACT_FRACTURE (weaker bruising and more deflections).
- Increasing armor IMPACT_FRACTURE and then increasing IMPACT_YIELD (total deflection).
- Increasing armor IMPACT_FRACTURE and then lowering IMPACT_STRAIN_AT_YIELD (total deflection).
- Lowering IMPACT_STRAIN_AT_YIELD (default is 940, lowering to ~900 gives weaker bruising and more deflections, lowering to ~840 gives total deflection).

What is the precedence of deflection?
1. The game compares SHEAR_YIELD of armor and weapon, and decides if blunt or edged damage will take place.
2. If blunt, then the ricochet check is made.
3. If the projectile didn't ricochet, then this deflection mechanism is examined.

Insight/wild guessing:
- The bolt's momentum is used as a pseudo-energy.
- The pseudo-energy is distributed across a certain contact area and thickness of armor material.
- The IMPACT_* properties of the armor are used to determine the energy requirement to first yield and then fracture the armor. See http://en.wikipedia.org/wiki/Stress%E2%80%93strain_curve and http://en.wikipedia.org/wiki/Modulus_of_Resilience
- If the bolt deflects, then the IMPACT_YIELD and IMPACT_STRAIN_AT_YIELD were enough to absorb all of the pseudo-energy.
- If the bolt hits but only causes bruising, then the distance between IMPACT_YIELD and IMPACT_FRACTURE was sufficient to absorb a lot of energy and only dent the armor.
- If the bolt hits at high velocity (say 1000 instead of 47 or 50), the armor is shattered and the blunt force is directly applied to the underlying skin.
- If the armor has a large IMPACT_STRAIN_AT_YIELD, the blunt force is directly applied to the underlying skin. This also seems to happen for flexible clothing and mail in some situations.

Implication of guess:
- If a silver bolt from a vanilla crossbow hits adamantine armor, it doesn't cut the armor or ricochet. Adamantine is perfectly rigid, so there will be no pre-fracture strain. This means that the blunt damage is sufficient to shatter the adamantine armor and deal damage to the tissue below. This is consistent with modding creatures to have adamantine skin, which will be shattered/smashed apart by the bolt. VANILLA CROSSBOWS PROVIDE SO MUCH PSEUDO-ENERGY TO THE BOLT, YOU HAVE TO NERF THEM TO FIRE AT 5% VELOCITY TO LET ARMOR EVEN HELP TO STOP THE BOLT.
- Toady is probably missing a few zeroes somewhere in the calculations.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on October 27, 2012, 08:25:25 pm
I simultaneously ran similar tests, and I think got identical (if somewhat less detailed) results.  In each of these tests, I multiplied the indicated material parameter of the armor by 10, and then measured deflection at SHOOT_FORCE 47, 48, 60 and 65.  The first row shows the result with no changes in armor material parameters.  All tests are for (unmodified) iron bolts vs. steel armor.
Spoiler (click to show/hide)
So I agree that IMPACT_YIELD, IMPACT_FRACTURE and IMPACT_STRAIN_AT_YIELD of the armor all play a role in determining deflections, and that the behavior is as Urist described.  I hope to figure out the exact dependence on each of these parameters eventually, but probably Urist will do it first :P.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on October 27, 2012, 10:57:25 pm
I simultaneously ran similar tests, and I think got identical (if somewhat less detailed) results.  In each of these tests, I multiplied the indicated material parameter of the armor by 10, and then measured deflection at SHOOT_FORCE 47, 48, 60 and 65.
...
So I agree that IMPACT_YIELD, IMPACT_FRACTURE and IMPACT_STRAIN_AT_YIELD of the armor all play a role in determining deflections, and that the behavior is as Urist described.  I hope to figure out the exact dependence on each of these parameters eventually, but probably Urist will do it first :P.

My method used less data and was simply a pass/fail test for both SHOOT_FORCE 47 and 50. I'd adjust a variable, and then test to see if it did anything.

In the case of the stress-strain curve (http://en.wikipedia.org/wiki/Stress%E2%80%93strain_curve#Ductile_materials), the area under the curve is proportional to energy. This is why raising the IMPACT_YIELD (to a number just below the IMPACT_FRACTURE) caused iron bolts at SHOOT_FORCE 47 to hit instead of deflecting - I actually reduced the area under the curve.

These calculations are probably used for blunt damage to living tissues as well.

Isn't it funny that a lead bolt which weighs 1.70 urists will do more blunt damage to a target than an electrum bolt which weighs 2.23 urists, due to the velocity weirdness?

My comment about the crossbows was probably off the mark. The bolt velocity might be reasonable (as shown by how much knockback momentum it imparts to small birds), but the damage calculation treats a bolt travelling at high velocity the same way it would treat a person stabbing someone with a bolt, swinging their arm in for the attack at the bolt's velocity.

Here are some results using uniarmor instead of standard plate armor.  There appear to be no changes for deflections of metal bolt vs. steel armor.
Spoiler (click to show/hide)
...


The average momentum of your bolt set is 376,335 at the point where deflection occurs. The steel armor has IMPACT_YIELD 1505000.

1505000/376335=3.9991 (which is very close to 4!)

EDIT: That doesn't hold up for your other material vs material statistics. More data is required.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Belteshazzar on October 27, 2012, 11:37:53 pm
Given all the data collected as regarding bolt energy and bolt lethality by material what course of action is suggested in bringing deflections more in-line with the desired "plate armor actually being useful vs projectiles?"
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on October 28, 2012, 07:58:19 am
The average momentum of your bolt set is 376,335 at the point where deflection occurs. The steel armor has IMPACT_YIELD 1505000.
1505000/376335=3.9991 (which is very close to 4!)
EDIT: That doesn't hold up for your other material vs material statistics. More data is required.
This force for this first transition appears to be increased by increasing IMPACT_YIELD and decreased by increasing IMPACT_STRAIN_AT_YIELD, while IMPACT_FRACTURE does not effect this transition, but rather the second one at higher force.  Maybe the transition depends on the ratio IMPACT_YIELD/(IMPACT_STRAIN_AT_YIELD*momentum)?

While I have a degree in physics, I actually know nothing about stress/strain calculations.  I will have to take a look at that wikipedia article you posted to give myself a crash course (maybe this afternoon).  Then again, I wouldn't necessarily assume that Toady follows real world physics here, but it can't hurt to check for that.

Given all the data collected as regarding bolt energy and bolt lethality by material what course of action is suggested in bringing deflections more in-line with the desired "plate armor actually being useful vs projectiles?"
I don't think we quite have a solution yet, but hopefully we will soon.  The rough answer is to reduce [SHOOT_FORCE] to something between 25 and 50, and then also reduce [MAX_VELOCITY] to maybe 100?  Understanding this is definitely a major goal for me.

My comment about the crossbows was probably off the mark. The bolt velocity might be reasonable (as shown by how much knockback momentum it imparts to small birds), but the damage calculation treats a bolt travelling at high velocity the same way it would treat a person stabbing someone with a bolt, swinging their arm in for the attack at the bolt's velocity.
I disagree that the momena for crossbow bolts are in any way reasonable.  First of all, the mass of metal crossbow bolts is about an order of magnitude larger than it should be.  Furthermore, a quick search of the internet suggests that real bolts should fly at around 100 m/s, while DF ones reach 1000(.  I'm unsure of units, but I'll guess m/s.  This would put the momentum of bolts roughly 100 times what it should be.  If it's 1000 tiles per tick, then this would actually be much more than 1000 m/s, as a tile is 2(?) meters wide and there are several ticks per second.   

It does seem reasonable that bolts should knock back pigeons but not creatures much larger, but who knows if the momenta needed for knockback are anywhere close to real world numbers?

Edit:  Here's some more numbers for force dependence after multiplying IMPACT_YIELD, IMPACT_FRACTURE and IMPACT_STRAIN_AT_YIELD by 10:
Spoiler (click to show/hide)
If the lower cutoff (the drop from 1.0 to 0.2 which normally occurs at Force=48) depended linearly on the ratio IMPACT_YIELD/(IMPACT_STRAIN_AT_YIELD*momentum), then I would expect it to occur between Force 470 and 480 when I multiply IMPACT_YIELD by 10, and between 4 and 5 when I multiply IMPACT_STRAIN_AT_YIELD by 10.  Clearly this does not happen.  This suggests a slower than linear dependence on both IMPACT_YIELD and IMPACT_STRAIN_AT_YIELD for this transition (such as a square root, or a log). 

Conversely, the upper transition normally occurs between 60 and 65, and would occur between 600 and 650 if it depended linearly on IMPACT_FRACTURE.  I see no upper transition even at 650 when I multiply IMPACT_FRACTURE by 10, which suggests that the dependence of this transition on IMPACT_FRACTURE is faster than linear (such as squared or exponential).  Given that the upper transition already looks like an exponential decay, I am going to guess that it's some kind of exponential behavior, but that's just a guess.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on October 28, 2012, 03:05:04 pm
...
That does seem like a plausible explanation.  I ran a full set of deflection vs (standard) plate armor at various forces.
...

I used your data from this test and crunched the numbers. It appears that the armor IMPACT_YIELD divided by the kinetic energy of the bolt is about the same for all materials except for bronze armor.

IMPACT_YIELD/(MASS*VEL*VEL/2)=?
1505000/(1.1775*49*49/2)=1064.67 iron bolt, steel armor
5000000/(1.3395*80*80/2)=1166.48 bronze bolt, addy armor
245000/(1.5735*17*17/2)=1077.54 silver bolt, copper armor
602000/(1.1775*16*16/2)=3994.16 iron bolt, bronze armor

Since the above doesn't depend on strain, I think the reason bronze armor is different is that it is triggering some kind of strain criteria. Steel is 2.8x as strong as iron, and 2.9x as flexible. Copper is half the strength and half the flexibility of iron. Bronze is 1.1x as strong as iron, but 1.7x as flexible.

If we lower bronze's IMPACT_STRAIN_AT_YIELD carefully, we should see a jump in 'required velocity' from 14-16 to 26-30. You have the setup to do the statistics better than I can.

EDIT: That doesn't actually work. Something else is going on with Bronze.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on October 29, 2012, 06:59:39 am
I can confirm that lowering Bronze's impact yield to 376 has no noticeable change on the force required to penetrate armor (deflects 100% at force 15 and 8% at force 20.  I will set up a run varying all material parameters for bronze today to see if I can nail down which are important for this. 

My guess is that the difference is IMPACT_FRACTURE/IMPACT_YIELD for bronze is only 1.4, while for iron it is 2 and steel it's 1.67.  I noticed during my testing that increasing IMPACT_YIELD  causes the second transition to occur at lower force, so I think that it may depend on this ratio (although not necessarily linearly or in the same manner on both parameters).  I'm guessing that if the second transition occurs at lower force than the first, then it takes precedence. 

Edit:
My run for today failed, due to the user error  :-[.  I will try to poke around some manually this evening, and then maybe do a run tonight fo
r bronze armor.  Urist, you said that SHEAR_YIELD is used to determine if blunt or edged damage will take place.  Do you know that determines if deflections will occur at all?  It appears that no deflections occur if the bolt material is "better" than the armor, with candy>steel>iron=bronze>copper, but I don't know what parameters determine "better". 

I did also find that, if I lower IMPACT_YIELD of steel to 150500, then the first transition moves to between Force 45 (deflection 1.0)  and Force 46 (deflection 0.19).  At standard IMPACT_YIELD (1505000) deflection drops at Force 48, and at 10X IMPACT_YIELD (15050000) the drop is between Force 100 and 200.  I will try to get a few more points for steel's impact yield to figure out the functional dependence.

Edit: My run failed again.   >:(  I forgot to change "steel" to "bronze" in one place, and I had been manually modifying Impact_Yield of steel to be really high, so I got 100% deflections at all forces even with no changes from standard bronze. 

Edit: (10/30 6 PM)
Here are some results for bronze (finally).  It looks like the only parameters that matter are the three impact parameters (although I didn't finish BENDING_STRAIN_AT_YIELD).  Edit: In each case I doubled the indicated parameter, rather than multiplying it by 10 as before.  I was hoping that a smaller change would produce less confusing results, but that would only be true if I told people what I did (sorry Urist  :-[).
Spoiler (click to show/hide)
Having seen this, I then replaced the three impact parameters for bronze with those of steel (I set [IMPACT_YIELD:1505000], [IMPACT_FRACTURE:2520000], and [IMPACT_STRAIN_AT_YIELD:940], and kept all other parameters equal to vanilla bronze).  I found that I get same results as for vanilla steel:
Spoiler (click to show/hide)
The errors on these numbers are about 1-2%, as I only used 72 targets, which results on 1,000-10,000 hits.  Therefore, the results for bronze with modified IMPACT parameters are exactly the same as those for steel within the margin of error.

Discovery: The only parameters which effect "edged" low velocity deflection rate are IMPACT_YIELD, IMPACT_FRACTURE and IMPACT_STRAIN_AT_YIELD
I tested deflection of steel bolts against modified bronze, and found that they don't deflect at all.  This is consistent with my larger table which shows that "better" bolts don't deflect off armor at any force, with candy>steel>iron=bronze>copper. 

Increasing SHEAR_YIELD of bronze to be equal to steel (430000) allows deflections to occur identically to steel (I think - need to verify this carefully), but setting it to 429999 does not allow any deflections even at very low force.  However, bronze also deflects off of iron, even though the SHEAR_YIELD of bronze is higher than iron.  I therefore also checked if setting SHEAR_FRACTURE or SHEAR_STRAIN_AT_YIELD equal to steel would make a difference.  I found that increasing SHEAR_FRACTURE to 720000 allows deflections, but 719999 does not.  The deflection vs force curve is definitely different in this case, as at force=47 deflection=0.19.  It does not appear that SHEAR_STRAIN_AT_YIELD does anything, but I'm not sure yet.

My current theory is that SHEAR_YIELD allows the lower transition to occur, and corresponds to the armor bending, but not breaking.  For iron vs. steel, hits that don't deflect between force 47 and 60 tend to cause mostly bruises, suggesting that although the bolt penetrates the armor ~80% of the time, even when it does it is slowed down significantly.  SHEAR_FRACTURE greater or equal to the bolt material allows the upper transition to occur, which corresponds to the bolt punching right through the armor.  It is also certainly possible that what's going on is more complicated, and also depends on SHEAR_STRAIN_AT_YIELD, or even other parameters.

My next step is to carefully examine the deflection vs. force curve for cases where only SHEAR_YIELD or SHEAR_FRACTURE is greater or equal to the bolt.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on October 30, 2012, 09:59:10 pm
Here are the force vs. deflection curves for steel bolts against bronze armor with impact parameters copied from steel ([IMPACT_YIELD:1505000], [IMPACT_FRACTURE:2520000], and [IMPACT_STRAIN_AT_YIELD:940]), the indicated SHEAR value set equal to steel, and all other parameters equal to bronze.
Spoiler (click to show/hide)
As you can see, the curves are nearly identical, except that with SHEAR_FRACTURE increased equal to steel the deflection drops to 0.2 at force 46, and with SHEAR_YIELD it doesn't drop until force 48.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on October 31, 2012, 02:13:44 am
...
Here's some more numbers for force dependence after multiplying IMPACT_YIELD, IMPACT_FRACTURE and IMPACT_STRAIN_AT_YIELD by 10:
...
I examined these numbers and it appears that, for iron bolts and steel armor, the deflection threshold kinetic energy is linearly related to IMPACT_YIELD and IMPACT_STRAIN_AT_YIELD.

I did my own test, firing copper bolts at iron armor, and reduced the IMPACT_FRACTURE of iron to just above the IMPACT_YIELD (it used to be 2x larger, then became 1.05x larger). The drop in deflection threshold kinetic energy appeared to be linearly related to the change in magnitude of [IMPACT_FRACTURE - IMPACT_YIELD]. In this case IF-IY was 13x smaller, and the energy required was also 13x smaller. I then tried a case where I made IF-IY 3x smaller, and worked backwards to predict a velocity at which the bolt should deflect. My prediction was correct! I tested for the relationship to IMPACT_STRAIN_AT_YIELD, and found it to be weakly present (making iron 3x less flexible while the IMPACT_FRACTURE was lowered resulted in the energy requirement increasing by 1.07x or something).

So we appear to have at least 2 cases (excluding adamantine's weirdness):

A) the IMPACT_FRACTURE is sufficiently larger than IMPACT_YIELD (i.e. steel), so the armor can deflect a bolt with a kinetic energy proportional to the armor's IMPACT_YIELD and IMPACT_STRAIN_AT_YIELD. Even when this type of armor stops deflecting, it tends to fail first by denting, which leads to bruising only and ~20% deflections.

B) the IMPACT_FRACTURE is close to the value of the IMPACT_YIELD (i.e. bronze), so the armor can deflect a bolt with a kinetic energy proportional to [IMPACT_FRACTURE - IMPACT_YIELD]. This armor is considered to have fractured on failure, so the attack hits the underlying tissue at full force.

...
Urist, you said that SHEAR_YIELD is used to determine if blunt or edged damage will take place.  Do you know that determines if deflections will occur at all?  It appears that no deflections occur if the bolt material is "better" than the armor, with candy>steel>iron=bronze>copper, but I don't know what parameters determine "better". 
...
Here are some results for bronze (finally).  It looks like the only parameters that matter are the three impact parameters (although I didn't finish BENDING_STRAIN_AT_YIELD). 
...

All I ever determined was that SHEAR_YIELD is used to determine if an edged weapon can cut a material. In this bug report http://www.bay12games.com/dwarves/mantisbt/view.php?id=5346 I describe how obsidian swords can't cut people because their SHEAR_YIELD is less than that of skin/meat/etc., whereas wood and teeth both have sufficient SHEAR_YIELD. I never investigated further into the other SHEAR properties.

Looking at those bronze results, it looks like you increased each parameter x10.
- In the case of IMPACT_YIELD x10, the kinetic energy went up about 1.4x, which is the ratio of IF/IY. I think since IMPACT_YIELD became higher than IMPACT_FRACTURE, the material doesn't yield at all until it fractures (the adamantine condition). Look at how the deflection goes from 0.06 to 0 in the "no changes" case around the same time that the deflection drops from 1 to 0 in this case.
- In the case of IMPACT_FRACTURE x10, the kinetic energy went up about 10x, presuming upper threshold velocity 54.
- In the case of IMPACT_STRAIN_AT_YIELD x10, the kinetic energy went down by an insignificant amount.

We ought to try decreasing both of adamantine's properties at the same time to see how deflection varies with velocity.

Toady comments in the release notes for 0.31.09 that "fixed problem with edge being disregarded too soon after impact breaks". I think this means that if a bolt can't defeat an armor's SHEAR properties, but can defeat the IMPACT_FRACTURE and smash through, it is allowed to start cutting again on the next layer. So if a bolt doesn't deflect, but it only bruises something or chips/fractures/etc. a bone, then the armor wasn't fractured. If the bolt doesn't deflect and it does tearing damage to the skin/fat/muscle, then it cut or fractured its way through the armor. This could be useful in a text filter to obtain more data points from results.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on October 31, 2012, 07:58:04 am
...
Here's some more numbers for force dependence after multiplying IMPACT_YIELD, IMPACT_FRACTURE and IMPACT_STRAIN_AT_YIELD by 10:
...
I examined these numbers and it appears that, for iron bolts and steel armor, the deflection threshold kinetic energy is linearly related to IMPACT_YIELD and IMPACT_STRAIN_AT_YIELD.
Unfortunately, I don't think the relationship is this simple.  It appears to be true that, for IMPACT_YIELD>IMPACT_FRACTURE, deflection threshold kinetic energy is linearly proportional to IMPACT_YIELD.  Here are some results for the force where deflection equals approximately 60% (the middle of the transition between 1.0 and 0.2) as a function of IMPACT_YIELD:
Spoiler: (updated) (click to show/hide)
I have also plotted the square of the force (proportional to the kinetic energy) as a function of IMPACT_YIELD-IMPACT_FRACTURE:
Spoiler: (updated) (click to show/hide)
As you can see, it is linear for IMPACT_YIELD>IMPACT_FRACTURE, but not for smaller IMPACT_YIELD.

update: I added more points to the above curves.  Note the discontinuity at IMPACT_YIELD=IMPACT_FRACTURE=2520000 - I believe this is real.  Here is also a zoom-in of the kinetic energy plot above near the transition:
Spoiler (click to show/hide)

Here are some of the raw deflection vs. force curves that I used to determine the transition. 
Spoiler (click to show/hide)
The number next to the curve in the legend is IMPACT_YIELD.  The data for low IMPACT_YIELD is not in here - I only copied down the force for the transition from 1.0 to 0.2 and not the force/deflection curve.  I have all the raw gamelogs, so I will try to add in this data later.

Edit - here is another set with IMPACT_YIELD <= IMPACT_FRACTURE.  Note that the curve for IMPACT_YIELD=IMPACT_FRACTURE=2520000 is quite different from the others.

I have also posted most of my data on DFFD (http://dffd.wimbli.com/file.php?id=7089) (I updated this more data).  I created this using Gnumeric (linux spreadsheet editor) and converted to excel, so the graphs will probably be all messed up, but the data should be fine. 

One other comment about the data - as |IMPACT_YIELD-IMPACT_FRACTURE| gets larger, the size of the plateau at 0.2 also gets larger.  This is also true for at least some values where IMPACT_YIELD<IMPACT_FRACTURE.  Notice that IMPACT_YIELD:3010000 (just above the IMPACT_FRACTURE:2520000) the plateau seems to have almost disappeared, but it is quite prevalent for vanilla IMPACT params (see earlier posts), which have IMPACT_YIELD:1505000.

Looking at those bronze results, it looks like you increased each parameter x10.
I actually only multiplied by 2 each time.  Very sorry I forgot to mention that.  It took me so many tries to get the run to work I forgot that I had made that change by the time I posted the data.

Today I am going to do some detailed runs for IMPACT_YIELD<IMPACT_FRACTURE.

Edit:
I looked at Urist's results more carefully, and it appears he only considered IMPACT_YIELD>IMPACT_FRACTURE, so his results are consistent with my finding that in this range the kinetic energy required to penetrate armor scales linearly with IMPACT_YIELD. 

In addition to running IMPACT_YIELD<IMPACT_FRACTURE, I also am running IMPACT_YIELD=IMPACT_FRACTURE today, and before I left I peeked at the first few results and I can say that it is weird.  At Force=45, there are ~90% deflections, which is very strange given that at very small impact yield there are 100% deflections at Force=45.  Candy has IMPACT_YIELD=IMPACT_FRACTURE=5000000, so we should expect the behavior of candy to be weird as well.  I definitely plan to explore force/deflection curves at different values of IMPACT_YIELD=IMPACT_FRACTURE.

I am hoping that in the next few days (or maybe this weekend) I can write code to do a simplex search to automatically map out force/deflection curves.  Right now I just tell the computer to evaluate deflection at a set of force values, but frequently the result is not at all what I expected, and therefore the forces I evaluate at are not ideal for mapping a good curve.  I need the computer to instead search for the forces which give certain values of deflection (x=1.0, 0.8, 0.6, 0.4, 0.2, 0.1 and 0.0), and then search until it finds a pair of adjacent forces such that the higher force has deflection less than or equal to x, and the lower force has deflection greater than or equal to x (for example, for iron vs. vanilla steel, the pair of forces (47,48) satisfy this for x between 1.0 and 0.2).  Since this is a one dimensional search, the simplex method (http://en.wikipedia.org/wiki/Simplex_algorithm) should do a good job.  Given how complicated the dependence on impact parameters appears to be, I think it would be most efficient for me to focus my efforts on writing this search code over the next few days, and not worry about running more data sets until I have it finished. 

Urist - do you (or anyone else who's motivated) have any interest in my collection of perl scripts?  They are written to work under linux, but I think the only change needed to make them work under windoze would be to call a different program to send keystrokes to DF.  For example, I think this (http://technet.microsoft.com/en-us/library/ee156592.aspx) might work, but I'm not sure if it's compatible with perl.  I definitely plan to post my scripts to DFFD eventually (and I did post some (http://dffd.wimbli.com/file.php?id=6895) a while back), but I end up changing them pretty much daily as I find that I need to do a more and more complex search to map out the parameter space.  So unless someone is really interested and into computer programming, I will wait until I have something that is more stable and also hopefully commented at least decently well before putting it up there.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on October 31, 2012, 08:21:24 pm
...
I looked at Urist's results more carefully, and it appears he only considered IMPACT_YIELD>IMPACT_FRACTURE, so his results are consistent with my finding that in this range the kinetic energy required to penetrate armor scales linearly with IMPACT_YIELD. 
...

I'm somewhat confused by your results. In real life, YIELD<FRACTURE (yield is less than fracture), which I always used for my own tests. YIELD>FRACTURE is like the below-absolute-zero temperatures that are possible in DF.

I'll examine your DFFD data, and reassess the earlier results for 2x instead of 10x.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on October 31, 2012, 09:20:40 pm
...
I looked at Urist's results more carefully, and it appears he only considered IMPACT_YIELD>IMPACT_FRACTURE, so his results are consistent with my finding that in this range the kinetic energy required to penetrate armor scales linearly with IMPACT_YIELD. 
...

I'm somewhat confused by your results. In real life, YIELD<FRACTURE (yield is less than fracture), which I always used for my own tests. YIELD>FRACTURE is like the below-absolute-zero temperatures that are possible in DF.

I'll examine your DFFD data, and reassess the earlier results for 2x instead of 10x.
Oh, wait, in your tests you said Fracture>Yield.  That's the opposite of what I thought.  I guess you were also varying fracture, not yield.  I haven't tested that, and our two tests aren't really related. 

It does make sense that Fracture should always be greater than Yield.  As I mentioned before, I don't know anything about materials physics.  I think it is greater or equal to yield for all the materials in DF, but I'm not sure.  It's definitely equal for candy, which is weird enough.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 02, 2012, 01:27:04 am
OK, here are the threshold velocity results for varying the properties of candy, using iron bolts and candy uniarmor:

Code: [Select]
IF=IY Velocity
5000000 84
3750000 63
2500000 42
1000000 16

This is linear with velocity. I also tried silver bolts in the 3750000 case, and got a threshold velocity of 47. 63/47=10490/7850 so this is also linear with weight. This means that candy deflects bolts below a certain momentum, not kinetic energy.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 02, 2012, 11:35:35 am
OK, here are the threshold velocity results for varying the properties of candy, using iron bolts and candy uniarmor:

Code: [Select]
IF=IY Velocity
5000000 84
3750000 63
2500000 42
1000000 16
This is linear with velocity. I also tried silver bolts in the 3750000 case, and got a threshold velocity of 47. 63/47=10490/7850 so this is also linear with weight. This means that candy deflects bolts below a certain momentum, not kinetic energy.
I assume by "threshold velocity" you mean the lowest velocity at which armor penetration occurs at all (which usually corresponds to the transition from 100% deflection to 20% deflection)?

I am finished writing the core of my simplex search algorithm (the simplex algorithm is really easy to code, but I don't know perl that well so I was spending a lot of time figuring out how to pass arrays back and forth from subroutines and that sort of thing).  I now just need to apply it to running dwarf fortress simulations, which should be relatively straightforward.

Urist, do you have any suggestions on what I should investigate first?  I think maybe I need to investigate IMPACT_STRAIN_AT_YIELD.  I noticed that it is zero for candy, and this seems very odd.  Looking at the wikipedia article on Stress-Strain (http://en.wikipedia.org/wiki/Stress%E2%80%93strain_curve), it appears to me that zero IMPACT_STRAIN_AT_YIELD implies that candy is "brittle", similar to glass or carbon fiber, but I am not sure.  Maybe Toady decided that carbon fiber is the closest real-world approximation to candy?  Do you have any thoughts?  I think it might be interesting to test candy and steel with IMPACT_STRAIN_AT_YIELD = [0,10,100,500,1000,2000,5000] or something similar.  At each of these values I would have the simplex find the velocity required for deflections equal to (100%, 80%, 60%, 40%, 20%, 10% and 0).  I estimate that it would take about 30 points to generate each deflection vs. velocity curve, and around 2 minutes for each point to run in the arena, so running this whole set would take about a day.  I suppose I could remove some points from the velocity/deflection curve, but I don't want to miss any unexpected behavior. 

Another idea I had was to scan a large range, but I think I might want to understand IMPACT_STRAIN_AT_YIELD better first.  I was thinking about using IMPACT_FRACTURE = [ 500000 (~silver) , 1250000 (~iron), 2500000 (~steel), and 5000000 (candy)] , and then at each IMPACT_FRACTURE using IMPACT_YIELD equal to  [10%, 25%, 50% and 100%] of  IMPACT_FRACTURE.  Then for each YIELD/FRACTURE pair I would have the simplex find the velocity required for deflections equal to (100%, 80%, 60%, 40%, 20%, 10% and 0).  Running this set would take about a day, but I am not sure what value to use for IMPACT_STRAIN_AT_YIELD (or other parameters), so I think I should investigate this first.

Another thing I would eventually like to investigate is the behavior with IMPACT_YIELD just below IMPACT_FRACTURE, as something weird is happening when they are equal.  However, I think I would like to map out the general behavior over a large range first.

Edit:  Looking at the stress-strain curve some more, it appears that IMPACT_STRAIN_AT_YIELD determines the strain at which the material transitions from elastic yield to plastic deformation (although this might actually be just IMPACT_YIELD - I'm not sure).  Our tests have shown that increasing IMPACT_STRAIN_AT_YIELD results in deflections at lower force (at least if you increase it a lot).  This might mean that if strain at yield is too high, then the armor is very rigid, and will allow transfer of a blunt blow through, causing damage, but with lower strain at yield the armor deforms, dissipating the force of the blow.  I think Urist may have said before that it determines flexibility, but I'm not sure.    I wish I could figure out what (if anything) all these parameters correspond to in terms of real world physics.

Edit #2:  There is also another direction I could go with testing.  I could temporarily abandon trying to understand details of how the materials properties impact armor behavior.  I would really like to figure out how the raws could be modded to produce decent bolt behavior.  I would strongly prefer not to change materials to achieve this, as that would almost certainly mess up melee combat, which as far as I know works well right now.  To that end, I could instead vary bolt contact area, mass and penetration depth, and test this against [candy, steel, iron, bronze, and copper] as a function of bolt velocity.  I would very much like to uncover the complete mathematics governing dwarven ballistics, but given how complicated it seems to be it might be wiser to delay this.  I'm not sure.  If we understand the math, it should be pretty easy to prescribe a set of parameters which will produce nice results.  Then again, Toady knows what the math is, and he's very smart, and yet I think it's very unlikely that he realized that the current set of raws would produce such wacky behavior for bolts and arrows.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Quietust on November 02, 2012, 03:09:51 pm
Minor offtopic rant:

I've just read through some bits of this thread, and I can't help but be annoyed by the rampant references to the term "candy". If you're going to post "scientific research results" (even if they are the result of ‼science‼), then don't use euphemisms! The top material is not "candy" - it is Adamantine.

We're intelligent people who know how the game works - there's no need to hide behind meaningless spoiler language (especially where said "spoiler terms" are worse than useless)...
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Zaroua on November 02, 2012, 05:33:09 pm
Also, for threshold IMPACT_YIELD greater than about 10000, the difference between deflect and blunt damage on armor is binary. For thresholds 0-10000, the difference is fuzzy and also appears to depend on body part size or number of armor layers (i.e. lower leg deflects because boots+greaves, but upper leg damaged because only greaves!).

This research has useful applications because wooden arrows (i.e. from elves) kill dwarves in candy, aluminum, wood, bone, and leather armor, but heaver junk metals like pewter (i.e. artifact) or copper armor will safely deflect the arrows. The armor density needs to be at least 3000.

So if I'm reading this right, you'd want adamantine plate with steel chain mail to maximize protection against arrows and bolts, correct?



Potential new discovery:

It has been generally known, given comments made by Toady One and various testing, that the IMPACT_YIELD property of an armor material has an effect on blunt damage received. AFAIK (and general forum wisdom) was that blunt damage depended only on blunt weapon density.

Take a silver bolt, and shoot it at a dwarf wearing steel armor. According to previous research and testing, the victim will suffer blunt damage, likely chipping a bone and with a chance of instant death due to skull=>brain damage.

Now mod silver to have a reduced IMPACT_YIELD of 350 instead of 350000. These silver bolts will deflect off the steel armor, but will still penetrate wood/leather armor and cut flesh. These modded silver bolts will deflect off any armor that they can't penetrate, including Silver or Candy - it's almost as if the bolts can no longer deal blunt damage. However, since we modded the material, this may have unintended consequences for armor properties or melee combat.

Some verification testing and additional research is requested.

TLDR; SOLID_DENSITY and IMPACT_YIELD both matter for blunt damage

Would this explain why silver blunt weapons with their 350k impact yield have such a hard time actually killing enemies while iron/bronze/steel blunt weapons are significantly better at getting kills - especially against unconscious enemies?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 02, 2012, 08:37:01 pm
...

So if I'm reading this right, you'd want adamantine plate with steel chain mail to maximize protection against arrows and bolts, correct?

...

Would this explain why silver blunt weapons with their 350k impact yield have such a hard time actually killing enemies while iron/bronze/steel blunt weapons are significantly better at getting kills - especially against unconscious enemies?

1. Yes, that would be a good combination. Shields and some shield user skill provide far better bolt/arrow protection in practice. Barring changes to combat, I will probably only use adamantine for edged weapons and not armor in future fortresses.

2. Perhaps. I haven't looked at melee weapons in detail.

...
I assume by "threshold velocity" you mean the lowest velocity at which armor penetration occurs at all (which usually corresponds to the transition from 100% deflection to 20% deflection)?
...
Urist, do you have any suggestions on what I should investigate first?  I think maybe I need to investigate IMPACT_STRAIN_AT_YIELD.  I noticed that it is zero for candy, and this seems very odd.  Looking at the wikipedia article on Stress-Strain (http://en.wikipedia.org/wiki/Stress%E2%80%93strain_curve), it appears to me that zero IMPACT_STRAIN_AT_YIELD implies that candy is "brittle", similar to glass or carbon fiber, but I am not sure.  Maybe Toady decided that carbon fiber is the closest real-world approximation to candy?  Do you have any thoughts?
...
Edit:  Looking at the stress-strain curve some more, it appears that IMPACT_STRAIN_AT_YIELD determines the strain at which the material transitions from elastic yield to plastic deformation (although this might actually be just IMPACT_YIELD - I'm not sure).  Our tests have shown that increasing IMPACT_STRAIN_AT_YIELD results in deflections at lower force (at least if you increase it a lot).  This might mean that if strain at yield is too high, then the armor is very rigid, and will allow transfer of a blunt blow through, causing damage, but with lower strain at yield the armor deforms, dissipating the force of the blow.
...

3. Yes. Adamantine doesn't have a sharp drop from 100% to 20%, its more like 100% to 99%.

4. http://www.youtube.com/watch?v=t9eB0PKYAt8 - A short youtube video explaining the basics of stress and strain. So the strain at yield is essentially the deflection at the instant the material starts to yield. IRL brittle materials are stiff, but not as stiff as Adamantine (which is impossibly stiff, in a divide-by-zero sense). IRL brittle materials DO have ultimate tensile strengths (i.e. fracture strengths) that are not far above the yield strength, so Bronze, Adamantine, and Bone are all brittle materials. Strain at yield is a derived property - IRL we use the elastic modulus (young's modulus) in calculations.

5. It appears that the strain at yield and the "impact yield" (i.e. yield strength) determine the energy required to start to plastically deform the material. If the strain at yield is too high (i.e. the 50000 values for meat), the material is very flexible and allows the transfer of a blunt blow through (to the bones beneath). However a larger strain at yield should reduce the energy of the bolt.

If the fracture strength is very high compared to the yield strength, and the strain at yield is low, the armor would absorb lots of energy in both elastic and plastic deflections. I might be able to make Adamantine stronger.

Pirate Bob, could you please plot some 100% deflection threshold data where you start out with yield=fracture, and then increase the fracture strength in steps up to about 5x yield? Then alter the strain at yield, and run the test again with the same values. You could use Bronze as the material, and try it with normal, double, and zero strain. The graph of this data should give us a good idea of how the ductile-brittle transition is handled, and when strain starts to matter.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 03, 2012, 11:44:55 pm
Pirate Bob, could you please plot some 100% deflection threshold data where you start out with yield=fracture, and then increase the fracture strength in steps up to about 5x yield? Then alter the strain at yield, and run the test again with the same values. You could use Bronze as the material, and try it with normal, double, and zero strain. The graph of this data should give us a good idea of how the ductile-brittle transition is handled, and when strain starts to matter.
I am working on these plots.  I uncovered a bug with my simplex code when I implemented for projectile testing, but I am 99% sure that is squashed now.  I am running overnight with steel armor starting with fracture=yield and increasing fracture, for several values of stain at yield.  I chose steel to start as I am slightly worried that bronze's behavior might be unusual, at least for deflection of iron.  I can run bronze next (i.e. tomorrow), unless there is something else more interesting to work on.

Edit:  Here are some preliminary results - the run is taking longer than I expected, so it will not be finished until this afternoon.   I am running with double IMPACT_STRAIN_AT_YIELD now and will post results later today. 

This was run using steel armor ([IMPACT_YIELD:1505000]), with IMPACT_FRACTURE = 1505000, 1512000, 2016000, 2520000, 5040000, 10080000, and 15120000.  I have run two sets so far, with IMPACT_STRAIN_AT_YIELD equal to 940 and 470.  I also added in a point at IMPACT_FRACTURE=3780000 for 470, which I will include in future runs.  This plots shows the minimum force(=velocity) where armor was penetrated for iron bolts against steel uniarmor, with all parameters not mentioned at vanilla values.
Spoiler (click to show/hide)
(updated)
It's hard to say for sure, but it appears that the cutoff force increases linearly with IMPACT_FRACTURE until a point determined by the inverse of IMPACT_STRAIN_AT_YIELD, and then remains constant.  It is also possible that the true behavior is something like an exponential decay to a constant value - it's hard to say for sure without more data.  Fitting the strain at yield 470 curve to a line for fracture<3000000 gives force cutoff = 3.53967E-5 * IMPACT_FRACTURE - 28.5878. 

Edit #2: I updated the plot above to include data with strain=1880, and also plotted the curve for 10% deflection (which does not depend on strain).  In this case, all values of IMPACT_FRACTURE drop to 20% deflection at force/velocity approximately 25.  I have also included plots of the full force/deflection curves for each value of IMPACT_FRACTURE and IMPACT_STRAIN_AT_YIELD.  There is a separate plot for each IMPACT_STRAIN_AT_YIELD, and each curve within the plot has the labeled value of IMPACT_FRACTURE.
Spoiler (click to show/hide)
I also plotted the force for 10% deflection as a function of IMPACT_FRACTURE for each value of IMPACT_STRAIN_AT_YIELD.  This force doesn't hardly depend on IMPACT_STRAIN_AT_YIELD and it is linear with IMPACT_FRACTURE.
Spoiler (click to show/hide)

Finally, I also updated my spreadsheet on DFFD (http://dffd.wimbli.com/file.php?id=7089) to add a sheet with the raw data for all of these plots. 

It appears that, if IMPACT_FRACTURE is below some cutoff determined by IMPACT_STRAIN_AT_YIELD (and possibly other parameters such as IMPACT_YIELD) that deflection exhibits a smooth, sigmoidal drop from 1 to zero, with the middle of the drop given by SHOOT_FORCE = 3.65E-5 * IMPACT_FRACTURE - 27.13 (note - I believe the reason this slope is slightly different than the slope for the 100% deflection cutoff is because the sigmoidal transition also gets wider as IMPACT_FRACTURE increases).  If IMPACT_FRACTURE goes over the threshold, then deflection drops to ~19% at some fixed force which depends on IMPACT_STRAIN_AT_YIELD, but not IMPACT_FRACTURE.  Deflection will always follow the same sigmoidal curve from 19% to zero, regardless of the cutoff.

My next steps will be to check this at lower values of IMPACT_STRAIN_AT_YIELD (higher cutoff) and to see how IMPACT_YIELD figures into this behavior.  I also would like to see how bronze behaves, as Urist Da Vinci suggested using bronze for these tests and he may have had a good reason.  I definitely feel like we're getting somewhere...
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 04, 2012, 11:35:10 pm
Here is a plot of the force at which deflection drops from 1.0 to 0.2 at high [IMPACT_FRACTURE] as a function of 1/[IMPACT_STRAIN_AT_YIELD] 
Spoiler (click to show/hide)
It is clearly linear, and fits nicely to the equation shown in the chart.  Since the Cutoff Force is also equal to 3.65E-5 * IMPACT_FRACTURE - 27.13, this implies that the IMPACT_FRACTURE where the plot of cutoff force vs. IMPACT_FRACTURE levels off is given by 1.16E9 / IMPACT_STRAIN_AT_YIELD + 815433.  I will be verifying this overnight.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 05, 2012, 12:36:00 am
Firstly, you wrote IMPACT_YIELD_AT_FRACTURE often, when you probably meant IMPACT_STRAIN_AT_YIELD.

...
It appears that, if IMPACT_FRACTURE is below some cutoff determined by IMPACT_YIELD_AT_FRACTURE (and possibly other parameters such as IMPACT_YIELD) that deflection exhibits a smooth, sigmoidal drop from 1 to zero, with the middle of the drop given by SHOOT_FORCE = 3.65E-5 * IMPACT_FRACTURE - 27.13 (note - I believe the reason this slope is slightly different than the slope for the 100% deflection cutoff is because the sigmoidal transition also gets wider as IMPACT_FRACTURE increases).  If IMPACT_FRACTURE goes over the threshold, then deflection drops to ~19% at some fixed force which depends on IMPACT_YIELD_AT_FRACTURE, but not IMPACT_FRACTURE.  Deflection will always follow the same sigmoidal curve from 19% to zero, regardless of the cutoff.
...

My recent test for iron bolts on adamantine armor found that the 100% deflection cutoff for materials with 0 IMPACT_STRAIN_AT_YIELD and IMPACT_YIELD=IMPACT_FRACTURE is:

Bolt Momentum = Bolt_Weight * Bolt_Velocity = 2.00E-5 * IMPACT_FRACTURE = IMPACT_FRACTURE/50000

If the sigmoidal transition gets wider as IMPACT_FRACTURE increases, then this would be one of the edges.
Your slope is also momentum-based and could be written as such.

...
This was run using steel armor ([IMPACT_YIELD:1505000]), with IMPACT_FRACTURE = 1505000, 1512000, 2016000, 2520000, 5040000, 10080000, and 15120000.  I have run two sets so far, with IMPACT_YIELD_AT_FRACTURE equal to 940 and 470.  I also added in a point at IMPACT_FRACTURE=3780000 for 470, which I will include in future runs.  This plots shows the minimum force(=velocity) where armor was penetrated for iron bolts against steel uniarmor, with all parameters not mentioned at vanilla values.
Spoiler (click to show/hide)
(updated)
...
Edit #2: I updated the plot above to include data with strain=1880, and also plotted the curve for 10% deflection (which does not depend on strain).  In this case, all values of IMPACT_FRACTURE drop to 20% deflection at force/velocity approximately 25.
...

1505000 / 50000 / 1.1775 = 25.5
So we can probably predict the deflection threshold velocity for all materials that have IMPACT_YIELD=IMPACT_FRACTURE, or in those cases where the IMPACT_FRACTURE is higher than yield but not high enough.

IMPACT_FRACTURE = 1.5 * IMPACT_YIELD at the point where the velocity stops increasing on the IMPACT_STRAIN_AT_YIELD 940 set of points. That's interesting. IRL that is the point where the energy required to yield the material is the same as the energy required to fracture the (already yielded) material. Not sure if that's the case here.

On the set of points for IMPACT_STRAIN_AT_YIELD 470, the velocity stops increasing at just about double the previous velocity. Perhaps this velocity can be predicted for other small values of IMPACT_STRAIN_AT_YIELD if the "multiply one by X, divide the other by X" relationship exists. Apparently you can't use this with large strain values to get velocities below 25 for steel armor, since the method used to calculate that 25 velocity ignores strain.

It looks to me like the width of the 20% deflection zone is linear with increasing IMPACT_FRACTURE, so we could probably predict it.

...
I also would like to see how bronze behaves, as Urist Da Vinci suggested using bronze for these tests and he may have had a good reason.  I definitely feel like we're getting somewhere...

We could probably make a deflection prediction algorithm at this point. We know armor thickness and contact area are involved. It's probably similar to how contact area and armor thickness are handled for the low-bolt's-impact-yield ricochet equation, but that needs to be verified. Take a situation where a bolt should not deflect (or only partially deflect) and see how the deflection improves as you increase the armor thickness or increase the contact area.

Bronze has a higher SHEAR_YIELD and IMPACT_YIELD than Iron, but it has a smaller SHEAR_FRACTURE and IMPACT_FRACTURE than Iron. Strange things are likely to happen when the two materials hit each other. Given how popular these materials are in both fortress mode and adventure mode combat, it might be worth a look.

FAKE EDIT: I haven't read your latest post yet. Sleep is required!
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 05, 2012, 11:15:47 am
Firstly, you wrote IMPACT_YIELD_AT_FRACTURE often, when you probably meant IMPACT_STRAIN_AT_YIELD.
Sorry about this - you are correct that I meant IMPACT_STRAIN_AT_YIELD in all cases.  I perhaps should have also stopped updating and gotten some sleep instead.  I think I fixed most of my references to YIELD_AT_FRACTURE, which of course does not exist.

My recent test for iron bolts on adamantine armor found that the 100% deflection cutoff for materials with 0 IMPACT_STRAIN_AT_YIELD and IMPACT_YIELD=IMPACT_FRACTURE is:

Bolt Momentum = Bolt_Weight * Bolt_Velocity = 2.00E-5 * IMPACT_FRACTURE = IMPACT_FRACTURE/50000

If the sigmoidal transition gets wider as IMPACT_FRACTURE increases, then this would be one of the edges.
Your slope is also momentum-based and could be written as such.
Any chance that you will post the data or plots of the data you used to obtain this relationship? (You had done this a while ago...)  I agree that this result equation also agrees with the result for YIELD=FRACTURE for my data, and is also the lower momentum limit for the deflection cutoff in the case of high IMPACT_STRAIN_AT_YIELD(doesn't hold for newer data).   If you look at my raw data, sometimes I get force=25 and sometimes I get 26, so 25.5 actually fits the data perfectly.

I am collecting more data on the the deflection cutoff vs. IMPACT_FRACTURE (my run did not finish last night).  When I have that data, I will plot the deflection cutoff as a momentum instead of a force, and see if the numbers come out nicer.  Just multiplying Force=3.65E-5 * IMPACT_FRACTURE - 27.13 times mass=1.1775 give momentum = 4.3E-5*IMPACT_FRACTURE - 31.9, so it seems like there are probably other parameters entering into this equation.  There is some error in this line fit, but not enough to say that 4.3 could round to 4 or 5. 

However, if I take the curve for cutoff force vs. 1/[IMPACT_STRAIN_AT_YIELD] and multiply this by mass=1.1775, then I get cutoff momentum = 50000/[IMPACT_STRAIN_AT_YIELD] + 3.1.  The error on the value 3.1 is large enough that it might be zero, so I am leaning towards the real relationship just being cutoff momentum = 50000/[IMPACT_STRAIN_AT_YIELD] when the [IMPACT_STRAIN_AT_YIELD] is small enough that this result is significantly greater than IMPACT_YIELD/50000 (and I do mean YIELD here, as this is derived from the FRACTURE=YIELD limit, and for very large [IMPACT_STRAIN_AT_YIELD] the deflection cutoff is given by IMPACT_YIELD/50000 and is independent of FRACTURE).

While I definitely agree that varying bolt parameters (contact area etc.) and testing iron vs. bronze (which I agree is likely weird - this is the reason I did not test it first) are important, I think we need to see how changing IMPACT_YIELD plays into this behavior next.  Unless something unexpected happens with my data from today or someone presents me with a better idea, I will probably redo varying of IMPACT_FRACTURE and IMPACT_STRAIN_AT_YIELD after doubling IMPACT_YIELD, or something similar.  I also need to double check that if I increase [IMPACT_STRAIN_AT_YIELD] further that the cutoff does not dip below momentum=IMPACT_YIELD/50000.

Edit:  With regard to the width of the sigmoidal transition, I will plot the difference between the momenta for deflections=0.2 and deflections=0.8 as a function of IMPACT_FRACTURE when I finish my new data set.  I didn't feel there was enough data in my set for yesterday to do this, as most of the curves are cut off by the 50000/[IMPACT_STRAIN_AT_YIELD] limit, leaving only 3 full curves which are all quite narrow.  I think I should have enough data tonight.  I would eventually like see if I can figure out what type of sigmoid (such as the logistic function, error function etc) fits to the data, but this is probably only of academic importance, unless I find that the shape is somehow more complicated that a sigmoid under some yet untested conditions.

Edit#2:  I had some more troubles with my runs yesterday and last night, so I don't have as much data as I wanted.  I spent the time I had to work on this figuring out what went wrong (it seems that either dwarf fortress itself or my scripts can't handle SHOOT_FORCE>1000), so I didn't have time to plot the results.  The data I do have suggests that IMPACT_YIELD does not change the slope of any deflection cutoff vs. IMPACT_FRACTURE or deflection cutoff vs. IMPACT_STRAIN_AT_YIELD curves, but can change their offsets.  Also, I found that at [IMPACT_STRAIN_AT_YIELD]=3760, the 100% deflection cutoff shifted down to Force=18, so momentum=IMPACT_YIELD/50000 is not in fact a hard lower limit for this.  Also, while it appears that momentum=50000/[IMPACT_STRAIN_AT_YIELD] is a good approximation for the cutoff at low [IMPACT_STRAIN_AT_YIELD], the results deviate significantly from this curve for [IMPACT_STRAIN_AT_YIELD]>1000.  Given how subtle this deviation is, I have wonder if Urist's finding that momentum=IMPACT_YIELD/50000 is exact for all IMPACT_YIELD=IMPACT_FRACTURE and all values of IMPACT_STRAIN_AT_YIELD.  This probably warrants more careful testing (eventually).

Right now I am running with contact area=4 (instead of 2), for iron bolts vs steel armor over a range of IMPACT_FRACTURE and IMPACT_STRAIN_AT_YIELD.  Do we know if any other bolt parameters (penetration depth, varying size without changing mass, etc) should matter?  I will also like to vary armor thickness and target creature size eventually.  It should also be interesting to measure several values of IMPACT_YIELD<IMPACT_FRACTURE holding IMPACT_FRACTURE constant to see the dependence of deflection cutoffs on IMPACT_YIELD.  I need more computers...:P
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 06, 2012, 11:29:49 pm
Here is an update of the force where deflection drops from 100% to ~20% at large [IMPACT_FRACTURE] as a function of [IMPACT_STRAIN_AT_YIELD]. 
Spoiler (click to show/hide)
The new point is at [IMPACT_STRAIN_AT_YIELD]=3760, force=18, and goes below the minimum cutoff expected based on  momentum=IMPACT_YIELD/50000.  With this point, it is also clear that the curve does deviate significantly from cutoff momentum=50000/[IMPACT_STRAIN_AT_YIELD], especially at large [IMPACT_STRAIN_AT_YIELD], but the deviation is small enough that I can't really characterize it well.

My results from doubling the Contact Area for bolts from 2 to 4 show no changes at all:
Spoiler (click to show/hide)
The plots of the forces for 10% and 100% deflection as a function of [IMPACT_FRACTURE] are identical to those with contact area 2, and I could see no significant deviations in the raw data either.  I think Urist Da Vinci said he saw some difference from changing Contact Area, but I'm not sure what and I'm too tired to look it up now.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 07, 2012, 03:42:28 am
I found something interesting when looking at penetration, so I'll take a step back to recap:

I came up with the "uniarmor" concept several pages ago in this thread when testing the "ricochet" deflection of bolts off armor. The creature size or body part size didn't matter to that deflection type, but the LAYER_SIZE of the armor did matter. The "uniarmor" set covers a dwarf in a uniform layer of [LAYER_SIZE:20] plate armor. This was supposed to remove "where did the bolt hit?" from future research. It does in fact work for the "ricochet" deflection type.

Code: [Select]
[ITEM_WEAPON:ITEM_WEAPON_SPEAR_VARIABLE]
[NAME:variable spear:variable spear]
[SIZE:300]
[SKILL:SPEAR]
[TWO_HANDED:37500]
[MINIMUM_SIZE:32500]
[CAN_STONE]
[MATERIAL_SIZE:3]
The format is ATTACK:EDGE/BLUNT:contact area:penetration size:verb2nd:verb3rd:noun:velocity multiplier
[ATTACK:EDGE:2:1:1:1:NO_SUB:1250]
[ATTACK:EDGE:2:10:10:10:NO_SUB:1250]
[ATTACK:EDGE:2:100:100:100:NO_SUB:1250]
[ATTACK:EDGE:2:1000:1000:1000:NO_SUB:1250]
[ATTACK:EDGE:2:10000:10000:10000:NO_SUB:1250]
[ATTACK:EDGE:2:100000:100000:100000:NO_SUB:1250]
This is a variable spear. It has a bolt-sized contact area and several levels of penetration. I used it, and several other versions that went like "21,22,23,24,25,26" etc. to measure the thickness, in "penetration units", of skin, fat, muscle, and armor. "Measure" means stab each body part with each penetration size repeatedly.

The dwarf upper body is, in "penetration units", about 3 skin, 38 fat, and 229 muscle, so you need a weapon of over 270 penetration to stab a dwarf in the heart (a weapon of less penetration will only tear muscle and bruise the heart!). These penetration amounts are proportional to the CUBE ROOT of (body_part_size/10). A dwarf's upper body is relsize 1000 whereas the head is relsize 300, so the dwarf's head only has 25 fat.

A kea has about 1 skin, 9 fat, and 48 muscle. A giant has about 20 skin, 204 fat, and 1051 muscle. A dwarf has thicker muscle than a human or a scaled-down giant, because of the natural dwarf strength bonus in their RAWS, and [THICKENS_ON_STRENGTH] in the tissue template. For humans and giants, the upper body skin:fat:muscle is in the ratios 1:10:50, even though the tissue token is [BP_LAYERS:BY_CATEGORY:BODY_UPPER:ARG3:50:ARG2:5:ARG1:1]. This is due to [THICKENS_ON_ENERGY_STORAGE] in the fat tissue doubling the tissue thickness for healthy fat levels. Presumably fat dwarves are thicker, and starving thin dwarves have almost no fat.

Now for armor:

See http://dwarffortresswiki.org/index.php/DF2012_Talk:Weight where I gave a method to calculate the weight of clothing or armor. Extensive testing has revealed that the thickness in "penetration units" of armor is given by:

[BODY_SIZE]*(percentage)*[COVERAGE]*[LAYER_SIZE]*(step factor)/100000

So Uniplate (for the upper body) is 60000*0.1836*100*20*1.25/100000 = 275 penetration units
Unihelm=66
Unigreaves=385
Unigauntlets=22
Uniboots=26

 :'( See the problem yet?

Since the penetration size required to penetrate armor with an edged attack (otherwise the attack is converted to blunt) is linearly proportional to the creature size, a giant has 5.3x the tissue penetration req. of a dwarf, but giant-sized armor has 150x the penetration req. (about 41314 for giant-sized uniplate). Worse, the clothing worn by those "deity" guys you can meet in adventure mode is about 55000 penetration units thick. Vanilla bolts have penetration 2000, and pikes have 12000. Do the math.

So in order to put a real uniform layer of metal across a dwarf, you have to make each piece of armor equal in volume, which means equal weight if the armor is all made of the same material. This extra weight makes it hard to move in combat.

I'd call it a bug if you need to wear a 17 kg boot to get the same thickness of metal as a 17 kg breastplate, even though the breastplate covers a larger body part (the upper body) than the foot. The armor should probably scale the same way that the body tissues scale (cube root).
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 07, 2012, 02:36:50 pm
I found something interesting when looking at penetration, so I'll take a step back to recap:
I came up with the "uniarmor" concept several pages ago in this thread when testing the "ricochet" deflection of bolts off armor.
*SNIP*
This is a very nice result!  In addition to be useful on it's own merit, it also gave me some insights into how LAYER_SIZE, CONTACT_AREA, and PENETRATION_DEPTH could influence the other type of deflections.  I realized that maybe I didn't change CONTACT_AREA enough to matter last night (I increased from 2 to 4), as it might be subject to weird rounding for this mechanism as well.  I will try again with say a 100-fold increase in CONTACT_AREA tonight.

This also confirmed a feeling that I had a few days ago that we need to create a summary of our results.  If I can't keep track of them, I can't imagine people not directly working on this project can understand what we're doing at all any more.  I have created a google doc (https://docs.google.com/document/d/1lytX4_1zwGqiiKcQ2Zsw-1YvPxz4vb1v5ECretSGUvM/edit) where I am beginning to compile our results.  I would definitely like to create a wiki page for this eventually, but
If other people involved in this project would like to help with wikifying it, then maybe we could do that sooner than later.  Otherwise, if anyone else would like to work on the google doc I have just send me your email address and I'll give you access (or do people think it would be safe to just grant access to anyone with the link?  I fear trolling...)

Finally (speaking of trolling ;)) I don't think I like using "ricochet"  to describe the first kind of deflection.  Maybe I don't understand what "ricochet" means, but based on my understanding and reading of wikipedia (http://en.wikipedia.org/wiki/Ricochet), it occurs when the surface hit is hard enough to prevent penetration, and the projectile is strong enough to resist fragmentation.  The projectile deflection we observe doesn't depend on the impact parameters of the armor at all.  Instead it requires that the SHEAR_YIELD/FRACTURE are high enough to convert the edged damage to blunt damage.  If the damage is blunted, then the chance of deflection depends on the mass of only the chunk of armor under the contact area of the projectile.  To me, this indicates that a chunk of armor of this size is being pushed in, as if the whole piece of armor is moving as a rigid unit then deflection should depend on say the mass of the entire breastplate, not just a section of it the size of the bolt's contact area.  Then, deflection occurs if the bolt's IMPACT_YIELD is small compared to the mass of the armor chunk moved, indicating that the bolt is deformed or fragmented.  To me, this sounds more like frangibility (http://en.wikipedia.org/wiki/Frangible) than a ricochet.  However, even if the deformation of the bolt is plastic and could be called a ricochet, I think the other type of deflection, which depends on the impact parameters of the armor and bolt momentum, is almost definitely a ricochet.  Therefore, I don't think the term "ricochet" is a good choice to distinguish these two types of deflection. 

First of all, this is only a matter of terminology, and really doesn't matter that much.  The only reason I care at all is I am thinking ahead to writing a wiki page etc, and I also wonder if maybe I don't actually understand what's happening in this type of deflection.  Second, I am by no means an expert in ballistics, so if I am wrong, please tell me so (and ideally explain why).  Maybe we could instead call it "bolt deformation" or "fragmentation" or something like that?  It doesn't sound as cool as "ricochet" though. 

Maybe a discussion of terminology is also premature since we really don't understand the second kind of deflection at all yet.  In any case, I don't mean to offend, and by all means Urist keep calling it whatever you want.  I just want to make sure that I understand what's going on, and that when we communicate what's going on to others we are as clear as possible.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: HiEv on November 08, 2012, 01:55:55 am
This also confirmed a feeling that I had a few days ago that we need to create a summary of our results.  If I can't keep track of them, I can't imagine people not directly working on this project can understand what we're doing at all any more.  I have created a google doc (https://docs.google.com/document/d/1lytX4_1zwGqiiKcQ2Zsw-1YvPxz4vb1v5ECretSGUvM/edit) where I am beginning to compile our results.  I would definitely like to create a wiki page for this eventually, but
  • I have little experience editing the wiki
  • I don't know what to title the page (maybe "Ballistics" or "Dwarven Ballistics"?), or how to move the page if we change the title later
  • what I have so far is very rough, and I don't want to confuse people with misinformation
If other people involved in this project would like to help with wikifying it, then maybe we could do that sooner than later.  Otherwise, if anyone else would like to work on the google doc I have just send me your email address and I'll give you access (or do people think it would be safe to just grant access to anyone with the link?  I fear trolling...)

I agree this needs a summary and needs to be wikified, but it also sounds like you're still in the process of getting to the bottom of things.

Adding stuff to the wiki is pretty easy, I can help if you need it.  Considering that this information is also entangled with armor, perhaps "Ballistics and Armor Physics"?  (Open to better suggestions if anyone has one.)  Moving a page is easy, you just mouse-over the little down arrow next to "View History" and pick "Move", give the page a new title, and then it moves the page and its talk page and sets up a redirect from the old name for you.

Once the results are nailed down a bit better, just post a summary here, and I can wikify that for you if you want.  (I've been avidly following this thread, so no need to email/PM me.)
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 09, 2012, 10:10:58 am
I agree this needs a summary and needs to be wikified, but it also sounds like you're still in the process of getting to the bottom of things.

Adding stuff to the wiki is pretty easy, I can help if you need it.  Considering that this information is also entangled with armor, perhaps "Ballistics and Armor Physics"?  (Open to better suggestions if anyone has one.)  Moving a page is easy, you just mouse-over the little down arrow next to "View History" and pick "Move", give the page a new title, and then it moves the page and its talk page and sets up a redirect from the old name for you.

Once the results are nailed down a bit better, just post a summary here, and I can wikify that for you if you want.  (I've been avidly following this thread, so no need to email/PM me.)
I very much appreciate your offer to help with the wiki!  I think the most efficient thing to do would be for me (or maybe Urist Da Vinci, if he wants to do it) to post results to the wiki, and then for you and others more familiar with the wiki's style and format to edit them.  I am OK with editing wiki pages, I'm just not confident that I can create a "proper" dwarf fortress wiki page.  I think we are getting very close, and perhaps a few things (like the way velocities are determined) could be posted soon.  I do like the name "Ballistics and Armor Physics", but it also made me wonder if these should be two separate things.  I suspect (although I have no evidence for this) that the Armor Physics side will be the same for melee combat as for projectiles, and that if we could figure out how velocities are determined for melee weapons we would find similar or identical results to projectiles of the same momenum, size, and contact area.  I think Zivilin may be investigating this, but I'm not sure.  I guess I should see what he's found before posting anything, as if they are, then maybe we should have a unified "Armor Physics" page, and just append the bit about determining projectile velocities to the page for bows and crossbows, or something similar.

As for the testing, I have a bunch more results for varying IMPACT_FRACTURE and IMPACT_YIELD, but I don't see a clear pattern coming out of them yet.  I will try to post plots etc this weekend (my wife is out of town, so I should have time).  I also confirmed that changing contact area follows the same "round to 100" pattern for elastic collisions as for ricochet/projectile deformation collisions.  Specifically, if I increase contact area to 9 (contact area * size 20 = 180), nothing happens, but if I increase to 10, I see a significant change.  Furthermore, it appears that increased contact area widens the distance between the 100%-20% dropoff and the 20%-0 dropoff, which opens the possibility of having multiple armors with 0<deflection<100% at the same bolt momentum (I also have new results showing this is impossible by just varying momentum keeping all other parameters at vanilla settings).  Unfortunately, at contact area = 10 I also saw at least one instance of a hand being severed, and I know that one of the reasons Toady modified projectiles previously was he didn't like them severing body parts, so I'm not sure if increasing contact area is a viable option for fixing projectiles.  Maybe going to 10 would be acceptable, but going higher would almost certainly not.  Intermediate values like 5 might also be interesting if standard plate armor has any regions which overlap to give a thickness of 40 or more, or something similar.

Fortunately, Urist's previous investigations have also shown that decreasing bolt SIZE has the same effect as increasing CONTACT_AREA on projectile deformation, so I am hoping the same will be true for elastic deflection.  I am running this now.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Mr S on November 09, 2012, 01:15:54 pm
I am following this so much.  I just gobble up every post, even if I'm not terribly good at statistical analysis myself.  I love the science involved.  (Next, we will mod Lignite bolts for !!Science!!  Or not.)

Perhaps the Wiki entry could be titled:
Ballistics Affects on Armor
Ballistics Protection of Armor

Of course, this is assuming that it stays seperte from the Melee vs. Armor discussion, or even the larger Material Properties information thread as a whole.

I would think that it would be very valuable to point out early on in the Wiki article, as in the introdution section, that this is still a W.I.P. and that information listed now could very well change in future versions.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: HiEv on November 09, 2012, 05:22:44 pm
Other alternate wiki entry titles:
Damage Physics
Attack and Defense Equations
Material Science

You can mix and match the first words with the last word of those for other possible titles.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 09, 2012, 09:17:38 pm
...
As for the testing, I have a bunch more results for varying IMPACT_FRACTURE and IMPACT_YIELD, but I don't see a clear pattern coming out of them yet.  I will try to post plots etc this weekend (my wife is out of town, so I should have time).  I also confirmed that changing contact area follows the same "round to 100" pattern for elastic collisions as for ricochet/projectile deformation collisions.  Specifically, if I increase contact area to 9 (contact area * size 20 = 180), nothing happens, but if I increase to 10, I see a significant change.  Furthermore, it appears that increased contact area widens the distance between the 100%-20% dropoff and the 20%-0 dropoff, which opens the possibility of having multiple armors with 0<deflection<100% at the same bolt momentum (I also have new results showing this is impossible by just varying momentum keeping all other parameters at vanilla settings).  Unfortunately, at contact area = 10 I also saw at least one instance of a hand being severed, and I know that one of the reasons Toady modified projectiles previously was he didn't like them severing body parts, so I'm not sure if increasing contact area is a viable option for fixing projectiles.  Maybe going to 10 would be acceptable, but going higher would almost certainly not.  Intermediate values like 5 might also be interesting if standard plate armor has any regions which overlap to give a thickness of 40 or more, or something similar.

Fortunately, Urist's previous investigations have also shown that decreasing bolt SIZE has the same effect as increasing CONTACT_AREA on projectile deformation, so I am hoping the same will be true for elastic deflection.  I am running this now.

1. That's cool that the contact area behaviour is consistent.

2. I have new research which I should finish up in a day or so which suggests that there is no 100%-20% dropoff, but rather that the 20% extends all the way to zero and is overlapped by a 100%-0% dropoff, if you get what I mean.

3. If you look back where I listed how to find body part contact areas and a few examples, you see that the average dwarf hand has a contact area of 18. AFAIK from looking at wound data, severing requires 100% penetration over 100% of the surface, so maybe the hand was hit twice?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 09, 2012, 11:21:35 pm
2. I have new research which I should finish up in a day or so which suggests that there is no 100%-20% dropoff, but rather that the 20% extends all the way to zero and is overlapped by a 100%-0% dropoff, if you get what I mean.

3. If you look back where I listed how to find body part contact areas and a few examples, you see that the average dwarf hand has a contact area of 18. AFAIK from looking at wound data, severing requires 100% penetration over 100% of the surface, so maybe the hand was hit twice?
2. I do know what you mean, and I was aware of this, but I guess I did not express it clearly.  At least, I think I understand what you are saying.  The way I believe it works is that there is some cutoff momentum above which deflection cannot be higher than 20% (or maybe 18.5%, whatever).  There is also a smooth transition from 100% to zero which occurs independently.  If the 100% to zero transition occurs at lower momentum than the 20% cutoff, then you don't see any cutoff.  This is the case for IMPACT_FRACTURE equal to or only slightly larger than IMPACT_YIELD.  If the 20% cutoff occurs at lower momentum than the 100% to zero transition, then you see a sharp drop to 20%, followed by a smooth drop from 20% to zero at higher momentum.  If they occur at approximately the same momentum, then you can see a smooth drop to say 80% momentum, then a sharp drop to 20%, and then another smooth drop to zero.  Basically, to draw the deflection curve, you draw the smooth 100% to zero dropoff first, and then you set any values above the 20% cutoff to no more than 20%.  For example, compare these plots at varying IMPACT_STRAIN_AT_YIELD (which moves the 20% cutoff) for several values of IMPACT_FRACTURE:
Spoiler (click to show/hide)
Increasing IMPACT_STRAIN_AT_YIELD results in a lower cutoff to 20%, but the portions of the curves below 20% always remain the same, and line up with the higher portions of the curves when they are visible at lower IMPACT_STRAIN_AT_YIELD.

3.  The full log did contain
Code: [Select]
The flying {iron bolt} strikes Arena Dwarf 59 in the right hand, shattering the bone through the small steel right unigauntlet!
A ligament has been torn and a tendon has been torn!
...
The flying {iron bolt} strikes Arena Dwarf 59 in the right hand and the severed part sails off in an arc!
So it appears you are correct and multiple hits were required to remove the hand.  I actually think this is relatively realistic - if you get hit more than once in the hand by bolts there will be nothing left.  Especially if they are broadheads.  Regardless, I will go ahead with a large scale test of CONTACT_AREA:10.

Some more results - varying bolt size DOES NOT change the deflection vs. momentum curve at all.  At first I got excited and thought it did, but it appears that SIZE gets rounded to the nearest 10, with 10 being the minimum (similar to layer thickness * contact area rounding to 100).  Therefore, size 5, 10 and 15 give the same results vs. velocity, but when size is increased to 20 velocities are halved for the same deflection (as mass doubles).   

I very much hope to post detailed results of everything this weekend.  I told everyone that I had nothing to do this weekend, which resulted in everyone wanting me to do stuff...
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 10, 2012, 12:58:17 am
OK, this is embarrassing. We didn't check which body parts were doing the deflecting in the 18-20% case. It was the lower body and toes, only. The reason why is that the lower body is covered by both the breastplate and the greaves. This is what happens when you layer up armor!

Iron bolts vs steel uniarmor set at velocity 55 results in 18% deflection.

To fix, edit the uniplate like so:

Code: [Select]
[ITEM_ARMOR:ITEM_ARMOR_UNIPLATE]
[NAME:uniplate:uniplates]
[ARMORLEVEL:3]
[UBSTEP:1]
[LBSTEP:2] lower body now protected once
[SHAPED]
[LAYER:ARMOR]
[COVERAGE:100]
[LAYER_SIZE:20]
[LAYER_PERMIT:50]
[MATERIAL_SIZE:9]
[HARD]
[METAL]

Now only use the modified uniplate, plus unihelm, unigauntlets, and uniboots. Discard the unigreaves. Dwarves now go pantless!

Testing this with iron bolts vs steel armor at velocity 55 results in 0% deflections.

Pirate Bob, could you please retest the following plot after making the edit?
...
(http://i.imgur.com/e7R7p.png)
...

Could you also edit your script to output the percent of hits that include the word "tearing", and the percent of hits that include the word "bruising". A bruising-tearing transition should become apparent when those results are plotted along with deflection like above.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 10, 2012, 02:25:13 pm
...
Pirate Bob, could you please retest the following plot after making the edit?
...
Could you also edit your script to output the percent of hits that include the word "tearing", and the percent of hits that include the word "bruising". A bruising-tearing transition should become apparent when those results are plotted along with deflection like above.
I can definitely do that today/tonight.  Hopefully this will make things much simpler.  I should have checked that the uniarmor worked as advertized, but I don't totally understand how coverage works.  I think I will also run a test where I reduce all armor thickness to 1.  If we understand how armor thickness is used correctly, this should make no difference compared to 20 (as both 1 and 20 * CONTACT_AREA=2 will round up to 100). 

I already have my script find the percentages that result in bruising and tearing, but I am just not recording the result right now, so recording it should be no problem at all.  I'm not sure exactly what you had in mind, so I think I will record %chips, fractures, bruising, and tearing all seperately, as well as the % which ONLY have bruising (which I was calling non-serious hits before).  If there's anything else you would like me to record, let me know and I can try to add it.  I also keep all the raw gamelog.txt files from all of my runs, so we can always go back and re-analyze them (or even look at them by eye) if you think of something later.  I'd post them to DFFD, but I think I'm up to several GB of logs now.  If there are ever specific logs you would like to see, please let me know.

Edit:
I did a quick run and verified that you are correct - with uniform armor thickness there is only one cutoff:
Spoiler (click to show/hide)
I am now setting up to do a full run and output %tear, %bruises etc. 
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pokon on November 10, 2012, 09:41:32 pm
...This has more in-depth information about the science of the effectivness of crossbows against armored creatures than I pumped out on my finals last year.

I wish this forum had a +1 button.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 10, 2012, 09:43:13 pm
Before seeing my latest research, take a look at these 2008 Toady quotes:

http://www.bay12forums.com/smf/index.php?topic=30026.msg996723#msg996723
http://www.bay12forums.com/smf/index.php?topic=21498.msg371081#msg371081
http://www.bay12forums.com/smf/index.php?topic=21498.msg369028#msg369028
http://www.bay12forums.com/smf/index.php?topic=21498.msg368028#msg368028

In particular:
Quote
So we'll also have armor acting like a pseudo tissue layer for purposes of transmitting bludgeoning damage and so forth? Additionally, if we're talking about a steel-skinned creature (Giant Magma Ants?) instead of a steel-armoured creature, is the force transfer handled differently?

Yeah, that's basically how it works.  The armor is all checked in order from outer to inner, then it gets at the tissue layers, altering the character of the attack as it goes.  There's a little left to do there, so it's not completely clear to me which way it'll go as far as how much force is transferred (or if it matters if it's skin or armor -- it doesn't currently, though yeah, there is a difference in real life).  It has to be enough that skin doesn't stop bones from being broken, but not so much that armor is useless against impacts, depending on the mats and nature of the armor/clothing.

So what I did is give dwarves steel skin:
Code: (tissue_template_default.txt) [Select]
[TISSUE_TEMPLATE:SKIN_TEMPLATE]
[TISSUE_NAME:skin:NP]
[SCARS]
TISSUE_MATERIAL:LOCAL_CREATURE_MAT:SKIN removed brackets
[TISSUE_MATERIAL:INORGANIC:STEEL]
[RELATIVE_THICKNESS:1]
Lower is faster.
HEALING_RATE:100 removed brackets don't want dents to vanish
[VASCULAR:1]
[PAIN_RECEPTORS:5]
[CONNECTS]
[TISSUE_SHAPE:LAYER]
and then I shot iron bolts at them at various velocities. This appears to provide the same level of protection as the updated steel uniarmor set. The advantage here is that I can use dfhack to get the wound data (strains and the percent fractured/penetrated) whenever the steel skin is damaged.

One result is that the strain never exceeds the strain at the time the tissue is fractured:

strain at fracture = IMPACT_STRAIN_AT_YIELD * IMPACT_FRACTURE / IMPACT_YIELD
i.e. 940 * 2520000 / 1505000 = 1573 (sometimes 1574)

Another result is that we can compare the combat text for steel skin and steel armor at various iron bolt velocities (these are NOT threshold velocities):
Code: [Select]
v  steel skin dwarf                  steel armor on normal dwarf

1  glance away                       deflected
25 bruised                           deflected
30 bruised/dented                    deflected
35 dented                            deflected
40 dented                            deflected
45 dented/fractured                  deflected
50 dented/fractured, bruise muscle   bruise muscle through the armor
55 fractured 20-60%, bruise muscle   bruise muscle through the armor
70 fractured 100%, tearing muscle    tearing the muscle through the armor

See the plot below of strains in the steel skin at various velocities. The horizontal axis is the sample size, scaled to a sample size of 100. We see that bruising occurred 25% of the time at velocity 30, and denting the other 75% of the time, regardless of the body part hit. We see that fractures (only about a 5% fracture) occurred 23% of the time at velocity 45, and that is also regardless of the body part struck.

Spoiler (click to show/hide)

Interpretation:

- Damage to tissue and to armor is tracked the same way, but armor doesn't report if it is dented/partially fractured.
- Armor effectively insta-heals after each hit, whereas tissue keeps and accumulates damage.
- If the bolt can cut the armor, then the bolt cuts into the tissue underneath.
- If the bolt can't cut the armor, but can fracture it 100%, then the bolt cuts into the tissue underneath.
- If the bolt can't cut or fracture the armor, then a strain-related mechanism (which can occur during denting or partial fracture) may allow blunt damage to pass to tissue underneath.
- For a given velocity, bolts impact with a range of possible strains which appear to follow a pattern. The strains are just the bullet hole in the wall, we need to learn about the bullet (the strain is an effect, not a cause).
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 11, 2012, 12:32:17 am
So what I did is give dwarves steel skin:
...
strain at fracture = IMPACT_STRAIN_AT_YIELD * IMPACT_FRACTURE / IMPACT_YIELD
i.e. 940 * 2520000 / 1505000 = 1573 (sometimes 1574)
This is amazing!  Knowing the strains will definitely help with understanding what's going on. 

Is it really correct that the strain at fracture does not depend on the contact area or the layer thickness?  If so, then how are these things playing into armor protection, as they clearly do matter for armor?  Do layer thickness and contact area enter into determining the strain? 

On my side, because I've been busy, I was careless setting up my run, and accidentally left SHOOT_MAXVEL set to 48, so I don't have results for adamantine, but all other armors were fully penetrated by copper bolts before velocity 48, so it wasn't that bad.  It appears for contact area=2 and uniform layer thickness of 20 there is no regime where bruising occurs at all for iron, copper, and bronze armor against copper bolts, but for steel only bruising occurs for all forces up to 48. 
Spoiler (click to show/hide)
I will have to run again with steel and adamantine to see what happens at higher forces for these.  I will also run at larger contact area to see how that changes things. 

Also, I'm not sure I understand your strain equation.  If I use this, I get
armorstrainforce
steel157442
iron63825
bronze76617
copper55020
The "force" is the middle of the drop in my plot of deflection vs. shoot force, and strain is from strain at fracture = IMPACT_STRAIN_AT_YIELD * IMPACT_FRACTURE / IMPACT_YIELD.  So looking at the strain, bronze should be better than iron, but based on deflection it appears to be worse than even copper.  This is for deflection of copper bolts, not for iron bolts vs bronze  (which we expect to be weird due to the shear yield/fracture mismatch).  Maybe I messed something up because I'm tired, and maybe there's more screwiness in my data that I realize, or maybe I just don't understand your equation...
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 11, 2012, 04:13:28 am
So what I did is give dwarves steel skin:
...
strain at fracture = IMPACT_STRAIN_AT_YIELD * IMPACT_FRACTURE / IMPACT_YIELD
i.e. 940 * 2520000 / 1505000 = 1573 (sometimes 1574)
This is amazing!  Knowing the strains will definitely help with understanding what's going on. 

Is it really correct that the strain at fracture does not depend on the contact area or the layer thickness?  If so, then how are these things playing into armor protection, as they clearly do matter for armor?  Do layer thickness and contact area enter into determining the strain? 

...

Also, I'm not sure I understand your strain equation.  If I use this, I get
armorstrainforce
steel157442
iron63825
bronze76617
copper55020
The "force" is the middle of the drop in my plot of deflection vs. shoot force, and strain is from strain at fracture = IMPACT_STRAIN_AT_YIELD * IMPACT_FRACTURE / IMPACT_YIELD.  So looking at the strain, bronze should be better than iron, but based on deflection it appears to be worse than even copper.  This is for deflection of copper bolts, not for iron bolts vs bronze  (which we expect to be weird due to the shear yield/fracture mismatch).  Maybe I messed something up because I'm tired, and maybe there's more screwiness in my data that I realize, or maybe I just don't understand your equation...

The strain is initially capped at the point where the material fractured, but it appears to creep upwards if the wound is repeatedly hit. The forces or energies or momentums that cause the strains are affected by contact size and layer thickness, but because of the round-to-100 thing then you don't notice the changes on dwarf-scale creatures. The skin thickness (but not armor thickness) is proportional to the cube root of the body part size, so the thickest skin on a dwarf is only 2-3x thicker than the thinnest skin.

Test results for copper bolts vs bronze skin at velocity 16 indicate that the damage falls into two categories:
a) The skin (armor in your case) is partially fractured 40%, 60%, or 80%. The strain in the armor is 766. No damage of any kind to underlying tissue. Some parts have fracture 41% or strain 767, but they were struck twice, so multiple hits each add 1 or more on top of the previous wound.
b) The skin (armor in your case) is completely fractured (100%), and the underlying soft tender bits are all cut up.

...
 It appears for contact area=2 and uniform layer thickness of 20 there is no regime where bruising occurs at all for iron, copper, and bronze armor against copper bolts, but for steel only bruising occurs for all forces up to 48. 
...

Yes, so bronze is worse than copper because it isn't being judged on strain. Only steel is good enough to meet the strain-or-whatever-induced-bruising criteria. If bronze didn't fracture so easily, you might see bruising because of the larger strain than iron.

So for steel, having IMPACT_STRAIN_AT_YIELD 1880 results in bruising immediately after yield (yield=metal skin denting). Having ISAY 940 (the default) means that bruising occurs just prior to the default IMPACT_FRACTURE (2520000). Having ISAY 470 means that no bruising occurs at the default IMPACT_FRACTURE (similar to bronze or adamantine), so you need to have a higher IMPACT_FRACTURE relative to IMPACT_YIELD before the bruising starts.

Spoiler (click to show/hide)

So how high does bronze's IMPACT_FRACTURE need to be raised before bruising appears, when copper bolts are shot at it? Then we can come up with an algorithm to predict that criteria.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: sGdYy409L on November 11, 2012, 07:19:25 am
1), 5) - To my knowledge, there is no way of changing quality parameters of items in arena mode (If someone knows otherwise, please chime in). As much as I would love to perform a study on the effects of quality level on crossbow performance, this seems to be an impossible venture - at least on a scale which would produce reliable results. I could train up 10 Marksdwarfs and try to set up a small scale experiment in Fortress mode, but this simply wouldn't be enough to be able to perform even basic statistical analysis and achieve meaningful results.

It is possible with dfhacks "changeitem" command. For changing items equipped by a creature use it like this:
- select the creature with v
- select a worn item with +/-
- enter (manually or via hotkey) the command "changeitem q 5". This changes it to be of masterwork quality.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 11, 2012, 09:24:37 am
1), 5) - To my knowledge, there is no way of changing quality parameters of items in arena mode (If someone knows otherwise, please chime in). As much as I would love to perform a study on the effects of quality level on crossbow performance, this seems to be an impossible venture - at least on a scale which would produce reliable results. I could train up 10 Marksdwarfs and try to set up a small scale experiment in Fortress mode, but this simply wouldn't be enough to be able to perform even basic statistical analysis and achieve meaningful results.

It is possible with dfhacks "changeitem" command. For changing items equipped by a creature use it like this:
- select the creature with v
- select a worn item with +/-
- enter (manually or via hotkey) the command "changeitem q 5". This changes it to be of masterwork quality.
I'll have to think about whether I can automate this along with what I am already doing.  I know you can use lua scripting with DFhack, so theoretically it should be possible.  We can definitely use this at least on a small scale to see if quality matters at all.

I am currently running bronze armor vs copper bolts with increasing IMPACT_FRACTURE.  I don't have time to post full results now, but (as I think Urist already knows) only steel ever produces bruises for contact area 2 or 10.  For contact area 10, the deflection cutoff for steel is 48 and the bruising cutoff is 116.  For contact area 2 defection cutoff = 42 and bruising 57.  Even adamantine never produces bruising.  I will be busy the rest of the day, so I may not be able to post again until tomorrow evening.

Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 11, 2012, 09:32:34 am
1), 5) - To my knowledge, there is no way of changing quality parameters of items in arena mode (If someone knows otherwise, please chime in). As much as I would love to perform a study on the effects of quality level on crossbow performance, this seems to be an impossible venture - at least on a scale which would produce reliable results. I could train up 10 Marksdwarfs and try to set up a small scale experiment in Fortress mode, but this simply wouldn't be enough to be able to perform even basic statistical analysis and achieve meaningful results.

It is possible with dfhacks "changeitem" command. For changing items equipped by a creature use it like this:
- select the creature with v
- select a worn item with +/-
- enter (manually or via hotkey) the command "changeitem q 5". This changes it to be of masterwork quality.
I'll have to think about whether I can automate this along with what I am already doing.  I know you can use lua scripting with DFhack, so theoretically it should be possible.  We can definitely use this at least on a small scale to see if quality matters at all.

I am currently running bronze armor vs copper bolts with increasing IMPACT_FRACTURE.  I don't have time to post full results now, but (as I think Urist already knows) only steel ever produces bruises for contact area 2 or 10.  For contact area 10, the deflection cutoff for steel is 48 and the bruising cutoff is 116.  For contact area 2 defection cutoff = 42 and bruising 57.  Even adamantine never produces bruising.  I will be busy the rest of the day, so I may not be able to post again until tomorrow evening.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: sGdYy409L on November 11, 2012, 01:26:09 pm
I just noticed that the dfhack "changeitem" command can also be used to create proper bone bolts.
type:

changeitem m CREATURE:DWARF:BONE force

and enjoy your new dwarf bone bolts!
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 11, 2012, 11:12:53 pm
I have run for several values of IMPACT_FRACTURE for both copper bolts  vs. bronze armor and copper bolts vs iron armor, with all other params vanilla (including contact area=2).  Here are plots of the forces required for 50% deflection as a function of IMPACT_FRACTURE:
Spoiler (click to show/hide)
As you can see, deflection levels off abruptly at Force=69 for Bronze and Force=118 for iron.  I think this is because deflection abruptly drops to zero at this force:
Spoiler (click to show/hide)
This is for bronze.  Notice that for IMPACT_FRACTURE x 3, the deflection starts to go down smoothly, and then drops sharply to zero, while bruising continues to go down smoothly.  The cutoff in deflection may be the cutoff proportional to 1/IMPACT_STRAIN_AT_YIELD, but I am too tired to figure this out right now.  Bruising does not experience any sharp cutoff in the region I explored, and appears to follow the curve that deflection would have followed were it not subject to this cutoff. 

Edit:  Using the equation momentum = 50,000 / IMPACT_STRAIN_AT_YIELD give momenta of 156.7 (force=117.01) for iron (IMPACT_STRAIN_AT_YIELD=319), and 91.4 (force=68.2) for bronze (IMPACT_STRAIN_AT_YIELD=547).  This exactly agrees with the cutoffs I observe, so I think it is clear this is the same cutoff I observed before, and that 50,000 / IMPACT_STRAIN_AT_YIELD describes it accurately.  I will eventually have to test if it deviations from this equation for large IMPACT_STRAIN_AT_YIELD (corresponding to small forces/momenta).  Based on this equation, steel (IMPACT_STRAIN_AT_YIELD=940) should have this cutoff at mometum=51.2, or force=39.7 for copper bolts.  Given that this is low, it explains why I see bruising for steel, and not for any other armor.  I will have to check if the deflection drop actually does occur at 40 for copper vs. steel. 

I am still not sure exactly what's going of for the relationship between deflection force/momentum and IMPACT_FRACTURE.  As you can see, it's very linear, but both the offset and slope are not round numbers.  Converting from force to momentum (muliply by copper bolt mass=1.3395) does not make the numbers and nicer.  Using the old (nonuniform) "uniarmor", I found that IMPACT_YIELD plays at least some role in the offset, but not the slope, and IMPACT_STRAIN_AT_YIELD affects neither.  Maybe it would be easier to study this behavior looking directly at the stains using DFHack and modded skin?

I will try some more analysis of my results this evening (maybe the relationship tracks on the upper or lower edge of the transition or something) and will also post the spreadsheet of my full results to DFFD.  I also need to post a large backlog of results from the past few days, although some of those may be confusing/uninteresting as they use the non-uniform armor.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 12, 2012, 02:23:28 pm
- For a given velocity, bolts impact with a range of possible strains which appear to follow a pattern. The strains are just the bullet hole in the wall, we need to learn about the bullet (the strain is an effect, not a cause).
What would happen if you made the target a more uniform creature than a dwarf, like maybe a sponge?  Something with just one body part that could be hit.  Would this remove/reduce the variation?

I have to try this myself sometime.  I assume you are using the same lua script used to read out bolt velocities to get this information?  Unfortunately this seems to crash my linux version of DF, so while I can see the report, I can only look at one shot per instance of DF before the game crashes.

I am also wondering if there is a relationship between the strain for fracture you found and the 50,000/IMPACT_STRAIN_AT_YIELD cutoff for deflections?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 12, 2012, 02:44:00 pm
I'll start off by quoting myself:
...
See the plot below of strains in the steel skin at various velocities. The horizontal axis is the sample size, scaled to a sample size of 100. We see that bruising occurred 25% of the time at velocity 30, and denting the other 75% of the time, regardless of the body part hit. We see that fractures (only about a 5% fracture) occurred 23% of the time at velocity 45, and that is also regardless of the body part struck.

Spoiler (click to show/hide)
...

See in the image how the strain goes up with velocity in steps, and there are about 6-11 steps? Turns out each of those steps is linear with velocity, by itself. However the slope of the linear plot is different for each. The leftmost point (trailing edge) is represented by:
Strain = 76.1 * Velocity - 2350
and the rightmost point (leading edge) is represented by:
Strain = 94.1 * Velocity - 2350
with both results capped between 0 and "strain at fracture". The strain grows about 1.25x faster on the leading edge than on the trailing edge, so we expect to see sharp transitions at low velocity and gradual transitions at high velocity.

Now if we look at the distribution of "percent fractured" (i.e. %penetrated or crack length, 100% implies the tissue has been completely penetrated or destroyed) at a constant velocity, for iron bolts vs steel skin, with varying steel IMPACT_STRAIN_AT_YIELD:
Spoiler (click to show/hide)
We see that how badly your skin (armor) has been fractured doesn't depend on IMPACT_STRAIN_AT_YIELD. It also appears that the velocity-dependant stepping also applies to fracturing, so we expect to see sharp bruising-tearing transitions at low velocities and gradual bruising-tearing transitions at high velocities.

I then tried to find the exact values of IMPACT_STRAIN_AT_YIELD below which bruising stops for iron bolts vs steel skin:
Code: [Select]
Velocity  Nobruising  Bruising
35        1282         1283
40        1111         1112
48        925          926
55        806          807
60        735          736

This data can be represented by:
Strain = 48539 * (Velocity ^ -1.023)
OR perhaps by:
Strain = 1/(0.00002294 * Velocity - 0.00002035)


Access to the wound data has allowed me to figure out the "translation" for the different wound descriptions on tissue:
Spoiler (click to show/hide)

I haven't read your latest two posts in detail. The strain or fracture stepping happens even if you only look at one body part, and regardless of body part size. I'll probably reply later today.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 12, 2012, 03:43:39 pm
I then tried to find the exact values of IMPACT_STRAIN_AT_YIELD below which bruising stops for iron bolts vs steel skin:
Code: [Select]
Velocity  Nobruising  Bruising
35        1282         1283
40        1111         1112
48        925          926
55        806          807
60        735          736

This data can be represented by:
Strain = 48539 * (Velocity ^ -1.023)
OR perhaps by:
Strain = 1/(0.00002294 * Velocity - 0.00002035)
This data appears to roughly fit momentum = 50,000/STRAIN_AT_YIELD.  This strongly suggests that armor "bruising" is the same transition I find for the sharp cutoff in deflection at momentum = 50,000/STRAIN_AT_YIELD. 

Edit:  Is it correct that this transition goes from zero to 100% bruising, with no intermediate regime?

Also, I haven't had time to test yet, but at least with the old non-uniform armor 50,000/strain wasn't exact (especially at low velocity/high strain) so I wouldn't worry that there's a slight difference. 
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 12, 2012, 05:11:11 pm
...
This data appears to roughly fit momentum = 50,000/STRAIN_AT_YIELD.  This strongly suggests that armor "bruising" is the same transition I find for the sharp cutoff in deflection at momentum = 50,000/STRAIN_AT_YIELD. 

Edit:  Is it correct that this transition goes from zero to 100% bruising, with no intermediate regime?
...

1. Note that it isn't the armor being bruised (in my cases the steel skin was being dented or fractured), but the fat/muscle beneath the armor.

2. Yes, either all bolt shots cause bruising beneath the armor (which if it hits the skull/brain leads to death) or all bolt shots don't cause any bruising.

...
What would happen if you made the target a more uniform creature than a dwarf, like maybe a sponge?  Something with just one body part that could be hit.  Would this remove/reduce the variation?

I have to try this myself sometime.  I assume you are using the same lua script used to read out bolt velocities to get this information?  Unfortunately this seems to crash my linux version of DF, so while I can see the report, I can only look at one shot per instance of DF before the game crashes.
...

3. Tested a giant sponge. It only has one body part and one material, yet I get stepped outputs for dent strains or penetration percentages.

4. Which version of DFHack are you using? I have dfhack-0.34.11-r2 and I got crashes as well when using dfhack-0.34.11-r1.


...
Spoiler (click to show/hide)
This is for bronze.  Notice that for IMPACT_FRACTURE x 3, the deflection starts to go down smoothly, and then drops sharply to zero, while bruising continues to go down smoothly.  The cutoff in deflection may be the cutoff proportional to 1/IMPACT_STRAIN_AT_YIELD, but I am too tired to figure this out right now.  Bruising does not experience any sharp cutoff in the region I explored, and appears to follow the curve that deflection would have followed were it not subject to this cutoff. 
...

5. The pink and blue lines represent when the bronze armor has completely fractured, and the tissue underneath gets to be cut up by the bolt. Because "percent penetrated (a.k.a percent fractured)" comes in a variety of magnitudes for a given velocity (at several discrete steps), you get a smooth transition to tearing damage.
The yellow line represents the sharp transition to bruising damage. Remember that armor deflection is the absence of bruising, tearing, or chipping in the fat/muscle/organs/bones/etc. The armor (like a metal skin) is still being dented or fractured (it just doesn't output that combat text).

So default bronze armor fractures before bruising can happen, whereas default steel armor has bruising happen before the armor can fracture.

For other people who are following the thread: the way it is currently, if armor damage was tracked and armor could break, a single wood arrow from an elf could destroy a piece of adamantine armor by creating a gaping hole or shattering the entire armor. A wood arrow currently (in vanilla DF) can fracture adamantine armor and tear the flesh underneath, but the armor always acts as if undamaged:
Quote
The flying {mangrove arrow} strikes Dwarf 2 in the lower body, tearing the muscle and bruising the left kidney through the small adamantine breastplate!
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: GlyphGryph on November 12, 2012, 06:33:17 pm
Zivillin, could you perhaps add links to supplemental posts in this thread from the OP? There's quite a few posts here already, so it's hard to review the additional research to see if my question has already been answered.

You said you tested against dwarves with no skills, and I believe Pirate Bob did the same, and thus Plate Armor was ineffective.

I would like to know if maxing out armor skill and dodging and giving them open space changes that - it could be that armor like plate provides a multiplicative bonus based on armor skill in situations like this (increasing deflections) that is effectively canceled out by the total lack of skill. 200 x 0 is still 0, after all.

If this is already done, all the better, but I suspect it may be like shields, where the skill involved is one of the more important (if not dominant) factor, since it's simply "does it deflect, or does it not deflect"
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 12, 2012, 08:10:44 pm
Zivillin, could you perhaps add links to supplemental posts in this thread from the OP? There's quite a few posts here already, so it's hard to review the additional research to see if my question has already been answered.

You said you tested against dwarves with no skills, and I believe Pirate Bob did the same, and thus Plate Armor was ineffective.

I would like to know if maxing out armor skill and dodging and giving them open space changes that - it could be that armor like plate provides a multiplicative bonus based on armor skill in situations like this (increasing deflections) that is effectively canceled out by the total lack of skill. 200 x 0 is still 0, after all.

If this is already done, all the better, but I suspect it may be like shields, where the skill involved is one of the more important (if not dominant) factor, since it's simply "does it deflect, or does it not deflect"
I performed all armor tests using dwarves with grand master armor user (the max available in the arena).  I don't see how giving them the ability to dodge and dodge skill would change the results, but it's an interesting idea so I will try it when I get a chance.   

I think there is just too much stuff here to even put links to all of it in the OP.  Our plan is to wikify it eventually, but for now I am working on a google doc (https://docs.google.com/document/d/1lytX4_1zwGqiiKcQ2Zsw-1YvPxz4vb1v5ECretSGUvM/edit) with much of the information (although it is not up to date).  That reminds me - I need to put more information on the conditions used for testing in this document.

1. Note that it isn't the armor being bruised (in my cases the steel skin was being dented or fractured), but the fat/muscle beneath the armor.
Oh, well, then it's the exact same thing I was looking at, so that makes sense that you would get the same result.  That's great then.  I've got quite a few points on this transition, and, like I said, for small STRAIN_AT_YIELD, it goes like momentum=50000/STRAIN_AT_YIELD, but at very large STRAIN_AT_YIELD (say maybe >1000) the needed momentum deviates slightly higher than this.  I have to confirm this deviation still occurs with truly uniform armor.

Edit:  I tried the latest version of DFHack, and no crashes running your scripts any more, so as you suspected it is a version issue, not a linux issue.  Now I have to think about combining it with my scripting...
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 13, 2012, 03:43:52 am
This appears (I don't know why adamantine is different, perhaps my tests there need to be peer reviewed) to work at predicting the velocity required to completely fracture armor (or metal skin) of standard (low) thickness:

(http://i.imgur.com/6ORtF.png)

This function doesn't show contact area or thickness yet. I think Pirate Bob found earlier that the round-to-100 rule applies to the contact area and thickness scaling for this function. I used a fudge factor of 2 to make the results work in the case where contact area was larger.

"Completely fracture" means the velocity at which you see the smooth sigmoidal transition in deflection and appearance of tearing damage.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: pisskop on November 13, 2012, 12:11:49 pm
ptw
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 13, 2012, 04:18:04 pm
This appears (I don't know why adamantine is different, perhaps my tests there need to be peer reviewed) to work at predicting the velocity required to completely fracture armor (or metal skin) of standard (low) thickness:

(http://i.imgur.com/6ORtF.png)

This function doesn't show contact area or thickness yet. I think Pirate Bob found earlier that the round-to-100 rule applies to the contact area and thickness scaling for this function. I used a fudge factor of 2 to make the results work in the case where contact area was larger.

"Completely fracture" means the velocity at which you see the smooth sigmoidal transition in deflection and appearance of tearing damage.
While this equation is definitely a start, it is does not fully describe the results from my last post for copper bolts vs. iron and bronze at varying IMPACT_FRACTURE.  I found that for iron armor, momentum=IMPACT_FRACTURE/22436-12.453 and for bronze, momentum=IMPACT_FRACTURE/22294-15.426 (multiply the fits for forces by copper bolt mass=1.3395).  While the coefficients of IMPACT_FRACTURE are close to 22500, the difference is significant.  Also, the offsets are really not close to those predicted by IMPACT_YIELD/45000. 

1) How do you define the location of the transition?  I define it as the force/momentum where non-bruise wounds occur 50% of the time.  Maybe you (and/or Toady) are actually defining it based on some other threshold?

2) Shouldn't your equation strain at fracture = IMPACT_STRAIN_AT_YIELD * IMPACT_FRACTURE / IMPACT_YIELD describe this same transition?  (Edit - it appears that is actually something different, and the equivalent thing would be the momentum/strain needed for 100% fracture?  Can you confirm this?)  If so, then we should expect the momentum at fracture also be a function of IMPACT_STRAIN_AT_YIELD * IMPACT_FRACTURE / IMPACT_YIELD.  It's possible that some factors (like 1/IMPACT_FRACTURE, for example) might cancel out, but it's also quite possible that the final equation becomes very complicated (which I think is likely given that simple linear fitting doesn't seem to quite work).  Also, how sure are you of the accuracy of strain at fracture = IMPACT_STRAIN_AT_YIELD * IMPACT_FRACTURE / IMPACT_YIELD?  Should I try to confirm this over a wide range of impact parameters?

3) Have you done anything more towards figuring out what determines the strain on the material?  Assuming (2) is true, this would be extremely informative for figuring out armor protection.  I could do this myself now that you got me to use the right version of DFHack, but it seems likely you've already been working on this.  If I was going to do it, I would imagine setting SHOOT_FORCE such that the strain was about half of its maximum value, and then seeing how the strain changes when different parameters are varied.  This has a huge advantage over deflection testing, as you get an exact numerical output of how the strain changed from a single hit(Edit - the result is not really "exact", as there is variation in the strain you get at a given bolt momentum - not clear if there is actually a great advantage over looking at deflection).  In other words, if (2) is true and you don't plan to do this, let me know and I will try.

I really, really need to put up my full data for all materials at contact area 2 and 10.  I'm sorry I didn't do this earlier, as it would have helped you a lot when working on the relationship between momentum for injury and impact parameters.  There's just a lot of it and I'm not 100% sure the best way to represent it.  I'll try for a spreadsheet of the raw data on DFFD if nothing else.  If you could tell me what % serious wounds you are looking at for your equation that would be helpful, as then I could make a table of that.  I am also running more simulations varying IMPACT_FRACTURE with IMPACT_YIELD set to zero right now, which hopefully should shed some light on the relationship between momentum required to cause injury and the impact parameters.

Edit:
I looked at the data for IMPACT_YIELD=0, and this data perfectly fits to momentum=IMPACT_FRACTURE/22500 for iron, bronze, and adamantine over the whole range from 1 to 6 times the vanilla IMPACT_FRACTURE.  The fit is perfect in all cases to within the error of the measurements.  This means that the offset and the corrections to the slope must be some function of IMPACT_YIELD, possibly multiplied with other factors (like IMPACT_STRAIN_AT_YIELD). 
Spoiler (click to show/hide)
I have posted the complete results for this and varying IMPACT_FRACTURE at vanilla values of IMPACT_YIELD for iron an bronze on DFFD (http://dffd.wimbli.com/file.php?id=7128).  And it is late, so I need to go to bed.  Sorry, I will really try to post my older data soon  :-[.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 13, 2012, 10:45:17 pm
...

1. I wasn't that consistent on the % deflection. I trust the iron/copper on steel results a bit more than the copper on iron/bronze ones because the material properties for copper, iron, and bronze all overlap somewhat:

Spoiler (click to show/hide)
Perhaps zinc bolts would produce better bronze armor results?

2. Nope, "strain at fracture = IMPACT_STRAIN_AT_YIELD * IMPACT_FRACTURE / IMPACT_YIELD" is a very hard result and you can see it for yourself using the wounds script. The strain for cut leg bones (i.e. use an adamantine sword to stab the leg) is 113, which is roughly equal to 100 * 130000 / 115000. The strain at fracture for shattered bones is 100 since the impact yield and fracture are identical there.

Also see what I posted earlier:
...
Now if we look at the distribution of "percent fractured" (i.e. %penetrated or crack length, 100% implies the tissue has been completely penetrated or destroyed) at a constant velocity, for iron bolts vs steel skin, with varying steel IMPACT_STRAIN_AT_YIELD:
Spoiler (click to show/hide)
We see that how badly your skin (armor) has been fractured doesn't depend on IMPACT_STRAIN_AT_YIELD. It also appears that the velocity-dependant stepping also applies to fracturing, so we expect to see sharp bruising-tearing transitions at low velocities and gradual bruising-tearing transitions at high velocities.
...

3. Perhaps instead of plotting deflection results (which can be misleading as there are at least two reasons why a bolt is no longer deflecting), plot the %bruising and %tearing. It'll start out near zero and then either bruising or tearing will suddenly increase as you increase velocity. We don't have to see the percentages for other types of injuries, as we are just looking for certain cutoffs.

If the momentum isn't high enough to initiate fracture, the resulting strain is randomly chosen from the stepped results, but overall appears to scale linearly with momentum (each step scales at a different rate, so the spread gets wider at higher velocities!). I don't think it's worth the effort right now to research in that direction.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 13, 2012, 11:34:25 pm
It seems we updated at the same time.  In response to 3, I have been plotting %nonserious injury, defined as either deflection or just bruising.  Plotting bruising and tearing separately is somewhat confusing, as they don't go to 100% ever.  Also, my search routine is designed to find a transition from 1 to zero, and it's easier to define the output such that it will look like that than to rewrite the search routine. 

I just realized I didn't add labels to the columns in the spreadsheet on DFFD - I will try to do that tomorrow.  The order isn't consistent between sheets within the file, so don't bother trying to figure it out...
Edit - I have updated the spreadsheet with column headings now, so it should be slightly less incomprehensible.

I also found that the sigmoidal transition from 100% to 0% nonserious hits seems to fit well to
% nonserious = 1-1/(1+exp(-(F-F0)/(F0/50))) for F<F0 and 1-1/(1+exp(-(F-F0)/(F0/25))) for F>F0.
This is a logisitic function, with different widths above and below the cutoff force.  F0 is the force for 50% nonserious wounds.  Note that the widths being F0/50 and F0/25 would also scale to M0/50 and M0/25 if this were converted to a plot vs momentum, as both the widths and value for 50% would be multiplied by the same factor (1.3395 in this case).   
Spoiler (click to show/hide)
The data shown are for copper bolts vs. the indicated armor material, with IMPACT_YIELD set to zero and IMPACT_FRACTURE multiplied by the indicated factor.

The true function used might be more of a gradual shift of the transition width, more along the lines of what Urist observes with %fratured and strain.  I can squint and say I even see steps in the data, but it is not accurate enough to say for sure. 

Edit #2:
Today I am running with IMPACT_FRACTURE held at the vanilla value and varying IMPACT_YIELD between zero and 1 times its vanilla value.  Hopefully this should help explain what YIELD does.  I'm hoping it will be easier to interpret this since we have clear results for what fracture does when YIELD=0.

On another note, I think maybe a good way to describe the two types of deflection would be:
1) The projectile absorbs the force of the blow.  This would be the "ricochet" deflections that occur if IMPACT_YIELD of the projectile is too low.
2) The armor absorbs the force of the blow.  This is what we are working on right now.  This does not appear to be entirely elastic, as I first thought (as the armor can be dented or partially fractured and still "deflect" the blow), so that's really not a good description here either.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 14, 2012, 09:44:48 pm
Finally, here are my results for force scans of all armor materials using Urist's new uniform armor and contact areas 2 and 10. 
Spoiler: Contact Area 2 (click to show/hide)
Spoiler: Contact Area 10 (click to show/hide)
I ran for both copper and iron bolts at contact area 10, and the results are identical when plotted vs. bolt momentum.  Here is a table of the momentum for 50% of hits either deflected or causing only bruises.
Spoiler (click to show/hide)
It appears that Urist is correct, and the momentum required for 50% serious wounds is multipled by Contact Area*LAYER_SIZE rounded to hundreds (rounding up to 100, and rounding down for numbers above 100).  In this scheme, Contact Area 2 rounds to 100, and contact area 10 rounds to 200.  Correspondingly, the momenta for Contact Area 10 are exactly twice those for Contact Area 2.  I will eventually have to confirm this by systematically varying Contact Area.

The equation we have so far is:
momentum = IMPACT_FRACTURE * round100(CONTACT_AREA*LAYER_SIZE)/(2250000-f1(IMPACT_YIELD)) - f2(IMPACT_YIELD).
The functions f1 and f2 are not yet clear, and may depend on more than just IMPACT_YIELD. 

I also have some results for varying IMPACT_YIELD at constant IMPACT_FRACTURE which I will try to post later.  Hopefully they will help clarify things further.

Update:  Here is the full spreadsheet of these results on DFFD (http://dffd.wimbli.com/file.php?id=7131)
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 15, 2012, 02:52:42 am
I then tried to find the exact values of IMPACT_STRAIN_AT_YIELD below which bruising stops for iron bolts vs steel skin:
Code: [Select]
Velocity  Nobruising  Bruising
35        1282         1283
40        1111         1112
48        925          926
55        806          807
60        735          736

This data can be represented by:
Strain = 48539 * (Velocity ^ -1.023)
OR perhaps by:
Strain = 1/(0.00002294 * Velocity - 0.00002035)
This data appears to roughly fit momentum = 50,000/STRAIN_AT_YIELD.  This strongly suggests that ... is the same transition I find for the sharp cutoff in deflection at momentum = 50,000/STRAIN_AT_YIELD. 

Edit:  Is it correct that this transition goes from zero to 100% bruising, with no intermediate regime?

Also, I haven't had time to test yet, but at least with the old non-uniform armor 50,000/strain wasn't exact (especially at low velocity/high strain) so I wouldn't worry that there's a slight difference.

I tried to find the dependance of the above "bruising of stuff through the armor (or metal skin)" on IMPACT_YIELD.

Spoiler (click to show/hide)

It does at least involve momentum rather than velocity, as I can change out the iron bolt at v=48 with a lead bolt at v=33. I also noticed regions where there was 50% bruising or something rather than a 0 to 100% transition when varying IMPACT_STRAIN_AT_YIELD and IMPACT_YIELD. The smooth transitions occurred between 893 & 910, as well as between 910 & 926. I couldn't detect any intermediate values between those numbers. The smooth transitions appeared to be the usual "stepped results" thing, where the larger strains or fracture percents coincided with the bruising.

There appears to be a sharp (or narrow smooth) transition between 878 & 893.

So sometimes the bolt has enough "something" that it needs an ISAY of under 893 to deflect rather than an ISAY of under 910, given an IMPACT_YIELD ~950000 and a momentum ~56.5.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 15, 2012, 09:19:32 am
First off, I added a link to the spreadsheet with my scan over all materials to my previous post.

I finished most of my scan of IMPACT_YIELD last night.  Here are the results for Iron, Steel, and Adamantine
Spoiler (click to show/hide)
I also plotted a zoom in of Iron by itself.  A spreadsheet of results is also posted on DFFD (http://dffd.wimbli.com/file.php?id=7132).  I have results for bronze which I will add later, but I doubt they will be very interesting.  In all cases, the lines represent momentum=(IMPACT_FRACTURE-IMPACT_YIELD/2)/22500.  This gives an excellent fit to the data everywhere.  Once again, Urist has proven to be correct, as he proposed this equation several days ago based on very sparse data...

If we zoom in on iron, there are in fact systematic differences from this equation.  I think that these result from the steps that Urist sees when looking at strain or %fracture, and agree that they likely have some dependence on IMPACT_STRAIN_AT_YIELD.  If you look closely at mine and Urist's previous data from varying IMPACT_STRAIN_AT_YIELD, you will see that it does seem to cause some slight changes in the results, but no clear systematic change.  We therefore both concluded that it doesn't do anything.  I now suspect that it may influence the exact location of the steps, without changing the average shape of the overall curve.  Probably the steps are another weird rounding thing.  For example, the code might multiply a quantity by IMPACT_STRAIN_AT_YIELD, round the result, and then divide it by IMPACT_STRAIN_AT_YIELD, which would result in steps that move around as you change IMPACT_STRAIN_AT_YIELD, but no clear dependence on IMPACT_STRAIN_AT_YIELD.

In any case, I have convinced myself that momentum=(IMPACT_FRACTURE-IMPACT_YIELD/2)*(CONTACT_AREA*LAYER_SIZE)/2250000 captures the behavior sufficiently well.  I need to verify that (CONTACT_AREA*LAYER_SIZE) multiplies both the YIELD and FRACTURE terms equally, and that this formula continues to hold for larger CONTACT_AREA.  If someone else finds evidence that IMPACT_STRAIN_AT_YIELD is important, I am certainly open to further investigation, but my results so far indicate that it mainly determines the shift from deflection by armor to harmless bruising through armor, which is of minimal importance for determining armor effectiveness.

I am planning to move on to using our results to attempt to balance projectile performance against armor.  In particular, I noticed that steel with CONTACT_AREA=2 and iron with CONTACT_AREA=10 are both penetrated at about momentum=75.  To me that suggests an attractive set of parameters:  Increase contact area to 10, and then set velocity so that bolt momentum~75.  Then iron helms and breastplates (thickness=20), as well as overlaps, will deflect bolts sometimes, and other areas of iron armor will not deflect at all.  Steel helms, breastplates, and overlaps will deflect 100% of the time, while other areas will deflect only part of the time.  Adamantine will always deflect 100% of the time, and other armors will do nothing.  I personally would prefer a system where all armors could have some finite chance of deflecting (think a hit at a grazing angle - you can skip a rock off water if the angle is low enough), this is not possible with the current mechanics.  I suppose gameplay wise there is not a significant difference between zero deflections and 1% deflections anyway.

Regardless, my goal is not to figure out the "best" set projectile parameters to give "proper" performance.  I plan to explore a variety of conditions and report the results, so that modders (and perhaps even developers) can make their own decisions about what parameters to use.

Edit - I realized I may be getting a little bit ahead of myself, as we still have to see how chainmail works.  I strongly suspect that it just converts edged damage to blunt damage regardless of momentum so long as SHEAR_YIELD/FRACTURE is equal to or greater than the projectile's, but I need to verify this.  This is definitely what happens at vanilla values.  It is possible that chainmail may also deflect projectiles at lower momenta.

Edit #2- I updated my Summary (https://docs.google.com/document/d/1lytX4_1zwGqiiKcQ2Zsw-1YvPxz4vb1v5ECretSGUvM/edit) to reflect our latest results.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 16, 2012, 01:27:31 am
... 
If someone else finds evidence that IMPACT_STRAIN_AT_YIELD is important, I am certainly open to further investigation, but my results so far indicate that it mainly determines the shift from deflection by armor to harmless bruising through armor, which is of minimal importance for determining armor effectiveness.
...
Edit - I realized I may be getting a little bit ahead of myself, as we still have to see how chainmail works.  I strongly suspect that it just converts edged damage to blunt damage regardless of momentum so long as SHEAR_YIELD/FRACTURE is equal to or greater than the projectile's, but I need to verify this.  This is definitely what happens at vanilla values.  It is possible that chainmail may also deflect projectiles at lower momenta.

Edit #2- I updated my Summary (https://docs.google.com/document/d/1lytX4_1zwGqiiKcQ2Zsw-1YvPxz4vb1v5ECretSGUvM/edit) to reflect our latest results.

1. Further testing on my part finds that the "momentum = 50000/IMPACT_STRAIN_AT_YIELD" for bruising results are changed by under 5% for the whole range of IMPACT_YIELD, so therefore I think it is not related to IMPACT_YIELD except in some odd number-rounding-error kind of way. I would just use the equation as presented. The elegance of the equation is that any projectile, even a bolt travelling at the minimum velocity of 1, will cause bruises through [IMPACT_STRAIN_AT_YIELD:50000] skin. Conversely, no projectile can cause bruises through adamantine plate because it is impossibly rigid.

I think I saw (I know, bad anecdotal evidence!) one of the bruise-through-armor events during a test kill a dwarf by bruising all the way through his skull into the brain (without penetrating the armor). It is probably more "less lethal" than it is "harmless".

2. So the to-do list is:
- How does chainmail work? Can you get bruises through adamantine chainmail?
- How does SHEAR_FRACTURE and SHEAR_YIELD work?
- Does SHEAR_STRAIN_AT_YIELD do anything?
- How does contact area and armor thickness change the previously-discovered equations?
- Does overlapping pieces of armor provide the same protection as a single thicker piece of armor?

I am going to focus my attention on SHEAR_FRACTURE, SHEAR_YIELD, and SHEAR_STRAIN_AT_YIELD for the understood plate armor for now.

3. I approve of this documentation.


Those Toady quotes I linked to earlier are a gold mine. I didn't spot this one there before:
Quote from: http://www.bay12forums.com/smf/index.php?topic=21498.msg371081#msg371081
Right now, armor skill gives an increase to a deflection roll, and armor quality boosts the deflection roll, and a good deflection roll lowers the effective force of the strike.  Until armor damage goes in, there probably won't be anything more complicated.  The toughness attribute, which used to decrease damage directly, now does a similar deflection roll for strikes to tissues.
So armor user skill, armor quality, and the toughness attribute may all matter. Elsewhere he mentioned that weapon quality improves the to-hit chance and the sharpness of edged weapons. No word on blunt weapon quality.

Quote from: http://www.bay12forums.com/smf/index.php?topic=21498.msg369028#msg369028
I don't think the low elasticity (which is probably actually something like yield strain, but I found inverting the moduli convenient -- I think it's strain with scale 1000 times the percent deformation at yield) will matter for items at this point, as it only is used so far in determining some skin/soft tissue like behaviors for attacks on creatures
So the STRAIN values may only be used for the bruising-through-layers, and nothing more.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 16, 2012, 03:43:38 pm
2. So the to-do list is:
- How does chainmail work? Can you get bruises through adamantine chainmail?
- How does SHEAR_FRACTURE and SHEAR_YIELD work?
- Does SHEAR_STRAIN_AT_YIELD do anything?
- How does contact area and armor thickness change the previously-discovered equations?
- Does overlapping pieces of armor provide the same protection as a single thicker piece of armor?
I am going to focus my attention on SHEAR_FRACTURE, SHEAR_YIELD, and SHEAR_STRAIN_AT_YIELD for the understood plate armor for now.
...
Those Toady quotes I linked to earlier are a gold mine. I didn't spot this one there before:
Quote from: http://www.bay12forums.com/smf/index.php?topic=21498.msg371081#msg371081
Right now, armor skill gives an increase to a deflection roll, and armor quality boosts the deflection roll, and a good deflection roll lowers the effective force of the strike.  Until armor damage goes in, there probably won't be anything more complicated.  The toughness attribute, which used to decrease damage directly, now does a similar deflection roll for strikes to tissues.
So armor user skill, armor quality, and the toughness attribute may all matter. Elsewhere he mentioned that weapon quality improves the to-hit chance and the sharpness of edged weapons. No word on blunt weapon quality.
 
1. You working on SHEAR_FRACTURE, SHEAR_YIELD, and SHEAR_STRAIN_AT_YIELD sounds great to me.  If you want me to do a run of iron vs. bronze varying IMPACT_YIELD and IMPACT_FRACTURE, let me know, as I had plans to do this eventually, but I can do it sooner than later if it would help.

I am currently running chain mail uniarmor (your armor with the [ELASTICITY_CHAIN_ALL] or whatever it is tag added to all pieces).  It does appear that all chain mail converts edged damage to blunt up to extremely high forces (something like force=64,000 is required to penetrate adamantine chain mail).  You definitely can get bruises through adamantine chain mail.  Chain mail can also provide total protection through deflection and/or conversion to only bruises at very low force (I think usually <20).  I will hopefully post complete results this weekend.

2. I had completely forgotten about dealing with skills and qualities.  I have done all tests thus far with Grand Master armor users.  I definitely will repeat some with unskilled armor users to see how much it changes, as that is trivially easy.  I should also see if changing marksdwarf/archer skills changes deflection (I usually run with these set to "Great" I think).  Changing ammo/armor qualities is a bit tricker.  I know this can be done with DFHack, but I am not an expert at using it.  If anyone happens to know how to write a script to change all the bolts/armors in the arena to a different quality, that would be very helpful.  While sGdYy409L already showed how to change one item at a time, this won't really work for large scale testing.  I can probably figure it out by looking at other scripts, but I really don't know what I'm doing so it might take me a while.  Also, on that subject, is it efficient (or even possible) to place and arm creatures using DFHack scripts, or am I better off sticking with my macros for setting up the arena?  The macros are very irritating, as maybe 10% of the time they fail to run properly (even with the computer running completely undisturbed). 
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 16, 2012, 09:37:30 pm
...
1. You working on SHEAR_FRACTURE, SHEAR_YIELD, and SHEAR_STRAIN_AT_YIELD sounds great to me.  If you want me to do a run of iron vs. bronze varying IMPACT_YIELD and IMPACT_FRACTURE, let me know, as I had plans to do this eventually, but I can do it sooner than later if it would help.
...
2. ...  Changing ammo/armor qualities is a bit tricker.  I know this can be done with DFHack, but I am not an expert at using it.  If anyone happens to know how to write a script to change all the bolts/armors in the arena to a different quality, that would be very helpful. 
...
  Also, on that subject, is it efficient (or even possible) to place and arm creatures using DFHack scripts, or am I better off sticking with my macros for setting up the arena?  The macros are very irritating, as maybe 10% of the time they fail to run properly (even with the computer running completely undisturbed).

1. Sure, that would help and I don't have the setup right now to do those statistical runs myself.

2. Here is a script for you. You can edit this in notepad or equivalent and add/remove items to be changed in quality. The IDs come from the raw files (i.e. ITEM_ARMOR_UNIPLATE):
Code: (quality.lua) [Select]

--double dashes are comments and don't count as code

--printall(df.global.world.items.all)

for k,v in pairs(df.global.world.items.all) do
--printall(v)
--print(v.subtype.id)

if v.subtype.id == "ITEM_AMMO_BOLTS" then
--print("make bolts masterwork quality")
v.quality = 5
end

if v.subtype.id == "COPYPASTE_ME" then
--print("make X normal quality")
v.quality = 0
end

end

print("done")

Stick with macros for arming. DFHack is good at changing things in the game or getting data, but creating things from nowhere gets really complex.

I read somewhere that mouse input can spoil some macros, and that unplugging the mouse can help. Unverified.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 16, 2012, 10:52:04 pm
1.  I will setup to do a full scan of bronze tonight.  If you ever want me to send you my scripts, let me know.  There's a bunch of stuff though, so unless you (or someone else) wants it I'll wait to package it up once I'm done modifying things all the time. 

2.  Thank you so much!!  That macro is perfect, and I will have no trouble modifying it to run any parameters we might want to edit.   

3.  It is true that mouse input is a problem - I have verified that.  Unfortunately, I think it's also a problem if any other process grabs attention, or if the computer just slows down, or whatever.  I have frequent issues running on my (mouseless) linux laptop with the lid closed at night.  I know that automatic updates can be an issue, but not sure what else.  I think long DF macros just fail sometimes if they don't execute fast enough or something (maybe too many commands get sent at once?).  Maybe I need to adjust the keypress repeat rate its using by adjusting MACRO_MS in data/init/init.txt?  I will try that.  I will also have my perl script look for failures, and repeat a given step of its search if it fails. 

Edit: Here are some preliminary results for iron vs. bronze.  So far they are so identical to copper vs. bronze that I had to use open symbols so that you could see both sets of data.
Spoiler: iron vs. bronze (click to show/hide)
I have also a spreadsheet with the full data set on DFFD (http://dffd.wimbli.com/file.php?id=7140).  I will try to run more to fill out this curve (only 3 out of the 5 points I ran actually worked :(), and then maybe also look at bronze bolts vs. iron armor.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 18, 2012, 12:56:36 am
Results of research into the SHEAR properties:

Methods used included changing various material properties and observing results for bolts vs armors and battle axes vs armors (in melee, not thrown!). I ran several tests where I used a metal skin instead of armor to get the wound info and more detailed combat text.

I ended up giving the armor materials the IMPACT properties of Adamantine and testing with bolts at velocity 50, so that bolts which could not cut through the armor would not fracture the armor and not cause bruising via IMPACT_STRAIN_AT_YIELD.

1. SHEAR_YIELD on the weapon material is compared to the SHEAR_YIELD on the armor material. If the armor has a equal or greater SHEAR_YIELD than the weapon, the attack is converted from an edge attack to a blunt attack. This does mean that materials can't cut themselves, and that iron can't cut bronze (bronze armor instead fractures under impact). This also means that silver, copper, wood, and glass weapons can't cut bones, and must fracture them instead, reducing the chance of severing/decapitation.

2. Presuming the weapon material has a greater SHEAR_YIELD than the armor material, if the weapon material also has a greater SHEAR_FRACTURE than the armor material, then the weapon cuts right through the armor and applies edged damage to the underlying tissue.

If the weapon material has a greater SHEAR_YIELD than the armor material, but the weapon material has a smaller SHEAR_FRACTURE than the armor material (i.e. bronze bolts vs iron armor), the armor is dented and the attack is converted from an edge attack to a blunt attack. The armor denting isn't visible unless you simulate armor with a metal skin. The denting is related to SHEAR_STRAIN_AT_YIELD since the IMPACT_* properties were Adamantine at the time, and it doesn't dent. This does mean that bronze can't cut iron either. I don't know if the denting has any effect on the momentum needed to fracture the iron armor under impact.

3. There is a "less lethal bruising" dependant on SHEAR_STRAIN_AT_YIELD (similar to the one for IMPACT_STRAIN_AT_YIELD) that can occur under certain situations (such as hitting a large creature that has a thick, cuttable, flexible hide with an axe) but it doesn't appear in vanilla bolt vs armor situations.

4. If you reduce momentum (via either the crossbow's properties or by making the bolt lighter) or reduce the MAX_EDGE of the bolt material enough, you can get situations where a bolt that should have cut right through the armor (i.e. steel bolts on iron armor) instead dents the armor. There is a narrow range of reductions where the bolt cuts through the armor but causes reduced damage to the underlying tissue. Zivilin tested (http://www.bay12forums.com/smf/index.php?topic=115683.msg3576462#msg3576462) if increasing MAX_EDGE changed crossbow performance and found no correlation, but he didn't try decreasing it a few orders of magnitude.

At default vanilla properties, if you then increase the contact area of bolts to 100 (to simulate broadheads), steel bolts are capable of severing hands, feet, arms, legs (even upper legs!) and heads. I imagine modders will want to change this.

Also see these Quietust quotes:
http://www.bay12forums.com/smf/index.php?topic=115683.msg3571429#msg3571429
I've just confirmed that weapon damage is based on the weapon's "sharpness", and sharpness is calculated based on the item's quality and the material's MAX_EDGE as follows:
Base: MAX_EDGE * 5/10
Well-crafted: MAX_EDGE * 6/10
Fine: MAX_EDGE * 7/10
Superior: MAX_EDGE * 8/10
Exceptional: MAX_EDGE * 9/10
Masterwork: MAX_EDGE * 10/10
I don't have ready access to an artifact weapon at the moment, but otherwise the info above is consistent with behavior from previous versions.

I noticed that the weapon sharpness is set at the time of creation, so my quality-changing script (2 posts ago) needs a line like the following in order to simulate masterwork quality bolts:
Code: [Select]
v.sharpness = 10000
Simply changing the quality doesn't update the stored sharpness.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 18, 2012, 07:02:01 am
First off, I tried to add in error checking to have my script rerun a test that fails while it is doing a search, but that has broken the script completely.  I guess I will scrap that until I have time to test it more.  No new results for bronze last night - it sounds like maybe we are done with bronze anyway?

Also see these Quietust quotes:
http://www.bay12forums.com/smf/index.php?topic=115683.msg3571429#msg3571429
I've just confirmed that weapon damage is based on the weapon's "sharpness", and sharpness is calculated based on the item's quality and the material's MAX_EDGE as follows:
Base: MAX_EDGE * 5/10
Well-crafted: MAX_EDGE * 6/10
Fine: MAX_EDGE * 7/10
Superior: MAX_EDGE * 8/10
Exceptional: MAX_EDGE * 9/10
Masterwork: MAX_EDGE * 10/10
I don't have ready access to an artifact weapon at the moment, but otherwise the info above is consistent with behavior from previous versions.

I noticed that the weapon sharpness is set at the time of creation, so my quality-changing script (2 posts ago) needs a line like the following in order to simulate masterwork quality bolts:
Code: [Select]
v.sharpness = 10000
Simply changing the quality doesn't update the stored sharpness.
If this is all true, couldn't I just adjust MAX_SHARPNESS in the raws to be twice the normal value to test masterwork bolts?  I will probably try both and make sure I get the same result unless you are 100% of what will happen...

Do you think your script will work for testing armor quality without further modification, or might we need to adjust other values manually?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 18, 2012, 01:49:52 pm
...
it sounds like maybe we are done with bronze anyway?
...
If this is all true, couldn't I just adjust MAX_SHARPNESS in the raws to be twice the normal value to test masterwork bolts?  I will probably try both and make sure I get the same result unless you are 100% of what will happen...

Do you think your script will work for testing armor quality without further modification, or might we need to adjust other values manually?
Yes, let's move on from the bronze stuff.

Yes, you could double MAX_EDGE and then use my original script to just update bolt quality, and it would give the same results.

Yes, simply increasing the quality should be enough for armor quality testing.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 18, 2012, 10:11:46 pm
...
it sounds like maybe we are done with bronze anyway?
...
If this is all true, couldn't I just adjust MAX_SHARPNESS in the raws to be twice the normal value to test masterwork bolts?  I will probably try both and make sure I get the same result unless you are 100% of what will happen...

Do you think your script will work for testing armor quality without further modification, or might we need to adjust other values manually?
Yes, let's move on from the bronze stuff.

Yes, you could double MAX_EDGE and then use my original script to just update bolt quality, and it would give the same results.

Yes, simply increasing the quality should be enough for armor quality testing.
I take it that you think maybe there is more to changing bolt quality that just changing MAX_EDGE?  In any case, I will first run a specific case just with altered MAX_EDGE and also using DFHack to change quality and edge as you prescribed, and see what happens.  If there is a difference, I will have to figure out how to run DFHack scripts using my searching script.  I should probably do that anyway.

For now, I have found that reducing armor user skill does decrease protection level by a moderate amount.  I am running a detailed study tonight (hopefully). 
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: JimmyBobJr on November 18, 2012, 10:45:11 pm
Chuck these finding up on the wiki, this needs to be preserved.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 19, 2012, 02:37:35 am
...
I take it that you think maybe there is more to changing bolt quality that just changing MAX_EDGE?  In any case, I will first run a specific case just with altered MAX_EDGE and also using DFHack to change quality and edge as you prescribed, and see what happens.  If there is a difference, I will have to figure out how to run DFHack scripts using my searching script.  I should probably do that anyway.

For now, I have found that reducing armor user skill does decrease protection level by a moderate amount.  I am running a detailed study tonight (hopefully).

If we go by Toady quotes, the bolt quality may affect accuracy. It's been confirmed that it changes the "sharpness", which is also changed by MAX_EDGE. I'm concerned that weapon quality might have no bearing on blunt damage, so that a high quality blunt weapon is merely more accurate.

I've experimented with bolt deflection in cases such as "steel bolt vs. iron/copper/zinc armor" and "iron bolt vs copper/zinc armor". These occur at velocity 2 with reduced MAX_EDGE values. It appears that:
MAX_EDGE * BOLT_SHEAR_FRACTURE / ARMOR_SHEAR_FRACTURE = 4994
is a "sharp" deflection criteria only for velocity=2. Bolts that don't deflect off armor at this velocity still cut through all tissues.

If I increase velocity, even to 20, then the transition becomes "smooth" rather than "sharp" and the MAX_EDGE values become small enough that we lose resolution. I can't even tell how it scales with velocity. This program code was probably made for swords and axes. It might be very hard to nerf cutting damage on bolts via modding without also making swords useless. Balance-wise, I'm ok with the concept that bolts can pierce to large depths. It may be hard to prevent bolts from severing body parts if you increase the bolt contact area.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 19, 2012, 08:19:21 am
If we go by Toady quotes, the bolt quality may affect accuracy. It's been confirmed that it changes the "sharpness", which is also changed by MAX_EDGE. I'm concerned that weapon quality might have no bearing on blunt damage, so that a high quality blunt weapon is merely more accurate.

I've experimented with bolt deflection in cases such as "steel bolt vs. iron/copper/zinc armor" and "iron bolt vs copper/zinc armor". These occur at velocity 2 with reduced MAX_EDGE values. It appears that:
MAX_EDGE * BOLT_SHEAR_FRACTURE / ARMOR_SHEAR_FRACTURE = 4994
is a "sharp" deflection criteria only for velocity=2. Bolts that don't deflect off armor at this velocity still cut through all tissues.

If I increase velocity, even to 20, then the transition becomes "smooth" rather than "sharp" and the MAX_EDGE values become small enough that we lose resolution. I can't even tell how it scales with velocity. This program code was probably made for swords and axes. It might be very hard to nerf cutting damage on bolts via modding without also making swords useless. Balance-wise, I'm ok with the concept that bolts can pierce to large depths. It may be hard to prevent bolts from severing body parts if you increase the bolt contact area.
My run failed again last night.  I think my item_weapon file got messed up in pre-run testing, causing my script to fail to adjust SHOOT_FORCE.  :(

1. I will try to test this eventually.  I have been meaning to make bolts blunt at some point anyway, so I can test this at the same time perhaps.

2.  It sounds like this will also require statistics?

3.  I have assumed from the beginning that the only parameters we can safely adjust are SHOOT_FORCE/SHOOT_MAXVEL, as well as contact area and penetration depth for bolts, as these only affect crossbows.  I don't want to think about the crazy complication that would arise if we tried to mess with parameters that are involved in melee combat as well.

I am still stuck trying to see how armor user impacts deflection - I am pretty sure that it does based on my one result, but I need a full run to work.  After that I will either test (as this is also trivially easy) archer/marksdwarf, or maybe start on bolt quality if I can get my scripts to interact with DFHack.  This should be quite straightforward, but lots of things *should* be easy...  Thanks again for writing a script for me to use within DFHack!  I will definitely get to testing that this week.  I was out of town this weekend, so that's why there was not much progress.

Update:  It appears that both armor user and marksdwarf/archer matter for deflection.  I believe that the 50% protection curve approximately follows momentum=(IF-IY/2)/(24000-AU*100) where IF=IMPACT_FRACTURE, IY=IMPACT_YIELD, AU=armor user level, and marksdwarf/archer level is great=12.  This is only from a few data points, so the exact curve may very well be slightly different, but it appears to follow this approximate trend.

The dependence I've seen so far for marksdwarf/archer looks weird, so I need to check that some more.  I've only run one test so far, and there was a weird plateau at 60% deflection, so I need to double check if that's real as we don't usually see plateaus with uniform armor. 
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 19, 2012, 10:21:26 am
...

2. It's worth noting in the documentation, but probably not worth your time to research it further.

3. I agree that we shouldn't investigate further anything related to melee combat, as it is outside of our scope/mandate (which could be best defined as "end all arguments about which bolt material is superior and why?"). Furthermore I'd like to eventually bring the thread to a conclusion and move on to something else.

If someone else (looking at you, casual thread readers!) was to investigate melee combat, I'd start with "stabbing with daggers" since it is likely to produce similar damage to a crossbow bolt.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 19, 2012, 10:38:58 am
...
If someone else (looking at you, casual thread readers!) was to investigate melee combat, I'd start with "stabbing with daggers" since it is likely to produce similar damage to a crossbow bolt.
Zivilin said he was going to work on this, but I'm not sure if he's made any progress.  I don't think he's posted anything yet.

One thing I plan to do with regard to melee weapons is do a quick run to see if the deflection rate is the same as for bolts.  I think it's rather probable that it is the same, and that melee weapons just use the listed velocity multiplier as their "velocity" rather than calculating it from SHOOT_FORCE etc.  If it's not the same, then I'm not going to delve any deeper, as melee seems to work well enough right now so far as I know.  But, if it is the same, then that significantly impacts how we should write up the results for the wiki.

If Casual Reader is interested in looking into melee combat, I am always very happy to share any or all of my tools for doing combat simulations and analyzing the results. 

Edit:
Chuck these finding up on the wiki, this needs to be preserved.
We will definitely do this.  I have a draft (https://docs.google.com/document/d/1lytX4_1zwGqiiKcQ2Zsw-1YvPxz4vb1v5ECretSGUvM/edit) of sorts in Google Doc format.  The biggest hesitation I have of starting a wiki post is I'd like to know if our results are relevant to melee weapons as well, or if ranged uses its own mechanism, as that will make a big difference in how we write things up for the wiki. 

Edit #2:
Doh, I'm stupid.  I ran a test last night where I varied MAX_EDGE of the armor, and amazingly that made no difference in the results  :-[.  Perhaps changing it for the bolt material might be more interesting...  I think I will just do the proper thing and try to use Urist's DFHack script tonight. 

Edit #3:
It appears that marksdwarf and archer skills have no impact at all on armor penetration by bolts.  I must have made some kind of mistake in my initial test.  I thought something was off as I never see a plateau in %nonserious vs. force like that.  Here is a table summarizing my results for momentum for 50% protection with contact area=2 (measured using copper bolts, but it shouldn't matter):
Spoiler: Vary Skills (click to show/hide)
It looks like momentum=(IF-IY/2)/(24000-AU*100) is fairly solid for predicting 50% deflection.  At some point I should vary Impact Fracture to make sure the slope is accurate, but I think it's good enough for now.  On to testing bolt and armor quality...

Edit#4:
I couldn't get my script to send commands to DFHack before I needed to go to bed, so I just ran a test changing only MAX_EDGE (of the bolt this time  :-[).  This made absolutely no difference in armor protection.  I also manually set up one test of copper bolts vs. adamantium at SHOOT_FORCE=78 (50% deflection) using Urist's script to change the bolt quality (and sharpness), and found no significant change here either.  I still want to do a full scan changing quality with DFHack, but so far it doesn't seem to impact deflection.  Also, so far I've only used copper bolts - I will try steel as well.

If this still produces no changes, I might consider doing an in-game test, just to make sure we didn't miss a variable that needs to be changed to adjust quality.  My initial thought would be to assume that gobbos will come wearing iron armor, and adjust SHOOT_FORCE to give 50% penetration of iron.  Then build a fort and cage some goblins, blank gamelog.txt, and release them to be shot to death with masterwork bolts.  I will have to have my analysis script separate different armor qualities worn by the goblins, but this is recorded in the logs and won't be a problem.  Also, goblins mostly will come with no quality armor.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 21, 2012, 10:13:00 am
...
I am currently running chain mail uniarmor (your armor with the [ELASTICITY_CHAIN_ALL] or whatever it is tag added to all pieces).  It does appear that all chain mail converts edged damage to blunt up to extremely high forces (something like force=64,000 is required to penetrate adamantine chain mail).  You definitely can get bruises through adamantine chain mail.  Chain mail can also provide total protection through deflection and/or conversion to only bruises at very low force (I think usually <20).  I will hopefully post complete results this weekend.
...

What happened to these chain mail results? I tried a few tests and found that mail can be cut through by a material with higher SHEAR_* properties, but the mail doesn't fracture under impact. Mail does appear to let blunt attacks through with only some reduction in damage.

...
Edit #3:
It appears that marksdwarf and archer skills have no impact at all on armor penetration by bolts.  I must have made some kind of mistake in my initial test.  I thought something was off as I never see a plateau in %nonserious vs. force like that.  Here is a table summarizing my results for momentum for 50% protection with contact area=2 (measured using copper bolts, but it shouldn't matter):
Spoiler: Vary Skills (click to show/hide)
It looks like momentum=(IF-IY/2)/(24000-AU*100) is fairly solid for predicting 50% deflection.  At some point I should vary Impact Fracture to make sure the slope is accurate, but I think it's good enough for now.  On to testing bolt and armor quality...

Edit#4:
I couldn't get my script to send commands to DFHack before I needed to go to bed, so I just ran a test changing only MAX_EDGE (of the bolt this time  :-[).  This made absolutely no difference in armor protection.  I also manually set up one test of copper bolts vs. adamantium at SHOOT_FORCE=78 (50% deflection) using Urist's script to change the bolt quality (and sharpness), and found no significant change here either.  I still want to do a full scan changing quality with DFHack, but so far it doesn't seem to impact deflection.  Also, so far I've only used copper bolts - I will try steel as well.
...

3. This would be another reason why I originally got a higher divisor for the slope than 22500 when testing adamantine, as I was using test dwarves with no armor user skill.

4. We know that we need to seriously nerf MAX_EDGE and bolt momentum to have bolts do anything other than cut through everything in the cutting calculations (if they can cut the armor at all!). You probably won't be able to detect anything from raising the bolt quality and MAX_EDGE. Perhaps you should focus on armor quality. I'll probably do some pass/fail testing of my own on the armor quality.


I ran a few tests and found that the "ricochet or frangibility" deflection where bolts have low IMPACT_YIELD (or the armor has high density) is checked after a bolt fails to cut through armor, but before the blunt damage is assessed. A wood bolt, which deals blunt damage through adamantine plate but deflects off steel plate, will cut through the steel plate if given sufficiently high SHEAR_* properties.

Also, I'll eventually make a flowchart image that presents all of the calculations to date in order.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 21, 2012, 07:31:13 pm
What happened to these chain mail results? I tried a few tests and found that mail can be cut through by a material with higher SHEAR_* properties, but the mail doesn't fracture under impact. Mail does appear to let blunt attacks through with only some reduction in damage.
Hmm...sorry it seems I forgot to post those.  I ran the simulations, and analyzed them, but the results never ended up here...

I modified Urist's uniarmor to convert it to chain mail:
Spoiler: unimail (click to show/hide)

I then measured protection from copper bolts as a function of momentum (using targets with grand master armor user and shooters with great archer/marksdwarf).  Here are the results with contact area 2:
Spoiler: Contact Area 2 (click to show/hide)
and also with Contact Area 10
Spoiler: Contact Area 10 (click to show/hide)
As you can see, all chainmail provides 100% protection at low bolt momentum, and then drops to 30% protection (corresponding to allowing only blunt damage through) at higher force.  Here is a table summarizing the momentum needed for 65% armor penetration (the middle of the first drop)
Spoiler: Summary Table (click to show/hide)
I also found that the conversion of damage to blunt does fail at crazy high momenta (something like 20000 for iron and 60000 for steel at contact area 2). 

I can't even begin to propose any kind of relationship between the data and material properties.  Iron, Bronze, and Copper all appear to be the same, steel is slightly better, and then adamantine protects up to roughly double the momentum stopped by steel.  Also, it appears that the cutoff more than doubles when increasing contact area to 10, so that may not follow the same rounding procedure as before either.  Also, the transition from 1 to 0.3 is much slower than for plate armor transitioning from 1 to zero.

For the very interested (perhaps Urist?) I also posted the full data set on DFFD (http://dffd.wimbli.com/file.php?id=7159).

Given that the behavior is kind of strange vs contact area, I think it might be worth testing what happens if dwarves are wearing 3 layers of 15 thickness mail (which is possible in-game).  I'll put it on the list...

If Urist happens to be reading this, I am working on implementing his script, but I ran into snag with making it work with my automatic testing.  I need a way to wait until the macro has finished placing all the dwarves before running the quality changing script.  Ideally it would be nice if there was a way to make a DFHack lua script loop until the number of dwarves reaches a given number, and then continue.  Barring this, I could have it pipe the number of dwarves back to perl, and have perl to the wait loop.  If neither will work, then I guess I am stuck just waiting a fixed amount of time and assuming that all dwarves will be placed.  If I do this, I will definitely need my analysis of gamelog.txt to check and make sure bolts fired are the desired quality.
Edit - it appears make lua sleep is not OS portable, but is easy on linux (for me).  Now I just have to count dorfs, which I think I can figure out... 
Edit #2 - it's somewhat embarrassing how long it took me to figure out that "#" gives you the number of elements in a table in Lua.  So it appears that #df.global.world.units.all should do the trick.   
Edit #3 - it seems my mucking around with lua was kind of a waste of time, as I have no good way to start the macro and then send a command to DFHack without shifting focus away from Dwarf Fortress, which of course hangs the macro (and apparently also DFHack and dwarf fortress in a particularly nasty way if I then run the lua checking script).  Oh well, I'll just wait a set time :(. 
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 23, 2012, 12:47:59 am
...
I then measured protection from copper bolts as a function of momentum (using targets with grand master armor user and shooters with great archer/marksdwarf).  Here are the results with contact area 2:
Spoiler: Contact Area 2 (click to show/hide)
and also with Contact Area 10
Spoiler: Contact Area 10 (click to show/hide)
As you can see, all chainmail provides 100% protection at low bolt momentum, and then drops to 30% protection (corresponding to allowing only blunt damage through) at higher force.  Here is a table summarizing the momentum needed for 65% armor penetration (the middle of the first drop)
Spoiler: Summary Table (click to show/hide)
I also found that the conversion of damage to blunt does fail at crazy high momenta (something like 20000 for iron and 60000 for steel at contact area 2). 

I can't even begin to propose any kind of relationship between the data and material properties.  Iron, Bronze, and Copper all appear to be the same, steel is slightly better, and then adamantine protects up to roughly double the momentum stopped by steel.  Also, it appears that the cutoff more than doubles when increasing contact area to 10, so that may not follow the same rounding procedure as before either.  Also, the transition from 1 to 0.3 is much slower than for plate armor transitioning from 1 to zero.

For the very interested (perhaps Urist?) I also posted the full data set on DFFD (http://dffd.wimbli.com/file.php?id=7159).

Given that the behavior is kind of strange vs contact area, I think it might be worth testing what happens if dwarves are wearing 3 layers of 15 thickness mail (which is possible in-game).  I'll put it on the list...
...

I analyzed your data set and then verified my theory below against your results for various armor materials, using copper bolts:

Mail armor (with [STRUCTURAL_ELASTICITY_CHAIN_ALL]) is equivalent to plate armor where the armor material has [IMPACT_STRAIN_AT_YIELD:50000]. That is, chainmail is modelled as plate armor that is just as flexible as actual skin (don't confuse this with my rigid metal testing skins), which allows blunt damage through the armor at any momentum. The shape of your plots for contact areas 2 and 10 are influenced by the material properties of the dwarf. The mail armors with higher IMPACT_FRACTURE seem to transmit less blunt damage to the wearer, but the relationship isn't linear.

See this Toady quote:
Quote from: http://www.bay12forums.com/smf/index.php?topic=21498.msg368028#msg368028
Right now it'll check the impact elasticity (which I guess is actually impact yield strain or something) of the outer layer, and that'll let it bypass impact fracture after a certain point (while still allowing bruises and ruptures without the layer eg skin actually breaking) even if the force is high enough (as the layer is assumed to have made way for the moving object in a sense).  So if you make a michelin man style creature that's just a purely elastic material, a mace will be unable to harm it unless it has blood flow and can bruise and so on, while relatively inelastic materials like bone will fracture, even through skin.
So mail armor can allow reduced blunt damage to pass through, while not being able to fracture because of the bypass.

Wearing multiple mail shirts might be better protection against crossbow bolts than the plate & mail combo.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 23, 2012, 11:16:22 am
I finally got Urist's script working with my automatic testing by just having it wait 1 minute after starting the macro which places dwarves, then running the quality modification script, and then unpausing dwarf fortress.  It seems to have worked without issues.

Here are the results for masterwork copper bolts against standard armor with unskilled dwarves:
Spoiler: Masterwork Bolts (click to show/hide)
There are absolutely no differences between masterwork bolts and basic bolts.  I believe the wiki claims that masterwork bolts do not influence hit probability either (only crossbow quality matters?) which would mean there is no advantage to using high quality bolts (and actually a disadvantage due to unhappiness when they are lost).  It is probably worth checking if bolt quality influences other things besides armor penetration eventually, but not now.

I also ran the same test with basic bolts and masterwork armor:
Spoiler: Masterwork Armor (click to show/hide)
The armor does give a modest increase to protection levels.  It appears that the force for 100% protection does not change, but the width of the drop from 100% to zero increases.  I'll probably add a table of these results later, but I need to go now.  Here is a spreadsheet of all results on DFFD (http://dffd.wimbli.com/submit.php?action=message&fid=7162).
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 25, 2012, 03:25:36 am
I tried to see how the IMPACT properties scale with increasing armor thickness, and it doesn't appears to use the same round-down-to-nearest-100 rule as before.

See Pirate Bob's quote here:
Finally, here are my results for force scans of all armor materials using Urist's new uniform armor and contact areas 2 and 10. 
Spoiler: Contact Area 2 (click to show/hide)
Spoiler: Contact Area 10 (click to show/hide)
I ran for both copper and iron bolts at contact area 10, and the results are identical when plotted vs. bolt momentum.  Here is a table of the momentum for 50% of hits either deflected or causing only bruises.
Spoiler (click to show/hide)
It appears that Urist is correct, and the momentum required for 50% serious wounds is multipled by Contact Area*LAYER_SIZE rounded to hundreds (rounding up to 100, and rounding down for numbers above 100).  In this scheme, Contact Area 2 rounds to 100, and contact area 10 rounds to 200.  Correspondingly, the momenta for Contact Area 10 are exactly twice those for Contact Area 2.  I will eventually have to confirm this by systematically varying Contact Area.

The equation we have so far is:
momentum = IMPACT_FRACTURE * round100(CONTACT_AREA*LAYER_SIZE)/(2250000-f1(IMPACT_YIELD)) - f2(IMPACT_YIELD).
The functions f1 and f2 are not yet clear, and may depend on more than just IMPACT_YIELD. 

I also have some results for varying IMPACT_YIELD at constant IMPACT_FRACTURE which I will try to post later.  Hopefully they will help clarify things further.

Update:  Here is the full spreadsheet of these results on DFFD (http://dffd.wimbli.com/file.php?id=7131)

In my test I increased layer size from 20 to 105, which should give the same results as increasing the contact area from 2 to 10 if the rounding rule was being followed. The armor was instead stronger than expected. More research is required on the layer size.

EDIT: looks like if the uniarmor set has a LAYER_SIZE greater than 50, the uniplate on the dwarf's upper body becomes thicker in "penetration depth" units than a crossbow bolt. Refer back to this post: http://www.bay12forums.com/smf/index.php?topic=116151.msg3766880#msg3766880
I'm going to test again at LAYER_SIZE 50.

EDIT2: Layer size 50 has the same results as layer size 20, therefore the rounding rule should still be followed.

EDIT3: Layer size 105, with modded bolts that have penetration depth 10x larger, follows the rounding rule and fractures at roughly double the momentum required to fracture layer size 20 armor.

The momentum required for bruising to pass through the armor is roughly unchanged and doesn't really depend on the armor layer size. When the velocity required to fracture steel armor jumped from around 67 to around 133, the velocity required to cause bruising through the steel armor only increased from 45 to 55.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 26, 2012, 02:23:52 am
New research, hence the second post in a row:

I thought it would be fun and useful to determine the velocities of thrown items. To do this I possessed arena dwarves and made them throw bolts at other arena dwarves wearing armor of various materials. We know how the armors behave when hit by bolts launched at various velocities, so we can work backwards from the thrown item results.

Thrown items are given a velocity of 100, regardless of the item's weight, even for extremely heavy items (i.e. giant sperm whale corpses). The thrown item velocity doesn't appear to change with strength or skill (skill boosts accuracy though).

Spat items, such as the magma crab's basalt globs, are also given a set velocity of 100.

I tested falling items by "eagle dropping" items onto armor-wearing arena dwarves from various elevations. A bunch of aluminum bolts (unstacked) all deflected off an adamantine-wearing dwarf when dropped from just above him. When the bolts were dropped from 8z above, they all caused various damage through the armor. We know that falling objects increase in velocity (see this post http://www.bay12forums.com/smf/index.php?topic=116151.msg3727568#msg3727568 from earlier in this thread), and this increased velocity translates to an increase in damage.

So if you are trying to train dwarves with falling objects, drop them as short a distance as possible. If you are trying to kill enemies, you can get improved results (at a cost of trap size and delay time) by dropping the items a larger distance before they hit the targets.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 26, 2012, 10:56:11 pm
I tried to run tests of how protection with different skills and qualities scaled with IMPACT_FRACTURE (to get a better estimate of the slope factor) over vacation, but I didn't have time to analyze any of my results while I was away.  Unfortunately, I had switch my program to adjust the ammo material parameters when I was looking at MAX_EDGE, and didn't change it back, so all my data I collected for the past few days is useless.

I did do a quick set of copper vs. steel for 3 layers of LAYER_SIZE 15 uniform chainmail today, and found it to be almost no different than LAYER_SIZE 20 steel chainmail (a tiny bit lower protection actually).  I will run a few more sets of this to be sure overnight, and post details tomorrow.  Assuming none of show a big difference, this would suggest that multiple layers of the same armor do not stack.  I should probably see what happens with stacked plate armor as well.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 27, 2012, 01:59:58 am
I tried to run tests of how protection with different skills and qualities scaled with IMPACT_FRACTURE (to get a better estimate of the slope factor) over vacation, but I didn't have time to analyze any of my results while I was away.  Unfortunately, I had switch my program to adjust the ammo material parameters when I was looking at MAX_EDGE, and didn't change it back, so all my data I collected for the past few days is useless.

I did do a quick set of copper vs. steel for 3 layers of LAYER_SIZE 15 uniform chainmail today, and found it to be almost no different than LAYER_SIZE 20 steel chainmail (a tiny bit lower protection actually).  I will run a few more sets of this to be sure overnight, and post details tomorrow.  Assuming none of show a big difference, this would suggest that multiple layers of the same armor do not stack.  I should probably see what happens with stacked plate armor as well.

Tip: Use [LAYER_PERMIT:5000] and you can wear (almost) as many mail shirts as you want.

For plate armor, do the above and also remove the [SHAPED] token when it occurs (as only one shaped item can be worn per body part).

It appears that multiple layers or increased thickness of armor that allows bruising to pass through, including mail, doesn't substantially increase the momentum required to cause bruising.

Wearing 20 layers of adamantine uniarmor (20 plates, 20 helms, 40 gauntlets, 40 boots) requires iron bolts at about velocity 250 to penetrate, as opposed to velocity 95 for a single layer of armor, or about velocity 760 for a single layer of adamantine uniarmor that is 20x thicker. So even with plate armor, it doesn't give much additional protection to wear multiple layers (maybe an additional 8 velocity per layer for my test case).
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 27, 2012, 07:59:47 am
Here are the results of 3 layers of LAYER_SIZE:15 chain mail worn by grand master armor users against copper bolts fired by great archer/marksdwarves:
Spoiler (click to show/hide)
I did adjust LAYER_PERMIT and remove SHAPED, and made sure that dwarves really were wearing all three layers of mail.  I also updated my DFFD (http://dffd.wimbli.com/file.php?id=7159) spreadsheet for chainmail to add in the new results.

There is not that much difference from a single layer of LAYER_SIZE:20 chain mail.  3 layers of adamantine offers slightly less protection, and steel slightly more.  I don't have any idea why this might be, but the bottom line is that at bolt momentum above 70 all mails except adamantine offer about 30% protection (covert all edged to blunt). 

I am not sure I understand all that Urist is saying about LAYER_SIZE not increasing protection as expected.  I can say for sure that increasing contact area for LAYER_SIZE:20 increases the bolt momentum by round(LAYER_SIZE*CONTACT_AREA) to the nearest 100.  I guess I will run with LAYER_SIZE:10 with contact area 15 and 20.  Contact area 15 should give the same result at my previous run for LAYER_SIZE:20, contact area 2 while contact area 20 should give the same result as LAYER_SIZE:20, contact area 10.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 27, 2012, 09:53:19 am
...
I am not sure I understand all that Urist is saying about LAYER_SIZE not increasing protection as expected.  I can say for sure that increasing contact area for LAYER_SIZE:20 increases the bolt momentum by round(LAYER_SIZE*CONTACT_AREA) to the nearest 100.  I guess I will run with LAYER_SIZE:10 with contact area 15 and 20.  Contact area 15 should give the same result at my previous run for LAYER_SIZE:20, contact area 2 while contact area 20 should give the same result as LAYER_SIZE:20, contact area 10.

My later edits to that post indicate that it actually does follow the round-to-100 rule. It's just that you have to increase the penetration depth when testing armors of above a certain thickness.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Stastny on November 27, 2012, 06:22:23 pm
Hi, I first just want to say that this is fantastic stuff, I've just come back to DF after a two-year hiatus and I've just eaten up this whole thread.  Really great.

Have you guys tried varying with Dodger skill somebody mentioned this earlier on but I've seen no follow-up)?  I did a bunch of not-nearly-so-quantitative tests back in the day in the arena and found it to be the single most important variable in fighting quality and wounds.  Even a naked Grandmaster Dodger, fighting against an unskilled or poorly-skilled dwarf (or a number of them), could be almost guaranteed to receive only 'tearing/brusing the skin or fat' results so long as he was conscious, un-stunned and not being attacked from behind, never mind the weapon or weapon material, and that includes bolts.

I've just now run a GM Dodger, naked, weaponless, vs. 4 unskilled marksdwarves:  after a great number of misses, and some 70 bolts fired, they finally got him with a 'tearing the fat' (after a number of 'tearing the skin' results), and then on page 13 took him out with a shot from behind to the spine.  Anecdotal, I know, but I've seen just this umpteen times.  Surely this is relevant for your armour calculations?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 27, 2012, 09:42:23 pm
I misunderstood what Urist was talking about in his last couple of posts, so I ran some more tests with LAYER_SIZE=10 plate armor and contact areas 15 and 20.  I confirmed that contact area 15
Spoiler (click to show/hide)
(marked L10) gives exactly the same result as LAYER_SIZE=20 and contact area 2, as expected (in both cases LAYER_SIZE*contact area rounds to 100).  LAYER_SIZE=10 and contact area 20 also gives the same result as LAYER_SIZE=20 contact area 10 (both round to 200).
Spoiler (click to show/hide)
Kind of a waste of time, but it definitely confirms that layer size and contact area behave as we believed.

Hi, I first just want to say that this is fantastic stuff, I've just come back to DF after a two-year hiatus and I've just eaten up this whole thread.  Really great.

Have you guys tried varying with Dodger skill somebody mentioned this earlier on but I've seen no follow-up)?  I did a bunch of not-nearly-so-quantitative tests back in the day in the arena and found it to be the single most important variable in fighting quality and wounds.  Even a naked Grandmaster Dodger, fighting against an unskilled or poorly-skilled dwarf (or a number of them), could be almost guaranteed to receive only 'tearing/brusing the skin or fat' results so long as he was conscious, un-stunned and not being attacked from behind, never mind the weapon or weapon material, and that includes bolts.

I've just now run a GM Dodger, naked, weaponless, vs. 4 unskilled marksdwarves:  after a great number of misses, and some 70 bolts fired, they finally got him with a 'tearing the fat' (after a number of 'tearing the skin' results), and then on page 13 took him out with a shot from behind to the spine.  Anecdotal, I know, but I've seen just this umpteen times.  Surely this is relevant for your armour calculations?
While this is definitely worthy of investigation, it is slightly outside the scope of what we are working on right now, which is focusing on what happens when a bolt actually hits an armored target.  I believe Zivilin tested dodging in another thread, but I'm not sure.  If he didn't already do it, I will add it to the long list of things I want to look at when I finish with this...
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 27, 2012, 10:18:05 pm
...
 I believe Zivilin tested dodging in another thread, but I'm not sure.  If he didn't already do it, I will add it to the long list of things I want to look at when I finish with this...

Sort of, see here:
http://www.bay12forums.com/smf/index.php?topic=117284.0

EDIT: Let's use this existing wiki page to write up the results:
http://dwarffortresswiki.org/index.php/DF2012:Material
It makes a few guesses as to how things work, but we understand some of the mechanics better now.
For example, we know real-world properties are used, but not real-world physics.

The existing page will have to move off-topic slightly as some of the properties are of weapons or armor, not materials, but I don't see the point in fragmenting the analysis among multiple pages.

EDIT2: Here's a flowchart image for tldr folks:
Spoiler (click to show/hide)
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 28, 2012, 07:56:26 am
Sort of, see here:
http://www.bay12forums.com/smf/index.php?topic=117284.0
...
EDIT2: Here's a flowchart image for tldr folks:
Spoiler (click to show/hide)
(1) Maybe we could ask Zivilin to repeat his dodging study using a few different values of the dodge skill.  If not, I can try to replicate it.

(2) I think the flowchart looks very nice.  One issue - the damage that occurs when a projectile dents plate armor is very different than the protection offered by chain mail.  Chain mail appears to just convert edged damage to blunt, meaning that (serious) fractures, chips, bruises and jams can occur.  When plate armor is dented but not fractured, ONLY bruises can occur, and a quick scan of the logs suggests these bruises are never serious (not brains hearts etc) but only to outer layers (muscle, skin, fat).  I think I need to rewrite my analysis to only call hits "nonserious" if they cause "bruising the skin", "bruising the fat" and/or "bruising the muscle", but no other damage to make this clearer.  Hits through chainmail can definitely result in only bruising, but still damage internal organs (bruising guts, speen, etc), so long as there is no bone in the way.  Damage to organs covered by bone (heart, brain, lungs) seems to require that the bone be broken first.

I'm not totally sure if I understand which situations you are referring to when you say armor is "dented" or "fractured" so maybe I don't have this straight, but you definitely need to consider what I call "nonserious" wounds separately from wounds through chain mail. 
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 28, 2012, 10:07:30 am
OK, updated flowchart:

Spoiler (click to show/hide)

http://www.graphviz.org/ is nice because you don't have to mess around with drawing shapes and arrows, you just have to feed instructions to the image generator.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 28, 2012, 12:18:06 pm
I took a look at the material page of the wiki (http://dwarffortresswiki.org/index.php/DF2012:Material), and I agree that this seems like a good place to put our analysis.  I also agree that it makes sense to put everything (or almost everything) on one page.  However, I think it might be nice to include some parts (or at least links to them) on other pages as well.  For example, I think it makes sense to mention the formula you worked out for projectile velocity on the crossbow and bow pages, and to give results for how armor performs with 34.11 values on the armor page. 

Putting the results on the material page would be especially nice if we could verify that the behavior for melee weapons is the same or similar.  I quickly tested copper spears (with the bash attack removed) against adamantine uniarmor, but I seem to have messed this up.  I set the "velocity multiplier" for spears to 62, hoping that this would just set the velocity of the blow.  Copper spears have a mass of 3.572, so this would give momentum = 221, and also a contact area of 20.  The momentum for 50% penetration of thickness=20 zero quality adamantine armor with zero armor user is (50000000-5000000/2)*(20*20)/2400000=417.   Last night when I calculated this I somehow got that the momentum for 50% penetration would be 222 - maybe I forgot to adjust the contact area?  Anyway, no surprise that I got 100% deflections from this test.  I hope to try again with higher velocity multipliers (specifically 117 to start) to see if deflection behaves as expected. 

I also need to reanalyze my results for chain mail using the criteria that nonserious hits should only include bruising of skin, fat, and muscle.  I have a script which calculates this from logs written, so now I just need to run it on my existing logs for chain mail.  I expect that, with this criteria, protection from mail will fall smoothly to almost zero, without the plateau I previously saw at ~30%, but we'll see.

Edit:  It occured to me that the Casual Reader may be able to tell us if melee weapons follow the same rules as projectiles without any significant testing.  I have posted a spreadsheet of the predictions of applying projectile behavior to melee weapons, assuming that melee weapon momentum is determined by mass*velocity mulitplier, to DFFD (http://dffd.wimbli.com/file.php?id=7177).  No need to worry about the numbers - if a cell is colored red, then that means the armor should be penetrated 100% of the time, and if it's green then there should be 100% protection (either deflection or hit reduced to bruising skin, fat or muscle).  These numbers are for layer thickness=20, so that means breastplates and helms, although I'm not sure how many cases are close enough that the lower thickness of greaves, gauntlets and boots matters.

In particular, all types of swords and daggers (except those made of adamantine) are predicted to always penetrate with stabbing or pommel strike attacks, but not to penetrate with slashes so long as the armor material is equal or better than the sword (addy>steel>iron=bronze>copper).  I think I remember having stabs be deflected in adventure mode, but it's been a while since I actually played dwarf fortress, so I'm not sure  :P.  Can anyone confirm that this or other predictions of my table are untrue?  Logs would be ideal, but "I'm sure I remember X" would be helpful too.  Any deflection of any attacks other than sword slash/slap or axe hack would disprove my wild speculations.

Writing this also made me realize that we never did get around to testing whether our results for dwarven targets hold for other races.  However, I can't imagine that humans or elves have enough size difference to change things much. 
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on November 29, 2012, 01:59:03 am
...
  Can anyone confirm that this or other predictions of my table are untrue?  Logs would be ideal, but "I'm sure I remember X" would be helpful too.  Any deflection of any attacks other than sword slash/slap or axe hack would disprove my wild speculations.

Writing this also made me realize that we never did get around to testing whether our results for dwarven targets hold for other races.  However, I can't imagine that humans or elves have enough size difference to change things much. 

1. Using this thing:
Code: [Select]
[ITEM_WEAPON:ITEM_WEAPON_SPEAR_VARIABLE]
[NAME:variable spear:variable spear]
[SIZE:300]
[SKILL:SPEAR]
[TWO_HANDED:37500]
[MINIMUM_SIZE:32500]
[MATERIAL_SIZE:3]
The format is ATTACK:EDGE/BLUNT:contact area:penetration size:verb2nd:verb3rd:noun:velocity multiplier
[ATTACK:EDGE:2:10000:100:100:NO_SUB:100]
[ATTACK:EDGE:2:10000:200:200:NO_SUB:200]
[ATTACK:EDGE:2:10000:300:300:NO_SUB:300]
[ATTACK:EDGE:2:10000:400:400:NO_SUB:400]
[ATTACK:EDGE:2:10000:500:500:NO_SUB:500]
[ATTACK:EDGE:2:10000:600:600:NO_SUB:600]
I find that iron variable spear vs steel uniarmor, and iron variable spear vs adamantine uniarmor, both transition from deflection to tearing somewhere between 300 and 400. So your table predictions are untrue.

Considering the bucketload of variables that affect melee combat, I'd just wrap up the ranged results and do melee in its own thread another time.

2. Humans don't appear to get different results, and very large creatures like giants get bugged armor that is thicker than the penetration depth of arrows.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on November 29, 2012, 08:20:08 am
1. Using this thing:
Code: [Select]
[ITEM_WEAPON:ITEM_WEAPON_SPEAR_VARIABLE]
[NAME:variable spear:variable spear]
[SIZE:300]
[SKILL:SPEAR]
[TWO_HANDED:37500]
[MINIMUM_SIZE:32500]
[MATERIAL_SIZE:3]
The format is ATTACK:EDGE/BLUNT:contact area:penetration size:verb2nd:verb3rd:noun:velocity multiplier
[ATTACK:EDGE:2:10000:100:100:NO_SUB:100]
[ATTACK:EDGE:2:10000:200:200:NO_SUB:200]
[ATTACK:EDGE:2:10000:300:300:NO_SUB:300]
[ATTACK:EDGE:2:10000:400:400:NO_SUB:400]
[ATTACK:EDGE:2:10000:500:500:NO_SUB:500]
[ATTACK:EDGE:2:10000:600:600:NO_SUB:600]
I find that iron variable spear vs steel uniarmor, and iron variable spear vs adamantine uniarmor, both transition from deflection to tearing somewhere between 300 and 400. So your table predictions are untrue.

Considering the bucketload of variables that affect melee combat, I'd just wrap up the ranged results and do melee in its own thread another time.

2. Humans don't appear to get different results, and very large creatures like giants get bugged armor that is thicker than the penetration depth of arrows.
1.  Clearly the table is wrong, as you say.  However, given that my rough predictions say that an iron spear should penetrate steel at momentum 295 and adamantium at 416, this suggests that the velocity multiplier may just act as a "momentum" like SHOOT_FORCE.  As you say, there are almost certainly other factors which impact melee combat (attacker stregth, weapon skill, etc), but I still suspect that these go into determining the momentum of the weapon, and that once the weapons hits it might follow the same behavior as projectiles.  I tried testing this with a similarly modified long sword, and originally found that the transition for slashing (contact area 60000) occurred around velocity 800000 against steel armor, which is consistent, but then I also got deflections at 1500000 against the same target later.  It seems likely that random variables or combat conditions (like directness of the hit) also figure into determining deflection in melee, either directly or through determining the weapon momentum.

In any case, I agree that due to the many variables in melee, this will be very hard to test and we/someone else should do it at a later time.  I still think there is decent support for the hypothesis that, once the momentum is determined, melee weapons will behave the same as projectiles, but proving this seems beyond the current scope.  I think we have enough information to say "this is what happens for projectiles, and we suspect something similar for melee..."

2.  Glad to hear that things do not vary much between human sized targets.

I have been running calculations of deflection off standard dwarf fortress armor over the past few days, as I would like to be able to include protection vs. momentum curves in the final write-up.  These are largely complete, but in the process I discovered that armor penetration occurs at lower momentum/more often if the target has fallen over.  I think the most appropriate thing to report is results for standing targets, as once you fall over you're pretty much dead anyway.  I'm working on that, and also will try to start adding things to the wiki if I get a chance (maybe this weekend).

We also should probably try to put a summary of our findings in bug 5516 (http://www.bay12games.com/dwarves/mantisbt/view.php?id=5516).  HiEv already posted a link to this thread there, but I think it would be nice to add a clear statement that plate armor does nothing, and one or more ways the raws can be adjusted to cause some plate armors to deflect bolts.  Maybe also a link to whatever final write-up(s) we do on the wiki or elsewhere.

Edit:  I have started adding our results to the wiki (http://dwarffortresswiki.org/index.php/DF2012:Material#Effects_on_Combat).  So far just text, but I'd like to have some plots (especially Urist's flowchart).  It also need some expanding, and some details checked/filled in.  Constructive editing would be most welcome...
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on December 02, 2012, 09:25:56 am
I've finished my testing of copper bolts vs. standard dwarf fortress armor (breastplate, helm, greaves, 2 gauntlets, and two low boots, with and without 2 chain mail shirts).  The statistics aren't great, as I only ran with 72 dwarves at each force point.  I more wanted to get a general shape for all curves rather than exact numbers, and I will do larger runs at a few points of interest.  Furthermore, I found that, once dwarves have fallen over, there is a significantly larger chance that armor will be penetrated.  I therefore only included on each dwarf before it had first fallen over, but this further reduced my sample size.  I therefore expect errors of up to 10% (which is most noticeable in the values for iron armor at momentum >100, which can fluctuate between 0 and 10%.  It is not clear that these differences are significant for iron armor at high momentum.)

EDIT:  THIS IS ALL WITH CONACT_AREA=10.  Sorry I forgot to mention that initially.  Contact area=2 (standard) produces much less interesting results as all plate armor effectively has the same thickness (as contact_area * layer_size gets rounded up to 100).

Spoiler (click to show/hide)
Here is a spreadsheet with all the raw data on DFFD (http://dffd.wimbli.com/file.php?id=7187).

Now for the (for me) exciting part.  If you look at momentum between 70-75, you will see that all armors provide some level of protection, with <10% protection for bronze/copper, ~20-40% protection for iron, 80-90% protection for steel, and >90% protection for adamantine.  This seems like a decently realistic result, but I am no expert on medieval armor.  In any case, it should hopefully be easy enough for anyone to look over these curves and pick a bolt momentum which gives the level of armor protection they think is most appropriate.

In game, there is still the issue that bolt masses get rounded when determining bolt velocites, which results in silver bolts having significantly higher momenta than iron/steel ones for the same crossbow parameters.  I think I may have a (slightly messy) fix for this as well.  Create duplicates of all bolt materials, but change their density to 600 (equal to wood, but you can use whatever you like so long as they're the same).  Then remove [ITEM_AMMO] from all standard materials, and give the bolt materials [ITEM_AMMO] and no other item tags.  Then you also need to remove whatever tag makes the material show up as ore that can be mined (not sure about this - will add when I figure it out) and add reactions to create bolts out of each bolt material from each corresponding normal material (which I was told is possible, but haven't tried).  Have to go now - will update if and when I get this to work.

Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Sutremaine on December 02, 2012, 09:32:49 am
Then you also need to remove whatever tag makes the material show up as ore that can be mined (not sure about this - will add when I figure it out) and add reactions to create bolts out of each bolt material from each corresponding normal material (which I was told is possible, but haven't tried).
That tag isn't on the metal itself, it's on the stone that you smelt to produce the metal. For example, tetrahedrite has [METAL_ORE:COPPER:100] and [METAL_ORE:SILVER:20].
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on December 02, 2012, 01:42:36 pm
Then you also need to remove whatever tag makes the material show up as ore that can be mined (not sure about this - will add when I figure it out) and add reactions to create bolts out of each bolt material from each corresponding normal material (which I was told is possible, but haven't tried).
That tag isn't on the metal itself, it's on the stone that you smelt to produce the metal. For example, tetrahedrite has [METAL_ORE:COPPER:100] and [METAL_ORE:SILVER:20].
Oh excellent!  So all I have to do to prevent the bolt materials from showing up as ores is not specifically create ores for those metals.  I now realize I should have known that, because as you point out tetrahedrite produces multiple metals, and copper, iron etc can be produced from several ores.  Thanks!

Edit: One other thing - we should try to create bug reports for the new issues we've discovered in this study (in addition to of course adding to 5516 (http://www.bay12games.com/dwarves/mantisbt/view.php?id=5516)).  In particular, I think the crazy way in which bolt velocities are created deserves it's own report.  I'd be willing to bet this is just a case of Toady using integers for everything, without noticing the strangeness that happens when calculating bolt velocities.  It (probably) should be relatively easy for him to fix if he wants to, and even easier just to close the report if he doesn't.  In any case, it can't hurt to alert him to it.  I am pretty sure there was lease one more thing we found, but I can't remember what it was.

Edit #2: I remembered another potential bug - bolt quality does not seem to do anything.  The wiki claims that quality determines damage, but I've seen no evidence to support this.  If it does turn out that bolt quality is not used after exhaustive testing, I think that might be worth reporting.  I suspect that bolt quality changes MAX_EDGE, per Quietust's statement, but that MAX_EDGE simply does not matter in any of the calculations involving bolts.  It certainly doesn't matter for vanilla bolts  ::).
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on December 03, 2012, 07:58:23 am
I tried to use Zilivin's Vitruvian Dwarf (http://www.bay12forums.com/smf/index.php?topic=116151.msg3594111#msg3594111) to calculate probabilities of armor deflecting at different momenta based on the armor covering body parts hit and make sure it agrees with my data.  I think that the thick parts (>=20) of standard armor should be the breastplate, covering the upper body, and the helm covering the head, making up 23% coverage, with armor less than 20 thickness covering another 67% of the body.  I did not worry about chain mail for now, just plate mail.  My data for protection vs. momentum shows a first plateau at ~90% for very low force which corresponds nicely to the total coverage.  However, after the initial force drop, the second plateau is at about 55% protection, which is no where near the amount covered by thicker armor.

Careful inspection of the log (posted on DFFD (http://dffd.wimbli.com/submit.php?action=message&fid=7190)) for copper bolts vs. adamantine armor at momentum 171 (force 128), armor user 15, quality 0, shows that
1) The breastplate appears to cover both the upper and lower body.
2) Any hits to the gauntlets or low boots are deflected (while the dwarves are still standing).
3) Hits to the greaves (only) or the (unarmored) upper arms are not protected.
4) Once the dwarves fall over, all hits penetrate.
I did not run a computerized analysis of the file - I just looked at it by eye, so it's quite possible I missed something.  However, the above all occurred many times each.

Assuming that armor covering the head, upper and lower body, hands, lower arms, and feet is "thick" (total 57.5% coverage) does explain the result.  However, I am completely at a loss as to why the gauntlets and low boots are acting like thicker armor, as they have LAYER_SIZE:15, the same as greaves (which are penetrated).  I am using vanilla raws for all armor, and bolt contact area 10.  I also don't know why the breastplate covers the lower body, but I probably just don't understand all the armor tags for that.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on December 03, 2012, 04:44:40 pm
...
Assuming that armor covering the head, upper and lower body, hands, lower arms, and feet is "thick" (total 57.5% coverage) does explain the result.  However, I am completely at a loss as to why the gauntlets and low boots are acting like thicker armor, as they have LAYER_SIZE:15, the same as greaves (which are penetrated).  I am using vanilla raws for all armor, and bolt contact area 10.  I also don't know why the breastplate covers the lower body, but I probably just don't understand all the armor tags for that.

The hands and feet have a smaller size and smaller natural contact area than the legs or torso?

Average dwarf hand has a contact area of 19, so perhaps you get different results if you hit more than 50% or 25% of the hand at once? 10/19=0.526. With contact area 2 bolts, this "wierdness" would only apply to the rare finger/toe hits. I do vaguely recall seeing bolts glance off fingers and eyes in our earlier tests. I haven't kept any of the combat logs.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on December 06, 2012, 10:31:19 pm
I have created a little mod (http://dffd.wimbli.com/file.php?id=7202) based on our research here.  It decreases the density of bolts to be 600 (equal to wood).  It also decreases [SHOOT_MAXVEL] to 833, for a momentum of 75.  This should deflect most of the time off of steel and addy, about 30% of the time off iron, and hardly at all off other metals.  It should also do about the same amount of damage to unarmored/less than iron armored targets as vanilla bolts.

I did this by creating custom metals with the density=600, and removing [ITEM_AMMO] from all normal metals and adding it to the custom metals (except steel and adamantine, as when I did this humans were showing up with steel ammo).  I then also added custom reactions to make light metal bolts from normal metal bars for dwarves.  I had to add these reactions to the craftsdwarf's workshop, as I don't know how to add them in the forge (or if that is even possible) - the wiki doesn't list the forge as a valid building for custom reactions.  Also, there are reactions which seem to be automatically generated at the forge for the light metals which have the [ITEM_AMMO] tag, but these don't work as you can't get bars of the light metal.  If anyone knows how to fix these things I can update it.  I also at one point saw light silver metal armor showing up in adventure mode, but I am pretty sure I fixed that.  If you see anything that is "metal tipped" other than bolts lying around, please let me know.

I'd very much appreciate any feedback anyone has about this in either adventure mode or dwarf mode.  I've tested it out a bit myself, but mostly just running around to make sure all the bolts/arrows are showing up where they should be, and not so much actual combat (although I did kill one kobald with light bolts).  I'll try to also run a large scale arena test of these bolts in the next few days.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on December 09, 2012, 11:20:27 pm
I did a bunch of testing of the modded bolts over the weekend, and compiled the results into a spreadsheet which I added to the zip file containing the mod itself (http://dffd.wimbli.com/file.php?id=7202).  Bottom line - it works really well, actually better than I had expected.  It seems that bolts will never penetrate helms if (1) the target is still standing (2) the armor material is equal or better than the bolt, and not bronze.  Bronze helms only block bolts 50% of the time.  If the target falls over, then the helm can be penetrated.  This means no instead death from random kobold archers in adventure mode if you are wearing a good helm and standing.

I tried playing adventure mode quite a bit with this mod, and it was a lot of fun.  I created a demigod char, and with a full set of iron armor he was able to do extremely well if I used good tactics (such as killing archers first, avoiding their line-of-sight, taking on enemies one at a time).  I was even able to take down a overlord bandit camp (with 6 archers, about 8 melee bandits) without sneaking or using other exploits.  However, I also saved my game before attacking this camp, and when I tried just rushing in and attacking the melee guys first, one of them knocked me over and then the archers instantly turned me into a pincushion.  Note that, while I was standing, I only actually got hit by arrows a few times - most of the time I dodged/blocked them, but the 2-3 hits on me were deflected (probably somewhat lucky there, as deflection off iron should be <50%).

Anyway, I think this set of values is pretty nice, but I'd really appreciate other opinions.  If anything I think the arrows might be a little too weak against armor right now, but I'm not sure.  I may play around with slightly increasing bolt velocity and run some more tests.  Also, this might make fort mode too easy - dwarves in steel will be almost invulnerable to archers, while their steel arrows will go right through any lesser armor.  Then again, if you are able to make enough steel to fully arm and armor your military, then maybe you should be able to easily maul a few gobbos with inferior weapons and armor.  If you feel differently, you can easily turn up bolt velocity to whatever level of deadliness you think is appropriate (and please tell me how it works  ;)).
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on December 12, 2012, 09:16:16 am
I added a bug report for the bolt velocity calculation (#6262 (http://www.bay12games.com/dwarves/mantisbt/view.php?id=6262)).  I think I included all the important details, but please add comments/corrections if I left something out.

I also found that (now everyone try to act surprised  :P) that there is at least one more layer of detail to bolt deflection that we don't understand.  In particular:
1) Deflection of bolts off human targets occurs slightly more often than off arena dwarves.  With iron armor, bolt mass 0.09, velocity 833, I found 42% deflection off humans and only 34% deflection off arena dwarves.  This could possibly be due to the lack of pain etc for arena dwarves, so I need to repeat the test with regular dwarves as well.  However, I think it is due to size because
2) The size of body parts clearly plays some role in deflection.  As described above, deflections occur more often than expected off hands/feet, and I have now also found that helms made of copper will deflect 100% of the time using the same mass=0.09 velocity=833 (copper) bolts.  I will try to tabulate results vs. various body parts and post here.  Does anyone know how to calculate the size of body parts?  I thought Urist posted it somewhere, but I'm not finding it.

That being said, I am unsure if I want to continue to pursue projectile research now, as I have spend an inordinate amount of time on this already.

Edit:
I forgot to mention that I've confirmed that in adventure mode all races seem to use the modified ammo materials (http://dffd.wimbli.com/file.php?id=7202) I created without any issue.  At least, humans, goblins, and dwarves do.  Elves still use normal wooden bolts, which depending on the type of wood may be more or less dense than the modded bolts.  Wood will be deflected by all metal armors except adamantine due to its low IMPACT_YIELD causing the projectile to absorb the force of the blow, so this probably isn't a major issue.  Also, I did nothing about bone bolts, but they have density 500 and therefore should be somewhat less effective than the modded bolts. 

I'll repeat once again that if anyone else would like to work on this project, now or in the future, I will be more than happy to provide you with all my scripts, etc, and help you with getting them to run for you.  I hope to get most of them packaged up in some reasonable way in the next few weeks, but I'm having a hard time figuring out what I should include.  However, if someone tells me "I want to test X", I can probably provide them with a good start towards doing that.

Update #2:  I ran a test of my modded bolts vs. normal dwarves, and bolts only had a ~30% chance of deflecting off iron armor.  So there definitely is some kind of size issue.  The thing is, humans are larger than dwarves, and the data we had so far suggested that deflection is more likely off smaller body parts, so I have no idea what this is about.  Maybe humans have a larger percentage of their body in the torso and head (areas covered by thicker armor), and this skews the results?  I have no idea.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: MaximumZero on December 15, 2012, 02:59:38 am
I am utterly nonplussed, PirateBob. The work you do is amazing, and should seriously go in a scientific journal. Maybe you should submit it to MoMA as part of the DF exhibit?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on December 15, 2012, 11:04:39 am
I am utterly nonplussed, PirateBob. The work you do is amazing, and should seriously go in a scientific journal. Maybe you should submit it to MoMA as part of the DF exhibit?

That would only serve to confuse the general public (they would think Toady doesn't understand how his own program works) and draw undue attention to DF's violence. We would prefer that the spotlight stay on Toady, and not on the DF community. It would also never practically happen.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on December 15, 2012, 11:39:22 am
I am utterly nonplussed, PirateBob. The work you do is amazing, and should seriously go in a scientific journal. Maybe you should submit it to MoMA as part of the DF exhibit?

That would only serve to confuse the general public (they would think Toady doesn't understand how his own program works) and draw undue attention to DF's violence. We would prefer that the spotlight stay on Toady, and not on the DF community. It would also never practically happen.
I agree with Urist completely.  While I greatly appreciate the compliment, it is merely a testament to how detailed Dwarf Fortress is that it takes this level of analysis to understand the mechanics. 

It's my hope that our results can be used by modders to balance projectiles to their liking.  I can say that I've playtested my personal set of modifications quite a bit, and it was extremely satisfying to have my demigod adventurer in a full set of iron armor survive a few battles with bandit archers, and then die to a rather beefy night creature. 

Edit:  I also added a note about our results to #5516 (http://www.bay12games.com/dwarves/mantisbt/view.php?id=5516).  I'm not sure if Toady will want to change the way projectiles work or not, but this should at least provide provide people who are unhappy with the current system with some options for modding.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Archetype on December 17, 2012, 07:35:25 pm
Hi Pirate Bob,

edit: nevermind, I was comparing the changes and didn't notice the extra files! Sorry :)

Thanks for the detailed analysis on this issue. I've looked at the fix you've posted on DFFD, however, I don't see the reactions. Are those in a separate file that's not in the zip file.

I would like to try out your fix in my games, thanks!
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: ORCACommander on February 17, 2013, 02:47:30 pm
Zivilin I hate to bump your topic but i have found a way for you test bolt quality and crossbow quality. You will need to install df hack (https://github.com/peterix/dfhack/) as your first step. next you will need to create your dwarves with their mundane items. next view the dwarves so that their inventory screen is up uses the up and down arrows to cycle through their gear. in the df hack command prompt put in changeitem q 5 where 5 = masterwork.

While this will completely change a stack of bolts to the same quality unfortunately it must be done manually for every item since it relies on the item being selected in the gui
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on February 18, 2013, 10:11:21 pm
Zivilin I hate to bump your topic but i have found a way for you test bolt quality and crossbow quality. You will need to install df hack (https://github.com/peterix/dfhack/) as your first step. next you will need to create your dwarves with their mundane items. next view the dwarves so that their inventory screen is up uses the up and down arrows to cycle through their gear. in the df hack command prompt put in changeitem q 5 where 5 = masterwork.

While this will completely change a stack of bolts to the same quality unfortunately it must be done manually for every item since it relies on the item being selected in the gui
Thanks for the suggestion - we actually have already done this (Urist da Vinci of course also thought of the same thing you suggested), and I managed to even figure out how to automate it.  I found no impact at all of bolt quality on damage done.  I believe that I posted these results somewhere in the thread, but the thread has gotten quite long...
I probably should investigate this in more depth at some point, but it's a lot of work and I've been busy.  If you are interested in doing any investigations yourself I'd be happy to provide you with scripts and/or advice.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: crossmr on June 07, 2013, 06:35:01 am
Did you take into account skilled weapon uses who can swat bolts out of the air?
I had a miner who was being chased by a squad of goblin archers who deflected 100% of the arrows with his pick.

I've also had small groups of 3 legendary fighters wade into 1 or 2 groups of goblin archers (Sometimes with an elite goblin archer) and just decimate both groups with no injuries at all. Combat logs showed the shield and or weapon deflections to be absolute. Crossbows are meant to be point and click. It makes sense that an archer might have an advantage over someone of equal skill. or even slightly greater skill.
But a truly skilled warrior can survive closing and then obliterate them.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: CognitiveDissonance on June 07, 2013, 11:08:16 am
Did you take into account skilled weapon uses who can swat bolts out of the air?
I had a miner who was being chased by a squad of goblin archers who deflected 100% of the arrows with his pick.

I've also had small groups of 3 legendary fighters wade into 1 or 2 groups of goblin archers (Sometimes with an elite goblin archer) and just decimate both groups with no injuries at all. Combat logs showed the shield and or weapon deflections to be absolute. Crossbows are meant to be point and click. It makes sense that an archer might have an advantage over someone of equal skill. or even slightly greater skill.
But a truly skilled warrior can survive closing and then obliterate them.

Spoiler (click to show/hide)

Skill will always overcome lack of skill. That's the point of shields, and training up your soldiers. Also why danger rooms are so popular, and so effective.
Skill can and should be overcome with numbers. You can only swat so many bolts...

See: Pincushion
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: crossmr on June 07, 2013, 12:06:54 pm
Quote
Skill will always overcome lack of skill. That's the point of shields, and training up your soldiers. Also why danger rooms are so popular, and so effective.
Skill can and should be overcome with numbers. You can only swat so many bolts...
People link this thread in their signatures..someone is bound to reply to it.

My point was, there was some complaint that bolts are "overpowered" because of how easily they can obliterate someone. I guess my point was that against someone unskilled, that should be the case. An unskilled marksdwarf will hit less often, but when he hits, if the target is unskilled, then we expect him to get maimed.
It's the nature of bolts.

We need to consider that a skilled warrior can duck, dodge, weave, block, deflect, and the armor will indeed catch the odd one, but if he actually gets caught, and it's a genuine hit, he should probably suffer for it. I just think that needs to be worked into how overpowered some people feel bolts are.

Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Mr S on June 07, 2013, 01:51:40 pm
The overpowered nature of Crossbow bolts isn't often argued as their ability to hit or be dodged.  What is most frequently argued regarding Crossbow bolts is that they strike with energy roughly equivalent to a planet-like object large enough to maintain its own atmosphere rapidly approaching the event horizon of a gravitational singularity.  Their mass is too high, they leave the crossbow at a constant velocity(energy? impulse?) regrdless of mass/density and a small handful of other physics "assumptions" are made in their calculations which could be handled more cleanly.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on June 07, 2013, 07:42:06 pm
The point of this thread is really not to argue that crossbow bolts are overpowered or not, it is merely to study the effect of armor at stopping bolts.  It was actually somewhat a surprise (at least to me) that the answer is that armor does absolutely nothing against metal bolts.

In my personal opinion, vanilla crossbows are relatively well balanced in fort mode, as on average the fact that armor does nothing is balanced out by shields/dodging being super effective against them.  I played a fort through to see what impact my suggested mods of more realistc bolt masses/energies were, and found that they had almost no impact at all because my (uber skilled) dwarves almost never got hit by bolts.  Furthermore, the amount of damage done by the less massive bolts did not decrease noticeably.  My marksdwarves were still extremely effective against goblins, even though their shots were occasionally deflected by armor.  Overall, the amount of deflections you'd expect realistic armor to produce is low enough that it simply isn't noticeable in fort mode.

That being said, it is VERY noticeable in adventure mode.  Things don't "average out" when players realize this is the tenth time they got shot in the head by a copper bolt, and their iron helm did nothing...again.  Also, in adventure mode archers tend to make a lot of shots "from behind" and such, so dodging/shields and such are less effective.

Bottom line - I think crossbow bolts can be relatively simply modded to allow them to work very well both in fort mode and adventure mode.  For the quick and dirty way, try setting [SHOOT_MAXVEL:833] in [ITEM_WEAPON:ITEM_WEAPON_CROSSBOW] and [ITEM_WEAPON:ITEM_WEAPON_BOW], and [SIZE:11] for [ITEM_AMMO:ITEM_AMMO_BOLTS] and [ITEM_AMMO:ITEM_AMMO_ARROWS] (I also posted a mod somewhere in this thread that uses custom materials to give all bolts the same mass, but this kind of makes a mess in fort mode).  If you can see any difference in fort mode, I'd really like to know about it, and you will almost certainly notice a difference in adventure mode.  In particular, for reasons I don't quite understand, helms seem to be made particularly effective, so this change should drastically reduce the number of one-shot deaths from archers.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Volfgarix on July 21, 2013, 11:08:06 am
(Realized that I posted stupid things, so I deleted this)
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on July 24, 2013, 08:35:22 pm
(Realized that I posted stupid things, so I deleted this)
I really wouldn't have called anything you posted "stupid".  This thread has become a massive sprawling 18 page mess, and which I can barely understand even though I wrote much of it.  I was meaning to address some of your questions and comments, but I can't remember what they were.  I did think your animal testing results were interesting.

One thing I can do is direct you to the material science (http://dwarffortresswiki.org/index.php/Material_science) page on the wiki, which has our best attempt to summarize the results so far.  I am hoping to do some more testing to work out some of the open questions with projectiles (effects of creature/body part size, overlapping armor layers, details of protection falloff with increasing momentum, probably many others), and if I do I might start a new thread (linked here) to discuss the results.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Volfgarix on August 10, 2013, 03:02:18 pm
(Realized that I posted stupid things, so I deleted this)
I really wouldn't have called anything you posted "stupid".  This thread has become a massive sprawling 18 page mess, and which I can barely understand even though I wrote much of it.  I was meaning to address some of your questions and comments, but I can't remember what they were.  I did think your animal testing results were interesting.

One thing I can do is direct you to the material science (http://dwarffortresswiki.org/index.php/Material_science) page on the wiki, which has our best attempt to summarize the results so far.  I am hoping to do some more testing to work out some of the open questions with projectiles (effects of creature/body part size, overlapping armor layers, details of protection falloff with increasing momentum, probably many others), and if I do I might start a new thread (linked here) to discuss the results.

Oh well, thanks, I thought that experiments like mine were did anyway, so I thought I didn't show nothing new.
So as I remember I said about your mod:
-Silver, copper are fine against unarmored targets, mostly bounced off metal armors. Probably damaged addy claded targets, but I don't remember.
-Adamantine bolts are bullshit even against unarmored targets (5-6 marksdwarves killed by elephant and alligator)
-Iron, steel works good if I did remember good..
-Wood bolts are weak as intended, but probably still better than addy ones.

I said then that the problem is wrong, hardcoded momentum calculation, which, as I did read, makes all bolts flying with that same speed, so silver bolts will have more momentum that the steel ones.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Hague on September 08, 2013, 05:13:01 pm
Sorry for thread necro, but has anyone attempted comparisons of cloth values. For instance, I know silk has incredible resistance to penetration. Has anyone tested whether candy thread clothes provide protection against bolts?

EDIT: Reading up on tags, the [STRUCTURAL_ELASTICITY_CHAIN_ALL] tag makes it so chain armor will blunt edged damage.

Also, [STRUCTURAL_ELASTICITY_WOVEN_THREAD] adds caps that prevent cloth armor from being too effective against edged weapons.

Has anyone tried reducing the SIZE value of crossbow bolts? They are currently 150, what if that were a quarter what it is now? Would that make bruising less prevalent and penetration more common?
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Pirate Bob on September 20, 2013, 10:15:16 pm
Sorry for thread necro, but has anyone attempted comparisons of cloth values. For instance, I know silk has incredible resistance to penetration. Has anyone tested whether candy thread clothes provide protection against bolts?

EDIT: Reading up on tags, the [STRUCTURAL_ELASTICITY_CHAIN_ALL] tag makes it so chain armor will blunt edged damage.

Also, [STRUCTURAL_ELASTICITY_WOVEN_THREAD] adds caps that prevent cloth armor from being too effective against edged weapons.

Has anyone tried reducing the SIZE value of crossbow bolts? They are currently 150, what if that were a quarter what it is now? Would that make bruising less prevalent and penetration more common?
The mass of crossbow bolts is linearly proportional to the SIZE value, and mass is very important for penetration and damage.  It's in this thread, but the thread has gotten to be 18 pages long it's somewhat hard to find.  You can find a decent summary on the Material Science (http://dwarffortresswiki.org/index.php/Material_science) page of the wiki.  Feel free to ask if you have any questions.

I have not tried anything with cloth armor, and I don't think anyone else has done much if anything.  I doubt it would do much against standard bolts, since adamantium plate does nothing, but it would be interesting to see if low momentum bolts could be stopped by cloth at some point.  I'll keep it in mind if I ever have time to do more testing, which sadly won't be any time soon.  If anyone else wants to try I'd be more than happy to help though.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Urist Da Vinci on September 21, 2013, 11:56:14 am
Sorry for thread necro, but has anyone attempted comparisons of cloth values. For instance, I know silk has incredible resistance to penetration. Has anyone tested whether candy thread clothes provide protection against bolts?

EDIT: Reading up on tags, the [STRUCTURAL_ELASTICITY_CHAIN_ALL] tag makes it so chain armor will blunt edged damage.

Also, [STRUCTURAL_ELASTICITY_WOVEN_THREAD] adds caps that prevent cloth armor from being too effective against edged weapons.

Has anyone tried reducing the SIZE value of crossbow bolts? They are currently 150, what if that were a quarter what it is now? Would that make bruising less prevalent and penetration more common?
The mass of crossbow bolts is linearly proportional to the SIZE value, and mass is very important for penetration and damage.  It's in this thread, but the thread has gotten to be 18 pages long it's somewhat hard to find.  You can find a decent summary on the Material Science (http://dwarffortresswiki.org/index.php/Material_science) page of the wiki.  Feel free to ask if you have any questions.

I have not tried anything with cloth armor, and I don't think anyone else has done much if anything.  I doubt it would do much against standard bolts, since adamantium plate does nothing, but it would be interesting to see if low momentum bolts could be stopped by cloth at some point.  I'll keep it in mind if I ever have time to do more testing, which sadly won't be any time soon.  If anyone else wants to try I'd be more than happy to help though.

I added the notes in the wiki about the [STRUCTURAL_ELASTICITY_*] tokens. All of them set the *_STRAIN_AT_YIELD properties of the armor to 50000 if not already higher, making the armor as flexible as skin. Also, [STRUCTURAL_ELASTICITY_WOVEN_THREAD] caps SHEAR_YIELD at 20000 and SHEAR_FRACTURE at 30000. This means that silk's strength is nerfed when used in flexible clothing rather than as (theoretical) solid silk plates.

If you didn't understand the above, know that clothing is almost useless against slashing/stabbing weapons, even adamantine clothing.

Prior to 0.31.06, silk clothing was overpowered. Toady fixed the issue and boosted the ability of animal bites/claws to penetrate clothing.
Title: Re: Dwarven Research: A Comparison Study on the Effectiveness of Bolts vs Armors
Post by: Sutremaine on September 21, 2013, 03:38:10 pm
That's a bit of a bugger, I modded procedurally-generated silk* to have the properties of copper while retaining the weight of silk. Good job I haven't tried to use it yet...

If I manually set the values of plant cloth, yarn, and other silk to those caps and removed the [STRUCTURAL_ELASTICITY_WOVEN_THREAD] token from clothing, would that strengthen the procedurally-generated silk while having no other effect?

*This always uses the material template ID'd as SILK_TEMPLATE. You can spice that one up a bit and create a new material template for the silk-producers in the raws.