Automatic variable replication, any way to condense replication of variables?

You can do a bit better network optimization by making your actions/inputs deterministic. This will reduce the load per packet, therefore bandwidth consumption and network saturation. It’ll also reduce cheating in multiplayer. The setup posted above has the client “tell” the server what to do. So technically the client is the authority.

Each input by client should be scrutinized to determine “if” the action of can be done. The same should happen on the server.

e.g. Sprinting…
Input → switch has authority (remote) → func Can I Sprint → set Is Sprinting → Server Sprint [run on server]

Event Server Sprint → switch has authority (Auth) → func Can I Sprint → set Is Sprinting

There’s no need to pass a bool here. If it’s possible to sprint, the server will reach the same result.

You can also do a bit more to make a large portion of your client actions/inputs responsive… not having to wait on the server to respond or execute the action logic.

By adding the actual sprint logic to the above chain you can eliminate the inherited ping and server processing delays. For example a player with a 150ms ping will have a 150ms + srv processing delay before the action is carried out locally.

e.g.
Input → switch has authority (remote) → func Can I Sprint → set Is Sprinting → Do Sprint → Server Sprint [run on server]

Event Server Sprint → switch has authority (Auth) → func Can I Sprint → set Is Sprinting → Do Sprint

edit … added bp setup

1 Like