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"

Generalised method for waiting for replication

I've been prototyping a turn-based game with no networking functionality, and I've begun to start adding networking to it because it'll be the only way it's played. I've gotten my head around most of the networking concepts, and the biggest issue right now is using functions across the network.

In earlier prototypes functions worked great - they returned values and execution waited for the function to complete. A good example is a purchasing action -

  1. a UMG widget blueprint has a purchase button, which calls a function in

  2. the possessed player blueprint that performs checks and makes changes to variables in a

  3. simulation blueprint.

  4. The possessed player blueprint function returns a success message to

  5. The original UMG widget which then displays it, and calls

  6. an update function that gets variables from relevant simulation blueprints and displays them

The issue is that because the purchase function now has to have an event call it (so that the event can replicate to the server and the function can run on the server), the update function at the end gets variables from the local replicated copy of variables/object, and the replication takes time, the update function doesn't display the latest value of variables - the changes on the server aren't replicated in time for the widget to get the latest variables.

What I'm looking for is a generalised way of telling an execution path to wait until selected local variables have been replicated from the server, and to only continue once that has happened. I've kind of done this using an onRep_ function earlier (only creating the HUD once it's been called, etc) but that only works for individual variables, and it gets messy because UI functions have to be put into simulation blueprints!

Or a way of having functions called from a client execute on the server, give a return value, and have the execution wait like they would locally.

Ooooor a way to create UMG widgets on a dedicated server (so that all function calls would natively happen on the server) and then somehow have them redirect to the client.

Has anyone else faced this issue of getting clients to wait on server return variables, and if so, how did you get around it?


Product Version: UE 4.9
capture.png (103.2 kB)
more ▼

asked Nov 07 '15 at 04:13 AM in Blueprint Scripting

avatar image

46 2 5 7

avatar image goldensyrupgames Nov 07 '15 at 04:42 AM

My current line of thought is to call the function locally and have it performed on all locally replicated objects/variables (it's turn based so I can afford to replicate everything to clients) to get the return value, and then call the same function on the server to make the change. The only things this will add to the current workflow are a few more event calls.

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

1 answer: sort voted first

I just ran into this issue. I ended up using RepNotify on the variable to do anything on the client since that gets called when the variable is updated in the clients from the server

more ▼

answered Dec 30 '15 at 02:43 AM

avatar image

208 24 21 30

(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