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

Packet priority #401

Closed
Naamloos opened this issue Nov 15, 2023 · 6 comments
Closed

Packet priority #401

Naamloos opened this issue Nov 15, 2023 · 6 comments
Labels
enhancement New feature or request epic Very cool performance Performance related issue priority: medium Moderately important server Relates to the server implementation

Comments

@Naamloos
Copy link
Member

When loading the overworld, the server seems to be very slow sending other packets as the queue is filled with world packets.

This means that when a player's render distance is set to something high, other packets don't seem to arrive until chunks have completed loading.

My idea here is to add priorities to packets (in one way or another) to ensure e.g. chunk packets get sent last and chat packets get sent immediately.

This would in theory improve the end-user experience since this means other players and entities wouldn't freeze up until the world finished loading all requested chunks.

@Naamloos Naamloos added enhancement New feature or request epic Very cool server Relates to the server implementation performance Performance related issue priority: medium Moderately important labels Nov 15, 2023
@Naamloos
Copy link
Member Author

I had come to this conclusion simply by the fact the server seemed to perform better when the render distance is set to 2 chunks

@Tides
Copy link
Member

Tides commented Nov 15, 2023

I think this has to do with world generation blocking the main server loop, I haven't opened an issue for it but I think moving it out and adding it as a hosted service the problem should probably get better

@Jonpro03
Copy link
Member

At login, 7x7 chunks MUST be sent to the client before spawning the player (PlayerJoin). Failing to do so results in the client sitting at a loading screen until it times out and loads what it has.
This is also true of teleportation/dimension change, I think.
Will need a way to flag these chunks as highest priority, or otherwise wait until the client has all of the chunks it needs before spawning the player.

@Naamloos
Copy link
Member Author

Great point, perhaps priority would be defined when sending instead of globally?

@Tides
Copy link
Member

Tides commented Nov 28, 2023

This is added in #403 but before I close

I had come to this conclusion simply by the fact the server seemed to perform better when the render distance is set to 2 chunks

Has this gotten any better?

@Tides
Copy link
Member

Tides commented Dec 8, 2023

Gonna close this as this is implemented and from my testing seems to no longer be a problem ~

@Tides Tides closed this as completed Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request epic Very cool performance Performance related issue priority: medium Moderately important server Relates to the server implementation
Projects
None yet
Development

No branches or pull requests

3 participants