[Solved] Emitter is replicating, but shows different behavior on client

Hi guys,

I have a blood splatter emitter that spawns decals on collision with the floor, this works excellent on server side creating a bloody gory mess.
However, on the client side, it works but, it works very unreliable, only creating half or less of the effect that you see server side.
So, the replication works but somehow the spawning happens very unreliable.

The events are instigated when the Character health is changed (this will need a more elegant solution, but thats not relevant), everything happens in the character BP.

Please have a look at the attached images.
Thank you in advance for the help.

First of all remote clients can’t “GetController” other than their own so you must have a lot of errors happening.

I guess your setting health on tick or very often? The server will only replicate the actor at the NetUpdateFrequency which by default is 100ms (10 times per second). If your health changes 60 times a second on the server then ~50 updates will never reach the client as it is only the latest value that is sent. If the health is updated in quick bursts then you would also just receive ~1 update.

Now you may be tempted to set the NetUpdateFrequency to 16.6ms (~60FPS) but it adds a lot of extra CPU time and potential net traffic that may be spent better elsewhere.

Perhaps the clients already have what they need to spawn the emitter by themselves and you don’t have to wait for the health to be updated?

Thank you for your insight, very helpful!

I am aware of the replication frequency, I was under the impression that a RepNotify event would fire any time a variable would change reliably, apparently this is not a good way of settings things like this up. I have now used the EventAnyDamage node (which is ran from server anyway) to directly execute a multicast, this reduces the amount of CustomEvents and it works perfectly!

Thank you.

BTW: I do not get any errors trying to get the controller, it seems to work just fine. Just to be safe I have replaced this with a reference to the collision capsule component.

Edit: Now that I think about it, it makes sense that a RepNotify event only fires when your variable is updated from server, I now understand why this was a bad setup. If the character is damaged a couple of times and this is only updated after x amount of time you will have one RepNotify event for multiple hits, thus decreasing the amount of emitters spawned on the client.