-
Notifications
You must be signed in to change notification settings - Fork 7
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
RFC regarding breaking API changes needed to implement Starfield support. #14
Comments
@Guekka Mentioning you on this issue, since I know you're waiting for me to implement Starfield support. |
This looks good to me. I don't mind the API break |
The defaults are tuned for the first game that introduced the format. lz4 compression was introduced in It's also not clear if lz4 compression is only available for texture archives, or if it works with general archives too. |
That makes sense |
@Ryan-rsm-McKenzie So, I've finally updated CAO (beta) to use this version. Everything appears to work correctly. There's just one minor oddity: I do not see why |
Is there any reason for not always using lz4 with starfield? |
Some warnings with g++ (13) |
Individual chunks don't know whether they were compressed using zlib or lz4. This information is stored in the archive header, and you have to forward it along. Storing this information in the chunk could noticeably bloat an archive's in-memory size by several kb. Texture archives would be impacted the worst.
Technically the format permits compressing ba2 archives using lz4, but it's still not clear whether the game will actually load them correctly, or whether it assumes all general archives are compressed using zlib. When I last checked, only texture archives were compressed using lz4, and I wouldn't put it past Bethesda to make stupid assumptions like that.
Fixing this required a breaking change. I had to add an underscore after every conflicting name:
|
Do we really care about a few kilobytes in the context of loading big archives? Even when loading 100'000 files, it would be something like 3 megabytes overhead at worst. In my opinion, the convenience outweights the overhead.
That unfortunately makes sense, coming from Bethesda. Thanks |
@Ryan-rsm-McKenzie I have now released CAO7 beta with starfield support. I think this branch can be merged 👍 |
With the introduction of the v2 and v3 variants of the
.ba2
format in Starfield, the archiveformat
is no longer sufficient to discriminate between data format variants. Most functions now also require acompression_format
to handle compression properly, which means that configuring inputs to functions has become overly obnoxious. As a result, I have taken the liberty to convert many functions to take some form of*_param
. This offers users the flexibility to override only the fields they need, while leaving others untouched by leveraging designated initializers. Unfortunately, this has the undesired side effect of being the largest API break this library has had thus far. This issue stands as a forum for users to provide feedback on the new API changes: whether they like them/don't like them/think they could be better/etc.For reference, the
.ba2
format is described in detail here.The text was updated successfully, but these errors were encountered: