Skip to content

Commit 1888309

Browse files
committed
chore: add intelligent time formatting for shields
- >50h: days - >120m: hours (e.g., 5.7h) - >300s: minutes - else: seconds
1 parent 8426b8e commit 1888309

4 files changed

Lines changed: 59 additions & 40 deletions

File tree

scripts/check_health.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,22 @@ def check_docs_staleness():
283283
# Reachability Simulation
284284
# -----------------------
285285

286+
def format_game_time(minutes_str):
287+
try:
288+
minutes = float(minutes_str.replace('m', ''))
289+
total_seconds = minutes * 60
290+
291+
if minutes >= 50 * 60: # Over 50 hours
292+
return f"{minutes / (60 * 24):.1f}d"
293+
elif minutes >= 120: # Over 120 minutes
294+
return f"{minutes / 60:.1f}h"
295+
elif total_seconds >= 300: # Over 300 seconds
296+
return f"{minutes:.1f}m"
297+
else:
298+
return f"{total_seconds:.0f}s"
299+
except:
300+
return minutes_str
301+
286302
def check_reachability():
287303
print("--- Running Reachability Simulation ---")
288304
try:
@@ -303,10 +319,13 @@ def check_reachability():
303319
routed_match = re.search(r"Routed Completion Time: ([\d.]+)m", content)
304320
lattice_match = re.search(r"Estimated End-Game Time: ([\d.]+)m", content)
305321

322+
raw_time = "0"
306323
if routed_match:
307-
game_time = routed_match.group(1) + "m"
324+
raw_time = routed_match.group(1)
308325
elif lattice_match:
309-
game_time = lattice_match.group(1) + "m"
326+
raw_time = lattice_match.group(1)
327+
328+
game_time = format_game_time(raw_time)
310329

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

scripts/data/health_summary.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"stale_docs": 1,
1212
"reachability_passed": {
1313
"passed": true,
14-
"time": "343.9m",
14+
"time": "5.7h",
1515
"sustainable": 21,
1616
"unsustainable": 13
1717
},

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": "343.9m",
4+
"message": "5.7h",
55
"color": "blue"
66
}

simulation_report.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Game Content Health Report
2-
Generated: 2026-03-06 15:30:07
2+
Generated: 2026-03-06 15:37:20
33

44
## 💀 Reachability Analysis
55
✅ All quests reachable.
@@ -8,63 +8,63 @@ Routed Completion Time: 343.9m
88

99
## ⚖️ Economic Sustainability
1010
### Sustainable Recurring Activities
11-
- Power the Forge
12-
- Refine Fire:Iron Ore->Fire I
13-
- Chop Wood
11+
- Shatter the Crystals
12+
- Harvest Sea-Life
13+
- Study Ancient Texts
14+
- Tutorial Section
1415
- Buy Potion
15-
- Refine Fire:Basic Gem->Fire I
16-
- Hunt Sand-Sharks
1716
- Archive Sifting
18-
- Mine Iron Ore
19-
- High Altitude Survey
2017
- Refine Scrap:Web->Gold
21-
- Study Ancient Texts
22-
- Gather Moonberries
18+
- High Altitude Survey
19+
- Refine Fire:Iron Ore->Fire I
2320
- Hunt Bats
24-
- Harvest Sea-Life
25-
- Shatter the Crystals
26-
- Hunt Spiders
27-
- Scavenge Scrap
28-
- Tutorial Section
29-
- Hunt Goblins
3021
- Deep Sea Scavenge
22+
- Power the Forge
23+
- Chop Wood
24+
- Hunt Goblins
25+
- Hunt Sand-Sharks
26+
- Scavenge Scrap
27+
- Gather Moonberries
28+
- Hunt Spiders
29+
- Refine Fire:Basic Gem->Fire I
30+
- Mine Iron Ore
3131
- Hunt Slimes
3232

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

4848
### Net Resource Rates (per second)
49-
- **Iron Ore**: 11.1049/s
50-
- **Sun-baked Scale**: 0.8315/s
51-
- **Mana Leaf**: 2.5611/s
49+
- **Crystal Shards**: 1.2472/s
50+
- **Blue Coral**: 2.1022/s
5251
- **Lost Parchment**: 0.4157/s
5352
- **Slime**: 4.1573/s
5453
- **Log**: 1.9955/s
55-
- **Leather**: 5.2556/s
56-
- **Basic Gem**: 5.5225/s
57-
- **Ice Shard**: 3.5037/s
5854
- **Fire I**: 29.1009/s
59-
- **Moonberry**: 2.6278/s
55+
- **Gold**: 1938.9487/s
6056
- **Ancient Bark**: 0.9977/s
61-
- **Mythril Spark**: 0.4157/s
62-
- **Potion**: 7.0075/s
57+
- **Basic Gem**: 5.5225/s
6358
- **Fire Shard**: 1.2472/s
64-
- **Blue Coral**: 2.1022/s
65-
- **Crystal Shards**: 1.2472/s
59+
- **Potion**: 7.0075/s
6660
- **Water**: 10.5112/s
67-
- **Gold**: 1938.9487/s
61+
- **Mana Leaf**: 2.5611/s
62+
- **Sun-baked Scale**: 0.8315/s
63+
- **Leather**: 5.2556/s
64+
- **Mythril Spark**: 0.4157/s
65+
- **Moonberry**: 2.6278/s
66+
- **Iron Ore**: 11.1049/s
67+
- **Ice Shard**: 3.5037/s
6868

6969
## 🔄 Feedback Loops
7070
✅ No unbounded growth loops detected (approximation).

0 commit comments

Comments
 (0)