I’ve been experimenting with sending my information in two ways.
- The first way is to create a struct
and put the [SyncVar] tag on it. - The second way is to convert the ‘would-be’ struct into a string and [SyncVar] on a string. Basically a Vector3 would turn into something like, “1.2343 5.2634 9.23456” which I would then rebuild by manually parsing. Realistically there would be more than just a Vector3, but hopefully you get the idea
Really, all I want to know is which way actually sends less information, but I can’t find a way to do this. The Unity profiler doesn’t have the actual bytes, and NetworkServer.GetStatsIn/Out doesn’t do anything. I’m also running it on my localhost and I don’t know how to capture that information with programs like Wireshark.
Question: How can I measure the amount of bytes being sent by a SyncVar, OR Would my ghetto string method be smaller than syncing actual Vector3/Quaternion/floats/doubles/etc since it’s all on a single variable?