Skip to content

Fix chunks not appearing until the player moved & Incorrect render distance - #86

Open
NotStirred wants to merge 8 commits into
OpenCubicChunks:devfrom
NotStirred:fix/render_distance
Open

NotStirred wants to merge 8 commits into
OpenCubicChunks:devfrom
NotStirred:fix/render_distance

Conversation

@NotStirred

Copy link
Copy Markdown
Member

Also in the diff is a dasm fix + a patch to add classloading (mixin/dasm) errors to the normal ./gradlew test log output, rather than it being buried in xml reports

Previously dasm log messages were buried, this commit places them in gradle
log output so they can be easily seen.
Vanilla's PlayerTicketTracker propagates levels out to ChunkMap.MAX_VIEW_DISTANCE (32) regardless of the actual view distance. In cubic worlds each step is a cube in 3D, so every player move between cubes recomputed levels for ~65^3 positions, which dominated server thread time.

In cubic worlds, shrink the tracker's range in place to the maximum view distance in cubes.
setServerViewDistance passed the view distance in chunks to updatePlayerTickets, which in cubic worlds is compared against cube distances, so cubes were ticketed out to twice the intended distance (~7x as many cubes). Convert it as cc_updateChunkTracking already does.
Vanilla skips propagating to neighbors when decreasing into the last two levels, since nothing can be propagated from them. The cubic override dropped this check.
Vanilla's player ticket throttler allows 4 positions in execution at once, each freed only once that position reaches entity ticking. Cubic worlds have far more positions in view, and each cube depends on a 3D neighborhood, so 4 slots left the server and worldgen threads mostly idle. Positions are still taken nearest-first.
The worldgen executor runs one task at a time, so generating terrain inline serialized all cube generation. Like vanilla's fillFromNoise, run it on the background executor, writing to acquired sections without per-block locking. Also compute the terrain height once per column rather than once per block.
@NotStirred

Copy link
Copy Markdown
Member Author

I didn't like the loading performance, unfortunately it wasn't one thing. Added a bunch of small changes to help performance, I can now fly at full spectator speed diagonally at 32 render distance and terrain is still visible in front a few chunks ahead.

Any commit should be droppable if needed

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