Overview
The Thaumcraft 4 Research Bot automates solving the Thaumcraft 4 research minigame through a four-stage pipeline:The Complete Workflow
1. Screenshot Capture
The bot starts by taking a screenshot of your Minecraft window, capturing the research table interface. This image contains all the visual information needed to reconstruct the puzzle state.2. Puzzle Recognition
The recognition phase uses pixel-perfect color matching to identify:- Frame Detection: Locates the puzzle boundary using specific RGB colors
- Aspect Recognition: Identifies each aspect by its unique color signature
- Grid Construction: Maps aspects to hexagonal grid coordinates
- Connection Points: Finds available spaces and existing connections
3. Solving Algorithm
The RingSolver performs an intelligent depth-first search to connect all aspects:- Aspect costs: Primal aspects (aer, terra, etc.) cost 1, compound aspects cost more
- Path length: Shorter paths on the board are preferred
- Connection topology: Ensures all nodes form a connected graph
4. Solution Execution
Once the optimal solution is found, the bot:- Converts grid coordinates to screen pixel locations
- Generates mouse movement sequences
- Executes click-and-drag actions to place aspects
- Verifies the solution is complete
Key Design Principles
Pixel-Perfect
Uses exact RGB color matching for reliable aspect detection across different GUI scales
Graph-Based
Models the puzzle as a hexagonal grid graph with aspect transformation rules
Cost-Optimized
Minimizes total aspect cost by preferring cheaper transformation paths
Backtracking Search
Explores multiple solutions to find the global optimum
Performance Characteristics
The solver typically finds solutions in under a second for most puzzles. Complex puzzles with many nodes may take a few seconds as the solver explores the search space.
- Caching: Grid state and pathfinding results are cached to avoid redundant computation
- Pruning: Paths that exceed the current best cost are abandoned early
- Heuristics: Aspects are sorted by cost to explore cheaper paths first
Data Flow
Next Steps
Puzzle Recognition
Learn how pixel-based recognition works
Solver Algorithm
Deep dive into the RingSolver implementation
Aspect System
Understand aspect costs and transformations