I&#039;ve taken some time to digest the ZDoom 1.23 code for weapon spread (and particularly SSG since it&#039;s the only weapon with a vertical spread pattern).<br /><br />The most basic difference stems from ZDoom using a different PRNG generator than what Odamex and vanilla Doom use. Although I have not done a distribution analysis of either PRNG generator, it would be interesting to see how both distributions compare if someone were to care to analyze them.<br /><br />In ZDoom 1.23, Randy changed the autoaiming code to return the pitch angle (angle the player has to tilt up or down to fire at the target) instead of the slope of the line from the player to the target. This necessitated him to also change the vertical spread calculation of the SSG to provide a random angle for each pellet rather than a random change to the line slope. <br /><br />With basic trig, [i]tan(pitch) = slope[/i]. So to use the same ZDoom spread code in Odamex, the ZDoom code<br />[code]<br />// increase the pitch angle by a random amount<br />pitch += (P_RandomDiff() &lt;&lt; 18);[/code]<br />becomes<br />[code]<br />// increase the slope by the tangent of the random amount from above<br />slope += finetangent[FINEANGLES/4 - (P_RandomDiff() &lt;&lt; 18) &gt;&gt; ANGLETOFINESHIFT)];[/code]<br /><br />This gives a similar vertical spread to the vanilla Doom spread code:<br />[code]slope += P_RandomDiff() &lt;&lt; 5;[/code]<br /><br />The net effect is that the ZDoomish code provides a spread that is inverted (pretty meaningless) and is about 80% as spread out vertically as the normal Odamex code.