Add new packet S2C_ClearAllChunks (ID 3005) to notify clients when the server rebuilds its world. Clients respond by clearing their chunk cache and requesting fresh chunks. Shift UPDATE_TIME packet ID to 3006 to accommodate.
Refactor `get_packet_id()` by removing the if-constexpr chain and instead
providing explicit specializations for each packet type. This simplifies the
primary template (which now only contains a static assertion) and improves
compile-time dispatch clarity. The `always_false` helper is no longer needed
in the primary template.
Switch to Arena allocation for protobuf messages to reduce heap allocations. Pass ChunkDataRsp by value to enable move semantics. Cap thread pool size to hardware concurrency with max 4 threads.
Increase header length to 12 bytes, add CompressType and PacketHeader struct, and implement decode_packet_header. Update CMake to find zstd and link against it, adding Findzstd module.
Add `update_player_chunk()` method to `ClientPlayer` that triggers a chunk request when the player moves more than 2 chunks away from the last recorded chunk. Introduce an atomic `m_requesting_chunk` flag in `ClientWorld` to prevent concurrent requests. Rename `m_player_chunk_pos` to `m_last_chunk_pos` for clarity.
Remove monolithic World, Player, Chunk classes. Introduce ClientWorld, ServerWorld, ClientPlayer, and related networked components. Add Abseil dependency for logging and checks. Rename old files to pre_remove_* and update all includes and references accordingly.
Restructure world generation to trigger chunk loading based on player
movement. Replace player name with UUID for identification. Implement
chunk request/response protocol. Improve thread management for gen
thread.
Introduce packet header and ID mapping for protobuf messages.
Refactor session and server_world to use new packet wrapper.
Fix missing semicolons in proto files.
Add Protobuf dependency, define proto messages for player requests, positions, and chunk data. Refactor Session to use strand and async write. Implement player join/exit and position sync in ServerWorld.
* refactor(gameplay): remove unused includes and members, clear vertex data after upload
* feat(shader-tools): add recursive #include support for shader sources
* refactor(shaders): extract noise and sky color functions into shared GLSL includes
* feat(gameplay): implement greedy meshing for chunk generation
Replace the per-face vertex generation with a greedy meshing algorithm that merges adjacent faces of the same block type into larger quads. Introduce `FaceKey` struct and helper functions (`axis_dir_to_face`, `get_block_safe`, `is_face_culled`, `choose_buf`) to support the new algorithm. Comment out the old `gen_vertices` implementation.
In texture management, rename `m_pbr_texture_array` to `m_normal_texture_array` to reflect its actual usage, and set texture wrap mode to `GL_REPEAT` for both the block and normal texture arrays.
* fix(primitive_data): correct back face texture coordinates and tangents
* fix(texture-manager): correct texture deletion and refactor reload
Make hot_reload private and add public need_reload method. Update UI to call need_reload instead of hot_reload. Fix incorrect use of glDeleteBuffers for normal texture array by using glDeleteTextures.
* refactor(chunk): add ChunkInfo and switch to shared_mutex for chunk access
Introduced ChunkInfo struct to expose chunk metadata (position, seed, biome). Replaced std::mutex with std::shared_mutex for chunk map to allow concurrent read access. Added World::get_chunk_info() method. Temporarily disabled cave/river cleanup and debug biome reporting.
* refactor(cave,river,chunk): use ChunkPos as key for paths and track cave existence
* refactor(gameplay): use deterministic origin-based cave and river generation
Compute cave and river paths on-the-fly per chunk from a deterministic origin instead of storing them globally. Remove concurrent hash map storage, shared mutexes, and related cleanup methods. This simplifies concurrency and reduces memory overhead.
* refactor(world): remove unused chunk generation progress tracking
* feat(renderer): add fog effect based on render distance
* refactor(gameplay): remove dead code and simplify chunk neighbor context
Remove the large commented-out `init_chunks()` function, and eliminate the `affected_neighbor` tracking in `gen_chunks_internal()`. This simplifies the neighbor context building and removes unused vertex data regeneration for affected neighbors.
* refactor(gameplay): move chunk generation phases into gen_chunk method
Consolidate multiple phase generation calls into a single gen_chunk() method on Chunk, which handles neighbor generation and ensures thread safety. Simplify World::gen_chunks_internal by using gen_chunk() instead of manual phase orchestration.
* fix(gameplay): use gen_phase_one to get seed
* feat(world): integrate thread pool and async chunk generation
* fix(renderer): correct shader uniform name and remove unused uniform
* feat(gameplay): add temporary chunk flag to prevent path clearing
* fix: add thread safety for cave and river path mutexes
* refactor: remove unused uniforms and set cameraPos uniform outside lambda
* feat(world): add dynamic thread pool resizing
* feat(world): add thread pool size management and UI controls
* feat(world): add ChunkLoadStyle enum and rename chunk_pos to get_chunk_pos
* feat(player): add configurable fly Y speed
* refactor(world): add thread pool start/stop and auto-detect threads
Extract thread pool starting and stopping into dedicated methods. Set default pool threads to 0 to enable automatic detection of available cores, and ensure thread pool is properly managed during world rebuild.
* fix: include shared_mutex header
* fix(gameplay): simplify set_chunk_load_style switch and fix fallthrough bug
* fix(world): add missing include for <utility>
* feat(shaders): add lighting to block accumulation OIT shaders
* feat(renderer): add water rendering with OIT and new shaders
* feat(water): implement screen-space reflection and refraction for water with depth fade and perturbation
* refactor(shader): replace glUniform calls with generic set_loc and remove cached locations
* feat(water): add noise-based caustics and configurable fog density
* fix(water shader): update depth fade and remove underwater check
- Increase DEPTH_FADE_DISTANCE from 8 to 10
- Remove conditional so depth fade always applies
- Darken deepColor from (0, 0.08, 0.15) to (0, 0.015, 0.045)
* feat(underwater): add volume scattering and shadow mapping for light shafts