Closed ThizThizzyDizzy closed 1 year ago
I think the .ncpf.<format>
would fit better if you want to make it support any format. Also if you want to have a binary format for NCPFs other than Config2 (which is, honestly speaking, quite a weird format), I could propose MessagePack or CBOR. These are both JSON-like formats in terms of data structure, yet these are binary.
Config2 was used because it's part of the library I was using at the time for window management/rendering, but I have since moved away from simplelibrary entirely
Another issue I thought of is encoding textures; they're done compactly in NCPF (#127) but how would this be done in JSON? Or would the JSON format be inherently textureless?
@ThizThizzyDizzy you can just encode texture BLOBs with base64, that's a common practice. However, are you sure you need textures at all in NCPFs? Like, we cannot open a NCPF in the plannerator if it contains addons not configured in the plannerator. So maybe just keep textures in plannerator config and remove from NCPF completely?
In current NCPF, Textures are not saved in saved reactors, as they have a partial configuration Textures, (and display names, and a few more things) are only saved in full configurations, (i.e. plannerator configurations, which is also NCPF)
By the NCPF spec, you don't have to use partial configs, so you could save a reactor with a full configuration if you wanted to The plannerator just doesn't do this for file size reasons
Oh, should things like textures and display names be treated the same way as the other definitions? (i.e. in the same list, perhaps being plannerator-specific fields)
I may extend this in the other direction as well, such as using .cfg.ncpf.json
to refer to a plannerator configuration saved as JSON
(This is relevant since I'm planning to save a bunch of different things, such as generator settings, within NCPF)
ncpf.json
is the new default (and currently the only one supported)
As part of the rewrite, I'm considering separating NCPF from the current format (Config2) and allowing any format, (most notably JSON) to be used instead, so long as it holds the same data structure. How should this be best achieved to avoid confusion over file formats? (I'm thinking of
.ncpf.json
for JSON-encoded NCPF files, or some abbreviation like.jncpf
)