Geyser: Recalculating position too often

Created on 4 Oct 2019  路  25Comments  路  Source: GeyserMC/Geyser

Describe the bug
Geyser is trying to recalculate the position of the player while the player is joining and was flying before.
Seemingly it tries to get the player one block down at a time until he is at z: 64 and then up again to ground level.

To Reproduce
Steps to reproduce the behavior:

  1. Log in and fly a bit above the ground
  2. Log out
  3. Log in again
  4. Geyser CPU usage spikes to 100%, player gets teleported down slowly

Expected behavior
Instant teleported to ground, no teleport at all when player is in creative mode or flying.

Server version
1.14.4 Paper

Geyser version
Not yet

Bedrock version
The current version, 1.12 I guess?

Additional context
Maybe a config option to disable the movement check is enough, like the Java server has it.

Assistance Required Confirmed Bug More Info Needed

Most helpful comment

That is because we now wait for the client to be ready.
And I'll probably look into a fix for that

All 25 comments

Are you using Tim鈥檚 PR version or just the one off Jenkins?

The one off jenkins, gonna try Tims version now

Same Issue. And now chunks no longer load (but I have a working bossbar, so that is a plus :D)
Malfrador moved too quickly. current position: (-28.374714, 102.34002, 302.2285), new position: (0.0, 69.0, 0.0) Recalculating position...
~25+ times when joining

EDIT: Chunks do load after a while, just a lot slower than before

That is because we now wait for the client to be ready.
And I'll probably look into a fix for that

I pushed a new commit a few seconds ago, can you try if the moved too quickly is reduced now?

I pushed a new commit a few seconds ago, can you try if the moved too quickly is reduced now?

Sadly not, same issue still. Its sometimes even worse, up to 100 movement checks with Geyser freezing/crashing

Joining the server in spectator sometimes "fixes" it, but sometimes even in spectator mode the same thing happens.
I also now sometimes have the issue that I join the server via Geyser and then im stuck, can't move, open the chat or use the escape menu.

I tried using an 1.13.2 server + ViaVersion. This worked quite well and the movement checks were the only issue.

I then tried an 1.14.4 server to rule out any issues that might be caused by ViaVersion, which resulted in a Geyser CPU usage of 95% when joining and the Paper 1.14.4 minecraft server crashing as a result of this.
The high CPU usage seems to be a result of the movement checks, as it was showing this in the powershell console very slowly (like one line every 30s).

I think an option to disable this "feature" is probably best for now. The Minecraft server does movement checks on its own and kicks a player for invalid movement, so why do it on geyser again?

Log for 1.14.4. Notice how the 429 http error for the metrics ended up in the middle of the error message.

Okt 05, 2019 1:09:03 AM com.fasterxml.jackson.databind.ext.Java7Support <clinit>
WARNUNG: Unable to load JDK7 types (annotations, java.nio.file.Path): no Java7 support added
Remapping items...
Item remap complete!
Remapping blocks...
Block remap complete!
Started Geyser on 0.0.0.0:19132
Done (2,125s)! Run /help for help!
/192.168.2.81:49970 tried to connect!
Attempting to login using offline mode... authentication is disabled.
Player connected with username Malfrador
Malfrador (logged in as: Malfrador) has connected to remote java server on address 127.0.0.1
33
Malfrador moved too quickly. current position: (Okt 05, 2019 1:10:16 AM java.util.logging.LogManager$RootLogger log
WARNUNG: Could not submit stats of GeyserMC
java.io.IOException: Server returned HTTP response code: 429 for URL: https://bStats.org/submitData/server-implementation
-5      at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900)
2.9554  at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
67      at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
        at org.geysermc.connector.metrics.Metrics.sendData(Metrics.java:196)
        at org.geysermc.connector.metrics.Metrics.lambda$submitData$0(Metrics.java:155)
        at java.lang.Thread.run(Thread.java:748)

, 100.84002, 408.87668), new position: (0.0, 69.0, 0.0)
Recalculating position...
Malfrador moved too quickly. current position: (-52.955467, 100.84002, 408.87668), new position: (0.0, 69.0, 0.0)
Recalculating position...
PS C:\Users\***\Desktop\DRE_Test\Geyser>

I thought it had to do with the server (Spigot) whoops.
And are you sure you're using the latest commit of my pr? I really thought that would fix it.

I never had the 95% usage issue you described, that is definitely not intended.
I don't really know why we have the movement checks, but it I'm sure it saved a few anti-cheat bans.

I'm really sure that I had the correct PR.
I only tested 1.14.4 once (and only had this spike once) because it was really annoying with the high CPU usage. I might try it again and see if it's related to something else (flying, missing chunks etc)

I almost know for sure that it has to do with the 'waiting for client feature'

confirmed bug

Has it been fixed? I accidentally pushed something (around half an hour ago) that should probably fix it

I did 5 Logins. I logged in, walked a few blocks and logged out again. Then I repeated the process.
In 2/5 cases, the issue appeared again, but Geyser only did two movement checks instead of 50+. Definitely better. 3 of the logins worked without any movement check.

CPU usage is still extremely high when logging in.
There is also a random "65" appearing in the log when you log in, just after "has connected to remote java server..."

note to all devs, should probably make timings, for debug purposes

The 65 is normal. It is (ViaVersions) 64 radius + 1 :p
And I'm not sure what causes the CPU to spike

try running a profiler

Any profiler you could recommend? Im not a java dev :D

jprofiler, came up with a google search

@Malfrador any updates?

Still downloading, Slow german internet, will take a few minutes ^^

jprofiler_2019-10-09_22-05-40
Seems like converting Chunks is the big issue.

very useful!

I鈥檓 rewriting the remapper, which _should_ resolve this issue when complete.

Closing due to the new issue

See #58

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Laxliet picture Laxliet  路  5Comments

CreaZyp154 picture CreaZyp154  路  4Comments

TOWUK picture TOWUK  路  3Comments

Minecon724 picture Minecon724  路  12Comments

HeyDon-Lee picture HeyDon-Lee  路  11Comments