0.27.0
Changelog
This release is still compatible with bevy 0.18. I will submit another release soon for compatibility with bevy 0.19.
Major changes
-
Switched the replication backend to
bevy_replicon.- The goal is to reuse the wider Bevy networking ecosystem's work, avoid splitting contributor efforts, and benefit from Replicon's well-optimized and documented code.
- Lightyear still provides its own higher-level replication API for prediction, interpolation, authority metadata, visibility, hierarchy propagation, and pre-spawning.
- The old
lightyear_replicationimplementation was more tightly integrated with Lightyear and supported having multiple replication senders/receivers per app by addingReplicationSenderandReplicationReceivercomponents. Replicon is centered on server-to-client replication, so other replication patterns (client-to-server replication, distributed authority, etc.) are now unsupported. - Some old replication-layer features are not yet at parity, including component-level delta compression, authority switching, per-component priority, and some advanced sender/receiver topologies.
- The move also brings useful Replicon features into Lightyear, including marker-specific replication rules, a flexible visibility-filter system, and mutation/checkpoint information that can be used by prediction and interpolation.
- Removed the ReplicationGroup API.
-
Added a structured
lightyear_debugtracing layer throughlightyear_tools.- Debug events are emitted as JSONL rows with stable categories such as timeline, prediction, interpolation, input, sync, messages, entities, transport, components, and manual events.
- Components can be sampled with typed debug or structured JSON formatters by adding
LightyearDebug. - Structured debug coverage now spans more of the runtime path, including sync/ping, input buffering, prediction rollback, visual correction, frame interpolation, and replication tick advancement. This is intended to make desync investigations easier to automate and easier to inspect with LLM-assisted analysis.
-
Switched
Tickfromu16tou32.- This avoids practical tick wraparound during normal game sessions and removes a lot of complicated sync/rollback edge cases.
- Replicon's replication tick is now treated as a transport/checkpoint index and mapped back to Lightyear's authoritative simulation
Tick.
-
Improved component registration API.
- The preferred component registration API is now
app.component::<C>()
.replicate()
.predict()
.with_rollback_condition(f)
.add_interpolation_with(f);
The main benefits is that you can register a component with lightyear, and then use any replicon function for the replication logic, e.g. app.component::<C>().replicate_once()
Also now you can only call prediction related functions (with_rollback_condition, etc.) after having called predict().
Enabling rollback without replication has now been renamed to local_rollback instead of add_rollback.
Migration notes
-
Naming between Lightyear and Replicon does not line up one-to-one.
- Replicon's native send-side marker is
Replicated, and received entities useRemote. - Lightyear keeps
Replicateas the user-facing send-side component. Code that previously queried Lightyear receive-side replication markers may need to move to Replicon'sRemote,ConfirmHistory, or the Lightyear compatibility exports depending on intent.
- Replicon's native send-side marker is
-
The visibility API now uses Replicon's visibility filters under the hood.
- Room-based visibility changed significantly: use
RoomAllocatorto allocate globalRoomIds and addRoomsto entities/clients. - Room ids are no longer ad-hoc local values; they must be allocated globally so Replicon's filter bitsets can reason about them consistently.
- Room-based visibility changed significantly: use
-
bevy_enhanced_inputintegration no longer relies on general client-to-server entity replication for action entities.- Action entities are now expected to use the pre-spawning flow and must be spawned on both the client and server.
- Input action replication now serializes the action context through
NetworkActionOfand handles rebroadcasted action entities explicitly.
Added
-
Added deterministic-replication late-join catch-up support.
- New clients can join a running deterministic game without replaying the full historical input log. The catch-up flow combines deterministic input replication with a one-time state snapshot gated through Replicon visibility filters. After receiveing the state snapshot, the new client can just simulate the rest of the game in a deterministic fashion with just input replication.
-
Added optional LZ4 transport packet compression.
- Compression keeps packet headers uncompressed, validates decompressed payload limits, respects MTU constraints, and includes benchmark coverage.
Prediction and interpolation
-
Prediction and interpolation now use Replicon's confirmation and mutation-checkpoint data to reason about entities/components that did not change. This avoids false predictions where an entity was assumed to have changed simply because no correction arrived.
-
Interpolation is more robust under packet loss and visibility changes.
- Interpolated entities now delay despawn until the interpolation timeline reaches the authoritative server despawn tick.
-
Fixed several rollback and confirmed-history edge cases.
- Prediction can now handle predicted entities whose latest confirmed states are not all at the same tick.
Transport and networking fixes
- Timeline sync is more stable under very low latency, keeping the client timeline at least one tick ahead of the remote/server timeline so deterministic inputs can arrive before the server simulates the target tick.