Instant Syncing of SyncType<T> RPC SyncVar.SyncNow(); #468
Replies: 2 comments
-
The main issue is that SyncTypes are sent with a single header indicating number written among other things. SyncTypes could be broken up to send independently but this would mean including a header for each SyncType. EG: as of current you have 10 SyncTypes then the header would be roughly 4 + (1 * syncTypes dirtied). So under the assumption 5 were dirty the header would be about 9 bytes. If SyncTypes were to send independently it would be 5 bytes per. Under the same assumption of 5 dirty this would cost (5 * 5) 25 bytes. It's not something that's completely undoable, we may even be able to have a special packetId for 'rpc' sync types which would use the 5 byte header. I know this option has come up often enough so perhaps we can work something out after v4 hits stable. |
Beta Was this translation helpful? Give feedback.
-
Revisiting this again, realizing a problem outside the bandwidth comment. A SyncType sending immediately would also mean you essentially lose the interval option. At that point you're literally just using a RPC. When this is true you may as well just use a RPC... private int _health;
[ObserversRpc(RunLocally = true)]
private void ObsSet_health(int value) { _health = value; } //also could be your callback. |
Beta Was this translation helpful? Give feedback.
-
Per our discussion in Open Development, have the ability to Sync a SyncType instantly by using an RPC.
EDIT: This suggestion was created before I knew that RPCs and SyncTypes are both still sent by by Tick by default, its just that RPCs are added to the Iterating packet queue instantly and Synctypes are not.
So when saying "Instant Syncing of SyncTypes, I guess this suggestion now means to also make the SyncTypes be added to the Packet Queue Instantly in order with Other RPCs.
This Is asking for Multi Requirements
{
SyncTiming= Instant; <= default is Tick Options are Instant,Frame,Tick
});
Allows users to update their Syncvars in the order they are updated inline with Rpcs.
If Implemented, Keep OnChange Hook to not callback until Tick is Called.
Will put separate suggestion to add OnHook override option to invoke at the time it was received.
Need feedback on what the best Syntax is for calling this behavior.
Example
FirstGearsGames Example of Syntax
Beta Was this translation helpful? Give feedback.
All reactions