I have a solid background in programming but I have never really tried networking so I am attempting to make a multiplayer game using MLAPI. The game I’m making is a TBS game and the player object needs a list of its units. I need a way to sync this list to the Server and other clients but I’m not sure how to do it because to my knowledge you can only create a NetworkList with data types and not classes. Is there a way I can have the server keep seperate lists for each player then tell each client about them?
Not familiar with MLAPI, but in general you sync the contents of the list. Or in your case, the contents of the class in the list.
So, if you have a class like this:
Public class my class
{
Public int myint; // 4 bytes
Public float myFloat; // 4 bytes
}
You will send 8 bytes per entry for manual serialization. A list of 10 entries is 80 bytes.
The contents of the list you send when a player joins the game. Then you update only the entry when the list changes to save bandwidth.