Batting Cage
In short
Practice: a pitching machine throws forever, there are effectively no outs and no goal, and nothing is saved or rewarded. You pick the park and drill one pitch type or all of them. It reuses
AtBatControllerunchanged by giving it a round that can never be won or lost in practice.
How it works
- Top bar BATTING CAGE opens a popup: “Pick a ballpark to practice in.” One PRACTICE button per park (the last one used is green). Every run map is listed, then the practice parks such as Scoreboard Smash.
BattingCage.Enterstores the selected batter and park and callsStartSession:- builds the park,
- stats = the batter’s modifiers + their level perks + their starting upgrades + the park’s
batterModifiers(no shop upgrades, no synergies, no pitcher modifiers), - the bat model comes from the batter’s starting Bat upgrade,
- a runtime “Pitching Machine” pitcher is created with the chosen pitch types,
- an inning node with
targetScore = int.MaxValue, 999 outs, a random seed, and inning 0 (the HUD shows no inning).
- When a session ends (after 999 outs) it simply starts again.
- Controls in the cage: Tab cycles the pitch (MIXED, then each pitch type, then MIXED) and M cycles the park. Both restart the session. The pause menu has PITCH: name, PARK: name and LEAVE CAGE.
- The cage switches itself off whenever the game leaves the
AtBatstate.
Numbers
| What | Value | Where to tune |
|---|---|---|
| Outs | 999 | BattingCage.EndlessOuts |
| Machine strike rate | 0.85 | BattingCage.MachineStrikeRate |
| Time between pitches | 0.8 s | BattingCage.MachinePitchGap |
| Machine speed multiplier | 1 (default) | PitcherDefinition.speedMultiplier |
| Pitch speed scale | 0.6 (no difficulty) | RunConfig.pitchSpeedScale |
| Special-ball chance multiplier | 1 (the RoundContext default) | RoundContext.ballChanceScale |
| Score goal | int.MaxValue (never) | BattingCage.StartSession |
In the code
| File | What it does |
|---|---|
Assets/_Project/Scripts/Modes/BattingCage.cs | Enter, NextPitch, NextPark, StartSession, BuildMachine, Parks |
Assets/_Project/Scripts/UI/LobbyNav.cs | The BATTING CAGE popup (DrawCageParks) |
Assets/_Project/Scripts/UI/UIRoot.cs | Pause menu buttons for the cage |
Assets/_Project/Scripts/Batting/AtBatController.cs | The same at-bat loop runs, see At-Bat Loop |
Gotchas
- The cage never touches
RunManager, the shop, saves, XP, meta points or leaderboards. - Every park is open in the cage, even maps you have not unlocked yet.
- The pitching machine keeps the
PitcherDefinitiondefaultspeedMultiplierof 1, weights every pitch type equally, and adds noextraPauseBetweenPitches(runs add 1 s), so the cage is quicker than a run. - The seed is random, so a practice session is not reproducible.
- The dev menu’s PITCHING section can force a special ball or pitch type here too. See Dev Menu and Shortcuts.
- The README only mentions Tab; M (change park) also works.
- No cutscenes: the cage never plays the match intro or an outro (they belong to
RunManagerandCoopRun). - The top bar’s INDEX lists the practice parks first under BALLPARKS with the subtitle “Batting cage” (Index Screen).
Related
- At-Bat Loop: the loop the cage reuses
- Pitch Types: what the machine can throw
- Ballparks: the parks you can practice in
- Controls: all keys