Support of Visual Matrix Puzzles
This week we have been working on a small domain-specific language for defining the logic puzzles in Tales from Wendmor.
These puzzles are inspired in part by the kind of visual matrix problems used in classic IQ tests, especially Raven-style progressive matrices: a grid of shapes follows an underlying rule, one part is missing, and the player has to infer the pattern. Traditionally these are static puzzles, but we are interested in pushing the format further with movement, timing and rhythm.
Instead of hard-coding each puzzle in JavaScript, we can now describe shapes, positions, colors, answer options and animation directly in a compact puzzle DSL file. The same system handles static rules such as AND, OR and XOR grids, as well as animated patterns using movement, rotation, scaling and blinking.
The main benefit of supporting a DSL is that we can focus on the puzzle idea rather than the implementation. A rule such as “move right, grow, move back and shrink” or “blink once on the left and twice on the right” can be expressed directly and then reused with different shapes and decoys.
The animated versions are particularly interesting. The full pattern is no longer visible at a single moment and players may need to remember a rhythm or movement while looking elsewhere in the grid, turning the familiar matrix-puzzle format into something that also exercises working memory and temporal pattern recognition.
Puzzles come with difficulty and start out easy. Here is an example of a fairly simple one:

But once players get better at solving them they can get a bit more challenging like this one:
