Pitchers and Bosses

In short

Four regular pitchers, two roaming bosses (The Ace, Knuckle Sandwich) and five park bosses, one per run map, who only ever pitch inning 9 of their own park (BallparkDefinition.finalBossId). Innings 3, 6 and 9 are boss innings. Bosses can handicap the batter (batterModifiers), throw their own special ball (balls) or throw decoys (decoys).

How it works

  1. RunMapGenerator.Generate builds the 9 innings when the run starts, from the run seed.
  2. Boss inning when (i + 1) % bossEvery == 0 (bossEvery = 3), or the last inning if the park has a finalBossId.
  3. Regular innings pick at random among non-boss pitchers with minRound <= i.
  4. The last inning is the park’s own boss (finalBossId) when it has one. Every run map has one.
  5. Innings 3 and 6 pick at random among bosses that are nobody’s park boss (every park’s finalBossId is excluded, not just this park’s), not used yet this run, with minRound <= i. Fallbacks loosen in order: drop minRound, then allow reuse, then allow park bosses, then any pitcher.
  6. During an at-bat, PitcherAI picks each pitch by weight from the pitcher’s mix (see the lean below), never the same pitch more than twice in a row (three times for a special-ball pitch). It throws a strike with chance strikeRate. Speed = pitch speedMph x speedMultiplier x random 0.97..1.03 (x1.15 more on a Super Fast ball). See Pitching.
  7. The boss’s batterModifiers are added to the batter’s stats for that inning only (RunManager, CoopRun).
  8. Two special-ball slots stack on every pitch: the map’s ball (PitchData.effect, from the park’s balls) and the pitcher’s own (PitchData.bossEffect, from PitcherDefinition.balls), each rolled on its own seeded stream. The pitcher’s sets the colour, glow, sound and pill colour (PitchData.Primary); the pill names both, e.g. “WIFFLE GHOST FASTBALL”. See Special Balls.
  9. Decoys (The Phantom): on a pitch that wins the decoyChance roll, decoys fake balls leave the hand with the real one, peel away from 30% of the flight to their own spot near the zone and vanish at 97%. They can’t be hit and cast no shadow: the shadow is the tell (Batting/DecoyBalls). Decoys combine with either ball slot.
  10. The lean: when a ball (park or boss) rides only some pitch types, the pitcher draws from those types 80% of the time (PitcherAI.FavouredShare), so about 67 to 72% of his pitches can carry it. A pitcher who throws none of them (Knuckle Sandwich at Windy City) doesn’t lean.

With the default content this gives:

InningWho can pitch
1Coach Pete only
2Coach Pete, The Junkballer, Groundball Gus
3 (boss)BOSS: The Ace (Knuckle Sandwich’s minRound 4 is too late; park bosses are excluded)
4, 5any of the four regulars (Flamethrower from here on)
6 (boss)BOSS: Knuckle Sandwich (The Ace is used)
7, 8any of the four regulars
9 (final boss)the park’s own boss: Backyard Benny (Sandlot), Farmer Fitz (Farmyard), The Gale (Windy City), The Phantom (Midnight), The Alien (Moon)

Where they show up besides the mound: the map screen briefing and the HUD list a boss’s own balls (”• His own …”, DescribeBalls), the main menu INDEX lists every pitcher under PITCHERS or BOSSES (Index Screen), the match intro shows inning 1’s pitcher card (Cutscenes), and clearing inning 3 or 6 plays the BOSS DOWN! cutscene before the shop (unless CUTSCENES is off).

Numbers

Pitchers

idNameBossminRoundSpeed xStrike rateTime between pitchesColour
coachCoach Peteno0 (inning 1)0.80.91.3 s(0.5, 0.5, 0.5)
junkballerThe Junkballerno1 (inning 2)0.950.751.2 s(0.6, 0.4, 0.8)
sinkerballerGroundball Gusno1 (inning 2)10.751.15 s(0.2, 0.6, 0.9)
flamethrowerFlamethrowerno2 (first used in 4)1.050.71.1 s(0.9, 0.3, 0.2)
aceBOSS: The Aceroaming01.10.651.0 s(0.9, 0.75, 0.1)
knucklerBOSS: Knuckle Sandwichroaming4 (inning 5)10.81.0 s(0.3, 0.8, 0.6)
phantomBOSS: The PhantomMidnight Yard5 (unused)10.81.15 s(0.7, 0.9, 1)
bennyBOSS: Backyard BennySandlot Field80.950.81.15 s(1, 0.85, 0.35)
farmerBOSS: Farmer FitzFarmyard80.950.81.2 s(0.6, 0.45, 0.25)
galeBOSS: The GaleWindy City Yard81.050.751.1 s(0.5, 0.8, 1)
alienBOSS: The AlienMoon Stadium81.050.751.1 s(0.55, 1, 0.5)

RunConfig.extraPauseBetweenPitches (1 s) is added on top of every pitcher’s own time. A park boss’s minRound never matters: he is placed by finalBossId, not drawn.

Pitch mixes (weight, share)

PitcherMix
Coach PeteFastball 4 (66.7%), Curveball 1 (16.7%), Changeup 1 (16.7%)
The JunkballerChangeup 2 (25%), Curveball 2 (25%), Sinker 2 (25%), Knuckleball 1 (12.5%), Fastball 1 (12.5%)
Groundball GusSinker 3 (50%), Slider 2 (33.3%), Fastball 1 (16.7%)
FlamethrowerFastball 3 (50%), Slider 2 (33.3%), Sinker 1 (16.7%)
The AceFastball 3 (28.6%), Sinker 2 (19%), Slider 2 (19%), Curveball 2 (19%), Changeup 1 (9.5%), Knuckleball 0.5 (4.8%)
Knuckle SandwichKnuckleball 1 (100%)
The PhantomFastball 2 (40%), Changeup 2 (40%), Curveball 1 (20%)
Backyard BennyFastball 2 (40%), Changeup 2 (40%), Curveball 1 (20%)
Farmer FitzSinker 3 (50%), Changeup 2 (33.3%), Knuckleball 1 (16.7%)
The GaleFastball 3 (50%), Slider 2 (33.3%), Changeup 1 (16.7%)
The AlienCurveball 2 (33.3%), Slider 2 (33.3%), Fastball 1 (16.7%), Knuckleball 1 (16.7%)

These are the base shares. At a park whose ball rides only some pitches (Farmyard, Windy City, Moon), the lean moves most pitches onto those types.

Boss tricks (on the batter while facing them, or on his pitches)

BossHandicap / ball / decoysDescription in game
The Ace-15% Timing Window (Percent, -0.15)“Throws everything and paints the corners. Shrinks your timing window.”
Knuckle Sandwich-20% Contact (Percent, -0.2)“Throws only knuckleballs. Your contact zone shrinks.”
The Phantom2 decoys, 1 in 4 pitches (decoys = 2, decoyChance = 1/4)“Three balls leave his hand. Only one is real: watch the shadows.”
Backyard BennyWiffle ball, any pitch, 1 in 4”The neighbourhood legend. His wiffle ball drifts one way, then cuts back hard at the plate.”
Farmer Fitznone yet (code: “his own special ball: still to be decided”)“Slow, steady and dirty: sinkers and changeups off the back of the barn.”
The GaleHeadwind / Tailwind, any pitch, 1 in 8 (then 50/50 which)“Pitches into the wind. Some stall at the plate, some get blown right past you.”
The Aliennone yet (code: “his own special ball: still to be decided”)“Learned the game from satellite TV. Throws everything, from very far away.”

The boss ball and decoy chances are multiplied by the difficulty’s special-ball scale (x1 / x1.5 / x2), like park balls: The Phantom’s decoys come 1 in 4 on Normal, 3 in 8 on Medium, 1 in 2 on Hard.

Decoy numbers (PitchData, PitcherAI)

WhatValueWhere to tune
Decoys split off at30% of the flightPitchData.DecoySplit
Decoys vanish at97% of the flightPitchData.DecoyFade
Distance from the real ball at the plate0.25 to 0.42 m, one per slice of the circlePitcherAI.DecoyMinOffset, DecoyMaxOffset
Kept near the zonex -0.55..0.55 m, y 0.2..1.4 mPitcherAI.ClampNearZone
Seeded stream0xDEC0 (never shifts the pitches)PitcherAI.DecoyStream

Pitch choice (PitcherAI)

WhatValueWhere to tune
Same pitch in a row, max2MaxSamePitchInARow
Same special-ball pitch in a row, max3MaxFavouredInARow
Share drawn from the special-ball pitches0.8FavouredShare

Batting cage machine (built at runtime in BattingCage.BuildMachine, not in the content): id pitching_machine, “Pitching Machine”, strike rate 0.85, 0.8 s between pitches, speed x1, every pitch type at weight 1 (or one chosen type).

In the code

FileWhat it does
Assets/_Project/Scripts/Data/DefaultContent.csPitcher(id, name, description, boss, minRound, speedMult, strikeRate, timeBetween, color, mix...); boss balls, decoys, finalBossId lines
Assets/_Project/Scripts/Data/PitcherDefinition.csFields (balls, decoys, decoyChance), WeightedPitch, DescribeBalls
Assets/_Project/Scripts/Run/RunMapGenerator.csPicks each inning’s pitcher; park bosses kept out of innings 3 and 6
Assets/_Project/Scripts/Pitching/PitcherAI.csPitch choice and lean, strike roll, speed, both ball rolls, MakeDecoys
Assets/_Project/Scripts/Pitching/PitchData.csbossEffect, Primary, Has, decoys, DecoyPositionAt
Assets/_Project/Scripts/Batting/DecoyBalls.csDraws the decoys (same look as the real ball, no shadow)
Assets/_Project/Scripts/Run/RunManager.csAdds pitcher.batterModifiers to the inning’s stats

Gotchas

  • The Phantom only pitches at Midnight Yard. A DefaultContent comment says he “can turn up as a late boss (inning 6 on)” elsewhere and that decoys fly “with every pitch”; the code does neither. RunMapGenerator keeps every park’s boss out of innings 3 and 6 everywhere (checked by BallEffectTest.EveryParkHasItsOwnBoss), and decoyChance is 1/4.
  • Farmer Fitz and The Alien have no special ball, handicap or decoys yet: they differ only in numbers and mix. The README marks their own balls as planned. “From very far away” is flavour text: PitcherDefinition has no release distance field.
  • None of the five park bosses has batterModifiers.
  • Knuckle Sandwich has one pitch, so the in-a-row limits do not apply to him.
  • Flamethrower has minRound 2 but inning index 2 is always a boss inning, so he first shows up in inning 4.
  • With only two roaming bosses, innings 3 and 6 are always The Ace then Knuckle Sandwich: no randomness is left.
  • Boss names include the “BOSS: ” prefix in displayName.
  • The lean draws from the pitch random stream, so adding a ball that rides only some pitches changes which pitches come (the ball’s own roll still never does).