Game Design Document
Core game design, Unity architecture, and client-side systems including VContainer DI, UniTask async, R3 reactive programming, and Cinemachine cameras.
Welcome to the RentEarth technical documentation. This guide collection covers the complete architecture, systems, and implementation details for the RentEarth survival action game.
RentEarth is a survival action game built with a modern tech stack spanning Unity (client), Rust/Axum (server), and Astro (web). The architecture emphasizes server-authoritative gameplay, reactive programming patterns, and clean separation of concerns.
Game Design Document
Core game design, Unity architecture, and client-side systems including VContainer DI, UniTask async, R3 reactive programming, and Cinemachine cameras.
Axum Server Architecture
Rust game server documentation covering MSCP message protocol, WebSocket handling, LRU caching, SharedWorker integration, and gRPC transport.
Pool Oracle System
Prefab library, entity pooling, tag/label system, variant architecture, LOD integration, and composite prefab design.
ECS Architecture
Entity Component System design using bevy_ecs for the Rust game server, including component inventory, system scheduling, and migration plans.
Pathfinding & Navigation
Server-authoritative pathfinding, waypoint graphs, A* navigation, spatial data structures, and NPC movement systems.
Combat System
Combat mechanics, HP/MP/EP stats, movement modifiers, entity state machines (emotional, behavioral, combat states), and damage calculations.
Billboard System
LOD-based billboard rendering for WebGL optimization, including camera-facing sprites, texture atlases, and GPU instancing.
| Layer | Technology | Purpose |
|---|---|---|
| Client (Game) | Unity + C# | 3D game rendering, player input, visual feedback |
| Client (Web) | Astro + TypeScript | Documentation, web dashboard, SharedWorker |
| Server | Rust + Axum | Game logic, entity state, physics (Rapier3D) |
| Protocol | Protobuf | Binary serialization for network messages |
| Database | Supabase | Authentication, persistence, realtime subscriptions |
| Pattern | Location | Description |
|---|---|---|
| MSCP | Server | Message Service Communication Protocol - all game mutations flow through typed commands |
| ECS | Server | Entity Component System via bevy_ecs for efficient state management |
| Reactive | Client | R3 observables for UI binding and event streams |
| DI | Client | VContainer for dependency injection and lifecycle management |
| Server-Auth | Network | Server is single source of truth; clients interpolate and render |
| System | Status | Guide |
|---|---|---|
| Core Game Loop | Complete | GDD |
| WebSocket Protocol | Complete | Axum |
| Prefab Pool System | Complete | Pool Oracle |
| A* Pathfinding | Complete | Pathfinding |
| NPC State Machine | Complete | Combat |
| Basic Movement | Complete | Combat |
| ECS Migration | =2 Planned | ECS |
| Billboard LOD | =2 Planned | Billboard |
| Combat System | =2 Planned | Combat |
| gRPC Transport | =2 Planned | Axum |
| Flow Fields | =2 Planned | Pathfinding |
The foundational document covering RentEarth’s Unity client architecture:
Server-side game logic and network communication:
Comprehensive prefab management and entity pooling:
Migration plan from custom EntityState to bevy_ecs:
Changed<T> and Added<T> queriesServer-authoritative navigation systems:
Stats, movement, and entity state machines:
WebGL performance optimization for distant objects:
����������������������������������������������������������������� AXUM SERVER (Rust) �����������������������������������������������������������������$ HTTP Routes ��,�� WebSocket ��,�� Future: gRPC �������,������� GameHandle (mpsc tx) GameCommand World Runtime ��������������<�������������� EntityState Environment PhysicsWorker Manager Manager (Rapier3D) �������������������������,��������������������������������������� WebSocket (10 Hz snapshots)����������������������������������������������������������������� CLIENTS �����������������������������������������������������������������$ Unity (Game) Browser (Astro/JS) SharedWorker ����������������������������������������������������������������������������������� ������������������ ������������������ EMOTIONAL STATE ����� BEHAVIOR STATE ����� COMBAT STATE ���������������� ���������������� ���������������� Calm Idle OutOfCombat Alert Patrol Engaging Angry Chase InCombat Afraid Flee Disengaging Happy Guard Dead ������������������ ������������������ ������������������New to RentEarth? Start with the Game Design Document for an overview of the client architecture and core technologies.
Working on server features? Read the Axum Server Architecture and ECS Architecture guides.
Implementing NPCs? Check Pathfinding for navigation and Combat for state machines.
Optimizing performance? See Pool Oracle for prefab management and Billboard for LOD systems.
When adding new documentation:
.mdx file in astro/src/content/docs/guides/title and descriptionproto/rentearth/snapshot.proto, proto/rentearth/pool.protounity/rentearth/Assets/Scripts/website/axum/src/astro/src/content/