Seamless travel client order issue

Hi,

I have a problem in my project where during seamless travel the client travels faster than the server. As a result, when the server enters, the client is already in the map.

Because of this, HandleSeamlessTravelPlayer does not get called on the server’s gamemode, and therefor the playercontroller of the client never gets upgraded to the one required by the new game mode.

Any idea how I can ensure that my server always travels first before the clients?

Kind regards,
Romenski

I’m working on the same project. After some debugging I found out this is caused by UNetConnection::ClientWorldPackageName being set to NONE after it is set to the loaded world by APlayerController::ServerNotifyLoadedWorld.

Somewehere in the FSeamlessTravelHandler::Tick function it calls UNetConnection::ResetGameWorldState() which sets this value back to NONE.

As a result the client keeps waiting forever to complete the travel.
I set breakpoints in the travel function on the server to force the client to load first to test this.

A quick way to fix this issue was to run the following code from the player controller that is waiting for seamless travel to complete on the client:

 void AMenuPlayerController::PlayerTick(float DeltaTime)
    {
    	Super::PlayerTick(DeltaTime);
    
            UNetConnection* connection = GetNetConnection();
    	if(connection && m_loadedFinalWorld)
    	{
    		ServerNotifyLoadedWorld(m_finalWorldPackageName);
    	}
    }

while manually setting m_finalWorldPackageName to the target level name and setting m_loadedFinalWorld when it is actually loaded to notify the server

I’m dealing with this very same issue myself.

Thank you for the work around code, but how are you “manually” setting the m_finalWorldPackageName value?

Do you set in it in BluePrints before/during/after the loading of the level, or in c++?

If you’re doing it via BP; I’m assuming you made a UPROPERTY variable for your custom game PlayerController .h file?

Apparently this issue got fixed in 4.12, so upgrade to that if you can. Otherwise:

I Used this piece of code on the same player controller

void AMenuPlayerController::NotifyLoadedWorld(FName WorldPackageName, bool bFinalDest)
{
    	Super::NotifyLoadedWorld(WorldPackageName, bFinalDest);
    	
    	if(bFinalDest)
    	{
    		m_loadedFinalWorld = true;
    		m_finalWorldPackageName = WorldPackageName;
    	}
}

So yeah, You’ll have to do this in C++.

many thanks for that!

we can’t move engines terribly easily, so I’ll wait for 4.12 to stabilize a bit more. They patched it twice in the first two weeks after release.

modifying the c++ will be easy, so I don’t have any qualms about that part.

why not just put a delay on when the character enters the map in the code?

This is an old forum post, but in case anyone finds this looking for a fix to this issue that seems to have resurfaced in UE5, check out this forum post: UE5 Seamless travel bug found. We found the cause, and also have a workaround