beyond-all-reason / beyond-all-reason/RecoilEngine
Changing display mode is now delayed by loading.
- Dominant language
- C++
- Stars
- 679
- Forks
- 290
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 38
Description
The lobby library in chobby has a callin OnBattleAboutToStart which it sends just before a game is started via any method (with Spring.Reload etc). The main purpose of the callin is to let the settings widget write springsettings.cfg so that the settings are sure to be used in the game. It also changes the display mode to the type selected for ingame display mode. Players can have a windowed lobby and fullscreen game to support hardcore IRC mode.

On 1544 the display mode switch would fullscreen spring as the game started loading. On 798, with the old lobby code, spring would stay as a window until loading is complete, then fullscreen once in the game. This is a problem for many reasons:
- Loading in a tiny window makes the loadscreen tiny and looks highly unpolished.
- It makes the minimap load at a low resolution and look terrible when blown up to fullscreen.
- It breaks UI loading. Widgets think they don't have enough screen space. Widgets think that the centre of the screen is offset.
To workaround this I added a delay of 0.3 seconds between triggering OnBattleAboutToStart and actually starting the battle. I loaded in a small window just now (after loading properly about 20 times over the past few days) so just increased the delay to 0.45 seconds. This solution is nowhere near as bad as loading in a small window, but it still has problems:
- Blowing up the lobby and waiting half a second looks unpolished. The 1544 behaviour just looked right because the load transition and display mode transition happened at the same time.
- A delay for an event that is not allowed to fail (eg making a connection to a game) is a ticking timebomb in the codebase, just waiting to appear as a weird race condition or state invalidation bug.
It's not an urgent thing to solve, especially if the current tradeoff is for reduced bugs with changing display mode, but it is something to keep in mind when revisiting display modes.
Contributor guide
Research direction
Start at the chobby lobby's OnBattleAboutToStart callin and the battle-start path that invokes Spring.Reload; compare the display-mode behavior described for versions 1544 and 798. Reproduce a windowed-lobby/fullscreen-game launch and verify that fullscreen switching happens with loading, without a timing delay or an undersized loadscreen and minimap.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100