A bit of editor tooling: Tile Editor.

OK, there are a lot of tile editing tools out there. Also I have no idea how many of these I have made over the years, on Amiga, ST, DOS, Win32, and even a simple editor on the Megadrive itself!

But, this project is about making as much from scratch as possible, and learning a bit of Unity on the way. So, here's the Genesis Tile Map Editor!

One of my favourite tile editors was the Rainbow Arts one, on Amiga. Sadly, and surprisingly I can't find any reference to this on the internet! I dont know how we came to use it either. I suspect it was some dodgy hacked copy! Anyway this program used a lot of keyboard shortcuts from DPaint, and so was quick to pick up for anyone in game development in the 90s!

It's all based on Brushes. Grab a rectangular brush with B, and place it with your cursor. (while applying any transforms or effects on the way). 

The other important feature is that of tile rules. This enables us to draw out a basic shape for the level, and rules will fill in all the correct details.




The first image is a level shape blocked out, second is with rules applied (so the corners and edges are modified) and the third has some details painted on (in this case, by hand)

I have added all the usual features as I need them.. saving and recalling brushes, changing tile banks, tile randomizing, grids, fill, masking, etc. The editor just grows as I need it. 


The Unity tool window is a very handy feature. This is a shortcut window for whatever tools you want to add. Currently (from left to right) I have Tiles, Objects, Paths, Zones, Compound Sprites, Sprites, and Palette editors.

So how does all this work in Unity? This was all new to me, so it took a while to research how best to make these tools. I settled on "Editor Tools" - these all appear in the tools window above. 

Deriving a class from EditorTool gives you an OnToolGUI callback, from which you can draw all the handles, sprites etc. which an editor needs, as well as the tool GUI itself (the text on the left).
I ran in to plenty of problems with this, mainly because of poor documentation (or at least I couldn't find much decent documentation!) so much of it was trial and error. 

This was probably the most time consuming part of the whole project so far, but I'm glad I tackled it, as it's given me a lot more Unity knowledge, and it's now very easy for me to add new editor tools.

All data in the toolset is handled with ScriptableObjects. I'll cover that aspect in another post.


Comments

Popular posts from this blog

Converting Gunslugs to Megadrive / Genesis

Mega Palettes