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 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

Product Version: UE 4.11
Tags:
more ▼

asked May 18 '16 at 03:14 PM in C++ Programming

avatar image

Romenski
21 1 2 5

avatar image Tenderz May 18 '16 at 03:26 PM

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.

avatar image Tenderz May 27 '16 at 01:35 PM

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

avatar image TX_Alpha Jun 27 '16 at 12:45 PM

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?

avatar image Tenderz Jun 27 '16 at 12:57 PM

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++.

avatar image TX_Alpha Jun 27 '16 at 03:15 PM

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.

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

1 answer: sort voted first

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

more ▼

answered Sep 07 '18 at 06:16 AM

avatar image

DLROKen
31 1 3

(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