Dark Gaming — Hexagonal Grid Engine

Hexagonal Grid Engine

Written by Dark. Posted at 5:20 am on January 28th, 2011

Having worked a lot on my game “Blue Sun” I learned how to imeplent hexagonal grid boards for games.
I wrote a short tutorial about them on Game Maker Forum.
It only explained some basic theory behind the hexagonal grids so I sometimes had people contacting me asking more about the topic.
I always tried to be helpfull, but eventually I realised that my tutorial is not enough. Even knowing the theory, implementing a hexagonal grid can be a nightmare.
Since I myself knew all the problems and solutions out of my head I decided to write my own hexagonal grid engine for Game Maker. Helping people do it themselves was not enough.

The engine is done, ready and free to use.
I must admit I am really satisfied with how this worked out. I implemented a clean, stable engine with easy to use functions and interface while giving many possibilities and freedom to use it in the desired way.
Basically the engine just marks hexagonal fields with objects. What the user does with these objects is up to him/her.
Another great feature of the engine is that it can support many more hexagonal grids than one. You could, for example use a separate hexagonal grids in your game where one represents ground space, while other represents air. These grids could have their own obstacles and terrain aspects.

The funny thing about this engine is that I was really surprised how fast it worked.
Implementing hexagonal grid in Blue Sun I encountered a few performance problems. I had to work on optimising the movement path searching.
The hexagonal grids in the engine I made worked much much faster. In Blue Sun path finding was getting slow with about 1 second delay for movement above 7 fields of range.
In the grid engine paths are built almost instantly with similar or larger ranges.
I guess I will just need to revise my Blue Sun code sometime.

One comment.

  1. A lot of thanks for your whole efforts on this website. Debby take interest in conducting investigations and it’s easy to understand why. We all notice all of the lively tactic you render valuable items through the website and therefore strongly encourage response from other people on that concept and my child is in fact starting to learn a lot. Have fun with the remaining portion of the new year. You are always performing a fabulous job.

Post a comment.

Warning! Posting links in comments is not allowed to block spam.
If you need to post a link, make sure to NOT include the http:// part.