How bluebilly2/earthgame2 works
EarthGame2 is an authoritative-server survival simulation: a Unity client presents the world, while an engine-free simulation owns world state and player outcomes. The main loop is player input over the protocol, server-side validation and simulation, then state and terrain updates back to the client. World creation/preparation and persistence are separate server responsibilities. The README documents these product boundaries; source excerpts are limited, so uncertain internal call relationships are omitted.
Main entry points: GameServer.cs Game server · WorldState.cs World state · GameClient.cs Client core · TileService.cs Tile service
Components 19
Client
- Client core
Engine/packages/com.earthgame.clientcore/Runtime/GameClient.cs - Client terrain
Engine/packages/com.earthgame.clientcore/Runtime/ClientGround.cs
Server runtime
- Game server
Engine/packages/com.earthgame.server/Runtime/GameServer.cs - Player sessions
Engine/packages/com.earthgame.server/Runtime/PlayerSession.cs - Movement validation
Engine/packages/com.earthgame.server/Runtime/MovementValidator.cs - Tile service
Engine/packages/com.earthgame.server/Runtime/TileService.cs - World creation
Engine/packages/com.earthgame.server/Runtime/WorldCreation.cs - World preparation
Engine/packages/com.earthgame.server/Runtime/WorldPreparation.cs - World saves
Engine/packages/com.earthgame.server/Runtime/WorldSave.cs
Simulation engine
- World state
Engine/packages/com.earthgame.engine/Runtime/World/WorldState.cs - Body needs
Engine/packages/com.earthgame.engine/Runtime/Body - Locomotion
Engine/packages/com.earthgame.engine/Runtime/Body/Locomotion.cs - Fire making
Engine/packages/com.earthgame.engine/Runtime/Fire - Materials crafting
Engine/packages/com.earthgame.engine/Runtime/Materials - World time
Engine/packages/com.earthgame.engine/Runtime/Time/WorldClock.cs
Networking
- Wire messages
Engine/packages/com.earthgame.protocol/Runtime/Messages.cs - Transport interface
Engine/packages/com.earthgame.transport/Runtime/ITransport.cs - UDP transport
Engine/packages/com.earthgame.transport/Runtime/Udp/LiteNetLibTransport.cs
Other components
- Player
Connections 16
- Player → Client core: plays through
- Client core → Transport interface: sends and receives
- Client core → Wire messages: encodes messages
- Client core → Client terrain: updates terrain
- Game server → Player sessions: manages players
- Game server → World state: authoritative state
- Game server → Tile service: serves tile requests
- Game server → Transport interface: communicates through
- Game server → Wire messages: handles messages
- Tile service → World state: reads terrain layers
- Tile service → Wire messages: sends tile chunks
- Player sessions → Movement validation: validates movement
- World creation → World state: creates world
- World preparation → World state: prepares world
- World saves → World state: saves world
- Transport interface → UDP transport: optional UDP implementation