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"

How can I pause a game running on a dedicated server?

I'm working on developing a training simulator, and would like for the simulation to pause at various points so that the trainees can answer questions related to what they're doing.

The single-player prototype worked without a hitch, but the project I'm working on is a multiplayer game hosted on a dedicated server. So far, every attempt to pause the game has failed.

Blueprint Code

Here's the relevant blueprint code in my PlayerController: Request Pause

Invoke Pause

I created "TEST_ClientRequestPause" and tied it to a button press so that I could test easier. It makes an RPC call to the server-side method (which would normally be triggered by an event on the server). The server-side event then calls other RPCs to attempt to pause the game. I've tried:

  • Server-side only

  • Client-side only

  • Multicast

The image above shows calls to the client-only and multicast RPCs.

Client Log

[2019.01.08-16.31.27:064][470]Strm: Error: Client request pause

[2019.01.08-16.31.27:096][472]Strm: Error: Invoking multicast pause

[2019.01.08-16.31.27:097][472]Strm: Error: Multicast pause success: false

[2019.01.08-16.31.27:097][472]Strm: Error: Invoking client pause

[2019.01.08-16.31.27:098][472]Strm: Error: Client pause success: false

Server Log

[2019.01.08-16.31.27:076][296]Strm: Error: Server request

[2019.01.08-16.31.27:077][296]Strm: Error: GameMode can pause: true

[2019.01.08-16.31.27:077][296]Strm: Error: Invoking multicast

[2019.01.08-16.31.27:078][296]Strm: Error: Multicast pause success: false

Analysis

The RPCs seem to be functioning as expected (the events are in the expected order and in the expected logs). The GameMode is reporting that it can pause. Perhaps network pausing is limited somewhere else (this post seems to indicate that network pausing is disabled by default). The log indicates that immediately after invoking "SetGamePaused(true)," the "IsGamePaused" node is returning false. I've also connected the boolean output of the "SetGamePaused" node to my log statement - it also returns false in all cases.

If anyone has any insight on why that might be the case, I would love to hear it. Is there an option somewhere in the project that needs to be set? Do I need to manage my RPCs differently? Answer #6 from vipeout in this post seems to suggest that the clients need to pause before the server pauses, but I can't seem to get the clients to pause (and I'm less concerned with preserving the "pauser" in the world state). Is there a known issue that would prevent a dedicated server from pausing? Are there any common mistakes that might cause the "SetGamePaused" node to return false?

Thanks!

Product Version: UE 4.18
Tags:
requestpause.png (228.6 kB)
invokepause.png (172.4 kB)
more ▼

asked Jan 08 '19 at 04:55 PM in Blueprint Scripting

avatar image

Bryant_PSC
6 2 7

avatar image Bryant_PSC Jan 16 '19 at 09:17 PM

It's been a week - time for a little bump to get this thing back into circulation. If nothing else, it'll indicate that I'm still interested in this conundrum!

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

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