General Questions
The mouse control is going wild! How do I stop it?
The mouse control is going wild! How do I stop it?
Why not just pre-compute the best solution for all puzzles?
Why not just pre-compute the best solution for all puzzles?
- Fixed given aspects (the starting aspects)
- Randomized hole positions on the hex grid
Why Python?
Why Python?
pyautogui- Mouse control and screenshotsPIL/Pillow- Image processingnumpy- Fast pixel array operations
Why isn't this a mod?
Why isn't this a mod?
- Still requires you to own the aspects
- Still requires you to craft missing aspects
- Still requires you to be at a research table
Technical Questions
What coordinate system does the hex grid use?
What coordinate system does the hex grid use?
HexGrid.calculate_distance:How does the solver algorithm work?
How does the solver algorithm work?
RingSolver uses a backtracking search algorithm:- Start with the given aspects on the board
- For each unconnected aspect:
- Find all possible paths to connect it
- Sort paths by aspect cost
- Try the cheapest path first
- If a path fails, backtrack and try the next alternative
- When all aspects are connected, record the solution
- Continue searching to find better (lower cost) solutions
- Return the best solution found
What are the performance characteristics?
What are the performance characteristics?
- Parse time: ~10-50ms
- Solve time: ~50-500ms
- Solve time: Several seconds to minutes
- The algorithm doesn’t scale well with many initial aspects
@lru_cacheon distance calculations and neighbor lookups- Aspect graph neighbors sorted by cost (cheapest first)
- Early pruning based on cost bounds
- Cached connected position sets
What aspect costs are used?
What aspect costs are used?
- Primal aspects cost 1 (aer, aqua, ordo, terra, ignis, perditio)
- Compound aspects cost the sum of their parents
config.toml:How are screenshots processed?
How are screenshots processed?
- Screenshot: Capture game window using
pyautogui - Frame Detection: Find colored frames using numpy masks
- Board frame: RGB(150, 123, 123)
- Left inventory: RGB(100, 123, 123)
- Right inventory: RGB(200, 123, 123)
- Aspect Detection: Flood-fill to find aspect icons by color
- Hex Grid Extraction: Group by X coordinate, sort by Y, detect holes
- Grid Building: Map to doubled-height hex coordinates
Can I customize aspect costs?
Can I customize aspect costs?
config.toml file:- You have large quantities of certain aspects
- You want to prioritize using aspects you’re trying to deplete
- You want solutions to avoid expensive/rare aspects
What are the 'Missing' and 'Free' values?
What are the 'Missing' and 'Free' values?
- “Free”: An empty hex space where aspects can be placed
- “Missing”: A hole in the board where no hex exists
Troubleshooting
The bot can't find my game window
The bot can't find my game window
game-window-title setting in config.toml:"GT: New Horizons"(default)"Minecraft 1.7.10"- Your custom window title
Mouse movements are too fast/slow
Mouse movements are too fast/slow
Currently no way to reduce the mouse interaction speed. The current speed works consistently for me, but might break on laggier machines.The delays are hardcoded in
mouseactions.py:The board parsing failed
The board parsing failed
- Resource pack not installed: You need the custom resource pack
- GUI size incompatible: The bot isn’t well tested on all GUI sizes
- Tooltip covering board: Hide NEI or move large tooltips
- Board not clean: Remove all manually placed aspects before running
debug_input.png and debug_render.png to see what the bot detected.Missing aspects from inventory error
Missing aspects from inventory error
- The bot will list them and ask if you want to auto-craft them
- Type
yto enable automatic crafting mode - The bot will drag-combine aspects to craft the missing ones
Solver is taking forever on large boards
Solver is taking forever on large boards
Solver algorithm currently doesn’t scale well with many (7+) given aspects on large boards. It gets quite slow. On the largest boards (9+ given aspects) it may currently take minutes to calculate.Workarounds:
- Be patient on large puzzles
- Use
testmode to avoid re-parsing the same board - Consider placing some aspects manually to reduce the search space
Linux support?
Linux support?
No Linux Support - I don’t want to deal with finding a universal way of taking screenshots and performing mouse inputThe bot uses Windows-specific libraries:
msvcrtfor console inputpyautoguiwith Windows window handling
Usage Questions
How do I run the bot in test mode?
How do I run the bot in test mode?
debug_input.png instead of taking a screenshot:- Testing the solver without mouse movements
- Debugging board parsing issues
- Running the solver multiple times on the same board
debug_render.png showing the detected board and solution.How do I benchmark solver performance?
How do I benchmark solver performance?
- Find all
test_inputs/board_*.pngfiles - Parse and solve each one
- Print timing and cost statistics
What does 'r' do when waiting for next board?
What does 'r' do when waiting for next board?
- Enter: Process next board (default)
- ‘r’: Retry placing aspects on current board
- Global hotkey (default
Ctrl+R): Process next board
- Mouse movements failed due to lag
- You want to see the solution applied again
- The game didn’t register some clicks
Where are cache statistics shown?
Where are cache statistics shown?