I am making a block game and the blocks placed by players will be saved into Datastore.
the blocks format are stored like this:
{
[1, 1, 1] = 1,
[1, 1, 2] = 1,
[1, 1, 3] = 1
-- and 1,000 more
}
The value is the block’s position, and the key is the block’s type.
The problem is that I’m storing thousands of blocks, and that’s a really lot if you would imagine.
So obviously I would want to find a way to compress it.
I already had come up with an algorithm here, which is to pack the current key and the previous key into one and calculate the incrementing index of the position into one.
However, the block data is not ordered and randomized. And I do not know how would I code and achieve my algorithm.
Is there any algorithm method I could use to compress them or do just I have to make my own one using a formula?