Tuesday, September 30, 2014

GuildCraft Dev Diary: Part XII

This post is a review of a plugin available in the Unity Asset Store called Grids 1.9. Those with unusually good memories might remember that I mentioned my intent to review Grids way back in Part IV.

Grids is from a two-man software company based in South Africa called Gamelogic. It is a code library that provides a series of builders and math algorithms for handling grid-based games in Unity. Later versions of the plugin have improved support for manipulating the builders in the Unity editor.
http://gamelogic.co.za/grids/

The first thing you will notice about Grids is that it has a really slick website and promo video. Their website also has a large number of sample projects available for different types of grids.


Act now and you can be the first to build an RPG with Cairo pentagonal tiling!


I found the Grids library is easy to get started with. In a couple of hours you can complete a video tutorial and start tinkering on your own. For those that are interested, the full source code of the library is made available.
https://www.youtube.com/watch?v=ZamZVrRnqVg

Overall, the API for using the grids library is well put together. Some of this structure is probably a natural consequence of building a library with so many interchangeable pieces, but it was clearly written by someone with a strong grasp of the subject matter. I like that it is largely divorced from Unity-specific references. (ie. MonoBehaviour)

It was annoying that the point (aka grid cell) types were specific to each type of grid in the examples, but I didn't dig into the source code to determine if this was a necessary evil or an oversight. Some developers may find the model-view-controller pattern that the grid builder naturally falls into feels a little 'backwards', but it should be easy enough to incorporate the grid behavior class into a turn manager.

In addition to providing grid factories and implementing methods for neighbors, distance, and so forth, Grids provides an implementation of the A* path-finding algorithm.


A* in action.


Grids has two great things going for it in terms of support. First, the developers are quick to respond to questions in the related Unity forum thread. Second, there are a huge number of sample projects available. I would have preferred to see a dedicated forum to make searching for commonly asked questions easier. Another thing that may bother some developers is that about half of the samples are rectangular and the other half are hexagonal. If you did not purchase the whole package it will take a bit of work to convert one to the other.
http://forum.unity3d.com/threads/gamelogic-grids-a-library-for-hex-tri-rhombille-and-square-grids.189866/

The pricing structure of the Grids library is generous if you like rectangles, but otherwise a little odd. You can get full support, including source code, for the most common types of grids for a good price ($20 for rectangular or $40 for hex). Buying the full package costs significantly more ($100) and includes several esoteric and unusual grid types. Due to the pricing structure, your best value is to purchase either the square grid library or hex grid library instead of the full package. There is also a free 30-day trial.
http://gamelogic.co.za/grids/buy/

Final score: I purchased Grids 1.9 rectangles version.


Jim

No comments:

Post a Comment