Repository navigation
Reduce physics meshing allocations and make chunk streaming safe - #170
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Walking across chunk boundaries caused heavy collision-meshing allocations and exposed races between terrain loading, physics preparation, entity persistence, and eviction. This PR reduces preparation cost and makes those lifecycle transitions consistent.
Measured collision preparation for a generated 16×256 column, including outlines:
These are local microbenchmark results, not measured gameplay frame-time gains. Geometry comparisons matched 1,040 generated sections and 174,186 ordered vertices; native checks matched 8,685 fixtures, including both mirror offsets, and verified body replacement accounting.
Validation: 41 new regression tests cover meshing, stale async results, eviction/reload, entity persistence, fire scheduling, and native Box2D stepping.
./gradlew testCore desktop:classes html:buildJspassed: 136 core tests passed, with one existing test skipped. Affected modules also passedktlintCheck.Interactive walking/teleport playtesting and an in-game frame-time profile remain unverified. Synchronous collision completion can still add work to a frame when an actor reaches unfinished terrain.