Server closing client connection with MissingLevelPackage in PIE

This question was created in reference to: [net.SkipMissingLevelDisconnect does what? PIE client disconnects from PIE server without [Content removed]

Hello again,

Some team members are currently experiencing this issue roughly 50% of the time when running any map in PIE Play as Client single process. There seems to be a race condition, and what’s concerning is that after almost a week of debugging we don’t understand how it’s guaranteed that this race condition doesn’t happen outside of PIE. Our understanding is that servers and clients could load cells independently given streaming source actors placed in the map, so is it not possible then that the client could try to notify the server of a cell it’s loaded prior to the server activating it?

I’ve distilled things down to what I think are the 2 requirements needed for us to be able to reliable repro:

  1. We’ve made some changes to EditorEngine.cpp to allow us to have a fixed frame rate for the dedicated instance but not the client instance since that helps us more accurately simulate the real world
  2. We’ve enabled unified streaming budget (s.UseUnifiedTimeBudgetForStreaming)

…with these 2 changes we’re able to more reliably repro, but given the referenced article it would seem like there are other ways as well. If it’s decided that we’re doing something unexpected with 1. above, then we can modify the engine further to get around the issue OR we can set net.SkipMissingLevelDisconnect to true. However it’s important that we fully understand why this isn’t a concern outside of PIE so if someone could elaborate that would be very helpful.

Thanks!

Hi,

By default, servers will keep all cells loaded, with only clients loading/unloading nearby cells based on the streaming source. This is controlled by the “wp.Runtime.EnableServerStreaming” and “wp.Runtime.EnableServerStreamingOut” CVars (which default to false).

In addition to these, there are CVars that control whether the client will wait for the server to acknowledge visibility updates before it makes streaming levels visible/invisible. These are “LevelStreaming.DefaultAllowClientUseMakingVisibleTransactionRequests” and “LevelStreaming.DefaultAllowClientUseMakingInvisibleTransactionRequests” (as well as “wp.Runtime.UseMakingVisibleTransactionRequests” and “wp.Runtime.UseMakingInvisibleTransactionRequests”). If you’re using Iris, then visibility transaction requests are enabled by default (see LevelStreaming.cpp).

To get a better idea of the issue, I have a couple questions.

First, just to double check, are you using Iris? Also, do you have any other non-default config values for World Partition and level streaming, such as to enable server streaming?

Next, the linked case mentioned using level instances. Are you using level instances in your map, or is this occurring just with cell streaming?

Finally, if you disable “Run Under One Process,” does the issue continue to occur? If the server is running as a standalone editor process, I believe it will use a separate tick rate (NetServerMaxTickRate) than the PIE client, which will continue to use the editor’s settings. This is similar to the first requirement you mentioned for the repro, so I’m curious if this can allow for a repro without modifying EditorEngine.cpp.

Thanks,

Alex

Hey Alex, thank you for the quick reply. Here are some rapid fire answers and thoughts:

We are using Iris.

We’ve also enabled server streaming and the unified streaming budget.

There are no level instances in the test map I’m using to repro.

It takes a long time to load our maps and the repro isn’t super reliable, so while I haven’t been able to repro outside of using a single process it may just be that I haven’t hit it yet.

…as I was typing the above my compilation of an untouched version of UE 5.6.1 completed. I created a new default open world map, and could not reproduce. After enabling server streaming, I can reproduce by flying around the open world map. (Note this is Play as Client single process.) That’s about as simple a repro as you can get :slight_smile:

Just to get ahead of something, if it comes back that the answer here is “server streaming is experimental and could have issues” then I’d like to understand what the repercussions might be if just enable net.SkipMissingLevelDisconnect and call it a day?

Thanks!

Hi,

Thank you for the additional info!

I’ve also been able to observe the disconnect in the default open world map, but only when visibility transactions are disabled. Just to double check, what are the values for LevelStreaming.DefaultAllowClientUseMakingVisibleTransactionRequests, LevelStreaming.DefaultAllowClientUseMakingInvisibleTransactionRequests, LevelStreaming.ShouldServerUseMakingVisibleTransactionRequest, wp.Runtime.UseMakingVisibleTransactionRequests, and wp.Runtime.UseMakingInvisibleTransactionRequests in your repro and the project where you first observed the issue?

As for net.SkipMissingLevelDisconnect, it’s hard to say what kinds of repercussions enabling this might have. If it’s just to avoid this issue in PIE and you’re not seeing any other issues with level streaming when it’s enabled, then it could be fine as a temporary workaround while we continue to investigate the issue. However, it was added as a temporary fix for a similar issue with a different cause, so I don’t think we’d recommend using it as a permanent solution.

Thanks,

Alex

Just be clear, the default open map repro mentioned above was in a pristine branch of UE 5.6.1 from Epic’s perforce and we had changed nothing other than me enabling the server streaming CVars.

With respect to the CVars in our game project:

LevelStreaming.DefaultAllowClientUseMakingVisibleTransactionRequests

This is set to the default, false

LevelStreaming.DefaultAllowClientUseMakingInvisibleTransactionRequests

This is set to the Iris default, true

LevelStreaming.ShouldServerUseMakingVisibleTransactionRequest

This is set to the Iris default, true

wp.Runtime.UseMakingVisibleTransactionRequests

This is set to the default, false

wp.Runtime.UseMakingInvisibleTransactionRequests

This is set to the default, false

Thanks Alex, we’ve made the change and I’ll keep you posted if anything comes up as a result.

Hi,

Thank you for the info and for your patience as I continue looking into this issue. I also apologize for my own misunderstanding, as I missed that LevelStreaming.DefaultAllowClientUseMakingVisibleTransactionRequests is set to false by default regardless of whether Iris is being used or not.

It is intended for visibility transactions to be enabled whenever server streaming is being used, as these requests should avoid the issue of clients streaming in a level before the server has done so. In the future, we will consider automatically enabling these transactions whenever server streaming is enabled.

With this enabled, do you run into any other issues with server streaming?

Thanks,

Alex

Hey Alex, again I appreciate you helping us with this. Verifying, you’re saying we need to enable all 5 of those CVars in the case that we’re using server streaming regardless of whether we’re using Iris or not is that correct?

Hi,

Yes, or at the very least I believe “LevelStreaming.DefaultAllowClientUseMakingVisibleTransactionRequests*”* should be set to true as well.

That being said, please let us know if you run into any issues with both server streaming and visibility transaction requests enabled.

Thanks,

Alex