ruffle icon indicating copy to clipboard operation
ruffle copied to clipboard

Load behaviors / preload skip option

Open kmeisthax opened this issue 2 years ago • 3 comments

This adds a setting to Ruffle that allows disabling streaming playback.

This comes in three layers:

  • streaming is the current behavior - tags are processed asynchronously and all movies run concurrently with loading. Preloaders work as intended.
  • delayed - tags are processed asynchronously, but movies do not run until tag processing completes. Preloaders are skipped but the UI is not locked while movies load.
  • blocking is the old behavior - tags are processed synchronously and movies start fully loaded. The UI locks until the movie finishes loading.

You can configure this on desktop with the --load-behavior=xyz flag and, on web, with the loadBehavior parameter on RufflePlayer.load.

The reason for this is a handful of movies that work, but have broken preloaders in Ruffle. Notably, Red Ball's preloader relies on some unspoken assumptions about Flash Player's streaming download that Ruffle violates. Switching to delayed loading fixes the game.

Note that we will not be defaulting to delayed as some other movies (such as some z0r loops) actually break if they load immediately. The primary purpose of this option is to debug regressions from chunked loading, and to allow people to play games with broken preloaders until we can fix them in Ruffle.

kmeisthax avatar Sep 18 '22 00:09 kmeisthax

Will it be an option for a web extension, like the "Log level" parameter for example?

Diatonator avatar Sep 18 '22 20:09 Diatonator

Personally I prefer long-term solutions over temporary ones, especially when it affects public API, that may be hard to deprecate later. Is there some obstacle in the way to imitate Flash Player loading behavior for all kind of SWFs?

relrelb avatar Sep 21 '22 08:09 relrelb

Is there some obstacle in the way to imitate Flash Player loading behavior for all kind of SWFs?

One of them is the fact that we don't really understand it well yet; if anything, having a simple switch could help understand which movies don't load and why. If you test a random SWF and it doesn't load with no errors, trying different modes is a great way of quickly finding a possible cause.

I prefer long-term solutions over temporary ones

It's not that unusual for emulators to have custom user-configurable options for hacks, compatibility modes, more-precise-but-way-slower modes etc; I wouldn't be surprised if we got more of these over time.

But I agree that having it part of self-hosted config (while it definitely can be beneficial now), might be an issue if we ever make chunked loading "better" and the config becomes unnecessary.

adrian17 avatar Sep 21 '22 13:09 adrian17

Taking everyone's feedback into account I've decided to drop the web config options and just keep this as a desktop option for now.

kmeisthax avatar Oct 18 '22 22:10 kmeisthax