itch.io is community of indie game creators and players

Devlogs

Chessboards and Pathfinding

Rogue Pawn (in Development)
A downloadable game for Windows

One mechanic Rogue Pawn will feature is "chessboard" style battles. 

Unlike the free-roam movement that was featured in the Ludum Dare (LD) release, we want these "chessboard" interactions to feature grid-based movement, just like a real game of chess. 

With Knight movement, simply moving to the nearest square isn't a very elegant solution, since the nearest square (by distance) isn't necessarily the nearest square (in number of moves)

So I set out to creating an "Breadth First Search algorithm" that could manage Knight movement.

The first step was to populate the grid with  relevant data. 

Shown here is:

  • green - player coordinates (starting with row and column 0)
  • yellow 0 - "empty" squares
  • orange 2 - enemy 
  • pink 1 - solid obstruction

This data will be useful in finding the grid locations that pieces can actually move to.

The next step is to do a "Breadth First Search" from the player location, using a technique similar to this article.

Rogue Pawn Facebook page: Dija Studios

Download Rogue Pawn (in Development)
Leave a comment