Vehicle MGs appear to rotate slower for other players than they really are

Issue #397 resolved
Matt Hands created an issue

For the player on the MG, it rotates instantly. For other players, it appears to rotate gradually. But this is totally misleading as the 'real' MG really does rotate instantly, so players can be killed by a gun that appears to be facing the wrong way.

This is a big problem, very much like the dreaded 'turret bug' of DH 5.0, where turrets wuld appear to be facing the other way, but shoot sideways.

Using the StuG/StuH remote MG as the best example, as it turns through 360 degrees, so this problem is most noticeable:

Player 1 is on the MG, with it facing at his 12 o' clock. Player 2 is an enemy at player 1's 6 o'clock. Player 1 becomes aware of player 2 behind him & swings the MG around quickly. Player 2 sees the MG swiveling pretty slowly, still nowhere near facing him, so he begins to load a bazooka. Player 2 finds himself dead, from an MG apparently facing the other way.

Comments (3)

  1. Matt Hands reporter

    Problem is caused because vehicle MGs are bInstantRotation weapons, meaning for the player on the MG they are not restricted by RotationsPerSecond or other limitations. But the comment next to bInstantRotation reads "//NOTE: Gradual rotation via RotationsPerSecond still used for non-owning net clients to smooth rotation changes". Sounds good but actually very bad in this case, as that's why other players see another, incorrect version of reality, i.e. slow MG rotation.

    Especially marked on the remote MG as it is set to only 0.05 RotationsPerSecond, so takes 5 seconds just to turn 90 degrees sideways. Needs to be higher.

    So, possible ways of solving this:

    1. Make MGs not bInstantRotation, so the 1st person rotation is the same speed as for other players and no longer instant. This starts promisingly, as you get a noticeable 'drag' feel as you try to haul the MG around quickly, which feels right. Until ..... the engine is registering your 'desired' rotation, so the MG keeps moving long after you stop moving the mouse, which feels plain wrong. Even worse, when you push the mouse too far one way, your desired yaw goes from positive to negative and the engine decides it would be quicker to turn the MG the other way ! Totally wrong. No solution here.

    2. Increase RotationsPerSecond to a high value, so other players see the MG move just as fast as its owner does. May or may not be realistic for something like the remote MG (it's just swivellng a submarine periscope-type arrangement, so probably very quick, although turning your body not so) - but it's certainly vastly better than the hideous 'turret bug' problem. I used this fix on modded StuG/StuH MGs and on the hetzer.

    3. What I hope is the best option - just thought of it today and testing it out now: intervene in UpdateRocketAcceleration() to limit the YawChange & PitchChange, based on RotationsPerSecond and DeltaTime. I'm thinking of a simple clamp on the YawChange & PitchChange that get passed intto CustomAim. That way, the owning player should get the same RotationsPerSecond turn speed as other players, so everyone sees the same thing and we can set the max rotation speed of MG as we wish.

  2. Matt Hands reporter

    Solution no.3 implemented in commit 4257fe5.

    Works really well, I think.

    Now the specified RotationsPerSecond are actually implemented in first person, some very inappropriate values (painfully slow turn) are revealed on some MGs. But will correct those separately.

  3. Matt Hands reporter

    Vehicle MG's RotationsPerSecond set in commit b96bcab.

    I think these values work well, but do shout up if you disagree.

    Standardised on 0.25 RPS for hull MGs and 0.5 RPS for externally mounted MGs (halftracks, Bren Carrier, Higgins, early StuG, Marder).

    Exception is remote MG on late StuG/StuH, which I have kept at a slower 0.25 RPS. To me, that feels about right, as you are twisting a persicope type MG around, not simply swinging an MG butt.

  4. Log in to comment