[Crash] Using ServerTravel in Blueprint with a Client connected

Hey there,

i am having some trouble with Networking in Blueprints.

I have a MenuLevel, a Lobby and a GameLevel.

Hosting a game calls “Create Session” and “Open Level (Lobby)” with “listen” as an additional option.
Joining works with “Join Session”. Then i want to use “ServerTravel” to get my Server and Clients to GameLevel.

If i only have Server “connected”, ServerTravel works. I’m calling it with Execute Console Command from PlayerController of Server. As soon as i have a Client connected, Engine/Editor crashs:

Access violation - code c0000005
(first/second chance not available)

UE4Editor_Engine!UActorChannel::CleanUp()

  • 1252 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\datachannel.cpp:1443]
    UE4Editor_Engine!UChannel::ReceivedSequencedBunch()
  • 335 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\datachannel.cpp:279]
    UE4Editor_Engine!UChannel::ReceivedNextBunch()
  • 2851 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\datachannel.cpp:588]
    UE4Editor_Engine!UChannel::ReceivedRawBunch()
  • 675 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\datachannel.cpp:344]
    UE4Editor_Engine!UNetConnection::ReceivedPacket()
  • 3880 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\netconnection.cpp:979]
    UE4Editor_Engine!UNetConnection::ReceivedRawPacket()
  • 266 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\netconnection.cpp:457]
    UE4Editor_OnlineSubsystemUtils!UIpNetDriver::TickDispatch()
  • 1367 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\online\onlinesubsystemutils\private\ipnetdriver.cpp:174]
    UE4Editor_Engine!TBaseUObjectMethodDelegateInstance<0,UNetDriver,void
    _cdecl(float)>::ExecuteIfSafe() + 231 bytes
    [d:\buildfarm\buildmachine
    ++depot+ue4-releases+4.7\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:772]
    UE4Editor_Engine!TBaseMulticastDelegate::Broadcast()
  • 165 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\public\delegates\delegatesignatureimpl_variadics.inl:1030]
    UE4Editor_Engine!UWorld::Tick() + 1024
    bytes
    [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\leveltick.cpp:1027]
    UE4Editor_UnrealEd!UEditorEngine::Tick()
  • 5618 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\editor.cpp:1329]
    UE4Editor_UnrealEd!UUnrealEdEngine::Tick()
  • 22 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\unrealedengine.cpp:347]
    UE4Editor!FEngineLoop::Tick() + 4179
    bytes
    [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launchengineloop.cpp:2257]
    UE4Editor!GuardedMain() + 1404 bytes
    [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launch.cpp:142]
    UE4Editor!GuardedMainWrapper() + 26
    bytes
    [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
    UE4Editor!WinMain() + 249 bytes
    [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
    UE4Editor!__tmainCRTStartup() + 329
    bytes
    [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

Seems like a null pointer, but i can’t see where it is happening. Error message is worst xD
It could be that i have a Pointer some where that i forgot to check with “IsValid”. I will search for that tomorrow.

But i have another crash when i try to get back to my main menu with server.

So, after i ServerTraveled to Map with Server alone, I call “Destroy Session” and “Open Level (MenuLevel)”
And this always crashs with this sweet error:

Unknown exception - code 00000001
(first/second chance not available)

Fatal error:
[File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.7\Engine\Source\Editor\UnrealEd\Private\Editor.cpp]
[Line: 6991] World
//Game//ThirdPersonBP//Maps//ThirdPersonExampleMap.ThirdPersonExampleMap
not cleaned up by garbage collection

KERNELBASE + 37901 bytes
UE4Editor_Core!FOutputDeviceWindowsError::Serialize()

  • 292 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\private\windows\windowsplatformoutputdevices.cpp:95]
    UE4Editor_Core!FMsg::Logf__VA() + 463
    bytes
    [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\private\misc\outputdevice.cpp:531]
    UE4Editor_UnrealEd!UEditorEngine::VerifyLoadMapWorldCleanup()
  • 1087 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\editor.cpp:6991]
    UE4Editor_Engine!UEngine::LoadMap() +
    4171 bytes
    [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\unrealengine.cpp:8756]
    UE4Editor_Engine!UEngine::Browse() +
    1442 bytes
    [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\unrealengine.cpp:8144]
    UE4Editor_Engine!UEngine::TickWorldTravel()
  • 813 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\unrealengine.cpp:8311]
    UE4Editor_UnrealEd!UEditorEngine::Tick()
  • 3829 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\editor.cpp:1267]
    UE4Editor_UnrealEd!UUnrealEdEngine::Tick()
  • 22 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\unrealedengine.cpp:347]
    UE4Editor!FEngineLoop::Tick() + 4179
    bytes
    [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launchengineloop.cpp:2257]
    UE4Editor!GuardedMain() + 1404 bytes
    [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launch.cpp:142]
    UE4Editor!GuardedMainWrapper() + 26
    bytes
    [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
    UE4Editor!WinMain() + 249 bytes
    [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
    UE4Editor!__tmainCRTStartup() + 329
    bytes
    [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

Normaly i would say this is due to a not destroyed Widget, but i already tried deleting every widget and
later on not even created one to check if it fixes error. There seems to be something else.

I looked through HUB and found out that getting all actors and destroying them should help, but that doesn’t do anything ): Is this due to ServerTravel? But deleting all actors should take care of everything…

Using Blueprint Only 4.7.5 project with default source (downloaded engine through launcher).

Update: This also happens in a new and fresh project:

  1. Make a new ThirdPersonTemplate Game
  2. Create 3 new Levels (or 2 and use ThirdPersonExampleMap as GameMap)
  3. Name one Level “MainMenu”, one “Lobby” and last one “Level” (if you made 3 new levels)
  4. Create 2-3 new GameModes and PlayerControllers. One for each Level
  5. Setup Levels to have their own GameMode and PlayerController
  6. In MainMenu PlayerController, create an Input that fires “OpenLevel Lobby?listen”. I used OpenLevel Node for that.
  7. In LobbyPC, create an input that fires “Execute Console Command” with “ServerTravel Level” (or ThirdPersonExampleMap)
  8. Inside LevelPlayerController, create an input that fires “OpenLevel MainMenu” (without listen).
  9. Launch game from MainMenu, press Key to Open Lobby as a server, press next key to ServerTravel to Level, press last key to Open MainMenu again

→ Crash with “Level not cleaned up by garbage collection!”

Is this normal? Am i not allowed to use “OpenLevel” on a server after a used ServerTravel? Is their another way to get out of game as a server?

Update: Launching game by rightclicking .uproject file, hitting “Launch Game” works. There i can easily ServerTravel and disconnect from Map to MainMenu. So it is a GarbageCollector Problem inside Editor.

Can we fix this somehow?

EDIT: Both mentioned crashs don’t appear if i launch game like i said above. So Editor does some bad things…

I can reproduce this, with Shootout Example. My editor crashes when calling ServerTravel

Yeah, and it seems like this is due to Editor. Running games alone (in standalone or what is it called?) works fine.

Hi eXi,

Following your steps using Third Person template, I wasn’t able to reproduce any crash. Would you mind uploading that somewhere so we can take a look? Thanks!

Sure, here is DropBox link:

If nothing is changed, you should have 4 Levels. Ignore ThirdPersonExampleMap. Open MainMenu map.

Make sure each of 3 levels has a GameMode set:

  • MainMenu → MainMenu
  • Lobby → Overridden by Lobby
  • Level → Overridden by ThridPersonGameMode (used this for normal level).

Now, with MainMenu Map open, start game in Editor with 1 Player and Dedicated Server False. You should have a black screen.

Press Q to load Lobby (check scene outliner for LobbyPC etc). Now Press E for ServerTravel to “Level”. Now you should see more than just a black screen. Now hit “T” to get back to MainMenu.

You can check 3 PlayerControllers which come along with different GameMode to see how i setup travel.

  • Q is OpenLevel Lobby
  • E in new PC is ServerTravel Level
  • T in again new PC is OpenLevel MainMenu

→ Crash at my end.

Hi eXi,

cause of crash is your Lobby GameMode, which has Seamless Travel enabled. Disabling this stops crash from occurring. I’m not certain what about Seamless Travel being enabled in that GameMode causes following map in chain to crash when traveling from it, but there are a few bug reports in that involve Seamless Travel (UE-11271, UE-11391, UE-13111) that may be involved. I’m going to either add information we’ve gathered from your crash to one of these, or open a new bug if appropriate. For now, disabling Seamless Travel between Lobby and Map should fix problem for you.

I’ll let you know when I see any update on those bugs or if I add a new one. Thanks for sending along test project!

Thanks . I thought i need to enable seamless travel for “ServerTravel” and a transition map. Does that mean i only need it for transition map and can still use “ServerTravel” without seamless travel on?

You can use ServerTravel without Seamless Travel on, but it’s not as smooth a transition. More on that here:

issue you’re facing is still being looked into, but I believe it’s generally way you’d want to do it. For now, if it’s only crashing in PIE, you can disable Seamless while testing in this environment and then re-enable when testing in Standalone (which shouldn’t crash). I think it’s mostly a PIE thing. This has been going on for some time, also reported here:

I’m going to forward this test project to network developers so they have something else to work with.

For reference: we were able to find old bug for this, UE-3187, which we had believed fixed. I’ve reopened it and added your details and a link to your project there. Thanks again!

Hi eXi,

Just wanted to let you know that this has been fixed internally. I just tested this in 4.8 Preview 4, and it appears to be fixed there as well. Let us know if you still see this issue in 4.8p4 or later. Thanks!

I’m trying with dedicated server to move client to another level, but when it happens, it is as if they are on two different maps do not see each other. simply i use open level and insert name of level. I also tried to run from server and then I also tried to do function in game mode that works only on servers but nothing … I was hoping you could help me!

this is video(this is on third person blueprint but is seems to be same on server)

Andrea

OpenLevel is a client function. You only use that in Singleplayer or on initial start of server together with “listen” in options.

You can only move Players with ServerTravel as a consolcommand in BP and there is no easy way to have more than 1 map open on a server.

So moving one client to another map is not possible. Only moving everyone.

so you’re saying that you can not make a mmo with more maps in EU4?
but only with a map?

An MMO is not done with one Server. An MMO has one Server per Map Instance. Maps in UE4 can be pretty big, but yes, you can not have more than 1 map per Server, so you need a system that creates servers and removes them and moves players between them, so you can have multiple players in it.

Also i doubt that UE4s networking system can handle playercount of an MMO, so you might want to create your own Server System for that.

system that creates servers and removes them and moves players between them
it is possible to do it in blueprint?

and with server mean physical server ?
and thank you for your time

Hi 8shadow8,

An MMO using out-of–box engine is not really possible, and certainly not using Blueprints. There has been much discussion about this on forums if you’d like to do a quick search there. Otherwise, if you have more specific questions to ask, I’d recommend opening a new post in appropriate section (Blueprint Scripting, C++, etc) to ask for some community input. Thanks!

Thank you!