ultimate-research / ssbh_lib

Reading and writing SSBH file formats in Rust
MIT License
8 stars 3 forks source link

anim buffer track compression #77

Closed ScanMountGoat closed 2 years ago

ScanMountGoat commented 3 years ago

This should compress and rebuild the necessary buffers and generate any needed flags. The easiest types to start with are uncompressed (direct, const, etc) and compressed boolans (1 bit per bool). It should be possible to clean up the writing code considerably using SsbhWrite and potentially a bool to bit converter like bitvec. Compressing single floats is easier to write and test than vector or transform compression.

ScanMountGoat commented 3 years ago

The range of bits used for float compression seems to be 0 to 24 bits. An initial implementation could just hardcode the bit count to 24 when min and max are not equal to reduce the risk of exporting an in game animation with worse quality than the original. Min and max are simply the minimum and maximum for a particular value (ex: scale.x) taken over all frames for a particular track.