beyond-all-reason / beyond-all-reason/RecoilEngine
Locally loaded replays unnecessarily wait for players and run the start countdown
- Dominant language
- C++
- Stars
- 679
- Forks
- 290
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 40
Description
When loading a replay locally, the engine waits for replay player slots that will never connect and then runs the normal game-start countdown.
This adds approximately 34 seconds to every replay start:
- About 30 seconds waiting for nonexistent player connections
- About 4 seconds for the “Game will start in 3…2…1…” countdown
Across all players and replay launches, those 34 seconds multiply quickly—eventually adding up to multiple human lifetimes spent waiting for locally loaded replays to begin.
It also makes the Skip button misleading before startup finishes: clicking Skip during this period pauses the replay instead of skipping, requiring the user to unpause and wait for startup to complete.
## Steps to reproduce
1. Open a replay file locally.
2. Wait for the game content to load.
3. Observe the additional wait for replay players.
4. Observe the normal game-start countdown.
5. Optionally click Skip before startup completes and observe that the replay pauses.
## Expected behavior
Locally loaded replays should begin immediately after the local spectator finishes loading:
- Disconnected player slots from the replay header should not delay startup.
- The generated local replay start script should use `GameStartDelay=0`.
- Normal hosted and multiplayer games should remain unchanged.
## Technical notes
A replay may advertise more player slots in its header than exist in the reconstructed start script. The local replay server currently waits for those disconnected header-only slots until its timeout expires.
The proposed fix is intentionally limited to locally hosted demos:
1. Ignore disconnected replay player slots when determining whether the local demo can start.
2. Override `GameStartDelay` to zero in the locally generated replay start script.
Contributor guide
Research direction
Start by tracing local replay loading, the reconstructed start script, and the readiness check for replay player slots. Verify that disconnected header-only slots no longer block local startup and that the locally generated script uses GameStartDelay=0, while normal hosted and multiplayer games retain their existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100