GZip for Level Files #33
Labels
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: SketchyMaze/doodle#33
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Currently, level and doodad files are in JSON format and they could benefit by some simple GZip compression.
For example, the "full-color Mario 1-1 example level" weighs 168 MB in size but after gzip compressing it, it reduced all the way down to 13 MB! (93% reduction). In Go, the gzip reader should transparently allow compression and decompression in level files.
Doodle should check for a gzip header when reading to tell whether the file is compressed or not, so legacy files can still be opened.
(Ticket was formerly: "SQLite as an Application File Format"; rejected because SQLite would make cross-compiling difficult)
https://www.sqlite.org/appfileformat.html
Levels and Doodads are currently stored as plain .json files and there's room for improvement (compression, obfuscation) and eventually the need to embed custom files inside of levels (attach custom doodads, wallpapers, etc.)
Instead of just moving to a gzipped JSON format or something more custom, SQLite may be a good next version to move to. It could use a couple of SQL tables to organize its data:
Doodle could be programmed to read legacy json files as normal by checking for the opening
{
character at the head of the file, or new SQLite files by checking for a SQLite header.SQLite as an Application File Formatto GZip for Level Files