Portfolio Website Patrick Noten

Divider Divider

Treasure Puzzle Generator

Divider
C#, Puzzle Solver, Puzzle Generator, Breadth First Search
Divider

This is a project I worked on at my internship at Tingly Games, where I worked on the core of the game and the effects. When working on the game Treasure which can be found here, I needed a way to generate puzzles for the game.

Below is a video of a puzzle being generated and solved:

To solve a puzzle I used the Breadth First Search algorithm to find the fastest solution to the puzzle. In short the Breadth First Search algorithm searches through a graph by eploring each layer for a solution before going into the next layer. This way it will find the fastest solution to the puzzle and then stop looking at the remaining points in the graph.

When my programn was able to solve every solvable puzzle I tested, I added a way to generate randomized puzzles. Basically it came down to placing a block on a random location and repeating that untill the puzzle had the minimum amount of blocks required. Then checking the puzzle for certain unsolvable cases (like the 3-length block in front of the exit).

After that I let the programn generate a randomized puzzle and solve the puzzle, if the puzzle met the predefined requirements (minimum moves to solve) it was good. I also did some testing to figure out what made the puzzle difficult and it turned out to be a combination of the amount of blocks, the amount of moves needed to solve the puzzle and the amount of possible moves.

For example if the puzzle had a small amount of minimum moves to solve and a small amount of blocks the puzzle would be easy. But more blocks wouldn't necessarily mean that the puzzle would be difficult, because if the amount of total possible moves was low the solution would be found much faster.

Tetris

Programs I Used:

  • Visual Studio