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

Use UpdateSubChunkBlocksPacket #4659

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AJ-Ferguson
Copy link
Member

Related to #4556

Performance is still not great, but this is a huge improvement over sending thousands of UpdateBlockPackets. Geyser should at least not consume all memory and crash now.

offset.getX() + 15, offset.getY() + 15, offset.getZ() + 15
);

int[] sectionBlocks = session.getGeyser().getWorldManager().getBlocksAt(session, blockIter);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will probably break between integrated and standalone world managers. Standalone will have the cache, Spigot will have the live blocks.

Temporary. Will need to find another fix :(
@valaphee
Copy link
Contributor

Btw. the reason no one really cared was because the Minecraft client calls the same method for both single block update and sub chunk block update. But yea there is definitely a packet overhead.

@AJ-Ferguson
Copy link
Member Author

I am aware. The packet overhead is huge especially when sending upwards of 10 million block updates which can easily happen on a 1.12 server. Unfortunately it seems like even if optimizations are made so Geyser can handle it, the bedrock client undergoes extreme lag while processing the block updates making it a poor experience.

@valaphee
Copy link
Contributor

valaphee commented May 15, 2024

In Java Edition the order of the block updates actually makes a huge difference. A majority of the lag are the light updates, but the only way to prevent light updates is to use sub chunks, even though I don't know which impact the update flags have.

You probably shouldn't use the neighbor flag (at least for full sub chunk or above a threshold), but the last time I experimented with those, they didn't had any impact. (maybe its possible to not trigger a light update?)

@AJ-Ferguson
Copy link
Member Author

I had a feeling it was something to do with light. Just tried changing/removing the flags, doesn't seem to make a difference :(
If there is some way to disable light updates that would be really nice

@onebeastchris onebeastchris added the PR: Bugfix When a PR contains a bugfix label May 20, 2024
@adalmo
Copy link

adalmo commented Jul 30, 2024

how can i use this with 1.21.2 support??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Bugfix When a PR contains a bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants