Skip to content
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

Tile scrambler #33

Open
basxto opened this issue Apr 20, 2021 · 2 comments
Open

Tile scrambler #33

basxto opened this issue Apr 20, 2021 · 2 comments

Comments

@basxto
Copy link
Contributor

basxto commented Apr 20, 2021

When a tilemap is used, the actual tile order in vram does not really matter.
So it would be cool to have an option to reorder them.

The easiest versions would be:

  • for fun / obfuscation
  • ordered by palette (would allow to get palette from the id instead of relying on attributes)

Those two could even get combined.

More complex versions would reorder them to improve tile compression:

  • RLE (increase byte runs in general or per plane)
  • LZ (increase runs and repeated byte sequences)

This would be an option of superfamiconv tiles, I'd call it --scramble or --reorder

@Optiroc
Copy link
Owner

Optiroc commented Mar 17, 2024

Reordering to improve compression is a cool idea! I’m a bit intimidated by search space / algorithmic complexity of it though…

@basxto
Copy link
Contributor Author

basxto commented Mar 17, 2024

Optimizing for repeated byte sequences in LZ would be indeed quite complex. Runs should be easier, but yes, there would be always some complexity.

For runs it would be: What symbol a tile starts with and with which it ends and how often those are repeated; with planes in mind that would be per tile per lane.

For a start it might be enough to have a permutation format, that would allow scrambling or reordering with external tools. That would also split ordering from conversion and allow to order it once and then convert it a lot of times (unconverted images in a git repo).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants