I've always really disliked the huge sway in yaw for bubbletop P-47s when firing guns, as I've expressed hereabouts in the past. Here's a crack at restoring sanity.
The plane here is the P-47D, in which guns can be fired as 2 inboard pairs, 2 outboard pairs, or all 8 together. The sway seems to be independent of the number of guns fired, appearing to be of the same magnitude in all instances. Another reason to dislike the simple, global treatment, which is not based on actual gun number nor degree of de-syncing in their firing. Hence the vociferousness of my argument for a reduction in magnitude.
From the video description:
The current P-47s having bubbletop canopies without the additional dorsal vertical stabilizer extension are given what I consider to be excessive sway in yaw while guns are firing. When machine guns are firing at a rapid rate in a balanced arrangement (as in equal numbers on both wings) there is a net averaging of the recoil forces that manifests largely as vibration. Together with the weathercocking tendency of the plane at speed, there is no physical mechanism by which the plane should sway laterally up to the 2.5 or 3 degrees to each side (5 to 6 degrees in total!) that we are made to suffer in the game.
In the specific code block created for this one purpose for bubbletop P-47s, I have adjusted the magnitude of the induced gunfire input so as to significantly reduce the sway. It still impacts precise aiming when a burst exceeds about 0.5 to 1 second, but is not so egregious as to be frustrating.
In this short video I present two firing sequences. The first is with the cockpit visible, and I verify a resonable trim in yaw so that we know there is no additional force that could exacerbate lateral sway. All 8 guns are fired for several seconds. In the second part the cockpit is made invisible and I fire 4 guns (yields the same sway as for 8 guns) so that the impact pattern on the water is more fully seen, revealed as a sinusoidal zig-zagging.
The related code in P_47ModPack.class:
pTailSway = new Point3f(1.2F, 0.0F, 0.0F); //originally (4, 0, 0)
void bubbleTopTailSway()
{
float fGunFactor = !((FlightModelMain) (super.FM)).CT.WeaponControl[0] && !((FlightModelMain) (super.FM)).CT.WeaponControl[1] ? 1.0F : 2.0F; //1.0 is 0.5 cycle/s, 2 is 1 cycle/s
float fGunFactor2 = fGunFactor; //NEW
if(fGunFactor == 2F)
fGunFactor2 = 1.2F;
Vector3f theTailSway = new Vector3f(0.0F, (float)Math.sin((double)((float)Time.current() / 1000F) * 3.1415926535897931D * (double)fGunFactor), 0.0F);
// float fSwayFactor = (super.FM.getSpeed() * super.FM.getSpeed() * fGunFactor * fGunFactor) / 15F; //original, where fGunFactor is either 1 or 2
float fSwayFactor = (super.FM.getSpeed() * super.FM.getSpeed() * fGunFactor2 * fGunFactor2) / 15F; //NEW, where fGunFactor2 is either 1 or 1.2
theTailSway.scale(fSwayFactor);
Vector3f theTailSwayMomentum = new Vector3f();
theTailSwayMomentum.cross(pTailSway, theTailSway);
((FlightModelMain) (super.FM)).producedAM.z += ((Tuple3f) (theTailSwayMomentum)).z;
}