SGDK icon indicating copy to clipboard operation
SGDK copied to clipboard

Rescomp could detect duplicate frames in case of same sprite sheet with different colors

Open thomasgoldstein opened this issue 7 months ago • 2 comments

Hi.

Consider the following scenario: 2 character sprite sheets that contain the exact same character frames, just with different colors (color indexes). In that case, rescomp will not realize it could avoid performing the sprite cutting on the second sheet.

I believe this is a relatively common scenario to work around the harsh color palette limitations of the Mega Drive. Xeno Crisis does this for the green and blue variants of the playable characters, for example.

What I guess you're doing internally in rescomp's sprite cutting logic is only care about which pixel is opaque or transparent, you don't care about the colors used, right? That means you could use that opaque vs transparent pixel matrix as a reference to determine whether a frame is a clone of an already-processed frame or not, which would cover the need above.

Just an idea. Thanks for entertaining the idea!

PS: This also makes me wonder if, ROM data wise, any data could be shared across such similar sprite sheets in order to reduce the footprint of similar sheets.

thomasgoldstein avatar Nov 18 '23 09:11 thomasgoldstein