What problem was I trying to solve?
I wanted to make a flexible drawing-based puzzle system where different drawings could trigger different events and where the drawn shapes could also be turned into physical 3D objects.
How did I solve it?
I built a modular node-based puzzle system where nodes can be placed onto a drawing grid. The system tracks the order the nodes are crossed and allows different methods to be assigned for success, failure, clearing, or crossing a node. This makes it possible to build puzzles that require specific sequences of inputs and connect those results to different events.
I also built a 3D mesh generator that converts the drawing into geometry. It uses marching squares to determine the shape of the drawing, smooths the edges by adjusting vertices when nearby pixels have similar colors, connects the hypotenuses of the generated cells, and creates caps on both sides of the shape so the final mesh has depth.
What makes this solution interesting?
- Uses configurable nodes to define the valid paths and sequences for a puzzle.
- Allows puzzle logic to trigger different events for success, failure, clearing, or crossing nodes.
- Supports puzzles where nodes must be activated in a specific order.
- Keeps the puzzle logic modular so different node layouts can be combined with different event behaviour.
- Generates a 3D mesh directly from the player's drawing using marching squares.
- Smooths the generated edges by adjusting vertices based on the similarity of the drawing's pixel colors.
- Connects the generated geometry and creates caps on both sides to turn the 2D drawing into a solid 3D shape.