I am currently working on a turn based RPG with chess movement. The characters move around is if they were following chess rules, but their attacks follow different rules. An example of how they will move can be seen below.
I don’t want pieces to have a lot of movement, so pieces like the rook or bishop won’t have infinite movement along its directions. Instead, movement is determined by a child tilemap layer with movement tiles. A piece is allowed to move onto any of it’s movement tiles (for pieces that move in a straight line, I’ll probably do something to prevent a piece from moving through an obstacle.
My question is this: How hard will this be to program enemy pathfinding for? The only solution I have thought of is checking every single tile the enemy can reach in the next 6 or so turns, and recording the shortest path to each, but that seems like overkill and like it’ll cause a lot of performance issues. For a more visual example, look at this?
How would I go about calculating the best path that will take the fewest turns for the rook on the left to reach the “knight” (I only have art for rooks rn)? What about the same but for the knight?
I don’t have much code at all for the project, I’ve mostly come here so I can confirm this kind of thing possible. If I need to I can come back when I’ve programmed more of the project, but I figured it may be more helpful to ask first before I code myself into a corner and have to reprogram something.
If anyone has any tips that may help, or resources I could have a look at, that would be much appreciated, but I’m kind of worried I’m stepping into new territory; this isn’t as simple as just drawing a straight line.