Autotile Editor

by Ter13
A quick way to import, format, and process animated autotiles.
ID:1610903
 
Your file must be formatted for the autotile editor to recognize the import process.

You must have your file in RMXP or RMVX format.

The RMXP format is 3 tiles by 4 tiles, and looks like this:



The RMVX format is 2 tiles by 3 tiles, and looks like this:



You should set your files up with only the unique frames lined up side by side. There should be no extra space anywhere in the document, and it should be an even multiple of your icon size in either dimension.

A simple animated autotile would look something like this:




After you have your file set up, open Autotile Editor.



Before you import your file, make sure you set the dimensions.

The dimensions are the pre-processed size. Scale is used for scaling the imported autotile up during the export phase.

Once you have set these values up to your liking, click on "Import..." and select your file.

The autotile will now appear in the preview window, and the export button and animation buttons are now usable.

Click on "Animation..."



First, you need to set the FPS value to the FPS this icon should run at, and then set the maximum number of frames.

Not every frame has to have a unique frame of animation. The "Frames" value is simply the number of frames the animation goes on for.

After you change these values, you MUST hit "Apply".

The keyframes menu at the bottom allows you to drag and drop keyframes from the animation menu into the keyframe track.

The preview at the left will show you the animation you are building.

Once you are done, you can hit "OK", and then "Export" on the main window to export a DMI file.



It should be noted that only 47 autotile states are exported, out of the possible 256. That's because my algorithm eliminates duplicate states.

My autotile format is:



Since only 47 of the 256 possible states are generated, that means you need to know how to detect duplicates in order to use this system.

Simply gather the 8 directions normally using bitflags for each direction, then run this function on the resulting value:

proc
fix_autotile(at)
. = 255
if((at & 7)!=7)
. ^= 2
if((at & 28)!=28)
. ^= 8
if((at & 112)!=112)
. ^= 32
if((at & 193)!=193)
. ^= 128
. &= at