Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate tolerances of Player->checkGroundState() (more accurate onGround checks) #6547

Open
dktapps opened this issue Dec 1, 2024 · 1 comment
Labels
Category: Gameplay Related to Minecraft gameplay experience Performance Type: Enhancement Contributes features or other improvements to PocketMine-MP

Comments

@dktapps
Copy link
Member

dktapps commented Dec 1, 2024

Problem description

Currently, players who are as far as 0.2 blocks above the ground will be considered "on ground", as seen here:

$bb->minY = $this->location->y - 0.2;
$bb->maxY = $this->location->y + 0.2;

This was necessary in the days before PlayerAuthInputPacket as the movement updates were sent at a maximum rate of once per tick, meaning a jumping player could hit the ground and bounce back up again in between packets arriving on the server.

Proposed solution

It may be possible to reduce this tolerance in newer versions, which would fix issues like the one seen in #6500.
It depends whether or not the client consistently sends a movement update upon hitting the ground. This wasn't the case with MovePlayerPacket, but might work better with PlayerAuthInputPacket.

Alternative solutions that don't require API changes

@dktapps dktapps added Category: Gameplay Related to Minecraft gameplay experience Type: Enhancement Contributes features or other improvements to PocketMine-MP labels Dec 1, 2024
@dktapps
Copy link
Member Author

dktapps commented Jan 27, 2025

Looks like this is also a performance issue for servers with large numbers of players.

The current best solution appears to be to use the velocity from PlayerAuthInputPacket to do classic collision checks. (These checks are currently skipped as keepMovement is set to true for players - we just allow the player to move where it wants to.)
However it's a bit awkward since the PlayerAuthInputPacket reports the attempted velocity for the next tick instead of the current one.
In addition, bringing back AABB collision checks for players will probably degrade performance, so it's a trade-off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Gameplay Related to Minecraft gameplay experience Performance Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
Development

No branches or pull requests

1 participant