2013/06/17

Grid Framework version 1.3.0 released

Grid Framework version 1.3.0 has been approved by the Asset Store team. The biggest features of this release is the addition of polar grids. Check out the updated included examples to see them right in action. Notice how in the lights-out example the coordinates wrap around, maning that once you've exceeded the maximum angle it start from the beginning again without you having to worry about anything.
Even if you prefer the good old rectangular- and hex grids you'll want to take a look at the updated API: You can now get the direction vectors for up, forwarad and right or north, north-east, east, south-east and so on just by calling one command. This will make grid-based movement much easier, since you don't have to convert back and forth between grid- and world space anymore.
On top of that the lights-out and the runtime snapping example showcase how to dynamially generate meshes from grids. The tiles of the polar lights game are all individual meshes that fit exactly inside the idividual faces. When the game starts the attached script runs a loop that runs through the grid and creates the needed vertices and triangles and then assigns the proper materials.

Here is the full changelog:


  • added up, right and forward members to rectangular grids
  • added sides, width and height members to hex grids
  • added the enum GFAngleMode {radians, degree} to specify an angle type; currently only used in methods of polar grids
  • added the enum HexDirection for cardinal directions (north, north-east, east, ...) in hex grids
  • added the GetDirection method to hex grids to convert a cardinal direction to a world space direction vector
  • hex grids and polar grids now both inherit from GFLayeredGrid, which in return inherits from GFGrid
  • the Lights Off example now features a polar grid as well
  • procedural mesh generation for grid faces in the Lights Off example
  • mouse handling in runtime snapping example changed because it was confusing a lot of users who just copy-pasted the code
Please note that this version officially requires Unity 4, since that is what I was building with, but there is no new API used and the scripts will run just fine in Unity 3.

2013/06/12

Version 1.3.0 submitted

A quick heads-up, version 1.3.0 has finally been submitted to the Asset Store. Remember, the price will go up to 25$, so if you still want it for 20$ now is the time to buy.

2013/06/09

Feature freeze for polar grids

Here is a quick update: I have reached feature freeze for polar grids, meaning I'm done with all the features. Now I need some last polish and I must prepare new images for the Asset Store, then it's all good to go. So, what took me so long? Well, designing and writing code is one thing, then you have to put it to use This often reveals weak points, some things might seems counter-intuitive, or some things are more complicated to use than others.

One example would be making an object rotate as it moves through the grid so it's always facing outwards. Sure, you can do it using the existing API to convert through coordiante systems, extract the angle of the object relative to the grid's Z-axis and then use Unity's built in math functions to create the quaternion by rotating x degrees around the grid's Z-axis. That doesn't sound pleasant at all. That's why now you can just call the World2Rotation method to get the quaternion directly, then you can do whatever you want with it.

This delayed the release a bit but such small additions can make a big difference in the end. Another thing worth noting is that this release has been written in Unity 4 and as such it will list Unity 4 as the required version in the Asset Store. Unity 4 has been out for half a year now, but even if you still want to stick with Unity 3 you shouldn't have any problems as I didn't use any Unity 4 exclusive API.

Well, that's it for now, thanks for reading.