Below is how my datas are packed :
[UDP HEADER][SEQ][ACKED_SEQ][TYPE][LENGTH][BITMASK][X][Y] 28bytes int int 1byte 1byte 1byte b b
I'm trying to find how much players can fit in a 50kb/s upload connection.
header_size = 28 + 8 msg_size = 5 players = 15 netfps = 30 packet_size = header_size + players * msg_size outgoing_size = packet_size * players bandwidth_needed = outgoing_size * netfps >> 49 950 for 15 players
First question, is my math ok ?
Also, i'm using 4bytes for my sequences, I could use 1 byte if i say that after 255 it goes back to 0. Of course it's problematic since i'm discarding too old packets based on that sequence but i could build something really ugly on top of it and maybe totally unsafe. Is that something which has already been done in those situations ? Are there some algorithms for it ? How stupid is that idea ?
I can almost answer the last question in my situation since reducing the header_size from 36 to 30 let me accept half a player more. I guess it could matter at larger players scale but not here.
Can i be more compact than what i'm doing ? I'm voluntary ignoring variable netfps, hidden players...
I could remove the length field since i know how much size my properties have, but that's all. With this and my weird new 2bytes msg header i'm now at 17 players. Knowing that it's not even true in real game experience since i'm having projectiles which counts as much as a player in a stress situation.
And by curiosity, how much bandwidth i could get for a dedicated server at ~40$/m ? (not VPS)



















