• Stars
    star
    2,912
  • Rank 15,580 (Top 0.4 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created almost 2 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The multiplayer game engine

Ambient

Crates.io docs.rs MIT/Apache 2.0 Discord

Ambient020.mp4

Ambient is a runtime for building high-performance multiplayer games and 3D applications, powered by WebAssembly, Rust and WebGPU.

See our announcement blog post for more details, or jump into our documentation.

Design principles

  • Seamless networking: Ambient is both your server and client. All you need to do is to build your server and/or client-side logic: the runtime handles synchronization of data for you.
  • Isolation: Projects you build for Ambient are executed in isolation through the power of WebAssembly - so that if something crashes, it wonโ€™t take down your entire program. It also means that you can run untrusted code safely.
  • Data-oriented design: The core data model of Ambient is an entity component system which each WASM module can manipulate.
  • Language-agnostic: You will be able to build Ambient modules in any language that can compile to WebAssembly. At present, Rust is the only supported language, but we are working on expanding to other languages.
  • Single executable: Ambient is a single executable which can run on Windows, Mac and Linux. It can act as a server or as a client.
  • Interoperability: Ambient allows you to define custom components and "concepts" (collections of components). As long as your Ambient projects use the same components and concepts, they will be able to share data and interoperate, even if they have no awareness of each other.
  • Asset pipeline and streaming: Ambient has an asset pipeline that is capable of compiling multiple asset formats, including .glb and .fbx. The assets are always streamed over the network, so your clients will receive everything they need when they join.
  • Powerful renderer: The Ambient renderer is GPU-driven, with both culling and level-of-detail switching being handled entirely by the GPU. By default, it uses PBR. It also supports cascading shadow maps and instances everything that can be instanced.

See the documentation for a guide on how to get started, or browse the guest/rust/examples for the version of Ambient you're using. The main branch is a development branch and is likely incompatible with the latest released version of Ambient.

Installing

The easiest way to get Ambient is by downloading the latest release here.

For alternative installation options, go to the documentation on installing.

Roadmap

Note: Ambient is in an alpha stage and the API will be iterated on heavily. We are working towards a stable release.

Feature Status Notes
ECS โœ… Single-threaded.
WASM API โœ… Rust is the only supported guest language right now, and WASM can be used on both the client and the server.
UI API โœ… Element UI, our React-inspired UI library, can be used in Rust WASM guests. See the examples.
Multiplayer/networking โœ… Multiplayer is server-authoritative without any prediction or compensation. See our documentation.
GPU-driven renderer โœ…
FBX & glTF loading โœ…
Physics (through PhysX) โœ… Using PhysX 4.1. PhysX 5 support is tracked in this issue.
Animations โœ…
Skinmeshing โœ…
Shadow maps โœ…
Decals โœ…
GPU culling and LoD โœ…
Multi-platform โœ… Windows, Mac, and Linux so far. x86-64 and ARM64 are actively supported; other platforms may also work, but require testing.
Audio โœ… Load sound, playback, looping, scale amp are supported. More featues on the way.
Run on Web ๐Ÿšง See this issue.
Multithreading API ๐Ÿšง Multithreading is already used internally, but we want to expose multithreading functionality within the WASM API. This may be explicit (i.e. task- or thread-spawning) or implicit (WASM modules being scheduled across threads).
Custom shaders ๐Ÿšง Custom shaders are supported by the renderer, but are not yet exposed in the API. See this issue.
Hot-reloading assets ๐Ÿšง See this issue.
ECS save/load ๐Ÿšง For loading, see this issue.

Examples

Each example in the examples directory can be run with Ambient as both client and server:

(Note that ambient needs to match the version that the examples were built for, see "Running examples" in the docs)

ambient run guest/rust/examples/games/tictactoe

Every example can also be run server-only. To do so:

ambient serve guest/rust/examples/games/tictactoe

This will start a server that other people, including yourself, can join. By default, the server will use the Ambient proxy to allow clients to join from outside your local network, and give you a URL to share with others:

ambient join proxy-eu.ambient.run:9176

Note that content is always streamed, so the only thing the joining user requires is Ambient itself to join the session.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.