Loading screen
On this page
When it shows
Every frame the subsystem checks these conditions in order; the first one that is not met keeps the screen up and becomes the logged reason:
- There is a game world.
- No map is loading, no client or server travel is pending, and no connection to a server is pending.
- The GameState exists, the world has begun play and no seamless travel runs.
- The GameState and its components report no work (stage
experience). - Every registered loading participant and Blueprint task reports no work (stage
preparing, unless it names its own). - Every local player that the viewport shows has a PlayerController, and that controller, its Pawn and their components report no work (stage
player). - No loading operation waits for its owner or its destination.
Startup screens, a blocking preparation, Wait For Texture Streaming and startup holds can keep the screen up after that. The screen then hands off: the destination already renders behind it, progress reaches 100 % and the screen fades out over Fade Out Seconds. Loading that starts again during the fade takes the screen back at full opacity. Input is blocked for as long as the screen is visible.
What the progress means
The progress bar shows the overall completion of the current loading in five equal steps: the request, the destination, the destination world, the local player and the handoff. Each step only completes on its own fact, and the bar never moves back. Between the world and player steps, the stage that currently holds the screen fills its step with its own fraction when it reports one, so the bar keeps moving through long work instead of jumping.
The status text is the stage text of the work that currently holds the screen. Stage Texts in Project Settings names your own stages and overrides the built-in texts of connecting, travel, world, experience and player. The built-in texts come in 14 languages from the plugin's own localization target. A packaged game switches to a language only when it is in Localizations to Package (CulturesToStage) and the game's own localization target also has a compiled .locres for it, even an empty one; the sample shows the smallest such target.
Your own widget
-
Create a Widget Blueprint whose parent class is Orion Loading Screen Widget.
-
Add any of these optional widgets with exactly these names; the parent class fills them:
Name Type Shows ProgressBarProgress Bar Progress; hidden while there is none. PercentTextText Block Progress as a whole percentage. TitleTextText Block Startup screen text: splash caption, shader compilation title or key prompt. StatusTextText Block Status of the current loading work. TipTextText Block Current tip. -
To animate on your own, override On Loading Screen State Changed and call the parent to keep the automatic filling. The state is pushed only when something changes, so avoid property bindings and Blueprint ticks.
-
Select the widget as Loading Screen Widget in Project Settings, as the Widget of a startup screen, or for one loading through a presentation.
The state also tells the widget which screen it shows (Kind), the stage key (Stage), the presentation of this loading, whether a press any key prompt is waiting (Waiting For Input), whether the destination already renders behind the fading screen (Handing Off), the PSO counts of the shader compilation screen and whether the game is exiting (Exiting). A Custom startup screen ends itself by calling Finish Startup Screen.
The presenter creates one widget per class and keeps it for the rest of the game instance, so a later loading shows the same widget again without rebuilding it. On Loading Screen Shown fires before the first state of each showing and On Loading Screen Hidden when the widget leaves the screen; reset anything that must start fresh in them. A widget that draws asynchronously, such as a web page, calls Hold Presentation in On Loading Screen Shown and Release Presentation once it has drawn; until then Wait For Loading Screen keeps waiting, so a synchronous map load freezes a finished frame.
HTML and other screens outside UMG
Loading Screen State To Json returns the state as one JSON object: kind (loading, splash, shaderCompilation, pressAnyKey or custom), progress, hasProgress, stage, title, status, tip, waitingForInput, exiting, handingOff, shaderPrecompilesCompleted, shaderPrecompilesTotal, page, route, content, variant and the game's current culture. stage and variant are always lower case, because a packaged game does not keep the case of names. Send it to a web page from On Loading Screen State Changed; Web UI with OrionBrowser shows the complete setup.
While a map loads synchronously the game thread is blocked, and MoviePlayer can only draw pure Slate. Your widget's last frame stays on screen until the load finishes, while the built-in Slate screen keeps its spinner turning. In the editor MoviePlayer is off, so PIE freezes on the last frame.
Keep the screen up for your own work
In Blueprint:
- Begin Loading Task with a reason for the log, and keep the returned task in a variable.
- Optionally call Set Progress with a stage key, a milestone (World or Player) and a fraction in [0, 1], or -1 when the total is unknown, and Set Status Text for the text the player sees.
- Call Finish when the work succeeds, fails or is canceled, and when the owner ends play.
Finish Loading Tasks on the subsystem finishes every task that currently reports exactly that reason, for a fail-open budget or when the owner lost its reference.
C++ objects implement IOrionLoadingParticipant instead; see C++ integration.
Travel and loading operations
Ordinary travel needs no code: the subsystem follows map loads, client travel, server travel, seamless travel, connections and their failures. Declare a loading operation when you are about to start work that ends in another world or replaces the current UI, so the screen covers it from the first frame and its progress starts at zero.
-
Call Begin Loading Operation with an owner and a request:
Field Meaning Destination Destination map package or travel URL. Empty keeps the current world. Mode Id, Context Id Optional names that a custom presenter uses to choose its content. Presentation Optional screen for this loading only. Travel The operation ends in another world; the screen stays until that world is ready. Wait For Owner Completion The screen stays until you complete or cancel the handle. Requires a live owner. Parent Operation Joins a running operation instead of starting a new one. Retain Destination Until Owner Completes Keeps the final destination across intermediate worlds. -
Start the travel or the work. Before a synchronous Open Level, call Wait For Loading Screen and continue from both its Ready and Failed pins: the map load blocks the game thread, and this way it keeps showing your screen instead of the last game frame.
-
Call Complete Loading Operation with the handle once the owner's part is done, or Cancel Loading Operation when it failed.
A handle only ever affects its own operation, so a late completion cannot release a newer loading. A destroyed owner, a travel failure and a network failure cancel the operation; the screen then leaves as soon as the world is ready again.
Choose the screen per loading
A presentation picks the screen for one loading. The built-in presenter reads Page as an Orion Loading Screen Widget class and Content as a background texture; Route and Variant are passed to your widget unchanged. It uses, in order:
- During startup, the startup screen's Widget.
- The presentation of the current loading operation (Set Loading Operation Presentation replaces it).
- The presentation of the task or participant that holds the screen (Set Presentation).
- Loading Screen Widget and Background Image from Project Settings.
- The built-in Slate screen.
Blueprint reference
On Orion Loading Screen Subsystem:
| Node | Use |
|---|---|
| Is Loading Screen Visible | The screen covers the viewport. |
| Is Loading Required | Something still loads; startup screens and holds do not count. |
| Is Handing Off | The destination is ready and renders behind the fading screen. Never grants gameplay input. |
| Get Loading Progress | Overall progress in [0, 1]. |
| Get Debug Reason | Why the screen is shown or hidden. |
| On Loading Screen Visibility Changed | Fires after the screen was shown or hidden. |
| Begin / Complete / Cancel Loading Operation, Set Loading Operation Presentation | Loading operations. |
| Finish Loading Tasks | Finishes tasks by reason. |
| Is Startup Active, Add / Remove Startup Hold, Restart Startup, Has Played Startup Intro, Mark Startup Intro Played | Startup. |
| Begin Shader Precompile, Is Precompiling Shaders, Get Shader Precompile Progress, Get Shader Precompile Counts, Has Pending Shader Precompiles | PSO precompilation for your own startup flow. |
| Is Presenting Game Exit | The exit screen is up. |
| Wait For Loading Screen | Continues once the screen is on screen; use it between Begin Loading Operation and Open Level. |