Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
dependencies ▾

Modern-Apps.git / games / voxels / AGENTS.md

AGENTS.md3.8 KiBRenderedCodeRaw
1# AGENTS.md — games/voxels/ (':games:voxels')
2
3> Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `games/voxels/` + allowed shared modules. Do not root-scan.
4
5_Install: ./install games/voxels (dev by default)._
6- Gradle: :games:voxels / dir: games/voxels/
7- Package roots present: ui, data, platform, network
8- Entry files: MainActivity.kt + platform/MenuActivity.kt (menu/world select) + Route.kt (menu: Route.Worlds / CreateWorld; game: Route.Game(worldId) + Inventory/Furnace/Chest/Stonecutter/Trade/Settings overlays)
9- Deps: :library:network, :library:e2ee-p2p
10- Metadata: metadata_data/games-voxels.md (present)
11- Rust: yes / screenshotTest: hand-committed
12
13### Relay server (backend, outside this repo)
14Host: `api.maproj.org` (Cloudflare FIRST_PARTY pins). Server checkout: `../location_share_server` (sibling of this repo root, `C:\Users\Vayun\Documents\code\location_share_server`). Live SSH: `ssh [email protected]`. Env template: `../location_share_server/.env.example` (copy to `.env`, never commit secrets). Full details: root `AGENTS.md` → "Backend server (outside this repo)".
15
16## Overview
17**Purpose:** Voxel sandbox on a hand-written Rust + Vulkan engine — infinite procedural worlds (25 biomes, villages), crafting/fishing/trading, saves, optional E2EE multiplayer through an untrusted relay. English plus 9 partially translated locales (13 locale files are empty and fall back to English; never machine-translate).
18**NOT a standard MA game:** `ui/` is thin Compose chrome (menus, inventory, hotbar, joystick) over `VoxelSurfaceView`; the world, physics and rendering live in Rust behind `platform/VoxelsNative`. Multiplayer sync (`network/VoxelsSync`) reuses the everysync E2EE-relay pattern.
19**Entry points:** `MainActivity.kt` → `platform/MenuActivity.kt` (`parseJoinLink`-style world invites live here, mirroring everysync) → `ui/VoxelSurfaceView.kt` → `platform/VoxelsNative.kt` → `data/WorldManager.kt`.
20**Gotchas:**
21- Screenshots are hand-committed (Layoutlib can't render Vulkan) — never expect `:metadata` to regenerate them
22- Engine bugs are Rust bugs — scope Kotlin-side work to `ui/`/`platform/` glue unless the trace crosses JNI
23- Multiplayer is E2EE through an untrusted relay — relay sees ciphertext only; keep it that way
24
25## Key files
26### Root + platform/ — entry, menus, Rust bridge
27- com/vayunmathur/games/voxels/MainActivity.kt
28- com/vayunmathur/games/voxels/platform/MenuActivity.kt — world select + invites
29- com/vayunmathur/games/voxels/platform/VoxelsNative.kt — JNI bridge (Kotlin side is glue)
30- com/vayunmathur/games/voxels/platform/VoxelsAchievementsManager.kt
31- com/vayunmathur/games/voxels/platform/AppBackupAgent.kt
32- com/vayunmathur/games/voxels/platform/SoundFx.kt
33- com/vayunmathur/games/voxels/platform/MusicFx.kt
34### data/ + network/ — worlds + E2EE sync
35- com/vayunmathur/games/voxels/data/WorldManager.kt
36- com/vayunmathur/games/voxels/network/VoxelsSync.kt — relay sync (everysync pattern)
37### ui/ — menus, inventory, HUD (thin chrome over the engine)
38- com/vayunmathur/games/voxels/ui/VoxelSurfaceView.kt
39- com/vayunmathur/games/voxels/ui/MenuScreens.kt
40- com/vayunmathur/games/voxels/ui/InventoryScreen.kt
41- com/vayunmathur/games/voxels/ui/InventoryCrafting.kt
42- com/vayunmathur/games/voxels/ui/InventoryBlessings.kt
43- com/vayunmathur/games/voxels/ui/Hotbar.kt
44- com/vayunmathur/games/voxels/ui/Joystick.kt
45- com/vayunmathur/games/voxels/ui/FurnaceScreen.kt
46- com/vayunmathur/games/voxels/ui/StonecutterScreen.kt
47- com/vayunmathur/games/voxels/ui/TradeScreen.kt
48- com/vayunmathur/games/voxels/ui/VoxelCatalog.kt
49- com/vayunmathur/games/voxels/ui/Theme.kt — game theme (not DynamicTheme)
50
51## Verify (this module only)
52```
53./gradlew :games:voxels:compileDevKotlin
54./gradlew :games:voxels:lint
55./gradlew :games:voxels:checkMetadata
56```