• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

How many buffers should I use?

H

HelmutShaftshwingen

Guest
I just got some LAN working for the first time in one of my games, so now it's time for me to start filling up packets with information about objects in the room.

Now I'm wondering how I should send packets in a resource friendly manner.
I've read that:
-strings should be aligned to 1
-8 bit integers should be aligned to 2
-16 bit integers and floats should be aligned to 4
-32 bit integers and floats should be aligned to 8

so should I make a separate buffer for each data type?
or pick one alignment on one buffer for everything to go into?

if I have multiple instances of an object spawning and despawning,
should I make one buffer that is specifically for that object and the associated data?
 
Top