#Syncing Regularly Changing Values w/ SA Architecture

4 messages · Page 1 of 1 (latest)

cerulean quiver
#

I recently started converting my "Mixed authority" game to a server authoritative model and I'm having trouble deciding the best course of action to synchronize my health and stamina values across the network. Right now, health/stamina checks are done on the server and also modified on the server and then the change is sent to clients. The only issue I'm having is noticeable latency on the client. These values will often change every tick, especially with passive regen. What would be a good way to hide this latency on the clients? My thoughts so far are to not synchronize every update and keep them in sync by synchronizing actions (e.g. when a jump is performed, both the client and server will modify the stamina independently as part of the jump logic, but the stamina change itself will not be sent over the network). My worry is that the client may get out of sync. Is this something that I could apply CSP to or would that be over-engineering this?

teal reef
#

You can set syncvars to exclude owner and set them locally on client as well. They won't get updated results from server in that scenario though.

#

There's also a new feature coming to synctypes in a week or so to allow client local setting while letting server overwrite value. It's not particularly useful in all situations because server could set values back to old values the client already predicted past.

cerulean quiver
#

Hmm, so either way I'll need to update stamina on the client and server separately to prevent latency?
Thanks, @teal reef!