Overview
Thaumcraft 4’s magic system is built on aspects - fundamental essences that can be combined to create more complex aspects. The bot models this as a directed graph to find optimal transformation paths.Aspect Hierarchy
Primal Aspects
The six primal aspects are the foundation of all Thaumcraft magic:Aer
Air - Cost: 1
Terra
Earth - Cost: 1
Ignis
Fire - Cost: 1
Aqua
Water - Cost: 1
Ordo
Order - Cost: 1
Perditio
Chaos - Cost: 1
Compound Aspects
All other aspects are created by combining two parent aspects. This is defined inaspect_parents:
View Full Aspect Hierarchy (Click to expand)
View Full Aspect Hierarchy (Click to expand)
Cost Calculation
Each aspect has a cost representing how “expensive” it is to use in research. The cost is computed iteratively from the primal aspects:The solver minimizes total cost when finding solutions. Using cheaper aspects leads to better (optimal) solutions.
Cost Overrides
You can override aspect costs in the config to reflect custom mod configurations:Aspect Graph
The bot builds an undirected graph where edges connect aspects that can transform into each other:Aspect Pathfinding
The core pathfinding function finds the cheapest paths from one aspect to another with a specific length:Algorithm: Dynamic Programming with Backtracking
Example: Finding Paths
Integration with Board Pathfinding
The solver combines aspect pathfinding with spatial board pathfinding:(element_path, board_path) represents a valid move where:
element_pathtransforms aspects according to Thaumcraft rulesboard_pathis spatially possible on the hexagonal grid
Custom Aspects and Disabled Aspects
The bot supports custom aspects from mods:Performance Optimizations
| Technique | Benefit |
|---|---|
| LRU caching | Aspect paths computed once and reused |
| Neighbor sorting | Explores cheaper aspects first |
| Dynamic programming | O(n × m) instead of exponential DFS |
| Cost-based pruning | Solver skips expensive aspect paths |
The
@lru_cache(maxsize=1000) decorator on pathfinding functions means the bot only computes each unique (start, ends, lengths) combination once. Subsequent calls return cached results instantly.Next Steps
Solver Algorithm
See how aspect paths are used in the solver
How It Works
Understand the full pipeline