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"

Array OnRepNotify replication doesn't run on server

Hi Staff!

When I set an elem in a replicated array, or add one, the OnRepNotify event doesn't run on the server, only on the client. Yes, the actor is set to replicated, I set it on the server, and try to print a string then, and only the Client writes it out. It could be reproduced in a clean project. Just press G, while starting it with 2 PIE windows.

It has a long history:
https://answers.unrealengine.com/questions/188370/repnotify-in-a-custom-component-not-working.html
https://issues.unrealengine.com/issue/UE-12029
It sais it couldn't be reproduced, but now it quite is.

Thank you for your time (probably) Kyle!

Product Version: UE 4.14
Tags:
myproject2.zip (379.0 kB)
more ▼

asked Nov 18 '16 at 10:25 PM in Bug Reports

avatar image

CrimsonHawk
531 23 24 40

avatar image Sean L ♦♦ STAFF Nov 21 '16 at 03:50 PM

Hey CrimsonHawk,

I'm looking into the issue, and I'll respond back as soon as I have an update.

Thanks

avatar image CrimsonHawk Nov 26 '16 at 01:21 PM

No update since then?

avatar image Sean L ♦♦ STAFF Nov 28 '16 at 04:26 PM

Unfortunately, not yet. I'm discussing this with one of the developers, but we were closed for the holiday most of last week. Hopefully I'll have more information soon.

I appreciate your patience.

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

4 answers: sort voted first

Y'd better using Playercontroller to transfer variable to Gamestate : )

more ▼

answered Jan 11 '17 at 03:07 AM

avatar image

youthnick
170 1 5 7

avatar image CrimsonHawk Jan 11 '17 at 08:10 AM

What does it have to do with PlayerController and GameState?

avatar image youthnick Jan 11 '17 at 08:13 AM

U can send variable to PlayerController using custom function , then transfer this variable to Gamestate using custom function too.

avatar image CrimsonHawk Jan 11 '17 at 08:20 AM

I think that you misunderstood the problem. The variable is replicating just fine, the problem is that the event doesn't run when it happens.

avatar image youthnick Jan 11 '17 at 09:52 AM

Yep, that is known bug in UE , I just told u the another way to replicate the variable : )

avatar image t0b4cc0 Jan 28 '17 at 11:16 PM

this is not about replicating a variable

this is about a feature not working as it should

the ON REP function of a variable that is set to rep notify should be called when the variable is being changed.

this is not the case however, and even worse it works is some ways and does not in others...

avatar image CrimsonHawk Jan 28 '17 at 11:41 PM

What I can't understand is how can it be "Backlogged", since it should be a core feature. Like top priority, since it could potentially affect everyone who is working on any multiplayer project. So if you would be so kind, go to the given link and press a Vote!

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

Hey CrimsonHawk,

After speaking to our developers, it appears that rep notifies are not called on the server for properties created in c++, but they are called on the server for blueprint properties.

I've looked into your project, and used a bit of a different setup that seems to be working on my end. Give it a shot:

alt text

Let me know if that helps.

arrayrep.png (52.7 kB)
more ▼

answered Nov 30 '16 at 02:43 PM

avatar image

Sean L ♦♦ STAFF
44k 485 149 438

avatar image CrimsonHawk Nov 30 '16 at 03:09 PM

Hi!

  1. My project is purely made with Blueprints. I didn't make anything in C++ for it. If you look at the example project I attached to the question, you can see it is also only made with blueprints.

  2. The RepNotify works as intended with the single variables, but only fires on the client when an array member is set.

  3. This difference between blueprint and C++ makes no sense whatsoever, even if it shouldn't affect me currently.

With your setup you remake a brand new array from 1 piece of data, and not just changing/adding 1 element in it. This wouldn't help in any practical situation. This way I could probably make it work, if after every modification I set the NewVar1 to NewVar1. But it also makes no sense at all and the problem would still exist.

(P.s.: I forgot to set the default map to NewMap1, and it has to be opened manually first, but I guess you figured that out already.)


Thanks for working on this bug/question.

avatar image Sean L ♦♦ STAFF Nov 30 '16 at 03:40 PM

I just wanted to provide that information for future use, I understand you're working in blueprints, but I figured it'd be nice to know in case you ever decide to expand the project to include C++.

After further testing, I've gone ahead and entered a bug report. I do believe that this is not working as intended.

Here's a link to the public bug tracker so you can keep an eye on the status of the issue:

https://issues.unrealengine.com/issue/UE-39186

Thanks a lot for your report and for providing a test project.

Let me know if you have any other questions.

Have a great day

avatar image CrimsonHawk Mar 30 '18 at 10:22 AM

Hey Sean! This issue was flaged for planned fix for 4.20, now it was put to won't fix a few days ago, because of "no updates". Update: I'm still eagerly waiting for this fix!

avatar image CrimsonHawk Oct 06 '18 at 06:12 PM

Hey Sean!

The ticket writes " let us know by posting on the AnswerHub or UDN, and Epic will re-open the ticket for further review." Would you reopen it?

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

I been further testing this. Set array element and add array element do trigger RepNotify, unless they are inside a "For loop",(a for each or each with break or normal for, doesnt matter wich one). I dunno if this is intended to skip the notify call cuz of the many "simultaneous" calls to the notify or is just a bug.

more ▼

answered Aug 19 '17 at 02:03 PM

avatar image

Alfffffffffff
38 6 5 5

avatar image CrimsonHawk Aug 22 '17 at 07:22 AM

Did you check the attached project zip? I didn't use for loop there, and it still didn't work as it should.

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

This is a bug that i hope is never fixed. With this bug u can choose when to notify and when not to notify. When using arrays, after a lot of changes this allows you just to notify once, at the end, instead of a lot of notifies in every change you make to a array with set elements or add functions.

more ▼

answered Sep 06 '17 at 01:53 PM

avatar image

Alfffffffffff
38 6 5 5

avatar image CrimsonHawk Sep 08 '17 at 08:51 AM

Then you are misusing it. Feeding a variable to itself so it would replicate is a very bad use of this feature. What you should do is set the array to non-replicated, and when you finished modifying it call a replicated event that updates this array on the clients. It not only would save some computing and networking resources, but even would make your code more readable.

avatar image Alfffffffffff Sep 17 '17 at 10:27 PM

is the only current workaround. :rolleyes: .Thats why is done this way. And it allows alot of control. The whole point of a repnotify variable is not to do what u propose.

avatar image CrimsonHawk Sep 26 '17 at 11:13 AM

The whole point of the rep notify is to be notified when it is replicated. Any other functioning is a bug. Any other "exploits" are misuses. This question is not about how to work even if these bugs exist, I solved that. It's about informing the developers about the problem, and asking them to fix it when they have time for that.

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