How would I go about customizing World Partition behavior for listen server?

Hi there,

I’m currently working on a large map and tried to use PIE in Listen Server mode. The performance was quite unexpected, and I stumbled upon this knowledge base article indicating that in Listen Server or Dedicated Server mode, all the streaming cells are forcibly loaded, which severely impacts performance (as well as freezing the editor for 10min as the cells are loaded).

The KB article mentions that it is possible to modify the Unreal Engine source code to modify that behavior. Since this a coop game, where both players would are always relatively close to each other, the caveat of having the wrong cells loaded on the server have a very low chance of occurring.

As I’ve never taken a look inside UE’s source code, could anyone give me pointers on classes/files that would be related to this behavior (is it in WP’s code, or is it rather in the networking part?) and/or hints on what parts would need changed to achieve this?

Thanks!

After digging a bit in the source code, it seems like this is already supported through the wp.Runtime.EnableServerStreaming=1 cvar. I’m keeping my source build of UE5 in case I need to do other changes, but otherwise if someone else has this issue, just setting this variable is enough!

@xplodwild i just wanted to stop by and tell you that you are amazing. thank you for saving my project. i was worried about providing dedicated servers without a backup solution in case people didnt want to host a server, and my project was taking way too long to load plus it had less than 30 fps for the listen servers because the entire map loads with 134000 actors. so thank you for this information.

thank you! @xplodwild this works if I set it in the console command. How can I set this in the build? It says it cannot be set while the game is running. Do I have to change the source code? Which file contains this variable?

I found the file (Source/Runtime/Engine/Private/WorldPartition/WorldPartition.cpp). It looks like they hardcoded the default value to 0 so to change this for a built game I have to build the engine from source?

I a managed to change the default value and build from source. So now sever streaming is on by default. But it seems like a lot of work to set a parameter.