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"

[Feature Request] Client-side replication event.

Event Dispatchers are a great way to update UI and control the flow of events without requiring potentially costly busy-wait in Event Tick. Set up some Event Dispatchers for when variables change, register some events from your UI, and now your UI only updates when your variables change. Efficient and easy to reason about.

However, the situation gets a little more convoluted when replicating variables. The RepNotify setting for variables triggers a OnRep_VAR function to be called. But only on the server. Similarly, Event Dispatchers cannot be marked as replicated, so Event Dispatchers set up to dispatch in a function/event that changes a variable only work on the current machine (usually server for game-critical variables). This means the flexibility of Event Dispatchers to provide on-demand updating is limited. Currently, I am working around this by marking my variables as RepNotify, then dispatching an RPC to the client from the OnRep_VAR function, which then calls the EventDispatcher on the client as well. This works, but is a bit boilerplate.

Feature Request: A notification of replication to the client would be extremely useful for keeping the client state, UI, and any other events in sync. As far as I can see it, there are a handful of options to accomplish this task:

  • Create a new replication type that would run OnRep_VAR on the server and the client.

  • Allow Event Dispatchers to be marked for replication. Thus, whenever an Event Dispatcher is called, it is replicated as well.

  • Some other mechanism to listen for when variables are replicated to owning client. Perhaps explicit registration for event delegates that listen for when a specific variable is replicated.

Product Version: UE 4.12
Tags:
more ▼

asked Aug 27 '16 at 11:00 PM in Using UE4

avatar image

GrimlessBBS
65 10 15 17

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

2 answers: sort voted first

Hmm. This may actually be related to my other bug report ActorComponent does not replicate variables to client. That would likely explain the confusion. I am using ActorComponents to test this, but they are not replicating. Sorry for the confusion, all! It's likely that these issues are related.

more ▼

answered Aug 28 '16 at 05:33 AM

avatar image

GrimlessBBS
65 10 15 17

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

Is that c++ bug/feature that OnRep_VAR doesnt work on client?

Because i have blueprint only project and its main way for me to keep client sync with server and its work fine (with the exception of OnRep_VAR isnt called if you add elements to array).

more ▼

answered Aug 28 '16 at 04:16 AM

avatar image

CriErr
1.2k 57 21 57

avatar image GrimlessBBS Aug 28 '16 at 04:32 AM

I will do some more testing, but as far as I could tell, in Blueprint, the OnRep_VAR function is only called on the server.

avatar image CriErr Aug 28 '16 at 05:02 AM

100% sure it getting called with every single type of networking on every client (remote client, listen server, dedicated server and standalone client).

alt text

 [2016.08.28-04.57.21:111][520]LogBlueprintUserMessages: [BPAC_Ability_Library_SDC] Server: Hello
 [2016.08.28-04.57.21:129][521]LogBlueprintUserMessages: [BPAC_Ability_Library_SDC] Client 1: Hello

As you can see, its even getting called if you overwrite OnRep_VAR in child blueprint. Are you sure object you trying to use is actually exist on the client?

(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