I'm trying to make an algorithm of any sort that can find the solution with the lowest move count. I'm coding in GML using GMS2 and it's for a game that I'm making myself.
This is a picture of the most simple level
The reason I call it a complicated 2d puzzle game is because of how many types of blocks there are. The goal is to connect the two blocks and the player gets a trophy for solving it in a low move count, but I don't want to have to find the most efficient solutions by hand for every level, especially some of the super complicated levels.
This is an example of a level with all block types in it
The black boxes with an X on them are immovable and act as obstacles
The two blocks you're supposed to connect and the small blue blocks are simple movable blocks and can be moved in any of the four cardinal directions as long as the space is open
The long blue blocks act the same way but require an open space their same size to move into a spot
The red blocks act as a normal movable block, but cannot be placed next to each other. They can still be diagonal from each other though
And the green blocks can only be moved in the directions indicated on the block, meaning only left and right or only up and down
My first thought was to make a depth first search algorithm to just brute force all possible game states until it finds the quickest solution but I'm unsure of how to pull that off.
If anyone has any ideas for methods I could use or information that could help at all then I'm open to all feedback since I don't really know much about algorithms or machine learning at all, thanks in advance!