Currently, chunks are loaded in an ellipsoid around the player. This is wasteful: many of the requested chunks are empty or invisible. Instead, the player should not request these chunks.
The relevant code is in ru.windcorp.progressia.server.Player.requestChunksToLoad(Consumer<Vec3i>).
The solution entails three parts:
[ ] Make client and server agree on what block faces are opaque by moving opacity-related methods from interfaces in ChunkRenderOptimizerSurface into BlockData and TileData
[ ] Add similar opacity methods to entire chunks that determine whether chunk walls are entirely opaque
[ ] Change request algorithm to ignore chunks that are empty or hidden by opaque chunk walls
Although this is up for debate, a reasonable algorithm for step 3 may be
request 3x3x3 cube around player;
iterate chunks around player with flood-fill algorithm:
start at player location;
do not pass through opaque chunk walls;
do not go further than load-distance away from start;
if a chunk is not empty, request it.
Currently, chunks are loaded in an ellipsoid around the player. This is wasteful: many of the requested chunks are empty or invisible. Instead, the player should not request these chunks.
The relevant code is in
ru.windcorp.progressia.server.Player.requestChunksToLoad(Consumer<Vec3i>)
.The solution entails three parts:
ChunkRenderOptimizerSurface
intoBlockData
andTileData
Although this is up for debate, a reasonable algorithm for step 3 may be