I'd vote for some extra care here.
First, we need to differentiate between gunPulse and gunMomentum.
The gunPulse is the pure force applied by firing a bullet.
On fixed guns it usually only has an x-axis component, i.e. firing a bullet slows down your aircraft.
Other components (y/z axis) come into play when the guns aren't mounted straight or when they can move around (gunner).
In either case, no turning momentum is applied to the aircraft from gunPulse, it's simply slowing the plane down in the case of the guns mentioned here (I-153 / Henschel).
I strongly recommend
not to tone down gunPulse as otherwise, you'd be starting to artificially create laser guns.
The gunMomentum in IL-2 has exactly two problems: Randomization and exaggeration for guns mounted close (<0.5m distance) to the centerline of the aircraft.
Other than that, the general idea and calculation is fine: You take the bullets mass, its speed and the dislocation from the aircraft centerline, and calculate a turning momentum from this.
IL-2 has surprisingly correct physics implemented here, but then there are the two factors mentioned above that kill everything.
It starts here:
if(World.cur().diffCur.Realistic_Gunnery && (((Aircraft)actor).FM instanceof RealFlightModel))
Fine. Only apply turning momentum to player aircraft and only if "realistic gunnery" is enabled. That's okay. AI cannot counter gun sway, and a player who doesn't want it can simply switch it off.
But this...
Loc loc2 = pos.getRel();
if(Math.abs(loc2.getPoint().y) < 0.5D)
...is bullshit already.
Why should the gun momentum be calculated any different depending on whether the gun in question is closer or further from the airplanes centerline than 0.5m?
Makes no sense at all.
The whole calculation thereafter is utterly irritating.
This...
double d1 = prop.bullet[i].massa * prop.bullet[i].speed;
v.x = World.Rnd().nextDouble(-20D, 20D) * d1;
v.y = World.Rnd().nextDouble(-100D, 200D) * d1;
v.z = World.Rnd().nextDouble(-200D, 200D) * d1;
v.scale(0.3D);
((RealFlightModel)((Aircraft)actor).FM).gunMomentum(v, false);
...exaggerates the gunMomentum on aircraft with guns mounted 0.5m off centerline or closer, by a factor of up to 6/30/60 in x/y/z direction.
Why - on - earth?
And this...
double d2 = prop.bullet[i].massa * (float)prop.bulletsCluster * prop.shotFreq;
v2.set(-1D, 0.0D, 0.0D);
loc2.transform(v2);
double d4 = 0.45D * Math.sqrt(Math.sqrt(prop.bullet[i].massa));
d4 = 64D * World.Rnd().nextDouble(1.0D - d4, 1.0D + d4);
v2.scale(d4 * v1.length() * d2);
v.cross(loc2.getPoint(), v2);
v.y *= 0.1D;
v.z *= 0.5D;
v.scale(0.3D);
((RealFlightModel)((Aircraft)actor).FM).gunMomentum(v, true);
...creates an absolutely weird tone down for small bullets and exaggerates the momentum of large bullets if the guns are mounted further than 0.5m off centerline.
All bullshit.
The whole block...
if(World.cur().diffCur.Realistic_Gunnery && (((Aircraft)actor).FM instanceof RealFlightModel))
{
Loc loc2 = pos.getRel();
if(Math.abs(loc2.getPoint().y) < 0.5D)
{
double d1 = prop.bullet[i].massa * prop.bullet[i].speed;
v.x = World.Rnd().nextDouble(-20D, 20D) * d1;
v.y = World.Rnd().nextDouble(-100D, 200D) * d1;
v.z = World.Rnd().nextDouble(-200D, 200D) * d1;
v.scale(0.3D);
((RealFlightModel)((Aircraft)actor).FM).gunMomentum(v, false);
} else
{
double d2 = prop.bullet[i].massa * (float)prop.bulletsCluster * prop.shotFreq;
v2.set(-1D, 0.0D, 0.0D);
loc2.transform(v2);
double d4 = 0.45D * Math.sqrt(Math.sqrt(prop.bullet[i].massa));
d4 = 64D * World.Rnd().nextDouble(1.0D - d4, 1.0D + d4);
v2.scale(d4 * v1.length() * d2);
v.cross(loc2.getPoint(), v2);
v.y *= 0.1D;
v.z *= 0.5D;
v.scale(0.3D);
((RealFlightModel)((Aircraft)actor).FM).gunMomentum(v, true);
}
}
...should instead be this:
if(World.cur().diffCur.Realistic_Gunnery && (((Aircraft)actor).FM instanceof RealFlightModel))
{
Loc loc2 = pos.getRel();
v.cross(loc2.getPoint(), v2);
((RealFlightModel)((Aircraft)actor).FM).gunMomentum(v, true);
}
Period.
That's physics.
And yes, it will eliminate most of the gun momentum we see in IL-2.
Why?
Because most gun installations are symmetrical left/right and only slightly off center in z direction, so as long as the guns fire synced (which they do in the beginning and on short bursts), there will be no noticeable gun momentum at all.
Only on asymmetrical installations, or in long bursts when the guns go our of sync, you'd have a chance to see noticeable gun momentum.
But hey, again, that's physics.
Apparently Oleg wasn't happy with it, for whatever reason (arcade?), but we can and should cure it.
Not by applying an artificial number, but by fixing the root cause.
The bubble-top P-47 without fin extension (for improved lateral stability) has its slower frequency, pendulum-like sway exerted in the FM (I presume)
No, it hasn't. It's done in code.
Mike