Catch players who move faster than allowed without punishing a laggy connection
If the server trusts the position a player reports, anyone can fly across the map. If it rejects every position that is too far, an honest player whose connection stalled for a moment gets thrown back. Here is a distance allowance that stops cheating yet forgives a short stall, and how to correct instead of reject.
Why this works
Speed is distance over time, and the server owns the clock. Giving each player a small allowance that fills at the top speed lets a short stall be made up, while hoarding or faking time is cut off by the limit on what can be stored.
When not to use it
Skip it when players are carried by things the game moves, such as a vehicle, a launcher or a fast lift: their speed is legitimate. There, count the extra motion in the allowance, or check against the path the game itself gave them.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 22 lines of example code with 3 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Catch players who move faster than allowed without punishing a laggy connection" (read_entry online-check-moves-with-a-distance-allowance) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP