Running the Game
Navigate to Build Directory
Launch MC-CPP
On first launch, a startup menu will appear for adjusting music volume before entering the game.
Basic Controls
Movement
| Key | Action |
|---|---|
| W | Move forward |
| A | Move left (strafe) |
| S | Move backward |
| D | Move right (strafe) |
| Space | Jump |
| Left Shift | Sprint (increases FOV dynamically) |
| Mouse | Look around (captured mode) |
Block Interaction
| Control | Action |
|---|---|
| Left Click | Break block (raycast targeting) |
| Right Click | Place block |
| Mouse Wheel | Change selected block type |
World & Display
| Key | Action |
|---|---|
| F3 | Toggle debug overlay (FPS, position, render stats) |
| F11 | Toggle fullscreen mode |
| O | Save world to save/ directory (NBT format) |
| ESC | Release/capture mouse cursor |
Understanding the Display
Crosshair
The white crosshair in the center indicates:- Your aiming point for block placement/breaking
- The direction you’re facing
- Raycast hit detection for block interaction
Debug Overlay (F3)
Press F3 to see detailed information:- FPS - Current frames per second
- Position - Player coordinates (x, y, z)
- Rotation - Camera pitch/yaw angles
- Chunks - Visible/loaded chunk count
- Render distance - Current setting from
Options::RENDER_DISTANCE - Shadow info - Cascade count, resolution (if enabled)
World Saves
MC-CPP uses NBT (Named Binary Tag) format with gzip compression for world persistence.Save Location
Manual Save
Press O to save all loaded chunks. The game also:- Saves chunks when unloading them (distance-based streaming)
- Automatically loads nearby chunks as you move
Performance Tuning
You can adjust settings insrc/options.h (source:/home/daytona/workspace/source/src/options.h:1) before building:
Render Distance
Field of View
Chunk Updates per Frame
Lighting Performance
info.md (source:/home/daytona/workspace/source/info.md:1) for details.
Shadow Quality
Changes to
options.h require rebuilding the project:Troubleshooting
Game Won’t Launch
“Cannot find assets/”:- Update GPU drivers
- Verify OpenGL 3.3+ support:
Low FPS
- Reduce render distance: Edit
Options::RENDER_DISTANCEto 4-6 - Disable shadows: Set
Options::SHADOWS_ENABLED = false - Lower shadow resolution: Change
SHADOW_MAP_RESOLUTIONto 1024 - Disable VSync: Set
Options::VSYNC = false(may cause tearing)
Stuttering When Moving
This is chunk streaming overhead. The game loads/unloads chunks as you explore:- Already optimized:
info.mddocuments FPS improvements from asynchronous chunk building - Increase
CHUNK_UPDATES(faster meshing, more CPU usage) - Increase
LIGHT_STEPS_PER_TICK(faster lighting, more CPU usage)
Missing Textures
Blocks appear black/magenta:- Check
assets/textures/exists in build directory - Verify
data/blocks.mccppis present - See AGENTS.md shadow debugging section (source:/home/daytona/workspace/source/AGENTS.md:110) for texture atlas issues
Advanced Features
Shadow System
MC-CPP implements directional shadows with cascades:- 4 cascades - Different resolutions for near/far objects
- PCF filtering - Soft shadow edges (configurable radius)
- Dynamic updates - Shadows follow sun direction (day/night cycle)
AGENTS.md (source:/home/daytona/workspace/source/AGENTS.md:16) for technical details on the CSM implementation.
Lighting System
Two independent light sources:- Skylight - Top-down sunlight propagation
- Block light - Emissive blocks (torches, lava, etc.)
Physics
Player movement uses:- Gravity with drag coefficients
- AABB collision with swept tests
- Dynamic acceleration (walk/sprint states)
- Interpolated rendering for smooth motion at any FPS
Next Steps
Explore the Source
Check out
AGENTS.md for a complete architecture overviewModify Block Types
Edit
data/blocks.mccpp to add custom blocksCustomize Shaders
Modify
assets/shaders/colored_lighting/ for visual effectsPerformance Profiling
Run
mc_bench to identify hotspots