How ambientrun/ambient works
Ambient is a cross-platform multiplayer game runtime and development platform. A developer creates or builds a Rust/WASM package, then launches it through the Ambient CLI; clients connect to a server where game state is maintained and synchronized, and the client renders the game. The README also identifies package interoperability, configurable asset pipelines, WASM isolation, and PBR rendering as major capabilities. The graph uses the README and indexed or excerpted source references; unsampled implementations and some runtime wiring are represented conservatively.
Main entry points: app.rs Client application · main.rs Ambient CLI · server.rs Network server · packages Game package
Components 16
Platform workflow
- Ambient CLI
app/src/main.rs - Campfire tools
campfire/src/cli.rs - Package operations
campfire/src/package.rs - Game package
guest/rust/packages
Game runtime
- Client application
web/client/src/app.rs - Server runtime
app/src/server/mod.rs - Network client
crates/network/src/client.rs - Network server
crates/network/src/server.rs - Network protocol
crates/network/src/proto/server.rs
Engine services
- Entity database
crates/ecs/src/query.rs - Terrain systems
crates/terrain/src/lib.rs - PBR renderer
crates/renderer/src/renderer.rs - Asset pipeline
crates/asset_cache/src/lib.rs
Package execution
- WASM runtime
crates/wasm/src/shared/engine.rs - Guest Rust API
guest/rust/api_core/src/lib.rs
Other components
- Developer
Connections 19
- Developer → Ambient CLI: launches
app/src/main.rs - Developer → Campfire tools: runs tools
campfire/src/cli.rs - Campfire tools → Package operations: dispatches
campfire/src/cli.rs - Package operations → Ambient CLI: invokes
campfire/src/package.rs - Ambient CLI → Client application: starts client
- Ambient CLI → Server runtime: starts server
app/src/main.rs - Client application → Network client: connects through
web/client/src/app.rs - Network client → Network server: exchanges game state
crates/network/src/client.rs - Network server → Network protocol: dispatches messages
crates/network/src/server.rs - Network server → Entity database: updates world
- Client application → WASM runtime: initializes
web/client/src/app.rs - WASM runtime → Guest Rust API: hosts packages
- Guest Rust API → Game package: implements
- Entity database → Network server: synchronizes state
- Asset pipeline → Game package: loads assets
- Client application → PBR renderer: renders game
- Terrain systems → Entity database: operates on world
- Developer → Game package: creates package
- Game package → WASM runtime: runs isolated