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"

[4.15] Post ServerTravel Events

I've been experimenting with ServerTravel lately and I can't seem to find consistent behavior with my blueprint scripts after server traveling for either the server or client. I've been able to find very little sample documentation of servertravel so all of this might be a misunderstanding of it. I've tried many things and have learned a lot, but I'm officially stumped and reaching out for help now. I've seen many others post about this, but no answer seems to have been found.

The problem: I'm trying to find the proper way for a listen server to detect when a client has finished loading the new level after the servertravel is called. The listen server also needs to know when it has loaded the new level for themselves.

My situation: I have a listen server with a lobby taking in clients on a blank level like you'd expect of a lobby level. Once all clients and the listen server are ready to play the game, they travel to a new map and begin playing in the new map. The new level requires some logic in the gamemode to set it up such as spawning actors and the clients need to know when to load UMG with data on the other clients once the level has finished loading.

The ideal flow I'd like to implement is:

  1. Server travels to a new level from a lobby, carrying all clients with it.

  2. Server and client load the new map

  3. Some trigger occurs for the listen server AND clients (even if individually) that informs the server they have fully loaded the new map and are ready for play

  4. Once all clients are ready for play, the server tells all clients that the game is ready to begin and performs some spawning logic

  5. Once a client receives the ping that the game is ready, load UMG elements with data from other clients provided by the server

The issue is #3 with this "trigger"

Things I've tried but find inconsistent behavior when testing in packaged games (as servertravel currently doesn't work with PIE):

  • Client fires BeginPlay from levelblueprint

  • Client fires BeginPlay or Tick from playercontroller or playerstate (since both are "respawned" during servertravel)

In all cases, the idea is that a client pings the server that they've "loaded" the level using a case above. The server collects which clients are ready with some data storage and fires off RPCs to each client once all are ready.

These cases don't fire for the server player however which causes huge problems in determining if the new level is actually ready. This is because of something happening with servertravel. Even for the client, the RPC is inconsistently fired causing the server to think they're ready before they actually are which makes the game "go" without them. When I say inconsistent, I mean it literally seems to randomly fire the "trigger" to inform the server they're ready and sometimes it doesn't from the server's perspective.

Product Version: UE 4.15
Tags:
more ▼

asked Jun 01 '17 at 04:14 AM in Blueprint Scripting

avatar image

Memorykiller
76 1 3 9

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

0 answers: sort voted first
Be the first one to answer this question
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