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

new: add chunk sections counting oversized blocks and reduce number of blocks collision is checked against #84

Merged

Conversation

2No2Name
Copy link
Member

This PR adds oversized block counting to chunk sections and an performance improvement based on that information.
If a chunk section has no oversized blocks (larger than full cube / no shape cache) it won't be necessary to check all the blocks around an entity while moving, as all blocks are known to be at most 1 block big. Of course this is checked seperately for each chunk section around the entity.
This PR also improves the block collision sweeper to test all necessary blocks in one chunk section at a time, allowing it to not repeat the above oversized block count check and also allowing it to cache the Chunk and ChunkSection until moving to checking collisions in the next one.
For example with item entites there was a visible improvement: https://cdn.discordapp.com/attachments/648967810139029505/713070457196249088/Screenshot_at_2020-05-21_18-47-00.png

@2No2Name
Copy link
Member Author

2No2Name commented Jul 20, 2020

Skipping the iteration on some blocks may change entity movement by 1e-7 in rare edge cases. Also see #79

Edit: this does not seem to happen. Vanilla also does not return VoxelShapes that are not colliding with the box that we iterate on.

@2No2Name 2No2Name force-pushed the 1.16.x/pull/oversized_block_tracking branch from c1d09be to 00ebdef Compare August 1, 2020 20:53
@2No2Name 2No2Name merged commit ef72f48 into CaffeineMC:1.16.x/dev Aug 3, 2020
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.

1 participant