Commit Graph

51 Commits

Author SHA1 Message Date
db7b67f265 refactor(packet): replace zlib with zstd compression and restructure header
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.
2026-06-26 19:12:39 +08:00
7e42f595c9 build: add ZLIB dependency 2026-06-26 17:23:35 +08:00
d7d47e9e7f refactor(gameplay): split world into client and server
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.
2026-06-25 17:54:32 +08:00
2953e8a233 feat(protocol): add packet serialization and login handling
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.
2026-06-23 21:58:35 +08:00
678fc02998 refactor(proto): restructure protobuf definitions and update build system 2026-06-23 21:10:40 +08:00
4303c1cd32 feat(network): integrate protobuf for player sync and session management
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.
2026-06-23 20:08:40 +08:00
1acfeef9e6 feat(gameplay): add Session class and UUID generation utility 2026-06-23 15:54:01 +08:00
27e3cd6851 refactor(gameplay): split Chunk into server/client variants and add networking 2026-06-23 14:49:16 +08:00
7c07110afa build: add asio library 2026-06-23 10:42:13 +08:00
zhenyan121
f4114c2699 refactor: world generation (#17)
* refactor: use TBB for concurrent hash maps and parallelize chunk processing

* fix: tbb link fail

* refactor(chunk): remove biome check for caves in rivers and oceans

* refactor(random): replace std distributions with custom implementations

Avoid overhead and platform-dependent behavior of `<random>` distributions by using direct engine operations and integer arithmetic. This ensures deterministic, cross-platform results and improves performance.

* refactor(generation): use chunk seed for cave and river paths

- Use per-chunk seed instead of global path_id for cave and river generation.
- Remove unused m_sum variables and m_path_id members.
- Clamp river yaw within 10 degrees of initial direction.
- Fix river radius interpolation (use t instead of 1-t).
- Lower sea level from 64 to 63.
2026-06-14 11:36:37 +08:00
zhenyan121
932463663f feat: ocean (#16)
* feat(gameplay): add Ocean biome with water generation and heightmap adjustments

- Introduce Ocean biome enum, builder, and detection logic.
- Add ocean water building to all existing biomes and modify heightmap thresholds for low mountainous areas.
- Skip cave and river generation in Ocean (and River) biomes; avoid carving water blocks.
- Comment out border blending call and update block fill logic.

* fix(gameplay): re-enable border blending and protect water in cave gen

* refactor(generation): move ocean water build to later phase

* feat(block): add is_transitional property and refine border blending

* fix(block): set stone block as transitional

* fix(world): generate temporary chunks for surface blend neighbor data

* fix(gameplay): simplify block fill logic in blend_surface_blocks_borders

* refactor(tree): remove debug logging and unused include
2026-06-12 19:42:59 +08:00
zhenyan121
d0bc8d627f refactor: transparent render (#14)
* fix(renderer): defer uniform location retrieval and add view matrix in outline rendering

* refactor(gameplay): encapsulate per-type vertex data into VertexData struct

* feat(rendering): separate transparent blocks into discard and blend modes

* feat(renderer): implement order-independent transparency

* fix(shaders): reduce alpha discard threshold to 0.8
2026-06-11 12:21:19 +08:00
zhenyan121
5901ab7cd9 feat: grass (#11)
* feat: add grass texture and update grass_block texture

* feat: add block data

* feat: add blocks_tool

* feat: add sync info and change function in blocks_tools

* feat: add check and new function

* refactor: make block texture loading data-driven

* feat: add rendering for grass

* feat: passable grass

* feat: random grass place

* fix: memory leak in TextureManager::load_cross_plane_texture
2026-05-28 21:34:36 +08:00
zhenyan121
bbf8b4e969 refactor: river (#10)
* fix: correct snowy grass block texture

* refactor: river generation

* fix: water placement error due to interpolation

* perf: improve river naturalness

* feat: add river tab item

* fix: path truncation
2026-05-23 14:29:41 +08:00
zhenyan121
a54e87dbc6 refactor: terrain generation (#9)
* feat: add BlockType

* refactor: use fBM for heightmap generation

* feat: improve mountain realism

* refactor: adjust mountain spawn probability

* feat: add biome boundary blending

* refactor: remove resolve_biome_adjacency_conflict function

* feat: add snowy plain

* perf: speed up world generation

* refactor: lower overall terrain height
2026-05-23 10:33:52 +08:00
zhenyan121
1a26474a05 feat: add cave (#8)
* feat: add cave generate

* fix: incorrect blocks on cave surface

* fix: non-deterministic cave generator

* refactor: move all chunk generation to dedicated generation thread

* refactor: remove inital cave

* feat: add cave parameter adjustment

* refactor: adjust cave probability
2026-05-09 20:13:55 +08:00
zhenyan121
9d200f31be refactor: chunk interpolate (#6)
* refactor: rewrite blend_heightmap_boundaries

* refactor: init_world

* fix: unnatural biome boundary transition
2026-05-03 16:02:01 +08:00
zhenyan121
a02bfad639 refactor: biome build (#5)
* refactor: rename Biome to BiomeType

* feat: add biome builder
2026-05-02 13:40:46 +08:00
c5a78185ba feat: add ChunkGenerator 2026-04-26 14:10:09 +08:00
4ca2133ff3 feat: add DevPanel 2026-04-25 14:24:50 +08:00
106cc3d398 feat: add Config class 2026-04-24 17:08:06 +08:00
2409734e89 chore: add toml++ library 2026-04-24 10:21:26 +08:00
c2321a0a6e refactor: warp everything in Cubed namespace 2026-04-20 22:18:02 +08:00
de4df4b476 fix: data race in world::init_world() 2026-04-18 15:14:11 +08:00
11b6e88d0d feat: initialize world in multiple threads 2026-04-18 12:35:48 +08:00
bb888fd7b7 feat: add tree generation 2026-04-18 10:59:37 +08:00
63930dcdc7 refactor: separate biome declaration and definition 2026-04-18 09:20:51 +08:00
be176ff18a build: upgrade C++ standard to C++23 2026-04-17 18:07:47 +08:00
ecc1595a39 fix: can't load image 2026-04-16 13:00:19 +08:00
cd107fa35d feat: add DEBUG_MODE and ASSETS_PATH macro 2026-04-16 12:55:36 +08:00
1d04fedb0f feat: add DebugCollector 2026-04-16 11:55:25 +08:00
311c675852 feat: add text class 2026-04-16 10:44:05 +08:00
16ff954166 feat: async world generation 2026-04-14 09:24:10 +08:00
23affb78b5 feat: add perlin noise 2026-04-05 18:21:43 +08:00
2cfbd1a03b feat: add shader class 2026-03-29 11:15:18 +08:00
b1a5581131 fix: windows build fail 2026-03-28 17:09:50 +08:00
c37c45ad19 feat: add font class and render font function 2026-03-28 12:04:31 +08:00
772d606bbe fix: build failed on window 2026-03-21 12:10:51 +08:00
686aac8067 build: add windows platform support 2026-03-21 11:46:31 +08:00
3916a72ca3 refactor: introduce App class as program core 2026-03-20 22:46:34 +08:00
4d4bbe82ec feat: add frustum culling 2026-03-19 10:54:13 +08:00
8b1579b5fd feat: add block placement and destruction 2026-03-14 14:37:27 +08:00
f392a656a7 feat: add outline for block that is looked 2026-03-14 10:18:20 +08:00
27b51d1a6a fix: correct file name 2026-03-12 16:44:40 +08:00
e1ceca109f feat: add AddressSanitizer 2026-03-12 15:37:28 +08:00
668fa9a57d feat: add world class 2026-03-07 17:00:05 +08:00
eccd744f8b feat: add map table to save block index 2026-03-07 14:44:08 +08:00
2ad9deff3e feat: add TextureManager class 2026-03-07 11:46:36 +08:00
fc7f3e75b1 style: unify naming conventions across the project 2026-03-07 09:51:51 +08:00
05a62e7443 feat: add camera and player class 2026-03-06 22:07:26 +08:00