We update the documentation frequently with new examples and knowledge base articles. If you want to stay up to date, follow us on Twitter.
If you are familiar with Amit Patel’s excellent guide on Hexagonal Grids, you may find this breakdown of features useful. It shows how Grids supports all the features in that article: Gamelogic’s Grids and Amit Patel’s Guide for Hexagon Grids
- Grids in the editor
- Grids in code
- Algorithms (new!)
This document gives the mathematical base for working on hex grids. This should be useful to you if you implement your own algorithms.
We frequently add more examples showing how to use our algorithms, how to implement common game mechanics, using Grids with various GUI packages, and advanced techniques such as mesh generation and scrolling. http://gamelogic.co.za/grids/examples/
- Can the Grids library work with 3D uneven terrain? Yes, it can. You have to figure out how to deal with the height, though (getting it from ray casts or height maps, for example).
- Does Grids support irregular grids? Not straight out of the box. However, it does make it easy to implement certain kinds of irregular grids. These include grids where cells span over multiple cells of a regular grid, and jittered grids. You can also roll out your own periodic grids with arbitrary polygons. We also made a game using a Voronoi grid.
- Can Grids be used to build an interesting GUI in Unity? Yes, indeed. It’s simple to use cells as buttons, and Grids works well with GUI packages such as EZGUI, NGUI, DaikonForge GUI, and 2D Toolkit. (The last is particular nice to use with grids, as it allows you to make polygon colliders with ease).
- Can Grids handle massive worlds? Yes. Here is an example of a grid with 250 000 hexes, and here is an example that shows how to render only part of the big grid.
- How do I make a single mesh for my grid? Here is an example mesh generation script for a pointy hex grid, and here is a more complicated example where special mesh is used to simulate a sphere tiled with hex tiles.
- Do I need to use Unity’s sprites? Do you support other GUI systems? Our examples use Unity’s built-in sprites. However, Grids does not support any GUI system directly, the examples merely exploit maps to place sprites; you can do the same with any system. We have tested Grids with NGUI, EZGUI, 2D Toolkit, and Daikon Forge GUI.
- My game compiles and runs in Unity, but when I try to compile the project in MonoDevelop I get errors. How can I fix this? You have to set your assembly options target framework to Mono/ .NET 4 for all the assemblies in your project. See How to set your target framework to Mono/.Net 4 in MonoDevelop.
- My game compiles and runs in Unity, and compiles as an XCode project for iOS. But it crashes, with errors about methods not found. How I can fix this? Sometimes, the AOT compiler cannot figure out all the code it needs to generate for an iOS project. When you call this code, the game crashes. To fix it, you need to give the compiler hints to make sure it generates all the code that you will call. See How to make sure the AOT compiler generates code to instantiate grids on iOS.
- (Grids 1.7 and earlier) I’m trying to upgrade the examples to the newest version of NGUI, but get errors. How can I fix this? Find the script ExampleUtils, and look for UIBaseCamera. Change it to UICamera.
- Is the source code for the 30 Games available? It is, please email us to get it.