Pocketmine-mp: Movement buffering system causes various bugs on net lag spikes

Created on 18 Jul 2017  路  14Comments  路  Source: pmmp/PocketMine-MP

Issue description

When a player sprints and jumps at the same time continuously, the anti-cheat gets triggered.

Expected result: What were you expecting to happen? Sprint jump with no problems
Actual result: What actually happened? Lots of players being pulled to the ground after sprint jumping continuously

Steps to reproduce the issue

  1. Join the server
  2. Start sprint jumping continuously

OS and versions

  • PocketMine-MP: 4bd65b4
  • PHP: 7.0.3
  • Server OS: Linux
  • Game version: PE/Win10

Plugins

  • Test on a clean server without plugins: is the issue reproducible without any plugins loaded? Yes, it is.

Crashdump, backtrace or other files

  • N/A
Core Fixed

Most helpful comment

A bit late to mention this, since the shitty anti cheat is already dead, but the root cause of this has been identified.

In a nutshell, the problem is PM's buffered movement processing. This is already being eyed for removal because it causes performance issues with laggy players (O(xyz) complexity, or O(n^3), which means bigger movement distance exponentially increases complexity). However, in a nutshell what's happening is this:
image

The image leaves out some finer details, but I'm sure readers can figure out what I mean.

When a net lag spike happens, a bunch of movements may arrive all on the same tick. When this happens, only the latest one is processed. This means that a move down -> hit ground -> bounce up may not be noticed. I was able to reproduce this problem even on a local server with 12ms latency.

I'm going to reopen this since the core issue is still present, even though the anti-cheat is gone.

All 14 comments

That鈥檚 never happened to me

I鈥檝e had this issue on a few PM servers, but I haven鈥檛 had the issue on my servers unless I cancel PlayerIllegalMoveEvent

I cancelled it too

I use it too, but nonetheless it's still an issue.

So it's just jumping in general?

Update: Easier to reproduce when turning and sprint-jumping.

It's the anti-flight that causes this bug. When you're jumping like that, the client frequently doesn't send their on-ground position (it sends it a maximum of once per tick).

No, I'm aware of that, the question would be better rephrased as this: "So instead of it being sprinting and jumping, it's just jumping in general?"

@IrishPacks Set always-tick-players to true, or auto-tick-rate to false in pocketmine.yml, does the bug still occur? I'm only able to reproduce the issue when the level has a tick rate > 1.

That seems to have fixed it, hm, it'd make sense though.

The anti-flight responsible for this has been removed from the core for 3.4 (#2428). Not exactly fixed, but won't be an issue anymore, so... closing...

A bit late to mention this, since the shitty anti cheat is already dead, but the root cause of this has been identified.

In a nutshell, the problem is PM's buffered movement processing. This is already being eyed for removal because it causes performance issues with laggy players (O(xyz) complexity, or O(n^3), which means bigger movement distance exponentially increases complexity). However, in a nutshell what's happening is this:
image

The image leaves out some finer details, but I'm sure readers can figure out what I mean.

When a net lag spike happens, a bunch of movements may arrive all on the same tick. When this happens, only the latest one is processed. This means that a move down -> hit ground -> bounce up may not be noticed. I was able to reproduce this problem even on a local server with 12ms latency.

I'm going to reopen this since the core issue is still present, even though the anti-cheat is gone.

Readers might also be happy to know that getting rid of this system will also reduce the "moved too fast" bug for a standard client.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ox531 picture Ox531  路  3Comments

beetree picture beetree  路  3Comments

JoshuaACasey picture JoshuaACasey  路  3Comments

L3ice picture L3ice  路  3Comments

sergeysova picture sergeysova  路  3Comments