Download

Reducing server position corrections/increasing error tolerance

I’m working on a multiplayer first person shooter with some advanced movement mechanics, players can run on/jump off of walls. This works great if I’m the listen server. It’s acceptable if I’m a client with no lag, but there are sometimes tiny hitches which would be hard to notice with a little camera shake/coverup.

My problem is that if I have 100 or so ping (net pktlag=100), when launching a character, there is a desync and the server will put the client where it is on the server, meaning there is one or more sizeable lurches whenever doing a wall jump. I have p.netshowcorrections set to 1 so we can see where the client and server disagree about position. This is with 100 ping.

This person had the same issue and I have already modified my code to do as Zak suggests, but I still have hitches which are too noticeable.

Here the top event is called when the client hits spacebar under certain circumstances, and the bottom one is called on the server. It takes time for the server to know that the client wanted to wall jump and so the server version of the character is behind the client version and the client keeps getting snapped into place.

I of course need to do the launch on the client so the game feels responsive, and the server of course won’t realize the character did a launch until several ms later, so I have a couple questions here.

  1. Is my implementation correct or should I be doing something else which would solve this issue on a basic level?

  2. If not, is there a good way to make the server a little more lenient on correcting positions? I read this post which talks about error tolerance, but I’m a bit confused what Zak means by game ini as there are quite a few ini files associated with the project, and after adding the suggested code to a lot of them I don’t see any change in game.

Which file am I touching? Do I need to rebuild my project or the engine or something after I do this? I’ve dealt pretty strictly with blueprints up to here so I apologize if this sounds like a dumb question.

  1. I probably shouldn’t use client authorative movement, because people could tell the server they’re floating in the air, for example and the server would believe them, right?

Let me know if you need any more information or have any ideas to help.

Did you ever manage to find a solution to this?