You may recall that I've added much new code for unguided rockets. Last night I refined the handling of the random initial flight path direction at the moment of launch. Here's an overview of all the unguided rocket handling, as it currently stands.
First, note that for each plane the hook orientation for the rockets determines their flight path relative to the plane's own flight path. For many planes this alignment is pretty close to the plane's longitudinal axis during typical flight speeds. For others, like the Wildcat, the aim direction is a bit downward. Additionally, as plane airspeed varies the velocity vector varies with respect to the longitudinal axis. The faster, more the nose pitches down, and hence the more upward the rocket flight path moves upward. My treatment does not do anything different here; a plane's own individual rail/tube orientation remains as before.
Formerly, the stock implementation of "realistic rocket spread" was very simple. For each group of rockets, such as the bunch mounted on rails on one wing, a random amount of aim error was imparted upon spawning of the aircraft. Think of this as the rails having got mounted incorrectly (which I do not like on principle because this treats each group as a solid unit, where all rails of the group move together; this is not necessarily the case.) Each group would receive its own aim offset, and all rockets of that group would fire off in the exact same direction. For instance, the left wing group might fire off low and to the left, and the right wing group might shoot off more or less straight but high. Every firing would end up being completely predictable, which the player could correct for if he remembered the offset to apply after the first missile or two were observed. OK if the rockets are salvo'd individually; if shot in pairs, one would have to correct for one, leaving the other to shoot off in a 'bad' direction. My main complaint was the lack of randomness for each and every individual rocket.
And so I implemented whole new code to deal with rockets. The player has full control via 4 conf.ini controls. Currently, I now bypass the difficulty control, "Realistic rocket spread"; whether enabled or not it has no effect at all. The 4 new controls allow an almost 'infinitely' greater degree control on of rocket spread, thus rendering the horribly simplistic stock scheme moot. Although I am looking at putting that difficulty setting back into use, perhaps as a simple switch to make all rockets shoot dead straight off their rails when selected as off.
1) The now more correct random aim error which replaces the former simplistic approach imparts a fully random aim offset for each and every rocket. While the code applies this as a velocity vector addition in meters/second on each of the 3 axes, for a plane speed of 100m/s (about 200kt) the value the player sets corresponds closely enough to the maximum offset possible in degrees. If, for instance, the value the player sets is 5, the largest flight path offset would be almost one ring diameter for a 100 mil gun sight reticle (5.7 degrees diameter). Most shots are rather less, with only a small percentage being that far off. But the key is now every rocket has an unpredictable initial flight direction. The player can set this from 0 to 15; I find 6 to work nicely.
My
change last night involved the application of plane speed at launch as a modifier. The idea being that at faster airspeed the initial aiming will be more accurate. I vary the random flight path offset inversely as the plane's speed; 2X faster results in 1/2 the error. Again, the value set by the player corresponds closely enough to the maximum offset in degrees for a plane speed of 200kt.
2) The old scheme of each group of rails having a random aim error is retained, but again is not currently dependent on the difficulty setting. Formerly a fixed upper limit of 3 (roughly, degrees) was used at all times, which could result in pretty awful offsets for a whole group of rockets. Now the player can set this from 0 to 3, allowing to have a subtler additional source of flight path offsets. Personally, I leave this at 0 when using only unguided rockets; the main individual randomness, combined with oscillation during flight, provides ample unpredictability!
Of course, for guided rockets this source of aim error can be useful.
3) Brand new is the enabling of oscillations in the flight path, to simulate the effects of turbulence, primarily. Again, this is for unguided rockets only. This feature has 2 player controls; one to enable/disable, and the other to set a desired intensity of oscillation. This is applied also as a vector component on the 3 axes, in meters/second. The player can set this from 0 to 30; I find 16 to work well. Perhaps I should combine the two controls, now that I think on it, using an oscillation value of 0 as the 'toggle off' control.
If anyone has any idea on how to implement the difficulty option, "Realistic rocket spread", I'm all ears. Should it be a global control, enabling/disabling ALL rocket features? That is, when this difficulty is set to off, all rockets would fly on the most perfectly true path possible. Or should it apply only to the two sources of initial flight path offset (rail group offset and individual randomness), leaving the turbulent oscillations as their own separate concern for the player to always control (by setting the conf.ini value to 0 in order to turn off)?