Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce preloader scene with progress info #21893

Merged
merged 9 commits into from May 17, 2024

Conversation

AaronVanGeffen
Copy link
Member

@AaronVanGeffen AaronVanGeffen commented Apr 24, 2024

Following up from #21888, this adapts the loading scene from #10180, calling it the PreloaderScene instead. This scene is used to display loading messages before the title scene is loaded. For example, when the object index is being built. It should not be merged before #21888, so marking this as a draft.

In its current form, it uses the NetworkStatus window to display status messages. I'd like to replace this with a dedicated ProgressBar window, using these same status messages as the window caption.

I'd like this progress bar window to look something like OpenLoco/OpenLoco#2411, with an OpenRCT2 twist. For example, use a roller coaster track to indicate progress. This progress bar window could then be used in-game as well, for example when loading and saving games. (Though not autosaves, ideally.)

Screen.Recording.2024-05-06.at.16.57.30.mp4

To do in this PR:

  • Make captions localisable
  • Fix broken replay test functionality
  • Catch loading the title scenario as well
  • Fix race in loading title scene??

To do in a follow-up PR:

  • Introduce dedicated progress bar window for UI
  • Make prerendered recolourable coaster tracks and vehicles for progress bar window
  • Adopt progress bar windows in loading and saving contexts

AaronVanGeffen and others added 4 commits April 24, 2024 18:31
Reset screen to a nice background colour
This splits off the initialisation calls to a new InitialiseRepositories function.

The SetCompletionScene invocation is moved to the Launch method. When the game is running
in headless mode, the preloader is not used. Instead, InitialiseRepositories is called in-thread,
and the transition to the 'completion scene' happens immediately after.
@AaronVanGeffen AaronVanGeffen added testing required PR needs to be tested before it is merged. changelog This issue/PR deserves a changelog entry. labels May 6, 2024
@AaronVanGeffen
Copy link
Member Author

With the latest changes in, I believe this is now ready for review.

NB: I have added delays to loading the object and scenario repositories (80bd69a). These should obviously be removed before merging.

@AaronVanGeffen AaronVanGeffen marked this pull request as ready for review May 6, 2024 13:59
@AaronVanGeffen AaronVanGeffen changed the title Introduce loading scene Introduce preloader scene with progress info May 6, 2024
@AaronVanGeffen AaronVanGeffen added the squash merge A PR that should be squashed on merge. label May 6, 2024
Progress is passed on to PreloaderScene and NetworkInfo window from there.
@Basssiiie

This comment was marked as outdated.

@AaronVanGeffen
Copy link
Member Author

Thanks for testing!

Loading seems to take about 30-40% longer than on develop.

That would be due to deliberate delays added to loading the object and scenario repositories (80bd69a).

There's no loading bar at all in the first half of the waiting time.

Thanks for reporting this. That shouldn't happen, of course. Rendering seems to (not) be happening during the object indexing process, for some reason. I can't reproduce it on macOS, but I can reproduce it on my Linux box.

I ran them both a few times as I messed up recording it. In most attempts and in the recorded attempts I deleted the object.idx prior to launching, but I don't know if that matters.

Yes, this is the right way to go about it, indeed.

@Basssiiie
Copy link
Member

Basssiiie commented May 6, 2024

Thanks, that's a lot better! Loading times now look similar. 😄

  • There still seems to be some some delay between the start of the object index in the console, vs. when it shows up on screen? (Or are these different steps?)
  • Maybe it's nice to have the plugin loading also on the loading screen? This part now seems to happen before the loader is shown.
2024-05-06.20-54-36.mp4

@AaronVanGeffen
Copy link
Member Author

There still seems to be some some delay between the start of the object index in the console, vs. when it shows up on screen? (Or are these different steps?)

As we've discussed on Discord in the mean time, this is a side-effect of using OpenGL. Unfortunately, with the current set-up, we cannot force OpenGL to do a redraw. This is possible for the software renderer, though. This means the progress info will be more up-to-date when using the software renderer.

Maybe it's nice to have the plugin loading also on the loading screen? This part now seems to happen before the loader is shown.

This isn't a trivial change, unfortunately. However, I have pushed some commits with a bodge that I hope will make this possible, still. If this bodge works, I'd like to clean it up a little, though 😅

@Basssiiie
Copy link
Member

Plugins seem to have some issues in the newest version in the loader scene, but do seem to load properly in the end when opening a park.

2024-05-06.22-51-31.mp4

@AaronVanGeffen
Copy link
Member Author

AaronVanGeffen commented May 6, 2024

Thanks for testing, @Basssiiie. As I thought, loading them through the preloader will be more difficult. I think it would be better to leave them as they were for now, and add them to the preloader in a follow-up PR.

I'll revert the changes related to plugins tomorrow.

@janisozaur janisozaur self-requested a review May 7, 2024 12:30
@AaronVanGeffen AaronVanGeffen removed the squash merge A PR that should be squashed on merge. label May 8, 2024
src/openrct2/Context.cpp Show resolved Hide resolved
src/openrct2/Context.cpp Show resolved Hide resolved
Copy link
Member

@janisozaur janisozaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only ask is for a comment to GetPreloaderScene, then it's good

@AaronVanGeffen AaronVanGeffen merged commit 8b51112 into OpenRCT2:develop May 17, 2024
22 checks passed
@AaronVanGeffen AaronVanGeffen deleted the loading-scene branch May 17, 2024 13:02
@AaronVanGeffen AaronVanGeffen added this to the v0.4.12 milestone May 17, 2024
Gymnasiast added a commit that referenced this pull request May 17, 2024
Small oversight from #21893.
Gymnasiast added a commit that referenced this pull request May 17, 2024
Small oversight from #21893.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog This issue/PR deserves a changelog entry. testing required PR needs to be tested before it is merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants