Hey everyone,
I decided to make a puzzle solver for the dice puzzles in the quest "Smash and Burn" from the Masterminds of Sharn expansion. While these puzzles have static starting positions with easy initial solutions, it is common for lag-spikes, missed jumps or group members incorrectly solving the puzzles to put them into difficult-to-solve states. This solver rapidly finds the shortest solution to any puzzle state.
Link: https://furyflashddo.com/
***
How do I use the solver?
The puzzle solver has two input modes which can be toggled on the right hand side of the interface: Edit and Practice. The Edit mode will increase the value of any tile you press by 1, and is used to input the current state of your puzzle. The Practice mode is functionally equivalent to pressing the tiles in-game, and can be used to practice the puzzle outside of the game.
Once you are ready to solve the puzzle from the current state, press "Solve". This will display the tiles to press in the correct order to solve the puzzle. If you wish to reset the puzzle state, press "Reset".
The selector on the left allows the user to switch between puzzle types. There are 4 different puzzles found within the quest. The solver assumes you are facing East in-game when solving each puzzle - take this into account when entering the current state.
You can also toggle between tile priorities using the "Use alternate tile priority" toggle under the puzzle input box. This is best used when the solution the solver has given you doesn't yield the same results in-game. If you follow the steps of the solution, and it doesn't work, toggle alternate priorities on and try again. This is described in more detail below.
***
How does the puzzle work anyway?
At its simplest, pressing a tile on the puzzle subtracts one from all the adjacent tiles and increases the tile you pressed by the number of tiles that are adjacent to it.
Here's an example of pressing the top right corner of a 3x3 puzzle:
In this case, the top-right tile had 2 adjacent tiles, so it increased by 2. The two adjacent tiles both decrease by 1.
This is the main rule of the puzzle, but there are special cases to be considered as well.
If a tile adjacent to the tile you pressed is currently at 0, it doesn't get counted as an adjacent tile:
The bottom-right tile is pressed, but despite having 2 adjacent tiles, only increases by 1. This is because one of the adjacent tiles is currently at 0.
Tiles can have a value between 0 and 4. If a tile is at 4, it can't be pressed:
The bottom-left tile is pressed, but nothing happens because it is already at 4.
If pressing a tile would put it's value above 4, it takes from the highest value adjacent tiles first:
The bottom-center tile is pressed, but it can only take from 1 adjacent tile because it is already at 3. It takes from the bottom-left tile first because that one has the highest value of all the adjacent tiles.
In the previous case, if multiple adjacent tiles are tied for the same value, the one that gets taken from first is based on the tile's location in the puzzle. I refer to this as a tile's "priority":
The bottom-right tile is pressed, but it can only take from 1 adjacent tile because it is already at 3. Both adjacent tiles have the same value, so the game determines the bottom-middle tile to have a higher priority based on its location and takes from this tile first.
That last case is confusing, because it's not clear how tiles are prioritized in such "tie" cases. This problem is discussed more below.
***
What is the "Use alternate tile priority" toggle in the solver?
In the case of a tie when pressing a tile, as illustrated in the examples above, the game has to decide which tile will be taken from first. Through hours of testing, I have determined that specific tile locations have higher internal priority than others, which is different for each puzzle. For example, one puzzle might prioritize tiles on the bottom row over tiles on the middle row, like what happened in the last example above.
Here's an example of tile priorities for the first puzzle you come across in the quest:
The tiles are numbered in order of their priority (1 is highest priority). The highest priority gets taken from first in the case of a tie.
This is annoying, but not a huge problem once the solver knows the priority orders. The real problem is that each puzzle has an alternate priority order that it chooses between randomly when you enter the quest. That means it is impossible for the solver to know which instance of the puzzles is being followed in any given case.
Here's the alternate tile priority order for the same puzzle - and there may be other layouts that I haven't discovered yet as well:
As before, the tiles are numbered in order of their priority, but the order is different for this instance of the puzzle.
As of right now, I have found 2 possible priority layouts for each puzzle. What the "Use alternate tile priority" toggle does is switch what layout the solver uses to determine ties - if you find that the solver gave you an incorrect solution for your puzzle, switching to the alternate priority layout and trying again should work.
***
I don't have a ton of experience with web hosting and web development, so any feedback or questions you may have about the solver would be appreciated! I'm planning to do some more work on the UI scaling and adding other useful features in the future.
Feel free to link the site in other places as well. Enjoy!
~Fury