Page 1 of 1

Hex grid with pathfinding

Posted: August 17th, 2017, 12:07 am
by MrGodin
So of course i got side tracked and wanted to make a hex based tile map with built in pathfinding.
Once the program is running, click a hex to make it impassable then press Space bar to show the route
Peace Out
Note: start node is top left, end node is bottom right so don't click them :P

Re: Hex grid with pathfinding

Posted: August 17th, 2017, 8:59 am
by OrbitalReign
well thats cool .
I had no idea what you were talking about till i tried it.

Re: Hex grid with pathfinding

Posted: August 18th, 2017, 12:56 am
by MrGodin
@OrbitalReign ... Pathfinding is so cool, hope you can implement it and anything you do. Hex based grids are different based on the even or odd rows you are on (cuz there indexes are same but confusing).. if you use a rectangle grid then the "getAdjacentCells" method will be different. have fun :). I can post code for that if you want :)
Peace Out

Re: Hex grid with pathfinding

Posted: August 18th, 2017, 4:44 am
by chili
Pathfinding is essential stuff. And A* can be applied to so many problems outside of it as well.

Hex grids are just cool. This page is a goldmine: http://www.redblobgames.com/grids/hexagons/

Re: Hex grid with pathfinding

Posted: August 18th, 2017, 1:05 pm
by MrGodin
chili wrote:Pathfinding is essential stuff. And A* can be applied to so many problems outside of it as well.

Hex grids are just cool. This page is a goldmine: http://www.redblobgames.com/grids/hexagons/
Yeah i did some reading on there and got a couple equations