Easily create levels for Unity 3D using Rotorz Tile System!

When creating Munchy Bunny! I was using an extension called Tidy Tile Mapper which allows you to create levels using 3D tiles. This is a fantastic extension for Unity which offers a lot of powerful features. Unfortunately I encountered several major limitations which made it difficult to achieve what I needed:

  • Each level consists of two separate grids; a large one for platforms and a smaller one for chocolate bricks, eggs, diamonds, etc. The grids have to occupy the same space on the Z-axis. This meant that the grids had to be separated to work on them and then moved back again afterwards. This was an extremely slow and tedious process which caused the Unity editor to crash on multiple occasions.
  • I found that the Unity editor began to run extremely slowly when using grids (even when empty) of 300 columns by 100 rows (the small grid size for Munchy Bunny!)
  • It was  not possible to define custom block orientations which meant that I was unable to create blocks to the quality that I desired.

Tidy Tile Mapper has many fantastic features but from my experiences it does not perform well with large grids. Additionally it is far from ideal when working with multiple grid sizes that occupy the same space.

So I decided to create my own tile system that would make it easier for me to create what I need. For those interested the extension is available from the Unity Asset Store, and there is more information here.

Tile system grids are represented virtually using a grid Gizmo (as opposed to lots of empty game objects). This has several advantages:

  • Less intensive on CPU and GPU in editor, thus allowing for larger grids. Obviously the editor will still slow down progressively as tiles are painted, but the absence of “empty” game objects made a massive difference for me!
  • Painted tiles can be selected easily. The box selection tool in Unity was generally useless previously because it kept selecting the “empty” objects generated by Tidy Tile Mapper.
  • Painted tiles can also be moved, rotated and scaled once painted, and components can be added and configured. Such manual tweaks will usually be preserved when tiles are refreshed!

I also found it useful to add options to allow the scale of painted tiles to be specified on a per-brush basis. This means that tiles can be scaled to match the grid upon being painted if necessary.

Tidy Tile Mapper offers the ability to automatically orientate tiles by specifying one or more prefab variations for each desired orientation. There were a fixed number of orientations that can be changed which may be fine for some developers, except I found myself needing more to achieve the smooth rounded edge effect that I was after. So with my tool I decided to make it possible to add any custom 3×3 orientations as needed. My tool can also attempt to determine the next-best orientation if the required one is undefined.

Additionally I was able to offer more control over the way in which painted tiles orientate against one another. There are a number of ways in which tiles can be coalesced (joined) which means that multiple brushes can be designed to work with one another.

Oriented brushes (like platforms, walls, etc) can become quite complex with quite a number of associated prefabs. This is fine until you want to create multiple variations of the same brush. For example, you may have a green grassy platform and a cave platform. So I implemented the ability to create alias brushes which makes it really easy to define new variations of existing brushes. Materials can be remapped and some properties can be overridden if needed.

I decided that it would be good to include some build functions. The purpose of these is to combine painted tiles (that are marked as static) into a single mesh. Vertices can be automatically snapped using the given threshold to avoid visual anomalies that can otherwise occur due to minor floating-point inaccuracies. Brushes can also be marked as “smooth” which causes their normals to be recalculated (again using the given threshold) which can help to smooth joins between painted tiles.

Click here to find out more about Rotorz Tile System!

Take a look at the tile system in action in the Munchy Bunny! demo for the Google Chrome web browser. Players will notice an improvement in graphics in the iOS version in our next update!


4 thoughts on “Easily create levels for Unity 3D using Rotorz Tile System!

  1. Could you tell me a bit more about your decision to use said tile mapper, in regards with the limitations? On one hand, I see the ease of use and great development speed, on the other, isn’t it a pain not to be able to give your players what you want to give them?

    1. Before I began my game I experimented with various approaches to create my levels. My initial thoughts were to create the platforms using Blender by creating the overal shape and then smoothing the edges. But I quickly discovered that the process of UV mapping these platforms was no easy task. Additionally this approach would have made it difficult to fine tune levels so that jumps worked well, etc.

      So it seemed obvious to me that I needed to construct levels using tiles. The modelling part only needs to be done once, and tiles can be added/removed as needed to fine-tune the gameplay that I was after.

      The vanilla approach to this would have been to use the vertex snapping feature of Unity. But this would have taken considerable time given the sheer number of tiles that my scenes are composed of. Also the smaller grid alignment would have been an absolute nightmare without some sort of placement system.

      “Tidy Tile Mapper” seemed like a good candidate on initial inspection. It seemed to have a lot of good reviews and the product description appeared to be what I wanted. During level creation I quickly became infuriated because I was unable to achieve what I wanted. Initially the extension was quite buggy, but the developer resolved the majority of these issues promptly, but the developer was unable to help me to overcome some pretty major limitations.

      So in order to get Munchy Bunny out in time for Easter I created a secondary tile system (early version of “Rotorz Tile System”) which was designed to work alongside “Tidy Tile Mapper”. This allowed me to overcome the limitation of having two tile systems occupy the same space because I represented my grid in a far simpler way (using lines instead of game objects). This took three days out of developing the game and to be honest I wasn’t sure that I would get the game finished in time.

      My tile system basically saved the day (and a lot of time). I was able to work with much larger tile systems without the editor slowing down. For example, Tidy Tile Mapper becomes incredibly slow with an empty 100×100 grid whereas my own is very smooth with an empty 500×500. And of course I could edit the smaller grid without having to keep moving it to overcome the other limitation of not being able to paint on tile systems that occupy the same space.

      I was still not happy with the visual quality of the platforms though because Tidy Tile Mapper did not allow custom orientations. This meant that I was unable to define the way in which inner corner pieces, etc. were to be represented. If you look at the original version of my game on iOS you will notice that there are noticeable joins/seams between tiles. There were a number of causes for these seams:

      – Despite being perfectly aligned in Blender, there were small floating point inaccuracies with vertex positions which caused flickering gaps between tiles. My vertex snapping process within my custom build process overcomes this.

      – Ability to define custom orientations meant that I could define all of the junctions that I needed. This meant that I could have rounded edges in the places that I needed them.

      – I also added normal recalculation into the build process to smooth normals between tiles. This overcame smoothing errors.

      Now that I have my extension I am able to create levels for Munchy Bunny without any of the previous limitations. This means that I can focus on giving the player the experience that I want. And the Unity editor is no longer grinding to a halt and crashing!

      I hope that this answers your questions. Please comment with any further questions and I will try my best to answer!

      Happy gaming 🙂

      1. Wow, thanks for the extensive reply. So in short, you managed to develop a side-by-side extension to work with the one that had limitations, seems like a good solution to me.

      2. In the end it had to be a replacement solution. But yes they certainly worked side-by-side for the first release. I set my heart on getting this out for Easter and I had to make some sacrifices in quality.

        However, I have replaced all uses of Tidy Tile Mapper with Rotorz Tile System in version 1.0.4 of Munchy Bunny and it is looking so much better! You can get a glimpse of 1.0.4 in the Chrome demo. I will release this to iOS when I have created some more levels.

        Tidy Tile Mapper is still a good product, but it seems to be targeted more specifically towards different needs. I hope that my extension fills a gap that will also help other developers.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s