Yeah, that works when you have almost no lag, on localhost. But not in a realistic online networking environment. No worries! Hopefully there is someone else that has figured it out
Hi there,
I read over Gabriel his nice client-server explanation that you can find here:
[http://www.gabrielgambetta.com/client-server-game-architecture.html][1]
What I want to, is have my pawn (not character class) replicate his movement smoothly to everyone. (On a dedicated server)
This is my current set up, for example the rotation:
It does not give me the desired behaviour, as there seems to be some input lag/rubber banding.
I have set the localhost packet lag to 250ms, but with correct prediction/reconciliation that shouldnât be a problem.
Anyone any idea?
I am also probably doing the timestamp thingy wrong, but I cannot find how else to do it.
Thanks in advance!
After a bit of debugging, it also seems that at step 3, the timestamp you get from the Execute on Server Event, is always this:
So this happens:
This does not happen with a Multicast, but thatâs not what I need. UE Bug?
It seems that you donât set your values that you want to send to the Server and Clients are not replicated. Try to promote the values you want send to the Server. Set the âtempâ values to replicate and maybe to reliable if you Need it.
EDIT:
If you have a movement component, set the entire actor to replicated as well.
Hi there,
No movement component.
I donât think the variables need to be replicated, since I am using replicated functions instead.
Its not that the replication is not working, itâs that itâs not predicting/reconciliating correctly after it gets the rotation back from the server.
If you see my comment on my question, that the timestamp returns 1110000. Well, if I set that same function to Multicast, it does return the correct timestamp. So somehow it gets lost if itâs a server function. (replicating that variable doesnât help)
Sorry, but then i have no idea whats wrong. In my Project i replicate all Things that may be from interest for all Clients and the Server. For now i have no Problem with that.
Decided to use another form of prediction/reconciliation.