Heroquest wizards of morcar tabletop simulator
Two references I used were Vincent Cogne’s 2010 blog post ( ) and wikipedia pseudocode ( ).Ī* uses an open list and a closed list (open list means we will visit it later, closed list means we already visited it). To keep things simple, I just implemented A*. Once I got that working, I moved on to actual pathfinding.
HEROQUEST WIZARDS OF MORCAR TABLETOP SIMULATOR UPDATE
When a hero moves a space, we update neighbor list for src node, dst node, src’s neighbors, and dst’s neighbors. When a space is revealed for the first time, we generate neighbors for that space. The graph is for monster AI, so a hero is a blocker. Each space has a list of 0 to 4 neighbor nodes that are valid moves. So before I implemented pathfinding, I added C++ code to generate the graph. My HeroQuest map is an array of 26×19 square spaces, but pathfinding works on nodes in a graph. A* can be further optimized a number of ways – use more efficient data structures, bidirectionoal search, jump point search can optimize uniform cost grids (like HeroQuest). A* is the standard pathfinding for games (I also used it in college game projects ~12-14 years ago), so it’s easy to find pseudocode, articles, tutorials, and videos about it. A* is modified Dijkstra optimized for a single dst (uses heuristic to search towards dst). BFS (breadth first search) explores equally in all directions. Labor Day weekend gave me an opportunity to implement pathfinding.