function module:SendContainerSlotClick(slotClicked, containerId)
local buffer = ByteBuffer.Create()
buffer:WriteSigned(64, slotClicked)
buffer:WriteSigned(64, containerId)
PacketEvent:FireServer(SendContainerClick, buffer:ToBase64())
end
What are your thoughts
Is this far more effective than, sending the entire data as its own parameter value during its FireEvent?
Say for instance i was sending a Vector3 object, it sends the byte value for the entire object Vs sending byte values for x y z values. Having more control of what kind of byte and what size the byte is.
A Vector3… only has its X Y Z values. That and a tag is all that’s sent over the network, you would be sending more data if you sent it in string representation like you propose.
A Vector3 is a vector.new(x, y z) which creates an Object of itself. Which also contains things like .Magnitude, and other vector properties/functions meaning you’d also be sending those during the object value being sent.
meaning your’e sending extra bytes when its not relevant.
There seems to be a fundamental misunderstanding of how ROBLOX replicates values and properties. Your attempt to [give] “better on performance” is going to ultimately drastically reduce the actual performance, as the Lua overhead is going to be much greater than the transmission time for the minuscule amount of data that is saved through encoding the data into a smaller datatype.
Bandwidth is cheap these days. No need to write an entire system to encode your Vectors into 8-bit chars streams.
So its recommended to just sent all the values as their own just to save the time of converting to base64 and then converting back into actual data representation hmm
Alright seems like theirs enough reason to switch this up.