Thanks for finding the relevant code snippet, I didn't have that available of course, so:
secondaryImpact = proj->calculateTrajectory(std::max(0.0, (1.0 - spread / 100.0) * choke / 100.0));
I plugged this into Excel to do the calcs, and double checked with Windows Calculator on Scientific so we can correctly honour the brackets:If it's high Spread and High choke (lets say 50 and 120), it will be: ((1.0 - 50/100) * 120/100)= 0.6
if it's high spread and low choke (lets say 50 and 70), it will be ((1.0-50/100) * 70/100) = 0.35
if it's low spread and high choke (lets say 15 and 120), it will be ((1.0-15/100) * 120/100) = 1.02
If it's low spread and low choke (lets say 15 and 70), it will ((1.0-15/100) * 70/100) = 0.595
std::max is usually a function to pick the largest/maximum of two values in C++. CalculateTrajectory is using voxels to trace paths as we might expect. Earlier in the code, CalculateTrajectory is used to create the origin point of the shot using the units accuracy. std::max here is always going to return the calculated figure since it's greater than zero, but since we're referring to the old CalcTraj for the origin point, I'm guessing this is showing the maximum possible deviance between 0 (i.e. hitting the same place as before) and X (what is generated here).
This is assuming a fair bit and I'm quite an amateur coder so I could be horribly wrong.
Which means that higher final decimal is bad. Oddly enough, yes, that means the documentation is wrong, because going by these formulae, the best option is High Spread, Low Choke (lol). Although the fact that there is a comment of "// identical with vanilla formula when spread 100" implies that 100 spread is... well if not good then at least identical to the standard shot.
Alternatively, if I'm wrong in that assumption and 1 is the desired target rather than 0 (i.e. the closer to 1, the less trajectory deviance), then yes, Low spread is overwhelmingly the most important factor (to the point where Choke's effect is diminished in comparison). That does have it's problems too, since really low spread and high choke ends up values over 1.
- Alternatively Alternatively, if the original notes about these number affect rough % chance to hit to same place is correct and this is just a % chance to hit the same tile then yes, you're spot on, though this is also odd since this code looks like it's tracing trajectories and doesn't say anything about percentages.
Or you know, I could have just spent an hour wasting my time lol. Let me know if the devs get back to you! (and if the notes in documentation are wrong, shoot them for me as well since bad comments are the devil and any dev should know that)
Edit: Number 3 is correct! Thanks to the devs for confirming