-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Versioning Extensions for the GRF File Format #206
Comments
I think adding a version chunk makes the format more complicated than it has to be. I think it's enough to have a I wouldn't add information about the tool that has generated the file, it's unnecessary information that makes the binary file grow for no good reason. On the DS we should really aim to be small in this case. |
My thought was that if you really wanted small files, you'd probably be using a better format anyways, and a compressor a little more intelligent than grit's. But I can understand where you come from. A simple u8 in the header would probably suffice. |
A better format like what? GRF looks pretty compact to me, but I may be missing something. I think I'm just going to switch from "HDR " to "HDRX" and add a version number to the chunk. I'll do this tomorrow, sorry for not being very responsive this week! |
If you want to preserve backwards compatibility, repurpose the high byte of one of the
If you don't, make the version number at least an |
@asiekierka That's why I want to use a completely different header chunk ID. If you don't find the ID you're expecting, you're using the wrong version. |
I suppose "better" probably isn't the right word. I meant to say that there's a fair bit of overhead I the format that if someone were worried about file size, they shouldn't be using this. But I do imagine that the whole version block could be a bit much.
I feel different block IDs would do a good job of not confusing someone else's decoder. It's probably not super important that the format be strictly binary compatible, since people can just re-convert their assets when upgrading their tooling. |
I've just pushed the changes to change the ID to Did you decide what to do about Tex4x4 textures? About whether both chunks are compressed together or not? |
Gotcha, I'll implement the If I was designing the format I would personally compress the palette index data and texel data separately, along with storing the compressed size of texture image data (so the palette index data can be located). In my view, this would make it easier to use without having to decompress both blocks together at once. Then again though, this kind of "ruins" the generality of the |
I've been thinking a lot about this. The problem with having I'm not sure how to do this, though. Maybe we can have a To be honest, I'm really not sure about what the best option is here. With my suggestion, at least you can always assume you have the texture data as long as you have a However, all of this is meaningless because you also need to check if you have a Let's just go with your |
I propose here the idea of including file versioning information in the GRF file format to allow for file format extensions.
The idea I had in mind for such a system would be the addition of a new block type with the signature
XVER
. Decoders may identify the presence of this block to signify that the file is encoded using a newer encoder version, and to be able to either choose to handle or reject such files. My idea for this block is to have a 2-byte format version (high and low version), followed by an optional encoder ID string. The layout would be such:Here the major version should be incremented for any breaking change to the file format that an older decoder should reject. Ideally, this block would come before the
HDR
block to signal to the decoder early on what format of data it should expect to see. I here propose that the file version to use with the BlocksDS version of the format should be at least 2.0.The purpose of the Encoder ID would be to identify what software was used to produce the file. Since this is not strictly necessary for a runtime application to decode the file, I've made it optional in this outline. It would be a counted string of up to 255 octets in length, in no particular encoding.
An example for the data block using grit as an example encoder:
I believe this would allow the format to be more easily extended, as no such system is currently in place with the format the way it is.
The text was updated successfully, but these errors were encountered: