Repository navigation
0.13.0
This release adds online two-player with rollback netcode (Issue #46).
NETPLAY is on the front end and on the pause menu.
- Connecting: one player chooses HOST A GAME, by default on UDP port 7845. The other types the host's address and chooses JOIN A GAME.
- The host sends its game, its save included, so both start from the same point. Then you play the game's own 2P as usual: the host is player 1 and the joiner player 2.
- Over the internet: the host needs the port forwarded, or both players can join the same VPN, such as Tailscale or ZeroTier. There is no lobby or NAT traversal yet.
- Rollback:
- Your own presses apply after INPUT DELAY frames (0 to 4, default 2).
- The other player's presses are predicted. When a guess was wrong, the game goes back and replays the frames, up to 8 frames.
- At 50–100 ms of latency with 5% packet loss, the games stay identical. A wrong guess can cause a short sound glitch.
- Safety:
- Every second the two games compare a fingerprint of their state. If they ever differ, the session stops with "DESYNC" and both sides save their state for a bug report.
- The joiner's own game and save are put back when the session ends, and the host's save is never written to the joiner's files.
- What must match, and what doesn't:
- Refused with a reason if different: version, ROM, ROM patches and character stats, and which music tracks a mod replaces.
- Taken from the host for the session: widescreen settings, the 6-button pad, lobby shortcuts and the ring tether options.
- Free to differ: volumes, video, controls, textures and sprites.
- Not available during a session: save states, rewind, fast-forward, TIME ATTACK, BACK TO TITLE, the music player and reloading mods. Cheats, awards and the speedrun timer are paused.
- Details, ports and limitations: docs/NETPLAY.md.
Validation:
- Windows: all 90 CTest cases pass. The new tests:
- rollback against a reference at 1, 3 and 6 frames of latency, with 25% loss;
- full sessions over a simulated network: 3000 frames of a 2P level at 50–100 ms and 5% loss, and another with no input delay, widescreen, 8% loss, different volumes and the host's tether options;
- two real processes over UDP on this PC;
- a deliberately broken state, which both players catch within 40 frames.
- In every one, both players end identical to a single machine fed the same presses.
- Real app: two copies of the app on one PC played about 4,900 frames with no desync.
- Lockstep: all 33 sweep runs with random input are bit-identical.
- macOS (M1): all 87 CTest cases pass, the netplay tests included, and lockstep is bit-identical on arm64.
- Linux: all 87 Linux CTest cases pass, the netplay tests included.
- Packages: the packaged Windows and Linux builds pass the startup tests. The Android APKs now ask for the INTERNET permission.
- Not tested: two machines over the internet, and netplay on Android and iOS devices; those builds compile, but netplay was only run on Windows, Linux and macOS. Reports are very welcome.
Downloads: the Windows x64 zip, the Linux x64 tar.gz, the macOS arm64 zip, the iOS .ipa, and two Android APKs: arm64-v8a/x86_64 (the usual one) and armeabi-v7a (32-bit ARM). Both APKs use version code 37 and the same signing certificate as 0.12.0, so they update in place.
You must supply your own Knuckles' Chaotix (Japan, USA) ROM. No ROM image or game assets are included.