ultimate-research / ssbh_lib

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

CompressionFlags.const_scale true for non const values (palu c01attacks3s) #149

Closed ScanMountGoat closed 1 year ago

ScanMountGoat commented 1 year ago

Saving fighter/palutena/motion/body/c00/c01attacks3s.nuanmb without any modifications using ssbh_data results in flickering artifacts in Ryujinx and in game. The only notable difference is in the CompressionFlags. The current implementation is assuming that this flag is true for tracks with scale values that do not change and false otherwise. This doesn't seem to match up with in game.

ScanMountGoat commented 1 year ago

The easiest test cases are a00wait1.nuanmb, a00wait2.nuanmb, and a00wait3.nuanmb for Kirby. These anims have only one track with "const scale" set to true. Hex editing the in game anims to set the flag to false causes reproducible animation glitches in game.

ScanMountGoat commented 1 year ago

This may indicate whether the scale is used since stage/yoshi_cartboard/battle/motion/bg2_set/bg2_set_00.nuanmb only has scale and sets this flag for the appropriate tracks. This would explain why the rotation values are reading incorrect data. The unit tests for ssbh_data should be adjusted to hopefully prevent this from happening again. ssbh_data does not match in game when reading animations with non zero bit counts but all transform fields disabled in the CompressionFlags, for example.