ThizThizzyDizzy / nc-reactor-generator

A program to plan and generate reactors for Nuclearcraft (https://www.curseforge.com/minecraft/mc-mods/nuclearcraft-mod)
GNU General Public License v3.0
30 stars 6 forks source link

NCPF Compression #127

Closed ThizThizzyDizzy closed 1 year ago

ThizThizzyDizzy commented 1 year ago

Current NCPF uses a number of methods to achieve a small file size; the block lists are formatted differently based on how much air is in the reactor; either X,Y,Z,ID for each non-air block, or a list of all the IDs in a specific order There's also the partial configurations, used to define just enough data to load (and I think calculate the stats?) of a reactor Config2 also has a compressed number list, encoding numbers with minimum number of bits required (used for id lists and textures, significantly reduces NCPF size) This adds a bunch of complexity; should I skip things like this entirely at the cost of large file sizes?

thedeadferryman commented 1 year ago

You can make compression optional and just apply deflation if selected. It will work well at least for JSONs (basically for anything but BLOBs). Also, as I've already mentioned in (#126), do you really need to keep base/addon/etc configurations in NCPFs? Maybe just keep these things in the plannerator configuration?

ThizThizzyDizzy commented 1 year ago

The problem with optional compression is that anything reading the file would have to support all methods of compression, unless it expects a special export for it's purpose

ThizThizzyDizzy commented 1 year ago

No special compression for NCPF beyond that of the specific save format (ex. Single line json or wrapping it in an archive)