Skip to content

Releases: gschup/ggrs

v0.12.0

09 Apr 18:37

Choose a tag to compare

Bug fixes

fix: spectator_handles() now returns only spectator handles; previously it incorrectly returned local + spectator handles due to a copy-paste bug (fixes #105)
fix: network_stats() for spectator handles no longer panics — it was looking up the address in player_reg.remotes instead of player_reg.spectators
fix: confirmed inputs are now flushed to spectators immediately within advance_frame(), reducing spectator latency by one frame; previously the packets were queued and only sent on the next poll_remote_clients() call
fix: spectator session no longer stalls at frame 0 when started before the host; sync request retries now use a dedicated timer instead of the shared last-send timer, which was being reset by ACKs and keepalives
fix: delta compression no longer panics when inputs serialize to variable sizes (e.g. enums with variants of different sizes); each encoded input is now length-prefixed

Breaking changes

breaking: the network wire format for input packets has changed; clients on different versions of ggrs will not be able to communicate
breaking: GgrsError::NotEnoughData is a new error variant returned by network_stats() when less than one second has elapsed since the connection was established; previously GgrsError::NotSynchronized was returned in both this case and the "not yet connected" case
breaking: SessionBuilder::start_synctest_session() now returns GgrsError::InvalidRequest if sparse saving is enabled, rather than silently ignoring the setting — SyncTestSession must save every frame to compare checksums across the check window
breaking: SessionBuilder::with_num_players() now returns Result<Self, GgrsError> and immediately rejects a value of 0; previously the error was deferred to session start
breaking: Config trait now requires a type InputPredictor: InputPredictorSelf::Input associated type; migrate existing impls by adding type InputPredictor = ggrs::PredictRepeatLast;, which preserves the previous behaviour of repeating the last known input

Improvements

feat: custom input prediction via the new InputPredictor trait; set type InputPredictor on your Config to control how missing remote inputs are predicted. GGRS ships with PredictRepeatLast (repeat last input, good for held-button state) and PredictDefault (always use Input::default(), good for one-shot events); implement the trait yourself for custom strategies (closes #69)
feat: Display implementations added for SessionState, InputStatus, PlayerType, and DesyncDetection
refactor: poll_remote_clients() collects endpoint events before processing, removing unnecessary pre-emptive clones of handles and addresses
docs: SessionBuilder methods now document valid value ranges and constraint relationships
docs: NetworkStats now explains the one-second warmup window and the idiomatic NotEnoughData handling pattern
docs: SyncTestSession struct now fully documents the save/advance/rollback/compare lifecycle, the panic-on-mismatch behaviour, and the all-players-local requirement
docs: NonBlockingSocket now includes a WASM/WebRTC implementation example using matchbox
docs: P2PSession::advance_frame() and poll_remote_clients() now document the spectator packet delivery timing
docs: SpectatorSession::advance_frame() now documents its dependency on the host having called poll_remote_clients for inputs to have arrived
docs: SpectatorSession::frames_behind_host() now documents that both current_frame and last_recv_frame start at NULL_FRAME
examples: handle_requests no longer takes an in_lockstep flag or uses unreachable!() — all request variants are handled unconditionally, relying on the library's guarantee that Save/Load are never sent in lockstep mode

Crate hygiene

chore: rust-version = "1.87" added to Cargo.toml, establishing the declared MSRV
chore: added comment to the getrandom optional dependency clarifying it exists to forward the js feature to rand on WASM targets

Code quality

clippy: resolved warnings across the codebase; added #[must_use] to SessionBuilder and its builder methods
refactor: internal constants consolidated and de-duplicated; GgrsError now derives Eq; minor readability improvements throughout
tests: expanded unit and integration test coverage across all session types and internal modules

Full Changelog: v0.11.1...v0.12.0

v0.11.1

14 Oct 17:20

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.11.0...v0.11.1

v0.11.0

19 Dec 10:29

Choose a tag to compare

What's Changed

  • Added NieR Automata: Online as project using ggrs by @jasper310899 in #78
  • Fix/Feature: Lockstep by @gschup in #79
  • Bump example game macroquad to 0.4 by @caspark in #81
  • feat: Remove GameStateCell's T: Clone requirement by @caspark in #80
  • Expose current frame in synctest and spectator sessions by @caspark in #84
  • Allow reading P2PSession's current desync detection mode by @caspark in #85
  • Only panic when sending large packets if in debug mode by @caspark in #87
  • Fix desync detection false positive caused by a rollback by @caspark in #86
  • RFC: feat: Input type must be Default+Serde but not POD by @caspark in #82
  • fix: avoid panicking when local frame adv exceeds i8 range by @caspark in #91
  • Fix max rollback and lockstep handling by @caspark in #88
  • Add changelog entry for bytemuck removal by @caspark in #92
  • Add tracing for logging by @caspark in #93

New Contributors

Full Changelog: v0.10.2...v0.11.0

v0.10.2

23 Apr 15:29

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.10.1...v0.10.2

v0.10.1

27 Feb 07:06

Choose a tag to compare

What's Changed

  • Report which frames checksums failed for in synctest sessions by @johanhelsing in #66

Full Changelog: v0.10.0...v0.10.1

v0.10.0

10 Nov 09:09

Choose a tag to compare

Changelog

  • Rename types with GGRS prefix to match rust naming conventions
  • Removed deprecated GgrsError variants
  • GameStateCell now implements debug.
  • fixed a bug where checksums of unconfirmed frames were compared during desync detection.
  • You can now trigger a desync manually in the example game by pressing SPACE.

v0.9.4

30 Mar 07:39

Choose a tag to compare

Changelog

  • SessionBuilder now implements debug. This requires Config::Address to have Debug
  • Optional desync detection for p2p sessions. This feature can be used by using with_desync_detection_mode in the SessionBuilder.

v0.9.3

10 Jan 11:56

Choose a tag to compare

Changelog

  • added support for fieldless enums in PlayerInput

v0.9.2

17 Aug 13:07

Choose a tag to compare

Changelog:

  • fixed a bug where sync would not work with RTT higher than SYNC_RETRY_INTERVAL

v0.9.1

21 Feb 10:23

Choose a tag to compare

Changelog:

  • fixed multiple local players, added example documentation for it
  • fixed save and advance request ordering during a rollback in P2PSessions