Pause the game via GameMode->SetPause but allow world partition streaming to continue

We would like to know if there is a better way to pause the game but allow world partition streaming states to continue updating in the background, without requiring making engine source modifictations.

Current we had to make an engine modification in “LevelTick.cpp” “UWorld::Tick” where we changed this check:

// Update streaming volumes
#if UE_SUPPORT_FOR_ACTOR_TICK_DISABLE
      if (IsActorTickAndUserCallbacksEnabled())
#endif
      {
        if (!bIsPaused && IsGameWorld())
        {
          // Update world's required streaming levels
          InternalUpdateStreamingState();
        }
      }
    }

To this:

      // Update streaming volumes
#if UE_SUPPORT_FOR_ACTOR_TICK_DISABLE
      if (IsActorTickAndUserCallbacksEnabled())
#endif
      {
        const bool bPauseStreaming = (bRequestedBlockOnAsyncLoading && GetNetMode() == NM_Client) ||
          GEngine->ShouldCommitPendingMapChange(this) ||
          (IsPlayInEditor() && bDebugPauseExecution);
        if (!bPauseStreaming && IsGameWorld())
        {
          // Update world's required streaming levels
          InternalUpdateStreamingState();
        }
      }

Which is effectively copying the “IsPaused” method, so we respect the other state of the engine, but without looking at whether the game was explicitly paused or not.

Is this considered a safe change or are there implications in having the streaming running in the background asynchronously while the game is paused?

Is there a better solution/alternative to this?

[Attachment Removed]

Steps to Reproduce

Create a world partition level.

Create and add your own custom data layer to the level.

Add any actors you would like inside that data layer that you can visually see with any mesh.

Make sure the data layer is not visible, not initially loaded and is a runtime data layer in the asset.

In any way you like (for example in the GameMode BP on a button press), pause the game THEN request for the data layer to be loaded.

Notice the engine stops all streaming from loading until the game is unpaused.

[Attachment Removed]

Hi Tiago,

Unfortunately when you’re using the engine’s built-in pause functionality, there’s no way around this without engine changes. That being said, the change you made looks safe to me and worked in my testing of the reproduction steps you provided. Handling it in that spot minimizes the number of changes and thus lessens the load of merging if you do an engine upgrade down the road.

For reference, I did find another user who did this same change without any apparent issues [Content removed]

Hope this answers your question!

[Attachment Removed]

Thank you for the quick response! We’ll go ahead with the change and I’ve marked your answer as best :saluting_face:

[Attachment Removed]