Scoring
In short
A home run scores
round((distanceFt x targetMultiplier + targetBonus) x HR Multiplier x greenMultiplier). Anything else scores 0. Distance is carry (where the ball first lands). Targets are landing zones or things in the air that pay extra. Reach the inning’s goal and the inning ends. See Run Structure.
How it works
HitPhysics.Simulateflags a home run and, if so, callsScoreCalculator.FindTargetfor the best target. See Hit Physics.ScoreCalculator.Score(hit, stats)turns it into points right after the swing, before the flight is shown.- When the ball lands,
ResolvePlayadds the score toRoundScoreand counts the home run. - On screen, the live counter builds the score step by step under “HOME RUN!”: DISTANCE (feet), the target, GREEN (or GREEN xn STREAK), HR POWER, each with its chip, ending exactly on the points (
HitTally.BuildStackrounds likeScore). The total “+points” then flies into the score panel, which only counts it up as it arrives. See Hit Show.
Targets (OutfieldTarget)
Each ballpark has a list of targets. Each target has a spray angle, distance, radius, multiplier (default 2), flat bonus, and heightM.
- Landing zone (
heightM= 0): earned if the ball’s first landing point is within the radius (on the ground plane). - Aerial target (
heightM> 0, for example the moon’s space station): earned if any point of the flight before landing passes within the radius of that point in the air. - If several are earned, the one worth the most extra points wins:
value = distanceFt x (multiplier - 1) + bonus. This lets multipliers and flat bonuses compare fairly.TargetValueexposes the same number (the match intro shows it as a target’s “worth”). - The HUD shows a target’s reward as “+150” (bonus) or “x2” (multiplier).
Per-park targets: see Ballparks and each park note.
Multipliers
- HR Multiplier stat (base 1). See Stats.
- Green multiplier:
1 + GreenBonus + GreenStreakBonus x (greenStreak - 1)on a GREEN, else 1. BaseGreenBonusis 0.25. See GREEN Swings.
Example (derived from the formula): a 400 ft home run with no target and base stats scores 400. The same hit as a first GREEN scores 500.
Coins
Coins are paid when the inning ends, by RunManager.InningCoins:
homeRuns x (coinsPerHomeRun + CoinBonus) + bonusCoins, and if the inning was cleared, + coinsPerInning + outsLeft x coinsPerLeftoverOut (+ bossBonusCoins on a boss inning).
bonusCoins are the extra coins from home runs off $$$ balls (see Special Balls). Full economy: Shop and Economy.
Numbers
| What | Value | Where to tune |
|---|---|---|
| Non-home-run score | 0 | ScoreCalculator.Score |
| Target multiplier default | 2 | OutfieldTarget.multiplier |
| Target radius / distance defaults | 30 ft / 420 ft | OutfieldTarget |
| HR Multiplier base | 1 | StatInfo.BaseValue |
| Green bonus base | +25% | StatInfo.BaseValue(GreenBonus) |
| Coins per home run | 1 + CoinBonus | RunConfig.coinsPerHomeRun |
| $$$ ball home run | +3 coins | BallEffects.MoneyBallCoins |
| Inning cleared | +4 coins | RunConfig.coinsPerInning |
| Per unused out (cleared) | +1 coin | RunConfig.coinsPerLeftoverOut |
| Boss inning cleared | +5 coins | RunConfig.bossBonusCoins |
In the code
| File | What it does |
|---|---|
Assets/_Project/Scripts/Ballparks/ScoreCalculator.cs | FindTarget, Earned, Value, TargetValue, Score, GreenMultiplier |
Assets/_Project/Scripts/Data/BallparkDefinition.cs | OutfieldTarget fields, Reward, IsAerial |
Assets/_Project/Scripts/Batting/AtBatController.cs | ResolvePlay adds the score, home runs, $$$ coins, longest hit |
Assets/_Project/Scripts/Run/RunManager.cs | InningCoins |
Assets/_Project/Scripts/UI/HudView.cs | Score card with GOAL and progress bar (shows HitCounter.DisplayScore), play summary card |
Assets/_Project/Scripts/Batting/HitTally.cs | The on-screen score stack for a home run |
Gotchas
- The score is computed at contact but only added when the ball lands, so a skipped flight still scores. The score panel lags a little more: it counts a home run’s points as the counter’s total arrives.
- PR #46 rebuilt batting but did not change scoring: only the exit velocity, launch and spray that feed the distance changed. See Batting Explained.
- Distance on the play card and banner is carry (
distanceFt), not where the ball stops rolling. - A landing zone checks only the first landing point. A ball that bounces into a zone doesn’t earn it.
- The
ScoreCalculatorclass comment invites new scoring rules (streak bonuses and so on) to go here. - In co-op the round score starts at the team’s score so far (
RoundContext.startingScore). See Co-op Rules.
Related
- Hit Physics: distance and home run
- GREEN Swings: the green multiplier
- Hit Show: how the score is shown building up
- Run Structure: inning goals
- Shop and Economy: spending the coins
- Ballparks: targets per park
- Upgrades: HR Multiplier, Coins per HR, green stats