From ba980e1bd7cb07062e3db8f5a000da47b2ac6266 Mon Sep 17 00:00:00 2001 From: Prabu Date: Thu, 23 Jul 2026 09:51:29 -0500 Subject: [PATCH] debug: SR_FORCE_ARENA_IDS to pin a gauntlet floor's arena line-up Art and QA passes on the replay arenas were awkward: the floor rolls random arenas and persists them, so hitting a specific arena meant relaunching until it came up. DEBUG-only env hook that forces an exact line-up and wins over the persisted picks, so a launch is reproducible: SIMCTL_CHILD_SR_FORCE_ARENA_IDS=arena_08,arena_09 \ xcrun simctl launch com.hexwireaaron.game Ids are validated against ArenaPool, so a typo or an unknown id falls through to the normal random roll rather than producing an empty floor. Co-Authored-By: Claude Opus 4.8 --- Game/GauntletService.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Game/GauntletService.swift b/Game/GauntletService.swift index 34ec139..7b08025 100644 --- a/Game/GauntletService.swift +++ b/Game/GauntletService.swift @@ -126,6 +126,20 @@ final class GauntletStore: ObservableObject { /// floor 4 on. Reuses the persisted picks if they exist (stable within a /// floor attempt); otherwise rolls fresh distinct arenas and persists. func arenaIdsForCurrentFloor() -> [String] { + #if DEBUG + // Art/QA pass: force an exact arena line-up, e.g. + // SIMCTL_CHILD_SR_FORCE_ARENA_IDS=arena_08,arena_09 + // Wins over the persisted picks so each launch is reproducible. + if let forced = ProcessInfo.processInfo.environment["SR_FORCE_ARENA_IDS"] { + let ids = forced.split(separator: ",") + .map { $0.trimmingCharacters(in: .whitespaces) } + .filter { ArenaPool.entry(id: $0) != nil } + if !ids.isEmpty { + dlog("[Gauntlet] SR_FORCE_ARENA_IDS → \(ids)") + return ids + } + } + #endif if let picked = floorArenaIds, !picked.isEmpty { return picked } let count = currentFloor >= 4 ? 3 : 2 let picked = ArenaPool.randomArenaIds(count: count)