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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Client side issues after first seamless travel

My starting point is, LAN on the same physical machine. Two packaged instances running development builds. Created a session which has been successfully joined by a client. Evidence of that is both characters can walk around in the lobby level and replicate fine. The problem comes when we move from lobby to the next map.

The way I think I do should do this is with this code "GetWorld()->ServerTravel("/Game/Maps/Arena1", true);" which is run from the server GameInstance. This then calls PreClientTravel on both Server and Client: I have logs that state this. The name of the playercontrollers during the PreClientTravel is PlayerController_0. I am expecting HandleSeamlessTravelPlayer and InitSeamlessTravelPlayer to be called on the server with both server and client playercontrollers, but this only happens with the servers local player. Strange also is that during this process on the client another player controller gets created from a network request, so now the client has got two playercontrollers updating. I guess swap player controller should be called somewhere. A little later on PlayerCanRestart_Implementation does get called for both player controllers and they are called different things now, one is PlayerController_0 and the other is PlayerController_1

I am guessing I have not switched playercontrollers on the client correctly at some point. I have overriden SwapPlayerControllers on GameMode but this never gets called.

Does anyone know what could be the issue?

Product Version: UE 4.19
Tags:
more ▼

asked May 26 '18 at 09:36 PM in C++ Programming

avatar image

GlassHalfBroken
11 1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

In the child class' overridden functions do you call the parent class' version of the same function?

more ▼

answered May 27 '18 at 09:30 PM

avatar image

mightyenigma
3.8k 18 20 20

avatar image GlassHalfBroken May 28 '18 at 05:02 PM

Thanks for answering. Yes is the short answer, however I am glad you asked as I had missed a couple that appear not to be relevant to this issue. I can see that both instances have loaded into the correct map so I added a debug key to spawn two pawns assigned to the playercontrollers on the server. Nothing appears on the client, although when I close the client on the server the associated pawn and playercontroller get removed correctly. As if the server is unaware of the clients problems.

Any further suggestions welcomed.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Well, It looks like you know more about network code than me, and I actually have done no coding except in Blueprint with Unreal. However, I can share a few observations that might help in your search for the problem:

  1. On the server, remote client's Players all get a unique index number, just like local players.

  2. On remote clients, I guess the player controllers exist but those that don't live on the client's machine get index = -1, so you can only have player indexes 0,1,2,3 and -1 (unless you modify the C++ code for that).

  3. Because player indexes are all 0,1,2,3 and -1 on remote clients, you can't match up client players with the server of that player by comparing player indexes - you have to go through their Pawn and get the controller that way OR the PlayerState's unique player ID integer var to find the match (which is how I do it to decide which one is which when a player joins a game in the middle of a session).

Hope those help.

more ▼

answered May 29 '18 at 09:22 PM

avatar image

mightyenigma
3.8k 18 20 20

avatar image GlassHalfBroken May 30 '18 at 08:30 PM

Thanks again for the reply. I feel it is something to do with the index or id. I will let this thread know if I sort it out. Cheers.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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