For the project Spring It, I wanted to create a way to make levels faster. Spring It is 2D and grid based, which makes level creation in Unity slightly slow. Unity 3D does not have an easy way to build levels to a grid we specify and would often cause the pieces placed by the player to not align to the piece we placed during level building. So I wanted to make a level editor that ensures we are placing our level pieces to the same grid the player is placing theirs. One of my team members, Chris Flynn, suggested I use Tiled map editor as a start for this level editor I was hoping to make.
After talking to the designer that will use this tool the most, I decided on a design that would allow an entire level to be built through the level editor rather than just the level pieces.
Spring It is a puzzle game where the players must get toy robots from one side of the screen to the collector on the other side of the screen. They are given a budget that allows them to places, springs, conveyors, and fans that will help the robots move and avoid traps. Players can place objects anywhere on the screen but some areas will be more expensive than others.
I broke the editor into 8 layers.
All the level pieces the player will see in the scene. This Layer must always contain at least one collector and one spawner.
All of the places where objects can be placed by the player at a cheaper price.
Any objects that the player will be able to be moved are placed. If we want to have the player able to move one of the springs placed in the level, this is the layer that object will be contained in.
Traps and objects that will be placed further back visually, this only includes the furnace as of right now.
Contains what the player is allowed to place, for example if we only want the player to place springs and conveyors in this level, then only those two objects will be placed in this layer.
Allows us to specify how many robots will spawn and how many robots will spawn in the level and how many must make it to the collector. The robots places int he top half of the tiled map must make it too the end to win, while the ones in the bottom half are the number of robots that spawn.
The amount of money the player will be given each layer. I even made specific tiles for this layer.
any objects that will move when their respective button is pressed. A new layer must be created for each set of button and activated object. This will be used for doors as of right now.
Next 8 different tile sets where made: Conveyor, Spring, Fan, Spawner, Collector, Robot, Furnace, Money.
For the tile sets, Conveyor, Spring, and Fan that can be placed in multiple rotations, multiple tiles, each with an arrow pointing a different direction.
The Budget tile set contains four tiles of differing money amounts, 100, 500, 1000, and 10,000.
As long as the Tiled map is exported in this manner, the code that I wrote will work in completely assembling a level on start. For more technical details, see my blog post on this.