Adventure Game Studio

AGS Support => Modules, Plugins & Tools => Topic started by: fernewelten on Tue 07/04/2020 04:46:29

Title: MODULE: Hexagons
Post by: fernewelten on Tue 07/04/2020 04:46:29
Hello,

I've used the last lockdown days to learn about grids of hexagonal tiles, and I've made a module out of it -- mainly for my own use, in minigames and such. If you think it useful, you're free to use it as you like. I've put the module under a CC-BY (https://creativecommons.org/licenses/by/4.0/) license.

Summary
This AGS module provides a framework for managing grids of hexagonal tiles.

Main limitation: Hexagonal grids have tiles with either “pointy tops” or “flat tops” -- I've only implemented flat tops so far.

The module is designed for AGS 3.5. You'll probably be able to make it work in AGS 3.x if you provide a declaration for managed struct Point { int x, y; }.

I'm providing documentation as well as a demo AGS program that uses these features. The program features some simple games and a maze generator for hex mazes.

(http://www.loquimur-online.de/ags/Hexagons/screenshot.png)
(http://www.loquimur-online.de/ags/Hexagons/hex-grid-example.png)

Get the module here: http://www.loquimur-online.de/ags/Hexagons/Hexagons-1.01.zip
(The module proper and the documentation are in the Assets subdirectory, as stated in the README file.)
Title: Re: MODULE: Hexagons
Post by: Crimson Wizard on Fri 10/04/2020 23:09:14
This will definitely come useful.
Are you planning on making a module for isometric grid? Then it could be bundled with regular rectangle grid and form 3 grid types modules pack :).
Title: Re: MODULE: Hexagons
Post by: Ponch on Sat 11/04/2020 02:37:03
Awesome. I respect the amount of work that went into this. Many years ago, I tried something similar to build a DRADIS combat game set in the Battlestar Galactica early 2000s remake series. I got it to work, finally, but the code was so kludged together that I will take that digital spaghetti to my grave!  :=

Thanks for sharing!
Title: Re: MODULE: Hexagons
Post by: fernewelten on Sat 11/04/2020 18:23:17
I've just uploaded version 1.01 of the Hexagons module.

Get the new version here: http://www.loquimur-online.de/ags/Hexagons/Hexagons-1.01.zip