When data (variables) is sent from one actor to another via a custom event or interface, is it better to send little and then request for more, or is it ok to send all at once since it is not going to be used yet anyway?
If relevant, online is required and server should be authoritative. Actors in this case a humans performing melee combat, and the solution should scale to hundreds if not thousands of such actors performing checks like these every 0,7 - 1,2 seconds.
Example of “request more if needed”:
ACTOR1 ACTOR2
Event1 float -> calculate
branch
request more
calculate <- result Event2
send more
Event3 ---> apply received (e.g. lower health)
bunch of
data incl.
floats, class
etc.
Additionally, how might one find answers to similar questions in the future by themselves?
First of all you need to make sure what you running code on server, if you running on server and custom event is set to “Not Replicate” or “Run on server” this code should run exclusively on server without replication (as it is described at event call). If your operation at the end modifies replicable property changes should be applied to client at end. Note that properties are synced only when frame is finalized on the server, so there should be no difference in performance of setting non replicated and replicated variable, The same thing if you want to do something client only, but keep in mind anything that happens in client can be altered by user, so any sensitive stuff should be done only in server and server should treat data from client as not trustworthy.
You should only replicate when it needed, server have ultimate copy of the game state which is replicates to all clients, so if you dont need anything from client you should do things on server and changes automatically be applied via replicated varables. Same goes with client, for example UI don’t need to have any contact with server, UI should reponce to data that is in the client which is replicated from server, server should not run any UI code as it does not diisplay anything.