Any efficient JSON string compression algorithms for lua?

Hey, so it’s gotten to the point in my game’s development where I have to implement data saving and I’ve created my own datastore using JSON, but the problem is that I want to save as much space as possible but im not sure what the best JSON string compression algorithm can yield the best results though

I don‘t really get what you mean. Do you mean avoid unnecessary spaces and stuff like that? Because the JSON conversion function already does that.

I don’t get what you’re talking about either. There’s only one JSON and there’s no “better” version, JSON is JSON. It depends on the data you give it to encode. If JSON is too space-inefficient, consider writing your own compression algorithm using things like base93 encoding and LZW compression (a lookup table that converts between keys and values seamlessly).

this is good!, but if ur databases are external you may be able to do further compression

2 Likes

Thats because you are using github gist for storage. Now you worry alot about space huh? Use roblox datastores instead.

1 Like

OKAY but to be fair this was before, I was testing out some other JSON free storage called Pantry that allows up to 1.44MB

Also for the github gists I think I may know a way to bypass the 1 MB limit, but I cant be certain though

Never.

1 Like

You are better off with firebase or mongo db. they give you 1 gb/500 mb free storage. you are using platforms that arent even for databases.

3 Likes

Thats pretty much exactly what I was looking for thanks alot!

1 Like

Can I ask what do you personally use for data storage for your games?

1 Like

I personally use roblox datastores, But you dont like it, so the next thing I would use is firebase. Since it provides more storage than mongodb.

do roblox datastores even run out lol

I dont think so. Only datastore keys have a limit (2 mb per key)

its 4m per key btw, its kinda crazy that they got 0 limit anyone could get a free INF database using the cloud api stuff

There is probably a limit that increases for big games. But its probably extremely high. If that was true, roblox would be bankrupt by now.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.