Download

Is there a c++ way to really really force a variable to get Replicated?

I’m finding it impossible to force Unreal to replicate a set of variables that I **really **need to get replicated on each frame/tick.
It’s the movement of VR hmd+controllers.

I am mostly Blueprints but could do some things in c++ if that’s what it would take.

So my basic question is, is there a way using c++ to REALLY force a variable to get Replicated?
I’e I don’t want to let the engine have a say whatsoever as whatever I do it seems to make the wrong decision.

Ideally without doing own socket stuff etc but please if you think that’s the only way, just hand it to me Doc.

(Further details in my Blueprint thread There must be a way to force variable replication on every frame!? But how? - Unreal Engine Forums)

Cheers
Fredrik

Could maybe use an unreliable rpc function with timestamp / value each tick? When received, discard if the timestamp is older than last received one, otherwise apply value.

@Fredrum Assuming you realize that the framerate can be faster than the network latency…

Thanks for the comments!
I’m now looking into my general tick rate as someone pointed out that maybe that was the problem and just doing some quick tests by turning off TickEnabled in most of the heavy actors makes it seems that assumption was correct. I then get a very reliable stream of Replicated values. Maybe one hitch per 50 values instead of one per 4-5.
So I’m now going back and translating more Blueprints to c++. I thought I had that under control so didn’t consider it. It’s a pain with this VR frame rate.

Also having that core design being so dependant on the directly replicated variables is not so smart so I’ll convert it to a more velocity based solution. Rather than being Location derived.