As a Roblox developer, it is currently impossible to store buffers in attributes.
With server authority being a heavily supported Roblox feature, a high priority the developer should undergo when making a game with server authority is to cut down on data being sent over the network, especially if the attribute is going to be changing every frame during the fixed simulation. I assume Roblox does some internal “compression” for types, such as numbers being converted into shorts or ints when the number is a small integer or floats when the number is a decimal. But it becomes a headache with trying to replicate data structures like tables which would need to be JSON encoded into a string or as a delimiter separated string. You end up losing a lot of compression, especially with floating point numbers, if stored as plain text. The other “solution” would be using a replication solution such as Replica and tying it to the instance but you lose the benefit of streaming in and streaming out the data.
Buffers are perfect for this because it can allow us to replicate tabular states in smaller amount of data size with methods such as bit packing and compression. Even without several authority it would heavily benefit all games in network optimization.
What’s wrong with modules is that they exist entirely outside of the server authority network framework. You need all your logic to exist within that framework so clients & server can properly rollback & predict game state.
The main benefit of buffers is that it uses the same allocated chunk of memory when you make edits to it. However, Roblox’s replication system doesn’t know how to do “diffs” on bits. It simply overrides the value that changed, and so possibly uses a new allocated chunk of memory (which defeats the purpose of a buffer).
However, you can technically store buffers using strings as character → bit representations. It’ very easy to translate from bit to char using the bit32, buffer, and string libraries.
May I ask why not use buffer.tostring() and buffer.fromstring()
Yes it adds a tiny bit of GC pressure with the intermediate strings but compared to doing it via remotes or something else I’d imagine its better..?
For server authority IDK that well but
Buffers are supported by bindable and remote events and functions; importantly, buffers implement transparent on-the-wire compression . A sufficiently large buffer will be compressed before sending the data to the client/server and decompressed on the other side automatically, thereby reducing bandwidth; when buffers are used for replication, we recommend grouping smaller buffers into larger buffers, similar to the example above, to take maximum advantage of the compression.
Roblox did specifically state that they would be adding buffer support to attributes years ago, but they haven’t updated that on us much by 2026.
actually good suggestion
But it will probably have same cap as strings
RN hacky way to go around is to use binary strings but proper buffer support without conversion would be better