VIVIA โ Architecture
Source Layoutโ
Core/Src/
โโโ main.rs # Application loop, input, commands
โโโ gameplay.rs # Clock, stats, enemies, animals, quests, crafting
โโโ inventory.rs # Hotbar, inventory slots, stacking
โโโ crafting.rs # NVCrafter recipe system
โโโ quests.rs # Quest chain progression
โโโ commands.rs # Chat commands (/tp, /spawn, /time, etc.)
โโโ settings.rs # SharedSettings (render radius, etc.)
โโโ assets.rs # Asset loading
โโโ input.rs # Keyboard/mouse state
โโโ audio.rs # Procedural sound engine
โโโ spatial_audio.rs # 3D spatial audio (Source 2 pattern)
โโโ physics.rs # Collision, gravity
โโโ pathfinding.rs # A* pathfinding for mobs
โโโ memory_pool.rs # Allocation-free hot path
โโโ job_system.rs # Background task scheduler
โโโ npcs.rs # NPC dialogue system
โโโ egs.rs # Epic Online Services bridge
โโโ network/
โ โโโ mod.rs # Packet send/recv
โ โโโ protocol.rs # Packet definitions, validation
โ โโโ server.rs # Authoritative server
โ โโโ client.rs # Client with interpolation
โโโ renderer/
โ โโโ mod.rs # GPU pipeline, draw calls
โ โโโ camera.rs # First-person camera
โ โโโ texture_atlas.rs # Block texture atlas
โ โโโ geometry.rs # Procedural 3D primitives
โ โโโ glb.rs # GLB model loader (decimation, UV bake)
โ โโโ skeleton.rs # Joint hierarchy, inverse bind
โ โโโ skin.rs # glTF 2.0 animation engine
โ โโโ anim.rs # Procedural walk/idle animations
โ โโโ text.rs # Text rendering
โ โโโ instance.rs # Instance buffer management
โ โโโ *.wgsl # GPU shaders (sky, weather, animals, models)
โโโ world/
โโโ mod.rs # World state, block access
โ โโ block.rs # BlockType registry (147+ types)
โโโ chunk.rs # 16ร512ร16 chunk storage
โโโ generator.rs # OpenSimplex2 terrain generation
โโโ biomes.rs # 9 climate-driven biomes
โโโ vegetation.rs # Tree/plant placement
โโโ decorations.rs # Decorative elements
โโโ ai_generator.rs # MeMLP neural network
โโโ ai_feedback.rs # Player preference learning
โโโ memplp.rs # Modular MLP architecture
โโโ online_trainer.rs # Open-Meteo API training data
โโโ meteo.rs # Embedded NASA climate data
โโโ dungeon.rs # Procedural dungeon generation
โโโ liquid.rs # Water/lava simulation
โโโ palette.rs # Block color palettes
โโโ storage.rs # Block storage optimization
โโโ raycast.rs # Block raycasting
โโโ worldgen.rs # World generation orchestrator
Data Flowโ
โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ
โ OpenSimplex โโโโบโ Chunk Gen โโโโบโ GPU Upload โ
โ (heightmap) โ โ (rayon) โ โ (wgpu) โ
โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ
โ
โโโโโโโผโโโโโโ
โ MeMLP AI โ
โ (online) โ
โโโโโโโโโโโโโ
Chunk Lifecycleโ
- Request โ player position triggers chunk generation requests
- Generate โ OpenSimplex2 heightmap + cave/ore placement + vegetation
- Decorate โ AI-driven vegetation, decorations, dungeon chests
- Upload โ vertex/index buffers to GPU
- Render โ instanced draw call per chunk
- Unload โ chunks beyond render distance are evicted
Block Registryโ
147+ block types, each with:
- Hardness (mining time)
- Tool tier (wood โ stone โ iron โ diamond)
- Texture (16ร16 PNG or procedural fallback)
- Model (13 block models: stairs, slabs, logs, etc.)
- Drops (what the player gets when mining)
- Fluid properties (water/lava propagation)