Skip to content

Commit 8426b8e

Browse files
committed
chore: correct game time reporting in shields
- Update check_health.py to prefer Routed Completion Time (343.9m) over Lattice estimate - Sync simulation seeds between ReachabilitySimulator and RoutedSimulator - Include routed time in simulation_report.md - Final local coverage: 77.44%
1 parent 690db85 commit 8426b8e

7 files changed

Lines changed: 70 additions & 50 deletions

File tree

Mythril.Headless/Simulation/ReachabilitySimulator.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ public void Run()
4040
Console.WriteLine("Flow Analysis Complete.");
4141

4242
var routed = new RoutedSimulator(items, quests, questDetails, questUnlocks, questToCadenceUnlocks, cadences, locations, refinements, statAugments, stats);
43-
routed.Run();
43+
routed.Run(seed);
4444

45-
GenerateIntegratedReport(finalState, flowState, flowSim);
45+
GenerateIntegratedReport(finalState, flowState, flowSim, routed);
4646
}
4747

48-
private void GenerateIntegratedReport(GameState state, QuantitativeFlowState flow, FlowSimulator flowSim)
48+
private void GenerateIntegratedReport(GameState state, QuantitativeFlowState flow, FlowSimulator flowSim, RoutedSimulator routed)
4949
{
5050
var sb = new StringBuilder();
5151
sb.AppendLine("# Game Content Health Report");
@@ -65,6 +65,8 @@ private void GenerateIntegratedReport(GameState state, QuantitativeFlowState flo
6565

6666
double maxQuestTime = state.QuestTime.Values.Where(t => t < double.PositiveInfinity).DefaultIfEmpty(0).Max();
6767
sb.AppendLine($"Estimated End-Game Time: {(maxQuestTime / 60.0):F1}m");
68+
sb.AppendLine($"Routed Completion Time: {(routed.LastRunTime / 60.0):F1}m");
69+
if (!routed.EndGameReached) sb.AppendLine("⚠️ WARNING: Path-routed simulation failed to reach End Game.");
6870

6971
var unreachableResources = items.All.Where(i => state.ResourceTime[i.Name] == double.PositiveInfinity).ToList();
7072
if (unreachableResources.Any())

Mythril.Headless/Simulation/RoutedSimulator.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,16 @@ public partial class RoutedSimulator(
1414
private readonly HashSet<string> _farmingStack = [];
1515
private const string END_QUEST = "Defeat the Mythril Construct";
1616

17-
public void Run()
17+
public void Run(SimulationSeed? seed = null)
1818
{
1919
Console.WriteLine("Starting Path-Routed Simulation...");
2020
var state = new SimulationState(stats);
21+
if (seed != null) {
22+
foreach (var s in seed.StartingStats) state.CurrentStats[s.Key] = s.Value;
23+
foreach (var c in seed.StartingUnlockedCadences) state.UnlockedCadences.Add(c);
24+
foreach (var a in seed.StartingUnlockedAbilities) state.UnlockedAbilities.Add(a);
25+
}
26+
2127
bool progressed = true; int steps = 0; const int MAX_STEPS = 10000;
2228
while (progressed && steps < MAX_STEPS)
2329
{
@@ -36,5 +42,12 @@ public void Run()
3642
Console.WriteLine($"[DEBUG] Current Stats: {string.Join(", ", state.CurrentStats.Select(kvp => $"{kvp.Key}: {kvp.Value}"))}");
3743
Console.WriteLine($"[DEBUG] Magic Capacity: {state.MagicCapacity}");
3844
}
45+
46+
// Expose time for ReachabilitySimulator to report
47+
LastRunTime = state.CurrentTime;
48+
EndGameReached = state.CompletedQuests.Contains(END_QUEST);
3949
}
50+
51+
public double LastRunTime { get; private set; }
52+
public bool EndGameReached { get; private set; }
4053
}

scripts/check_health.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,14 @@ def check_reachability():
299299
if report_path.exists():
300300
content = report_path.read_text(encoding="utf-8")
301301

302-
# 1. End Game Time
303-
time_match = re.search(r"Estimated End-Game Time: ([\d.]+)m", content)
304-
if (time_match):
305-
game_time = time_match.group(1) + "m"
302+
# 1. End Game Time (Prefer Routed over Lattice)
303+
routed_match = re.search(r"Routed Completion Time: ([\d.]+)m", content)
304+
lattice_match = re.search(r"Estimated End-Game Time: ([\d.]+)m", content)
305+
306+
if routed_match:
307+
game_time = routed_match.group(1) + "m"
308+
elif lattice_match:
309+
game_time = lattice_match.group(1) + "m"
306310

307311
# 2. Sustainability counts
308312
sust_match = re.search(r"### Sustainable Recurring Activities\n(.*?)\n\n", content, re.DOTALL)

scripts/data/health_summary.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"failure_count": 0,
44
"metrics": {
55
"monoliths": 0,
6-
"coverage": 77.62,
6+
"coverage": 77.44,
77
"mutation_score": 0.0,
88
"missing_tests": 0,
99
"key_violations": 0,
1010
"testid_violations": 0,
1111
"stale_docs": 1,
1212
"reachability_passed": {
1313
"passed": true,
14-
"time": "0.6m",
14+
"time": "343.9m",
1515
"sustainable": 21,
1616
"unsustainable": 13
1717
},

scripts/data/shield_coverage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"schemaVersion": 1,
33
"label": "coverage",
4-
"message": "77.6%",
4+
"message": "77.4%",
55
"color": "green"
66
}

scripts/data/shield_game_time.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"schemaVersion": 1,
33
"label": "optimal completion",
4-
"message": "0.6m",
4+
"message": "343.9m",
55
"color": "blue"
66
}

simulation_report.md

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,70 @@
11
# Game Content Health Report
2-
Generated: 2026-03-06 15:16:14
2+
Generated: 2026-03-06 15:30:07
33

44
## 💀 Reachability Analysis
55
✅ All quests reachable.
66
Estimated End-Game Time: 0.6m
7+
Routed Completion Time: 343.9m
78

89
## ⚖️ Economic Sustainability
910
### Sustainable Recurring Activities
11+
- Power the Forge
1012
- Refine Fire:Iron Ore->Fire I
11-
- Hunt Bats
12-
- Hunt Goblins
13-
- Scavenge Scrap
14-
- Refine Fire:Basic Gem->Fire I
15-
- Hunt Spiders
16-
- Refine Scrap:Web->Gold
17-
- Study Ancient Texts
18-
- Hunt Slimes
1913
- Chop Wood
20-
- Shatter the Crystals
21-
- Harvest Sea-Life
22-
- Power the Forge
23-
- High Altitude Survey
24-
- Tutorial Section
2514
- Buy Potion
26-
- Gather Moonberries
15+
- Refine Fire:Basic Gem->Fire I
2716
- Hunt Sand-Sharks
2817
- Archive Sifting
2918
- Mine Iron Ore
19+
- High Altitude Survey
20+
- Refine Scrap:Web->Gold
21+
- Study Ancient Texts
22+
- Gather Moonberries
23+
- Hunt Bats
24+
- Harvest Sea-Life
25+
- Shatter the Crystals
26+
- Hunt Spiders
27+
- Scavenge Scrap
28+
- Tutorial Section
29+
- Hunt Goblins
3030
- Deep Sea Scavenge
31+
- Hunt Slimes
3132

3233
### ⚠️ Unsustainable Activities (Reachable but starving)
33-
- Refine Earth:Crystal Shards->Earth I
34-
- Refine Lightning:Fire Shard->Lightning I
34+
- Refine Haste:Lost Parchment->Haste I
35+
- Refine Ice:Mana Leaf->Ice I
36+
- Refine Mixology:Herb->Potion
37+
- Refine Ice:Moonberry->Ice I
38+
- Sell Gem
3539
- Refine Water:Blue Coral->Water I
40+
- Refine Earth:Crystal Shards->Earth I
3641
- Refine Wood:Log->Herb
37-
- Purify the Grove
38-
- Refine Lightning:Ice Shard->Lightning I
39-
- Refine Mixology:Herb->Potion
4042
- Refine Scrap:Slime->Gold
41-
- Refine Ice:Mana Leaf->Ice I
42-
- Sell Gem
43-
- Refine Ice:Moonberry->Ice I
43+
- Refine Lightning:Ice Shard->Lightning I
44+
- Purify the Grove
45+
- Refine Lightning:Fire Shard->Lightning I
4446
- Refine Life:Ancient Bark->Cure I
45-
- Refine Haste:Lost Parchment->Haste I
4647

4748
### Net Resource Rates (per second)
48-
- **Fire I**: 29.1009/s
49-
- **Slime**: 4.1573/s
50-
- **Mythril Spark**: 0.4157/s
51-
- **Gold**: 1938.9487/s
52-
- **Leather**: 5.2556/s
49+
- **Iron Ore**: 11.1049/s
5350
- **Sun-baked Scale**: 0.8315/s
54-
- **Water**: 10.5112/s
55-
- **Blue Coral**: 2.1022/s
5651
- **Mana Leaf**: 2.5611/s
57-
- **Moonberry**: 2.6278/s
58-
- **Fire Shard**: 1.2472/s
59-
- **Iron Ore**: 11.1049/s
60-
- **Potion**: 7.0075/s
61-
- **Ice Shard**: 3.5037/s
52+
- **Lost Parchment**: 0.4157/s
53+
- **Slime**: 4.1573/s
6254
- **Log**: 1.9955/s
55+
- **Leather**: 5.2556/s
6356
- **Basic Gem**: 5.5225/s
64-
- **Lost Parchment**: 0.4157/s
65-
- **Crystal Shards**: 1.2472/s
57+
- **Ice Shard**: 3.5037/s
58+
- **Fire I**: 29.1009/s
59+
- **Moonberry**: 2.6278/s
6660
- **Ancient Bark**: 0.9977/s
61+
- **Mythril Spark**: 0.4157/s
62+
- **Potion**: 7.0075/s
63+
- **Fire Shard**: 1.2472/s
64+
- **Blue Coral**: 2.1022/s
65+
- **Crystal Shards**: 1.2472/s
66+
- **Water**: 10.5112/s
67+
- **Gold**: 1938.9487/s
6768

6869
## 🔄 Feedback Loops
6970
✅ No unbounded growth loops detected (approximation).

0 commit comments

Comments
 (0)