When it came time to talk level generation for the Adventure Jam: Summer 2012 game “Balloon Chase” we had a good amount of discussion of how we wanted to go about it. We knew that the level would be broken into randomized segments made out of a set of tiles and that’s about the only constraint we had. So from there we discussed doing it as CSV (comma separated values) by hand or exporting from excel, but then we decided it could potentially get ugly picking symbols for all the different tiles we wanted to implement. From there we took the logical leap to do it by colors and the obvious tool for this task was MS Paint. By no means did we pioneer this technique, the first time Jordan and I saw it in action was from Notch during a past Ludum Dare event and I’ve wanted to do fun things with image data ever since I saw Andy Schatz talk about his image based level serialization technique for Monaco at GDC 2011.
Our segments are currently all generated from 9×9 bitmaps, but they could be taller if the designer so pleased. Each tile is represented by a different color which we stored in a key file so anyone could easily grab a color picker and design out segments. After they draw out the idea they import it into unity and run a simple script I wrote that generates a prefab of tiles out of the image. I ran into some quick trouble here with the texture import settings of Unity slightly tweaking some of the colors and crushing them into a texture with power of two dimensions. Luckily that was just a matter of changing the appropriate settings. Once the prefab is generated the designer would set the entry/exit and exit points of the segment (left, center, right) and it was ready for use in the game!
This technique ended up being perfect for the time we had allotted. In the day that we had to implement the levels, we generated over 100 segments and got themall popping into the game. Having such a large selection helped create a good feel for a completely different play experience every time you try to ascend Lil’ Bean Park. The only challenge I wish I had more time to tackle is that I would have loved to add the entry/exit points into the Bitmap file instead of having the designer do it by hand after import, but I’ll save those shenanigans for our next Adventure Jam.