Yup. I must admit that this shows how low my code-reading abilities are.
May I know what's causing my forward and strafe speed to double only when I press the forward key together with a strafe key?
Forward + Strafe Keys = Doubled Movement Speed
Re: Forward + Strafe Keys = Doubled Movement Speed
There's a condition missing, when you press forward you move at 1x, and when you press strafe you move at 1x sideways, which combined is 1.4x diagonally. A little func which decreases movement speed when you press two keys to move diagonally would solve that.
I forgot how to mod the original movement code, fixed it once but then dumped it for newer code someone made a sample for.
I forgot how to mod the original movement code, fixed it once but then dumped it for newer code someone made a sample for.
Re: Forward + Strafe Keys = Doubled Movement Speed
Exactly right, this is the situation:HWGuy wrote:There's a condition missing, when you press forward you move at 1x, and when you press strafe you move at 1x sideways, which combined is 1.4x diagonally.
The fix is simple: Just (re-)normalize, that is, scale back to unit length, the movement vector. As a result, all vectors will have length 1 and movement speed is the same in any direction.
Do you want to implement this yourself?
I can do it, too, but it's a nice exercise to get familiar with the code.
Iirc, it's the
WishVelocity
in HumanPlayer.cpp
that represents the vector in the above image. I also seem to remember that someone had the same question before, not long ago, but at the moment, I cannot find the related thread.In any case, if you want me to have another look at this, please let me know.
Best regards,
Carsten
Carsten
Who is online
Users browsing this forum: No registered users and 7 guests