x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Seamless Travel to Same Level Problems

Hi,

Using 4.13.2 with the ShooterGame demo for testing I've noticed that if I use seamless ServerTravel to reload the same level twice then things go bad. AGameMode::PostSeamlessTravel seems to call HandleSeamlessTravelPlayer immediately for remote players who have not started to travel, since the ClientWorldPackageName is the same both before and after the transition.

This means that APlayerController's LastCompletedSeamlessTravelCount and SeamlessTravelCount are equal already for remote clients when the server's PostLoadMap event triggers.

Normally for ShooterGame this doesn't seem to be an issue but I am writing a plugin that spawns an entity from the PostMapLoad event and doing that in this situation completely breaks the remote clients' replication, but works perfectly otherwise.

First seamless travel, looks good and works fine:

 [OnPostLoadMap] Client: 000002AE98DEAB00 LCSTC: 0 STC: 1

Seamless travel again to the same level, the remote client is stuck and replication doesn't work:

 [OnPostLoadMap] Client: 000002AE98DEAB00 LCSTC: 2 STC: 2
  LogPlayerController:Verbose: APlayerController::ServerNotifyLoadedWorld_Implementation: Client loaded /Temp/Untitled_3
  LogNet: Server connection received: ActorChannelFailure
  LogNet: Server connection received: ActorChannelFailure
  LogPlayerController:Verbose: APlayerController::ServerNotifyLoadedWorld_Implementation: Client loaded /Game/Maps/Highrise

Relevant engine code:

 void AGameMode::PostSeamlessTravel()
 {
     if ( GameSession != NULL )
     {
         GameSession->PostSeamlessTravel();
     }
 
     // We have to make a copy of the controller list, since the code after this will destroy
     // and create new controllers in the world's list
     TArray<TAutoWeakObjectPtr<class AController> >    OldControllerList;
     for (auto It = GetWorld()->GetControllerIterator(); It; ++It)
     {
         OldControllerList.Add(*It);
     }
 
     // handle players that are already loaded
     for( FConstControllerIterator Iterator = OldControllerList.CreateConstIterator(); Iterator; ++Iterator )
     {
         AController* Controller = *Iterator;
         if (Controller->PlayerState)
         {
             APlayerController* PlayerController = Cast<APlayerController>(Controller);
             if (PlayerController == NULL)
             {
                 HandleSeamlessTravelPlayer(Controller);
             }
             else
             {
                 if (Controller->PlayerState->bOnlySpectator)
                 {
                     // The spectator count must be incremented here, instead of in HandleSeamlessTravelPlayer,
                     // as otherwise spectators can 'hide' from player counters, by making HasClientLoadedCurrentWorld return false
                     NumSpectators++;
                 }
                 else
                 {
                     NumTravellingPlayers++;
                 }
                 if (PlayerController->HasClientLoadedCurrentWorld())
                 {
                     HandleSeamlessTravelPlayer(Controller);
                 }
             }
         }
     }
 }

...

 bool APlayerController::HasClientLoadedCurrentWorld()
 {
     UNetConnection* Connection = Cast<UNetConnection>(Player);
     if (Connection == NULL && UNetConnection::GNetConnectionBeingCleanedUp != NULL && UNetConnection::GNetConnectionBeingCleanedUp->PlayerController == this)
     {
         Connection = UNetConnection::GNetConnectionBeingCleanedUp;
     }
     if (Connection != NULL)
     {
         // NOTE: To prevent exploits, child connections must not use the parent connections ClientWorldPackageName value at all.
 
         return (Connection->ClientWorldPackageName == GetWorld()->GetOutermost()->GetFName());
     }
     else
     {
         // if we have no client connection, we're local, so we always have the current world
         return true;
     }
 }

Thanks!

Product Version: UE 4.13
Tags:
more ▼

asked Nov 09 '16 at 08:25 PM in Bug Reports

avatar image

Skilletorr
21 1 2 6

avatar image NymKappa Nov 10 '16 at 08:24 AM

Why do you want to load the same level mutiple times ? I think Unreal provide you other methods to re-initialize a level. Maybe check the "OnReset" event, something like that :)

avatar image Skilletorr Nov 10 '16 at 08:43 AM

Unfortunately as a plugin author I don't have control over game code, I need to support every reasonable use case. I think traveling to the same level is a common and reasonable way to entirely reset, especially if the next level is chosen by player vote or something like that. If seamless traveling to the same level is not supported then I think it should be documented and the travel function should reject attempts to do it rather than calling functions out of order and subtly breaking things :)

avatar image RotemS Dec 17 '17 at 12:17 PM

@rdeist Did you ever find a workaround for this issue? I find myself in the same situation.

avatar image Sean L ♦♦ STAFF Nov 17 '16 at 04:31 PM

Hey rdeist,

I've tested this issue on my end using Shooter Game as well as a clean test project, and I'm not seeing the same results.

What exactly is broken when you perform the second travel?

Do you have any steps we can follow to reproduce the issue on our end, or a simplified test project that showcases the issue?

avatar image RotemS Nov 20 '17 at 08:50 AM

OP clearly states

"Normally for ShooterGame this doesn't seem to be an issue but I am writing a plugin that spawns an entity from the PostMapLoad event and doing that in this situation completely breaks the remote clients' replication, but works perfectly otherwise."

I'm noticing Epic devs are really trigger happy to close issues without even reading. OP did all the work for you, right down to the the problematic line of code. It's easy to see why it breaks it.

avatar image superman_tb Feb 05 '18 at 11:28 AM

You can try my solutions

(comments are locked)
10|2000 characters needed characters left

3 answers: sort voted first

Seamless traveling to the same level is supported now, if you make sure that transition map is not empty.

more ▼

answered Feb 05 '18 at 11:31 AM

avatar image

superman_tb
66 1 2

avatar image RotemS Feb 08 '18 at 10:50 AM

@superman_tb Thank you! I've moved on already but I'll be sure to give this a try in the future!

(comments are locked)
10|2000 characters needed characters left

Hello,

I am marking this topic as resolved for tracking purposes, as we have not heard from you in a few days. If this issue persists, feel free to respond to this thread. For any new issues, please create a new Answerhub topic.

Have a great day

more ▼

answered Nov 21 '16 at 04:47 PM

avatar image

Sean L ♦♦ STAFF
44k 485 149 438

(comments are locked)
10|2000 characters needed characters left

I am in the same situation too, in 4.17.2.I want to change the gamemode on the same map.I got "ActorChannelFailure" randomly in every seamless travel.

more ▼

answered Feb 04 '18 at 11:25 AM

avatar image

superman_tb
66 1 2

avatar image superman_tb Feb 05 '18 at 03:32 AM

I run clients and server on the same machine.Check the logs below, I find that server called HandleSeamlessTravelPlayer in AGameMode::PostSeamlessTravel before remote clients start seamless travel.The client finally crashed in "check( !ObjectNetGUID.IsDefault() && ObjectNetGUID.IsValid() )" of FObjectReplicator::StartReplicating ClientLog: link text

ServerLog: link text

errorclient.log (29.3 kB)
errorserver.log (30.9 kB)
avatar image superman_tb Feb 05 '18 at 05:50 AM

Finally, I find the bug.See the debug picture as below alt text My project has no TransitionMap, so there is no chance to check the condition "CurrentMapName == DestinationMapName" to do "Connection->ClientWorldPackageName = NAME_None;" So there are two solutions: 1. Add a Transition map to the project 2. modify the "FSeamlessTravelHandler::StartTravel" in World.cpp

@Sean L ♦♦ Is this a engine bug?

debug.jpg (157.7 kB)
(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question