All four road tiers now carve into the 3D world. Rugged and Trail were generated, exported and parsed all along, but nothing ever consumed them — which is why county roads visible on the 2D map did not exist in 3D. Tier identity is now carried into the carve via a RoadSegment struct, so each tier gets its own width, shoulder and grade-smoothing from one tunable block in Constants: highways widest and holding a grade, trails narrow and hugging the land. Rugged and Trail surface as dirt rather than asphalt. Because tiers now have different reach, nearest-by-distance was no longer a sound way to pick the governing road — a nearby footpath could shadow a highway whose shoulder still covered the column. The carve now considers only roads whose shoulder actually reaches, and takes the closest of those. The per-chunk cull pad is derived from the widest shoulder plus a margin, so widening a road cannot silently truncate it at chunk edges. Untouched: density field, Marching Cubes interpolation/welding, chunk dims, the .dat contract, the 2D A* generation, and mesher normals. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| Scripts | ||
| README.md | ||
Client Module - IslaApocalypse
Phase 2 Status: Active (Mesh Rendering & Vertex Painting Online)
Overview
The Client directory handles the visual representation of the 3D Voxel Engine. It is strictly responsible for receiving pre-calculated mathematical data from the Server and Core modules and translating it into Godot-native visual nodes (MeshInstance3D). It does not calculate collisions, densities, or terrain generation.
Key Architecture & Components
1. The Visualizer (ChunkRenderer.cs)
A script attached to a MeshInstance3D node that physically draws a single 32x32 chunk of the world.
- Mesh Generation: Calls
MarchingCubes.GenerateMesh()from theCoremodule, passing in theDensitiesandBlockIDsscalar fields. - Vertex Painting: Dynamically creates a
StandardMaterial3Dand enablesVertexColorUseAsAlbedo = true. This tells Godot to ignore standard texture maps and instead color the mesh using the exact RGB values we assigned to the vertices based on theirBlockID(e.g., Green for Grass, Brown for Wasteland). - World Positioning: Multiplies the
ChunkPosition(e.g., [1, 0]) byConstants.CHUNK_SIZEandConstants.VOXEL_SCALE(1.0f) to perfectly align the chunk in the global 3D space. - Backface Rendering:
CullModeis explicitly disabled to ensure players don't see through the bottom of the map if they clip inside a mountain.
Next Immediate Steps (Phase 2, Step 4)
- Currently, the renderer draws the exact topography. Once the
Serverimplements Road Carving, theClientwill automatically inherit those flattened vertices and paint them with theASPHALTvertex color without needing any code changes here. - Future implementations will include reading
BlockIDsto paint different UV maps/textures instead of just raw RGB vertex colors.