I recently learned about game optimization… Specifically network traffic. It seems to me that using bytes for EVERYTHING would be ideal…
Currently I have my server handle everything inventory related, but the client handles its UI. So, the client sends the server info when its using its inventory. Would it be better to send, say, a byte instead of an integer? Clearly it would be assuming you don’t need a value higher than 255. But what about other things, such as string? Could I send a byte(enum), and then convert it to a string on the server?
It seems as though it’s sending less data vs one less command the server needs to execute(albeit a small one - converting enum byte to string). Which is preferable? I could right now easily change essentially ALL of my variables to bytes. Should I? I would be very nice to learn which is preferable so I won’t have to make all of these optimizations in the future.
Also, how many bytes does a “2d texture” reference have? Or a “static mesh reference”? Is there some place I can find how many bytes every kind of variable has?