How to use correctly the Seamless Travel

Hi everyone, I have a couple of issues that are really making me crazy with the Seamless Travel in a multiplayer online game that im doing with my team. Some explanation: We have a main menu, where each player starts the game, from there the player is able to create or join a session, this session is thought only as a Lobby before the real match, to select your prefered character, weapons, wait to the other players… When all players are ready the game starts and the players should be carried to another map. First I tested all in LAN just using Server Travel, and all works fine, I saved all data in the Game Instance, and after the Players Controllers and Players States where created again in the other map, I get the data. The problem became when I tested all that with Steam. I noticed, that Player Controller and Player States can’t be destroyed and created to travel to the Match Map because the Steam clients fail and are disconnected. I thought then that Seamless Travel was the solution that I need, and seems to work, but at this point the problem is…

In the seamless travel, the actor by default will persist like this:

  • The GameMode actor (server only)
  • Any actors further added via
    AGameMode::GetSeamlessTravelActorList
  • All Controllers that have a valid
    PlayerState (server only)
  • All PlayerControllers (server only)
  • All local PlayerControllers (server
    and client)

PlayerStates are not replicated anymore! I can’t get the PlayerStates on my clients!

Im trying right now to use PostSeamlessTravel function calling for each player controller, functions that maybe can solve this issue but by now, with any good result. Also I used SwapController to get my custom Controller working.

void AConceptGameMode::PostSeamlessTravel(){
	Super::PostSeamlessTravel();

	for (TActorIterator<APlayerController> ActorItr(GetWorld()); ActorItr; ++ActorItr) {

		AConceptPlayerController* CPC = Cast<AConceptPlayerController>(*ActorItr);
		if (!CPC){
			AConceptPlayerController* NewPlayerController = Cast<AConceptPlayerController>(SpawnPlayerController(ROLE_Authority, FVector(0, 0, 0), FRotator(0, 0, 0)));
			SwapPlayerControllers(*ActorItr, NewPlayerController);
			//AController* Controller = *ActorItr;
			//HandleSeamlessTravelPlayer(Controller);

			//FActorSpawnParameters SpawnParams;
			//SpawnParams.Owner = NewPlayerController;
			//APlayerState* NewPlayerState = GetWorld()->SpawnActor<APlayerState>(NewPlayerController->PlayerState->GetClass(), FVector(0, 0, 0), FRotator(0, 0, 0), SpawnParams);
			//NewPlayerState->ForceNetUpdate();
			//NewPlayerState->ForceNetRelevant();
			//NewPlayerState->ClientInitialize(NewPlayerController);
			//NewPlayerController->PlayerState->CopyProperties(NewPlayerState);
			//NewPlayerController->PlayerState->Destroy();
			//NewPlayerController->PlayerState = NewPlayerState;
			PostLogin(NewPlayerController);
		}
	}
}

Anyone knows how to replicate to the clients all PlayerStates instances associated to the PlayersControllers after a Seamless Travel?

THANKS!

I find this question interesting aswell, can anyone add some knowledge regarding the issue?

Some help here please? Im still with this issue… :frowning:

I haven’t been able to get servertravel working for my project, but it sounds like you shouldn’t try to persist the playerstates at all. Rather, I would try using URL parameters to send the data you need, and not the entire actor.

For example, during the lobby, a player selects Character #1 and weapon #3. When transitioning to the next map, that player would include the params ?character=1?weapon=3, then on login the server reads the params and assigns Character #1, weapon #3 to that player, stores this information in the playerstate, and anything else.

I can’t give any exact implementation details, but I’m fairly certain this is how this type of thing was done in earlier versions of UE.

u commented “HandleSeamlessTravelPlayer(Controller);”.
without thta can u have same exact player Controller1 on client side?