feature: late spectator - #120
Merged
Merged
Conversation
Owner
|
Looks great! Let me sit on it for a night, but this looks good as-is! Thank you for the work :) |
Owner
|
I have been hesitant to add late players joining a match for multiple reasons, but late spectators seem like a straightforward addition. |
Owner
|
btw TowerFall and your mod are awesome <3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello! I'm working on EX (https://github.com/Fcornaire/TF.EX), a mod that attemtp to brings rollback netplay to TowerFall. I've used ggrs since the beginning of the project and stuck with it because I like how it's designed.
I thought it would be cool if a spectator could join a P2P session after it started, and after digging into the repo, it turned out to be easier than I expected.
How it works
The core idea: when enabled, the host retains every confirmed input since frame 0, so a late spectator can join at any time and replay the session from the very first frame, then catch up to live.
SPECTATOR_SEND_WINDOW) 64 frames rather than all at once, so a far-behind spectator is throttled instead of disconnected.Your opinion
SpectatorTooFarBehindcan no longer occur. I kept the variant for backward compatibility.Existing tests all pass, and I added some.
Demo
Here's the feature running in TowerFall: three instances, the top two are the live players, the bottom one is a spectator who joins mid-match and catches up:
2026-08-23.late-spectate.mp4