I’m making another r/place game on roblox, Im trying to get a 1000x1000 grid, my issue is, I get this error when I try and save data for 1 million pixels,
"Serialized value exceeds 4MB limit."
I tried encoding and decoding it with json to try and compress the data but it yields the same result
Is it possible to go past this value, and/or bypass it?
the data I’m saving looks like this
ds:GetAsync('Grid')['x,y'] = { -- x,y being the pixel location
Color = Color,
Player = Player,
LastPlayer = Player,
LastColor = Color
}
200x200 grid works as normal, 300x300 already yeilds this result
Roblox Datastores have quite a few limits, so this would be difficult to do for every server startup.
Apparently for each key value you can have up to 3 million characters, and there’s a 6 second cooldown between Set requests. There’s no written cooldown for Get, so maybe you could somehow split all the data between a few keys instead of a key for each pixel.
What’s the purpose in storing the previous player & color? Wouldn’t storing the current player’s user ID and current color for each pixel suffice? This will halve the current amount of memory you’re utilising. Additionally you should round the color channels of Color3 values, i.e; Color3.new(0.123456789, 0.123456789, 0.123456789) would be stored as Color3.new(0.12, 0.12, 0.12).
local Pixel = {
ID = Player.UserId,
Color = {
R = 1,
G = 1,
B = 1
}
}
For further memory optimisation you could store player IDs in a base greater than 10 (decimal), for example 16 (hexadecimal).
This is some basic sterilization which converts colors and the names to one string, after that you can make a decompiler to convert the strings to its corresponding values. (that still takes around 60 bytes per node)