Release 0.16.0
Release 0.16.0
Added
Support for Steam P2P
Thanks to a PR from @msvbg , it is now possible to connect to a client acting as host-server by using Steam P2P sockets
The network_send_interval
is now configurable with more precision
Previously you only had access to 2 settings:
- client_send_interval
- server_send_interval
which would control how often the client or the server sent packets to the remote.
Now the send_interval
is configurable:
- per ReplicationGroup (if you want to update an entity less frequently)
- per Channel
This gives you more flexibility to control how often you want to send messages/packets.
For example, you can send replication updates every 100ms, but send client inputs every frame if available. (this setup is particularly useful if you want to predict other player's inputs, a la RocketLeague)
@RJ added an example with remote player prediction
Added better support for handling remote player inputs. Now inputs from other players can easily be forwarded to a given player so that they can run client-prediction on all entities (the local player entity and the remote player entities)
@RJ created an awesome example spaceships
showcasing how to achieve something like this.
It uses input delay, remote player prediction, physics via xpbd, etc.
Updated the InputDelay/Prediction settings [EXPERIMENTAL]
Previously you could only set a fixed amount of input delay (for example 3 ticks).
Now the input delay depends on your network conditions: the settings are identical to what is described here.
Note that this feature is still being tested and might not work if the network conditions are varying.
Miscellaneous
- Some common bevy
RunConditions
are now provided, such asis_started
,is_disconnected
,is_host_server
, etc. - The serialization logic now uses
bincode
instead ofbitcode
. You can provide your own serialization function instead of bincode. - lightyear doesn't use
anyhow
anymore, instead functions now return typed errors such asReplicationError
,SerializationError
, etc. - Extra diagnostics are provided, such as
PingDiagnostics
to track the jitter/RTT, orRollbackDiagnostics
to track the number of rollbacks
Fixed
- lightyear can now work properly when running on wasm even if the tab is put in the background! Thanks to https://github.com/Nul-led/bevy_web_keepalive/tree/main from @Nul-led
- Tons of bugfixes for replication edge cases
- Input handling has been refactored to be more robust and more independent from world replication. In particular inputs can be replicated every tick even if the world replication is less frequent
Breaking changes
- The serialization logic now uses
bincode
instead ofbitcode
- The
Controlled
component now has an extra fieldlifetime
that specified how to despawn the entity if the controlling client is disconnected Visibility
has been renamed toNetworkRelevance
to avoid a name conflict with bevy'sVisibility
- The
DisconnectEvent
now returns aDisconnectReason
explaining why the client was disconnected - The
PredictionConfig
,ReplicationConfig
,SharedConfig
now contain additional fields
What's Changed
- improve examples common by @cBournhonesque in #361
- fix examples by @cBournhonesque in #362
- despawn recursive predicted/interpolated entities by @cBournhonesque in #363
- send updates since we last sent an update, not since we last received an ACK for that entity by @cBournhonesque in #365
- add subscribe_ack to reliable sender, add subscribe_nack to all channels by @cBournhonesque in #366
- add common run conditions by @cBournhonesque in #368
- Update musli requirement from 0.0.121 to 0.0.122 by @dependabot in #367
- Add WebPlugin to keep running in background by @cBournhonesque in #371
- add simple_setup example by @cBournhonesque in #372
- fix action-state for other players by @cBournhonesque in #374
- Draw Confirmed entity outlines in xpbd_physics demo by @RJ in #375
- Rebroadcast remote players inputs to have more precise rollbacks when predicting other players by @cBournhonesque in #376
- add option to display confirmed entities by @cBournhonesque in #377
- collect rollback metrics, write to Diagnostics by @cBournhonesque in #378
- put rollback diagnostics into PredictionDiagnosticsPlugin by @cBournhonesque in #379
- Add PingDiagnosticPlugin by @cBournhonesque in #380
- Add delta compression by @cBournhonesque in #384
- add componentsync mode to Controlled by @cBournhonesque in #392
- fix replication issue with send_tick by @cBournhonesque in #399
- improve config docs by @cBournhonesque in #400
- Add user-provided hook to accept/reject connections by @cBournhonesque in #401
- switch to bevy_keepalive by @cBournhonesque in #403
- Add extra tests/docs for delta-compression by @cBournhonesque in #404
- Fix delta compression by @cBournhonesque in #406
- fix by @cBournhonesque in #409
- fix example by @cBournhonesque in #411
- make ClientConnection.client pub by @cBournhonesque in #412
- switch benchmark backend to criterion by @cBournhonesque in #413
- Support steam p2p sockets by @msvbg in #346
- fix remote inputs entity mapping by @cBournhonesque in #414
- Return DisconnectReason in the DisconnectEvent for clients by @cBournhonesque in #416
- remove None state and instead init NetworkingState without entering OnDisconnect by @cBournhonesque in #417
- update benchmarks: separate send/receive by @cBournhonesque in #420
- add trace feature with lots of trace instrumentation by @cBournhonesque in #422
- add channel bandwidth stats by @cBournhonesque in #424
- Rewrite packet builder by @cBournhonesque in #428
- Few QOL changes by @cBournhonesque in #429
- Replicate existing entities from client->server when client reconnects to a server by @cBournhonesque in #431
- add perf tracing logs by @cBournhonesque in #432
- add lz4 by @cBournhonesque in #433
- Remove anyhow, use thiserror by @cBournhonesque in #434
- Remove unused imports by @cBournhonesque in #438
- Fix docs by @cBournhonesque in #439
- cleanup unused deps by @cBournhonesque in #440
- Update criterion requirement from 0.3 to 0.5 by @dependabot in #442
- Update metrics requirement from 0.22 to 0.23 by @dependabot in #441
- Update tokio-tungstenite requirement from 0.21.0 to 0.23.0 by @dependabot in #445
- Remove unused imports leafwing by @cBournhonesque in #447
- Improve replication logic by @cBournhonesque in #446
- apply visual interpolation before transform propagate by @cBournhonesque in #451
- Removed bitcode by @cBournhonesque in #452
- Return an error message in case a message is too big to be fragmented by @cBournhonesque in #454
- Fix build packet when we cannot write the channel_id by @cBournhonesque in #458
- Re-use allocations during write by @cBournhonesque in #459
- flag to enable sending messages bigger than 300MB by @cBournhonesque in #460
- type-erased the replication systems by @cBournhonesque in #461
- add tools to profile with flamegraph by @cBournhonesque in #462
- enable specifying a send_frequency for a ReplicationGroup by @cBournhonesque in #465
- Set
send_interval
per Channel instead of globally by @cBournhonesque in #466 - Improve input handling by @cBournhonesque in #472
- Fix priority example by @cBournhonesque in #474
- rename visibility to network relevance by @cBournhonesque in #476
- New example: Spaceships by @RJ in #480
- fix settings by @cBournhonesque in #495
- Update bevy_mod_picking requirement from 0.18.2 to 0.19.1 by @dependabot in #490
- Spaceships example: bullet collisions and predict missing inputs by @RJ in #501
- Remove WebTransport use directives from WebSocket module by @blinkdog in #506
- Add wasm-bindgen-futures Dependency to websocket Feature by @blinkdog in #508
- Fix some replication issues by @cBournhonesque in #512
- remove extra visibility by @cBournhonesque in #513
- Reduce allocations during replication-send by re-using the allocated memory for pending_actions/updates by @cBournhonesque in #515
- Fix despawns for entities created at startup by @cBournhonesque in #523
- fix space ships host-server by @cBournhonesque in #525
- Fix Controlled replication in host-server mode by @cBournhonesque in #528
- Upgrade to bevy 0.14 by @cBournhonesque in #464
New Contributors
Full Changelog: 0.15.1...0.16.0