About this project
Lightyear is a networking library for writing server-authoritative multiplayer games with the Bevy game engine. It is compatible with WebAssembly via WebTransport and is distributed as a Rust crate (lightyear = "0.30" for Bevy 0.19).
Getting started: the repository provides examples, a tutorial that recreates the simple_box example, and a work-in-progress book for further documentation.
Repository layout: workspace crates live under crates/, grouped by role, with directory names dropping the lightyear_ prefix while Cargo package names keep it. Groups include io (low-level links and backends such as aeronet, link, udp, crossbeam, websocket, webtransport), connection (connection, raw_connection, netcode, steam), core (top-level lightyear crate plus core, sync, utils, frame interpolation), inputs (inputs, inputs_native, input_bei, inputs_leafwing), replication (replication, prediction, interpolation), transport (serialization, transport, message), integration (Bevy ecosystem integrations such as Avian), and platform, deterministic, tools and tests crates.
Features described in the README:
- Transport-agnostic IO: UDP sockets, plus aeronet for WebSocket, Steam and WebTransport support.
- Serialization: postcard is the default serializer, with support for providing a custom serialization function.
- Message passing: channels with different ordering and reliability guarantees, and packet fragmentation for messages larger than roughly 1200 bytes.
- Input handling: player inputs are buffered every tick on the client, and the client input for tick N is processed on tick N on the server; inputs are protected against packet loss by including recent frames in each packet. Optional integrations exist for leafwing-input-manager and bevy-enhanced-input.
- Deterministic replication: supported when only inputs are replicated and the simulation is deterministic; compatible with lockstep and prediction/rollback.
- World replication: uses bevy_replicon for replication, interest management, pre-spawning and related features.
- Advanced replication: client-side prediction with rollback, snapshot interpolation, configurable input delay, bandwidth management with priority-based sending, and lag compensation for interactions between predicted and interpolated entities.
- Topologies: client-server, P2P, and host-client mode where a client acts as the server.
- Examples: numerous examples covering the features and integrations with other Bevy crates such as avian.
The README also lists related projects, including a lightyear-template starter project and games such as Lumina and cycles.io, and a compatibility table mapping Lightyear versions to Bevy versions (0.28-0.30 to Bevy 0.19, 0.26-0.27 to 0.18, 0.25 to 0.17, 0.20-0.24 to 0.16, 0.18-0.19 to 0.15, 0.16-0.17 to 0.14, 0.10-0.15 to 0.13, and 0.1-0.9 to 0.12).
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.