[Bug][4.15] Client Load Level Instance Kicks Client

Whenever a client tries to stream a level in 4.15, the client is kicked from the host and loads the default loading map.

Replication:
Start a new 3rd person blueprint project, create a new level, add the level to the sub-level list, make the new level current, create a single mesh in the new level for proof of loading.

129787-worlds.png

Add the following code:

129786-load+level+instance+error.png

Play game with 2 players, or 1 and dedicated server.
When the client loads the level, they are immediately kicked.

Loading on the server does not replicate to the client, and obviously manually streaming this causes a kick.

Please advise.

Hello AGPStudios,

Thank you for reporting this issue. Iā€™ve reproduced this issue and entered a bug report for it. You can find / track the report here: UE-43726

#Not a bug, Security Feature

I am the author of that node that is in the engine, contributed via github: .com/EpicGames/UnrealEngine/pull/2320

It is not a bug, UE4 has code to prevent a client from loading a level that the Server has not loaded first. Presumably this is a security / cheating management decision, present in PlayerController.cpp

#Solution

To work around this, you just need to always load the level instance on the server first, with the exact same name.

#Request

I wish this security feature was optional, it makes certain aspects of dynamic level generation more complex/less stable because if there is even a slight timing difference, the client can get dcā€™ed making this anti-cheat feature reduce overall capability of UE4 to be handle dynamic worlds without the developer having to worry about the chance of a client getting dcā€™ed

The code is so embedded so as to prevent cheating that it is also impossible to work around.

As with all major engine decisions, it would be great if we as the developers had more control so that UE4 can play its role as dominant awesome engine of the world even better.

#:heart:

Rama

PS: This is in regards to Unreal Engine Issues and Bug Tracker (UE-43726)

More in-depth explanation of solution:

  1. UE4 will kick client if client tries to load a map with a name that is not in the server list

  2. Solution is therefore to ensure that server loads the map instance with that exact name before the client does, even if it is only by a moment

  3. Therefore, if client wants load level instead of server just doing stuff automatically

  4. Have client call the server to ask server to load it and rep that function to then load on the client with exact same name knowing it will be after the server loaded it :slight_smile:

Rama

Hey there Rama,
Iā€™ve tried reproducing your workaround, however I was unable to have the client remain present.

Iā€™ve run this top down as the server loads the map, and then the client is notified when itā€™s loaded, even after a delay to the same result.

http://i.imgur.com/V2PNlni.png

1 Like

Any news ? The problem is describe in this post
PlayerController.cpp line 317 : (World->StreamingLevels[i]->GetWorldAssetPackageFName() == InPackageName )
I can not find any fix for this issue :ā€™(

Hi,
Got the same problem on 4.18.2
I also did try to do what Rama say but i end with deconection or nothing display on clients. =/
No one have a working ā€˜tempā€™ solution to share ?
Thanks

Lucky I found this thread as I was struggling to figure out why my client player kept not working when I introduced more lag. I am doing ā€˜LoadStreamLevelā€™ but it seems the symptoms and fix works the same for that so maybe their behaviours are the same. This has taken me three days to figure out, trying this and that. It would have been good if this was mentioned in the Blueprint documentation.

1 Like

How was this solved? can you go more in depth, show some blueprint code you were able to come up with that solves this? Iā€™m getting same result as AGPStudios.

I just checked the bug tracking on this, and it has been changed to ā€œWonā€™t Fixā€.

Here my solution :
Tell me if it work for you.

Hi! I donā€™t think showing my actual blueprint would help much as it is a bit particular to my case.
Basically I just set up a ā€˜report backā€™ system where the server set a checking variable that was replicated down to the Client/Remotes GameInstance (so its persistent) and then i have a little loop (sorry) that halts the process until it detects this variable is set which means that the Server is ready and coast is clear for Remote to continue loading the instance/stream.

Thanks so much, this is what I was looking for, thanks!

How do you know when the level is loaded? Iā€™ve found get streaming level, but I donā€™t know how to get the package name for an instanced level. It doesnt seem to match the name of the tile, what is the package name exactly? Iā€™ve seen references of a direct path, like /Game/Maps/etcā€¦ is that correct?

Iā€™ve found a work around here, using the victory plugin: Dynamic level streaming with multiplayer support - Blueprint Visual Scripting - Unreal Engine Forums

It might not work for your case but Iā€™m setting a ā€˜MapIDā€™ from BeginPlay of the Map that Iā€™m streaming/instancing in. But on the GameInstance as I mentioned.

So I was having this issue with a level loading system and the solution was to use the node ā€œLoad Stream Levelā€ instead.

1 Like

Thanks! it worked

Has anybody got this working? I am still having issues with this in 5.3.

My setup:

  1. Generate a streaming level on the server using the Create Instance node

  2. Wait until the level Is Loaded and Is Visible are both true.

  3. Pass the level information to the clients and have them create the same streaming level with the same name as the server (same function as 1, but on each client.)

I have confirmed that the Unique Instance Names are identical on server and client, and that the server is definitely loaded before the client, and yet my clients are still kicked!

Can anybody help?

Jackson

Solved it. Read my solution here: Dynamic level streaming with multiplayer support - #46 by jacksonnexhip

(also other good information in this thread about whatā€™s going on behind the scenes.)

1 Like

Sorry to necro, I am playing around with this in UE5.3 and I cannot seem to get this to work without the client disconnecting. I tried the solution @jacksonnexhip posted, I tried preloading the level like @Rama said. Even using the ā€œUse Client Side Level Streaming Volumesā€ in the persistent levelā€™s world settings and using streaming volumes to stream in a sublevel, the outcome is exactly the same. The level gets displayed for a second, then the client resets the map and I see it disconnected in the output log.

Any help appreciated!
Thanks an cheers!