Pathfinding with movement limitations?

I’m looking for a way to implement pathfinding for my procedurally generated mazes so only solvable maps can be generated.

The catch is that a standard pathfinding algorithm won’t work, because of how movement works in my game.

Basically the player can only move in one of four directions: North, South,East,West. Then once the player starts moving, it can’t stop moving until it hits a wall. So it works a little bit like sliding on ice.

I have a video of my original game made in c++ from a few years ago if it’s hard to understand what I mean: - YouTube

instead of doing *star with a grid of data, i came up with a variation a while back that would work for your situation.

you can do it with just a single array instead of a two dimentional array.

the indexes in your main array would hold a smaller list of connections to the other indexes of the main array.

then you can move through it with the smaller list of connections to itself and mark the amount of steps and if you have been there as you go.

Its actually a bit simpler than *star

i think this method would work wonderfully in your situation because each square and it’s possible destinations. the spaces in between wouldn’t even have to be in your list!!!

you would need a bit of effort to make your list though, you would need to loop through your levels squares and do some other nested loops to get the possible end points for each relevant square.

if you are interested in this approach let me know and i can post some code to get you going.