Designing Maps, The Easier Way
So after adding Kenney’s TD assets in my game creating a demo map, I ran into a problem of creating maps because while the first demo map was all fine and dandy, it was pain in the ass to drag and drop or duplicate assets to to create a map. To make things easier I decided to take help of Tiled Map Editor which a designer friend of mine used to use to create levels.
Tile Map Editor Creating levels in Map Editor was again trivial, some work had to be done to use the TMB file generated by Map Editor, basically a XML file, and use to it populate the map in Unity. Another problem I came across was that there was no spritesheet available for the Kenney’s meshes to import into Map Editor.
Creating Spritesheets To begin with creating levels in Map Editor, you need a spritesheet / image atlas with all your props to visualize what the level is coming to. To do this, I wrote a small script in C# to take all the models of a given folder and populate it in the scene in a grid in Unity with a zero unit of gap between each of them also helped me visualize all the assets in a pack later on when bought other asset packs. I used the screenshot feature of Unity (and sometimes the taking screenshots manually to get the view right) and fix the image of any extended edges in Krita image editor.
Populating Maps from Tiled Map Editor Files
I said, creating levels in Map Editor is trivial, the harder task was
to read the TMB files and populate the map in Unity. Because in the
Kenney’s assets, well or at least in most of their packs, all the models
are named in proper sequential manner, like tower_defense_001.fbx,
tower_defense_002.fbx so on and so forth, it was easier to take the
index I’m getting from the grid of the Map Editor export and append that
index to a string which points the given model.
Get Yet Another Tower Defence Game
Leave a comment
Log in with itch.io to leave a comment.