Core Loop
In short
A run is one map, played for up to 9 innings. Each inning has a score goal: reach it and the inning ends at once, then you shop and play the next. Make your outs first and the run is over. Every run, won or lost, pays meta points and XP that unlock things for the next run.
How it works
- Title screen (
GameState.MainMenu). The big button says PLAY!, or CONTINUE when a run was saved partway, or PLAY CO-OP in co-op mode. The DAILY CHALLENGE card starts today’s daily run straight away. - Map select (
MapSelect, PICK A BALLPARK). Slide the carousel to an unlocked park, pick NORMAL / MEDIUM / HARD, then PLAY BALL!. See Map Select and Unlocks and Difficulty. - Between innings (
RunMap). A line score with every inning’s goal, a briefing on the next pitcher and park, and your build. PLAY BALL! starts the inning. SAVE & QUIT and ABANDON RUN are here too. - Inning (
AtBat). Pitches keep coming until the score reaches the goal or the outs run out. See At-Bat Loop. Before inning 1 only, the match intro plays (Intro) and ends with the batter’s walk-up. See Cutscenes. - Shop (
Shop). Only after a cleared inning that was not the last. A cleared boss inning plays BOSS DOWN! first (Outro). Buy upgrades, REROLL, then NEXT INNING goes back to step 3. See Shop and Economy. - Run over (
RunOver). MAP BEATEN! after clearing all innings, GAME OVER otherwise. When the run ended in play, the matching cutscene (MAP BEATEN! or GAME OVER) plays first. The results show score, points earned, two XP bars and every unlock. Buttons: RUN IT BACK, PICK A MAP, MAIN MENU. - Meta rewards are paid inside
RunManager.EndRunbefore any cutscene or the results: map record and unlocks, meta points, account and batter XP, leaderboard entries, then the save is written and the run checkpoint deleted.
The title screen’s top bar also has CUSTOMIZE, PERKS, BATTING CAGE and INDEX (Index Screen).
flowchart TD Title["Title screen<br/>PLAY! / CONTINUE"] -->|PLAY!| MapSel["Map select<br/>pick map + difficulty"] Title -->|CONTINUE| Resume["Resume checkpoint"] Title -->|DAILY CHALLENGE| Map Title -->|PLAY CO-OP| Coop["Co-op lobby"] Title -->|BATTING CAGE| Cage["Batting cage<br/>(no rewards)"] Title -->|CUSTOMIZE / PERKS| Meta2["Spend points"] Title -->|INDEX| Idx["Index<br/>everything in the game"] Resume --> Map Resume --> Shop MapSel -->|PLAY BALL!| Map["Between innings<br/>line score + briefing"] Map -->|"PLAY BALL! (inning 1)"| Intro["Match intro<br/>then walk-up"] Intro --> Inning Map -->|PLAY BALL!| Inning["Inning: at-bats<br/>pitch, swing, score"] Inning -->|goal reached| Last{"Last inning?"} Inning -->|out of outs| Over["Run over<br/>GAME OVER cutscene"] Last -->|"no, boss inning"| Boss["BOSS DOWN! cutscene"] Boss --> Shop Last -->|no| Shop["Shop<br/>buy, REROLL"] Last -->|yes| Won["Run over<br/>MAP BEATEN! cutscene"] Shop -->|NEXT INNING| Map Map -->|ABANDON RUN| Over Over --> Rewards["Meta rewards<br/>map record, points, XP, leaderboard"] Won --> Rewards Rewards -->|RUN IT BACK| Map Rewards -->|PICK A MAP| MapSel Rewards -->|MAIN MENU| Title
Numbers
| What | Value | Where to tune |
|---|---|---|
| Innings per run | 9 | RunConfig.inningsPerRun |
| Outs per inning | 3 (Hard: 2), plus Extra Outs | RunConfig.outsPerInning, Difficulties.OutsDelta |
| Boss innings | every 3rd (3, 6, 9) | RunConfig.bossEvery |
| First inning goal | 500 on the first map, Normal | RunConfig.inningGoal |
| Starting coins | 5 | RunConfig.startingCoins |
In the code
| File | What it does |
|---|---|
Assets/_Project/Scripts/Run/RunManager.cs | Solo loop: StartRun, PlayCurrentRound, OnRoundFinished, OpenShop, LeaveShop, EndRun |
Assets/_Project/Scripts/Core/GameState.cs | The screens: MainMenu, MapSelect, RunMap, AtBat, Shop, RunOver, Customize, Lobby, CoopWatch, Intro, Outro, Index |
Assets/_Project/Scripts/Core/GameRoot.cs | GoToMainMenu, OpenMapSelect, EnterCustomize, EnterLobby, EnterIndex; Run is the active IRunDriver (solo or co-op); Intro and Outro directors |
Assets/_Project/Scripts/UI/MapSelectView.cs | The ballpark carousel |
Assets/_Project/Scripts/Run/IRunDriver.cs | What the map, shop and results screens call, so solo and co-op share them |
Assets/_Project/Scripts/UI/RunOverView.cs | Results card, XP bar fill, restart buttons |
Gotchas
- Reaching the goal ends the inning after the pitch in flight is resolved (
AtBatController.IsRoundOveris checked between pitches), so the last home run can push the score past the goal. - ABANDON RUN (between innings or from the pause menu) ends the run as a loss through the same
EndRun: it still pays meta points and XP, records the map best and posts to the leaderboard. It skips the GAME OVER cutscene. - Settings > CUTSCENES off skips the intro and every outro; the loop is otherwise the same.
- There is no shop before inning 1 and none after the last inning.
- Starting a new run (map select, NEW RUN, or the daily card) replaces a saved run without asking.
- Co-op uses its own driver (
CoopRun) with the same screens. See Co-op Run Flow.
Related
- Run Structure: innings, bosses, goals and the checkpoint
- Map Select and Unlocks: how maps and difficulties open
- Shop and Economy: coins and the shop between innings
- Meta Progression: what the run-over rewards buy
- XP and Levels: the two XP bars on the results screen
- Cutscenes: the match intro and the end-of-game scenes
- Game States and Screens: the state machine behind each screen