Wednesday, October 30, 2013

Warp Wars 0.2 On The Move (Region Tool)



At the beginning of V 0.2, we felt a need to hold back all the plans, until we felt our design was complete.  Its not complete yet, but I believe it is far enough along that we can start sharing pieces of it.  That first piece is the:

Region Tool

The region tool is a system that allows us to define a specific area of our game map.  This can be used to lock down regions where buildings can be constructed, areas where bridges can go, safe zones, AI information, etc.  

The specific reason we chose to build it, was to support one of our basic designs for the game, Gridless Buildings.  We want a player to have pixel perfect placement of their buildings.  Most games like this use some kind of tile based system.  But we want our designers to be able to create worlds that are rich, and take full advantage of 3D terrain.  

In order to do this, we needed a way to detect if our building was within certain buildable areas, i.e. reasonably flat ground.  The designers will build the world as the wish, and then use the region tool to mark safe areas.  

Enter the new problem.  Unity does not have out of the box support for this.  You can't even edit individual vertices in unity, you can only stretch, rotate and reposition entire models. To do this, I needed to write code that would generate editable points on each vertice to allow us to reshape them in the game.  Here is a video showing that.