Just some final research to wrap up the attack research I have been doing. This will reference Urist DaVinci's (UDV) work which can be found
here and
here. Note that his work and this work has all been done in DF 40.xx. I am unsure how much has changed with combat in 42.xx, but will be doing similar research to double check everything when I start using 42.xx.
1. The velocity UDV found is not the same as the velocity input into attack_velocity(unk_30). Instead it is some factor of that velocity, capped at the velocity. This is dependent on skill, strike ease, level of connection, and random factors. With, on average, greater skill, greater striking ease and greater level of connection resulting in higher velocities.
2. UDV didn't post any results for hit chance from his dissasembly reading, but from what I have found, all of the factors that influence the velocity are the same as those that influence attack_accuracy (unk_3c). Even the randomness found in the attack_velocity is the same randomness found in attack_accuracy. This means that whatever random roll is made is applied to both, instead of a different roll for each. The main difference between attack_velocity and attack_accuracy is attack_accuracy does not seem to be capped, instead increasing linearly with skill.
3. Type of attack and multipliers
velocity accuracy
normal x1 x1
quick x0.5 x1
heavy x1.5 x1
wild x1.5 x0.75
precise x1 x1.5
Ending Note:
The actual equation that determines attack_accuracy is still unknown, but suitable temporary value ranges can be found numerically. In the future I may attempt to find an actual equation like UDV has done for attack_velocity.
Next up for research:
With the inclusion of emotion changing syndromes I plan on using 42.xx to test the various numbers in unit.current_soul.personality.emotions and determine how they translate from the syndromes to the structures. In addition I hope to test the effects these emotions have on units. Possibly even seeing if the emotional state has any effect on combat (besides the extreme states where the unit "flees in terror" and such).