Hex grid with pathfinding

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
MrGodin
Posts: 721
Joined: November 30th, 2013, 7:40 pm
Location: Merville, British Columbia Canada

Hex grid with pathfinding

Post by MrGodin » August 17th, 2017, 12:07 am

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
Attachments
chili_framework-master.zip
(630.37 KiB) Downloaded 139 times
Curiosity killed the cat, satisfaction brought him back

OrbitalReign
Posts: 19
Joined: July 17th, 2017, 1:24 pm

Re: Hex grid with pathfinding

Post by OrbitalReign » August 17th, 2017, 8:59 am

well thats cool .
I had no idea what you were talking about till i tried it.

MrGodin
Posts: 721
Joined: November 30th, 2013, 7:40 pm
Location: Merville, British Columbia Canada

Re: Hex grid with pathfinding

Post by MrGodin » August 18th, 2017, 12:56 am

@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
Curiosity killed the cat, satisfaction brought him back

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Hex grid with pathfinding

Post by chili » August 18th, 2017, 4:44 am

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/
Chili

MrGodin
Posts: 721
Joined: November 30th, 2013, 7:40 pm
Location: Merville, British Columbia Canada

Re: Hex grid with pathfinding

Post by MrGodin » August 18th, 2017, 1:05 pm

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
Curiosity killed the cat, satisfaction brought him back

Post Reply