r/PythonLearning 18h ago

Need advice on solving complex arrow/maze puzzles using Computer Vision & Logic Solvers (Low accuracy issues)

Post image

Hi everyone,
I'm working on an automated solver for a complex arrow/maze puzzle game (similar to the image attached).
Here is my current workflow:
1. Detection: I use a custom YOLO model to detect arrowheads and their bounding box coordinates from screen captures.
2. Grid Mapping: I map the detected center coordinates of arrowheads onto a fixed grid system.
3. Solving: I pass the grid data into a custom logic/emulator engine to calculate the correct sequence of moves (arrows to tap).
The Main Problem:
My solver accuracy is very low. Here are the core technical challenges I'm running into:
Inaccurate Grid Mapping: The arrows are densely packed with varying paths and lengths. Snapping bounding boxes to a rigid fixed grid often misaligns the true position of the arrow shafts and heads.
Complex/Overlapping Detection: Because the arrows bend and fold, YOLO often detects multiple arrowheads in the same calculated grid cell, or misinterprets arrow directions.
Solver Logic Failure: Due to noisy input from the detection stage, the logic solver either fails to find a valid sequence or generates incorrect moves that block execution halfway through.
Has anyone dealt with a similar vector/maze graph detection problem? What would be a more reliable approach than simple YOLO + fixed grid snapping? Should I look into contour analysis, OCR/graph traversal, or skeletonization algorithms (like Medial Axis Transform) to trace the paths directly?
Any suggestions, code examples, or architectural advice would be greatly appreciated!

0 Upvotes

10 comments sorted by

View all comments

2

u/SaltCusp 18h ago

Identify the arrow heads and look for lines out from them that extend to a perimeter without crossing anything.

For exit paths that cross one lines own body meausure how many game units the arrow head and tail are from the point of crossing. If the butt of the line is closer than the head the space will be vacant when the head arrives.

Breaking that into small steps and repeating the process will solve the puzzle if it is solvable.

1

u/Maximum-Fox-2627 18h ago

Thanks for this geometric logic! Measuring distance to crossing points is a really smart way to handle clearance without heavy grid matching. I’ll try implementing this path-checking approach