Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Unexpected prediction with IN_WALK #2030
Normal movement keys work as expected: no movement. However, using the +walk key (flagged to IN_WALK and defaulted to left alt) causes crazy prediction issues and the player's camera springs forward and backward.
All buttons removed in CMoveData in a clientside SetupMove hook has no success.
I can't seem to reproduce this- Setting the speeds to 0 causes the player to move at the maximum allowed velocity of 10,000 (assuming sv_maxvelocity is set high enough). I can imagine this causing prediction faults with an internet server. Are you testing this in vanilla GMod? What happens when you try this in SP?
Right, I can confirm this now. First of all, this is only to do with WalkSpeed and IN_WALK; RunSpeed plays no part. Looking at the prediction errors, this is caused by the server expecting no movement at all, whilst the prediction system is expecting movement at the maximum allowed velocity. In other words, the server is treating the values correctly, but the prediction system is treating any WalkSpeed value <=0.25 as equivalent to zero.
As for the involvement of IN_WALK, I suspect that when walking is enabled, its override value of 100 is preventing the errors. Even when disabled, the IN_WALK input gets triggered, and therefore the prediction system thinks the player is walking. Since walking is actually disabled, the velocity is taken from the WalkSpeed value and hence there is a major disagreement.
A temporary workaround until this can be looked into is to use a safe value such as 1 for WalkSpeed.