Posted: 26th Sep 2022 13:30
I know I can read and write it as a byte, but under the hood, does it get sent as an integer or a true byte? I am asking because I am optimizing my network code, sending a single byte should be better than sending a 32bit integer (4 bytes). I even pack my bytes with individual bits if I don't need a full byte so that a byte can contain more than 1piece of information.
Posted: 26th Sep 2022 22:30
Maybe you could use pktmon to check
Posted: 27th Sep 2022 5:47
cybermind,

this stuff is a bit beyond me but a skim of Network.cpp seems to show integer (UINT)?

ie, @ CheckMessagesServer, i see GetBytes() followed by RecvUInt()

perhaps you can make more sense of the source than i so figured i'd direct you to it.
Posted: 27th Sep 2022 9:36
In the days of Dialup every byte mattered and sending a int when a byte is required is wasteful, maybe packing four bytes into a int and sending that would be better
Posted: 28th Sep 2022 12:38
I am trying to make speed-optimized multiplayer code, so if each added byte is still handled as a 32-bit integer and possibly with a bit of overhead for each value added to the message, I might as well pack all 4 bytes into one 32-bit integer sending only one integer with its overhead (plus all the other overhead for the packet itself, of course).
Posted: 28th Sep 2022 13:26
AddNetworkMessageByte() will only send a single byte over the network
Posted: 3rd Oct 2022 10:05
Thank you, it is good to know Is there any overhead for each byte? Something telling the receiving end that only a byte will be sent?
Posted: 3rd Oct 2022 11:59
Is there any overhead for each byte? Something telling the receiving end that only a byte will be sent?

Nope, the receiver has to assume the format of the message to read it correctly, or you can add your own values to tell the receiver what to expect
Posted: 7th Oct 2022 10:51
Nope, the receiver has to assume the format of the message to read it correctly, or you can add your own values to tell the receiver what to expect


Ah, yes, that makes sense, that's what I am doing when I read packets. Thanks for the clarification