Posted on Mar 20, 2011

The forgotten post

Looking back at my draft post, I noticed that I never published my “finished” 2D experiment with Unity3d. After my first experiment with Unity, I thought it was time to build a tile-map-maker, like Mario Bros, for my upcoming game.

The idea is quite simple: I wanted something similar to a drawing application, like Paint or Photoshop, but instead of drawing pixels, tiles (collision + graphics). It could be used to draw 2d meshes (planes, 2d polygons) or 3d meshes (houses, trees, stairs) on separated layers. Here my work-in-progress tile-maker:


Tile-maker in Unity3D

In the process of building this small application, I found myself dealing with some undocumented glitch/bug. A rigid body doesn’t seem to trigger the OnTrigger on a sensor body when the MeshCollider’s mesh is perfectly aligned on 2 axes + same rotation and size. Well, it’s not really an issue when dealing with a full fletch game because it will almost never happens, unless the game has something of grid-swap behavior. It my case, the grid-swap made each of my meshes to be perfectly aligned. So I wasn’t able to know if my brush was colliding with an existing tile. To solve this problem, I resize my brush to be smaller than the tiles so it wasn’t a perfect match in size.

So why not using Unity3D to build my maps? When I designed my game for Flash, the only viable option to build, save and load a map was to use something with XML files. I don’t have a clear answer to why I did it in Unity; Unity offer all sort of optimizations and tools while in the editor, and scene load / unload is already built-in, so it’s a bit of a no-brainer to use it. At least it was a good learning experience!

Latest Tweets