Give our Grids library a try

edited in General
Hi everyone,

Over the last few months we (me and my partner Jonathan Bailey) have been working on a grids library that we plan to sell in the Unity Asset store. The library makes it easier to work with various types of grids; especially hexagonal and triangular grids. To give you an idea of how it works, here is some Unity code for instantiating cells in a hexagonal grid formation:

public void Start()
{
  //Contructs a grid in a rectangular shape
  var grid = PointyHexGrid<Cell>.FatRectangle(9,7);

  // Map the grid to the center of the screen, with given cell dimensions
  var map = new PointyHexMap(cellDimensions)
    .WithWindow(screenRect)
    .AlignMiddleCenter();

  //Instantiate cells and place them at the tight positions
  foreach(var point in grid)
  {
     Cell cell = Instantiate(cellPrefab);
     cell.transform.SetXY(map[point]);
     
    grid[point] = cell; //and assign the cell to the correct grid spot.
  }
}


image

Some other features:
  • Supports rectangular, diamond, hexagonal, triangular and rhombille grids.
  • Supports many grid shapes for each grid type.
  • Works well with GUI and sprite plugins such as NGUI and EZGUI.
  • Easy to use layout functions for centering grids or aligning them with edges.
  • Some grid algorithms: shortest path, connected shapes, diffusion.
  • Fully documented.
  • Comes with unit tests.
  • Comes with code generation templates for Visual Studio.
  • Lots of examples, including some mini-games: hex versions of Lights-out, Lines, and Pipes.
You can find more info on our web site: http://www.gamelogic.co.za/ or browse the documentation (witch is still not hundred percent complete at this stage... o.0)


We are doing some beta testing at the moment, so I was wondering if any of you want to give it a try. I would say the library is especially useful for prototyping projects, because it allows quick experimentation. The examples games are all less than 200 lines of code. With the grid-math out of the way, it's easy to get down to the game mechanics immediately.

Just send me a PM, and we can arrange it.

Thanked by 1raithza

Comments

  • Hey cool. It this a side project as a hobby, or something you hope will become full time?
  • It's definitely not a side project; we spent a significant amount of time doing research and making this first product, and we plan to extend the line over time. "Full-time" as a concept has little meaning for either of us; we both work on different projects; we were lucky enough that we could spend the last month on mainly this one.
  • Um. It's probably not that relevant/important, but just in case it's helpful, some typos:
    .AlignMidddleCenter();
    //Instatiate cells
    Cell cell =Instaitate(cellPrefab);
    Thanked by 1hermantulleken
  • Thanks @Elyaradine
    (That is what happens when typing code without a compiler...)
Sign In or Register to comment.