Hello. I am new to multiplayer networking and I have two basic questions.
First a brief synopsis:
I have created a series of multiplayer game components in C#. They are
- Generic TCP/UDP client
- Generic TCP/UDP server
- Game server, matchmaking server, chat server
To get through my prototyping, I used JSON serialization with easy success. But I feel uneasy about JSON's ability to keep networking messages small. For example, I am developing a sports game with Unity to be a prototype for the aforementioned products. This game can be up to 8 players, but there's not too much data that needs to be sent. In reality just the two vector3s for each player (position and trajectory) and one for the game object (ball). With JSON and a modest approach, I think I can keep the size of each message to around 1kb. But I have no idea if this is a lot of data, or nothing at all.
The clients would send much less than that to the server, at least twice per second.
The server would send this ~1kb message to each client, at least twice per second (so 16kb/s from the server for 8 players).
Is this a lot?
If it is, I was interested in using Google's ProtBuffs, but it looks like using that with Unity is a bad idea. Are there any other techniques, or would I be OK with JSON? Or should I write my own? The other issue with JSON is that it's a lot of string parsing for the server (imagine 1000s of clients).