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 FE2CL_..._AROUND, _AROUND_DEL packets #295

Merged
merged 7 commits into from
Oct 29, 2024
Merged

Use FE2CL_..._AROUND, _AROUND_DEL packets #295

merged 7 commits into from
Oct 29, 2024

Conversation

yungcomputerchair
Copy link
Member

@yungcomputerchair yungcomputerchair commented Oct 27, 2024

Currently, when a player's visible chunks change, we send a single enter/exit packet for each entity in the vicinity.
This PR makes it so that we batch these entities in AROUND and AROUND_DEL packets (for enter and exit, respectively).

Since the packet buffer size is fixed, there is a maximum number of entities that we can send per packet. Thus we have to do dynamic batching, helped by a new Bucket utility class. To minimize the number of packets, I modified the buffer size for 728 and 1013 to match the client's increased buffer size.

Copy link
Member

@dongresource dongresource left a comment

Choose a reason for hiding this comment

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

Looks good. I really like how cleanly you implemented this. The main things to fix are the buffer size one-offs and the transportation-around-del gotcha.

I think we should let this one bake on the 104 server for a few days before pushing it to Academy and maybe before merging to the repo as well; just because it's such a core component.

src/Chunking.cpp Outdated Show resolved Hide resolved
src/Chunking.cpp Outdated Show resolved Hide resolved
src/Chunking.cpp Outdated Show resolved Hide resolved
src/Bucket.hpp Outdated Show resolved Hide resolved
src/Chunking.cpp Outdated Show resolved Hide resolved
src/Bucket.hpp Show resolved Hide resolved
src/Chunking.cpp Outdated Show resolved Hide resolved
src/Chunking.cpp Outdated Show resolved Hide resolved
src/Chunking.cpp Outdated Show resolved Hide resolved
src/Chunking.cpp Outdated Show resolved Hide resolved
yungcomputerchair and others added 7 commits October 28, 2024 20:40
Introduces a generic, fixed-size `Bucket` type in place of the inner
vector. This does add size generics but I think it's a very good
tradeoff considering how performance-sensitive this codepath is.
@yungcomputerchair yungcomputerchair merged commit ae327cc into master Oct 29, 2024
6 checks passed
@yungcomputerchair yungcomputerchair deleted the around branch November 17, 2024 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants