UFO:Alien Invasion
Development => Coding => Topic started by: Doctor J on May 10, 2008, 12:29:49 pm
-
The spread values given for firemodes in the .ufo files - are these in degrees, radians, 'gosh units' or what? I tried grepping the sources but didn't find anything like a useful comment, only it being used in G_ShootSingle().
-
They're multipliers to a gaussian random value that's generated in the code.
-
I think the gaussian spread is dimensionless and the spread values are in degrees.
http://ufoai.ninex.info/wiki/index.php/Damage_rate_vs_distance
angle = angles[YAW] * (M_PI * 2 / 360);
it converts from degrees to radians before calling cos and sin.
-
I think the gaussian spread is dimensionless and the spread values are in degrees.
That's what i was looking for, thanks!
-
What do the different formats in the weapons_xx.ufo for "spread" mean?
Most entries read e.g. "spread 1.0 1.0", but flamer has "spread 1.5 0.5", machinegun has "spread 3 20" for full auto sweep, and grenade launcher has "spread 0 1.5" for aimed single shot?!
-
From the wiki (http://ufoai.org/wiki/UFO-Scripts/weapon_*.ufo):
width of gaussian applied to attempted line of fire, in degrees (TODO: check it really is degrees). First element affects pitch, second element affects yaw. Lower values mean greater precision.
-
Oh, thanks, but let me rephrase ... why have those 3 given entries those "strange" values?
Is the "3 20" used to achieve the sweep effect?
Why do flamer and GL then have different deviations in vertical/horizontal direction?
-
Is the "3 20" used to achieve the sweep effect?
Why do flamer and GL then have different deviations in vertical/horizontal direction?
First number is pitch, second number is yaw. So yes, "3 20" will mean wildly inaccurate horizontally.