A networking library to make multiplayer games for the Bevy game engine
A networking library to make multiplayer games for the Bevy game engine
A library for writing server-authoritative multiplayer games with Bevy. Compatible with wasm via WebTransport.
For Bevy 0.19, add Lightyear to your project with:
[dependencies]
lightyear = "0.30"
You can first check out the examples.
To quickly get started, you can follow this tutorial, which re-creates the simple_box example.
You can also find more information in this WIP book.
Workspace crate sources live under crates/, grouped by role. Directory names drop the lightyear_ prefix, but Cargo package names keep it.
crates/io: low-level IO links and backends such as aeronet, link, udp, crossbeam, websocket, and webtransportcrates/connection: connection abstractions and adapters such as connection, raw_connection, netcode, and steamcrates/core: the top-level lightyear crate plus shared core, sync, utils, and frame interpolation cratescrates/inputs: input crates such as inputs, inputs_native, input_bei, and inputs_leafwingcrates/replication: replication, prediction, and interpolation cratescrates/transport: serialization, transport, and message cratescrates/integration: Bevy ecosystem integrations such as Aviancrates/platform, crates/deterministic, crates/tools, and crates/tests: platform support, deterministic replication, tooling, and test supportaeronet for WebSocket, Steam and WebTransport supportpostcard as a default serializer, but you can provide your own serialization functionClient, and lightyear makes sure that the client input for tick N will
be processed on tick N on the server.
Inputs are protected against packet-loss: each packet will contain the client inputs for the last few frames.leafwing feature, there is a special integration with
the leafwing-input-manager crate, where
your leafwing inputs are networked for you!bevy-enhanced-input crate!lightyear uses bevy_replicon to enable world replication features
(replication, interest management, pre-spawning, etc.)avian| Lightyear | Bevy |
|---|---|
| 0.28-0.30 | 0.19 |
| 0.26-0.27 | 0.18 |
| 0.25 | 0.17 |
| 0.20-0.24 | 0.16 |
| 0.18-0.19 | 0.15 |
| 0.16-0.17 | 0.14 |
| 0.10-0.15 | 0.13 |
| 0.1-0.9 | 0.12 |
No open issues yet, or sync has not completed.