BackgroundThis exchange transpired a few days ago on Niffcord:
Hmpf Macslow: Hey, why is the wind in Knytt world always blowing from the right? I'm making a level about a part of the (real) world where the wind is nearly always blowing from the west (left, in KS terms), and basically allll the trees in all the tilesets that are wind-bent are bent the wrong direction; the dust object blows only left to right; the leaf object likewise... 😄
Hmpf Macslow: (Are there custom objects that reverse the direction? But that still leaves all the trees.)
Pie: Mirror every tileset/screen and then add a sign that says right is west
Pie: Hmm...now I want to do that to The Machine for science
Lucinda: omg pls
As a result, I made a tool to generate a mirror image of any level.
FeaturesIn addition to reflecting map data and graphical assets, it can
- Adjust shifts, triggers, warps, map spoofing, and custom object offsets;
- Adjust the default save file;
- Replace objects with their mirrored versions if available (some are approximate, like birds and fish); and
- Reposition wide objects (e.g. the wide spike bar, 6:1) if possible (it won't overwrite another object).
Object replacement/repositioning even works on custom objects that use vanilla object behaviors.
Some people requested silly features like reversing the music and cutscenes, so I have included those as options. Audio processing is handled by a separate command line program called
sox which is bundled with this program. If you don't want to use it, just delete the sox folder.
UsageFor basic usage, drag the level's folder onto
knytt_reverse.exe. It will create a new level in your worlds folder with "(reversed)" appended to the original level's name. The original level will not be changed in any way. If you want to change the options, run
knytt_reverse --help on the command line or see the examples below.
Reverse cutscene images
knytt_reverse -c "/path/to/world/folder"
Reverse Icon.png and Info.png
knytt_reverse --icon --info "/path/to/world/folder"
Reverse music
knytt_reverse -m "/path/to/world/folder"
Swap music channels
knytt_reverse -m -e swap "/path/to/world/folder"
Reverse all audio
knytt_reverse -m -a -s "/path/to/world/folder"
Maximum settings
knytt_reverse -c -m -a -s --icon --info "/path/to/world/folder"
DownloadIssuesI don't intend to spend any more time on this, but let me know if you run into any problems and I'll see if they can be fixed easily. Known issues are listed below.
- KS Ex and other mods are not supported.
- Flags warps that use an artifact count for the X axis (e.g. FlagWarpX(A)=Artifact1) cannot be mirrored.
- Not all objects have mirrored versions, most notably the robots 13:1, 13:2, 13:3, 13:6, 13:13, and 13:14 and the dust effects 7:14 and 7:15.
- During testing, I found that a number of levels contain PNGs that are not strictly valid. Unfortunately, the library I'm using does not allow me to process these files. You can get around this by resaving them in any image editor.
- Indexed images are converted to RGB after processing. In one level that I tested (What happened next by ixMarcel and Fubaka), this resulted in the processed image being so large that KS could no longer load it.