DEV Community

Cover image for Finding the Right Reference Changed Everything for my Project
Marlon Joseph
Marlon Joseph

Posted on

Finding the Right Reference Changed Everything for my Project

I got hooked on Wood Block Puzzle and eventually got frustrated enough to build a solver for it. Read the board from a screenshot, figure out where each piece fits best and show the optimal move. Sounded straightforward until I tried to plan the actual architecture.
How do you reliably extract a game board from a phone screenshot? What should the evaluation logic prioritize, clearing lines immediately or keeping the board open for future moves? I had questions but no clear starting point.

Discovering a Working Reference
I dug through GitHub and dev forums looking for grid-based puzzle solvers. Most repos were either abandoned or built for Tetris, which has gravity mechanics that don't apply here. I needed something built for a static placement game that drop pieces on a board, clear rows and columns where no time pressure applies.
After searching through several projects, I found a working repo that was actively maintained. Block Blast shares the same fundamental mechanics as Wood Block Puzzle i.e grid board, shape placement, line clearing. The project even had a fully functional live version as Block Blast Solver with screenshot-based solving. The full pipeline was proven and running.

Figure1. Credit:aiblockblastsolver.com

Three Things That Reshaped My Approach
Studying the codebase changed how I thought about the problem:
Screenshot parsing is the real challenge.
The solver logic was surprisingly clean. The heavy lifting was in detecting the board state from screenshots as it has been trained by YOLO across multiple game themes because color variations completely break naive detection.

Smart scoring beats greedy scoring.
Instead of just maximizing immediate clears, the evaluation weighted board openness, center availability and multi-move look ahead. I adopted a similar approach for my own scoring function.

Raw detection isn't enough.
A validation layer that used grid structure to compensate for missed cell detections. Without this, small pieces get misread constantly. I would have learned this the hard way.

Adapting It
Having a working reference saved me weeks as the specific game barely matters but the engineering patterns underneath are universal.
Sometimes the smartest move in development is the same as in the game: look at the whole board before you place your first piece.

Top comments (1)

Collapse
 
usama_masood profile image
Usama Masood • Edited

One good example often reveals the strategy and possibilities that weeks of trial and error couldn’t. Although trial and error gives you more exposure to possibilities.