A library for writing server-authoritative multiplayer games with Bevy. Compatible with wasm via WebTransport.
https://github.com/cBournhonesque/lightyear/assets/8112632/7b57d48a-d8b0-4cdd-a16f-f991a394c852
Demo using one server with 2 clients. The entity is predicted (slightly ahead of server) on the controlling client and interpolated (slightly behind server) on the other client. The server only sends updates to clients 10 times per second but the clients still see smooth updates.
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.
bincode 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!Replicate bundle will be automatically replicated to clients.Roomstracing and metrics libraries to emit spans and logs around most events (
sending/receiving messages, etc.).avian| Lightyear | Bevy |
|---|---|
| 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 |
$ claude mcp add lightyear \
-- python -m otcore.mcp_server <graph>