XP and Levels
In short
Every finished run earns XP twice: once for the account and once for the batter who played it. The account level (max 50) decides which batters and cosmetics can be bought and which call signs can be worn. A batter’s character level (max 10) adds small trait perks at levels 2, 5 and 10. Only XP is saved; levels are always worked out from it, so curves can be retuned without breaking saves.
How it works
-
Run XP (
Leveling.RunXp), the same amount for both tracks:xp = round((inningsCleared x 25 + homeRuns x 5 + (won ? 150 : 0)) x MetaPoints(difficulty)) -
MetaProgression.AwardXpadds it toSaveData.accountXpand to the batter’sBatterProgress.xp, fills the XP fields of theRunSummary, and returns lines for the results screen:ACCOUNT LEVEL 3!,NEW ITEMS TO BUY: NERD GLASSES, TOP HAT,NEW BATTER TO BUY: BAKED BEAN,NEW CALL SIGN: BIG STICK,STRING BEAN LEVEL 2: +2% CONTACT. -
Account curve. The step from level L to L+1 costs
100 + 75 x (L - 1)XP. Total to reach level L:steps = L - 1 AccountXpForLevel(L) = 100 x steps + 75 x steps x (steps - 1) / 2 -
Character curve. A fixed table (below), level 10 at 4,500 XP.
-
Level perks. Each batter has
levelPerks(a level and a stat modifier).MetaProgression.LevelBonusreturns every perk at or below the batter’s level;RunStateadds them to the run’s stats at run start, and the batting cage and the title screen stat bars use them too. -
Results screen. Two bars fill one after the other: ACCOUNT LV n then BATTER LV n, each with +n XP (or MAX). LEVEL UP! pops with a chime at each new level. A click on the card or Space skips to the end. XP is already saved when the bars fill: it is awarded before the end-of-game cutscene (Cutscenes).
Numbers
| What | Value | Where to tune |
|---|---|---|
| XP per inning cleared | 25 | Leveling.XpPerInning |
| XP per home run | 5 | Leveling.XpPerHomeRun |
| XP for beating the map | 150 | Leveling.XpForWin |
| Difficulty multiplier | x1 / x1.5 / x2.5 | Difficulties.MetaPoints |
| Max account level | 50 | Leveling.MaxAccountLevel |
| Max character level | 10 | Leveling.MaxCharacterLevel |
| Account first step / growth | 100 / +75 per level | Leveling.FirstStep, StepGrowth |
| Perk levels | 2, 5, 10 | DefaultContent.PerkLevels |
Total account XP per level (from the formula; the test checks 100 and 3,600):
| Level | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 20 | 50 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| XP | 100 | 275 | 525 | 850 | 1250 | 1725 | 2275 | 2900 | 3600 | 8225 | 14725 | 93100 |
Total character XP per level (Leveling.CharacterXp):
| Level | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| XP | 0 | 300 | 650 | 1050 | 1500 | 2000 | 2550 | 3150 | 3800 | 4500 |
Default perks (each applies from its level on):
| Batter | Level 2 | Level 5 | Level 10 |
|---|---|---|---|
| Peapod | +2% Timing Window | +2% Timing Window | +2% Timing Window |
| Baked Bean | +1% Power | +1% Power | +1% Power |
| String Bean | +2% Contact | +2% Contact | +2% Contact |
| Pinto | +1 Coins per HR | +1 Coins per HR | +1 Extra Outs |
Example: a Normal win with 15 home runs earns 9 x 25 + 15 x 5 + 150 = 450 XP, taking a new account from level 1 to 3 and a new batter from level 1 to 2.
In the code
| File | What it does |
|---|---|
Assets/_Project/Scripts/Progression/Leveling.cs | Curves: RunXp, AccountXpForLevel, AccountLevel, AccountProgress, CharacterXpForLevel, CharacterLevel, CharacterProgress |
Assets/_Project/Scripts/Progression/MetaProgression.cs | AwardXp, AccountLevel, BatterLevel, LevelBonus, NextPerk, CanBuy, SelectedCallSign |
Assets/_Project/Scripts/Data/BatterDefinition.cs | requiredLevel, levelPerks, LevelPerk |
Assets/_Project/Scripts/Data/DefaultContent.cs | Perks, batter and cosmetic requiredLevel, call sign levels |
Assets/_Project/Scripts/UI/RunOverView.cs | The two animated XP bars |
Assets/_Project/Editor/ProgressionXpTest.cs | Curves, run XP, perks, level gates, call signs, AwardXp lines, old saves |
Gotchas
- Percent perks add to the batter’s own percent: a level 10 Baked Bean has +23% Power, not 1.2 x 1.03.
- Level perks are fixed when a run starts; levels gained at the end of a run apply from the next run.
- Pinto’s extra out only comes at level 10 because outs are whole numbers.
- In co-op each player earns XP from the team’s innings and their own home runs.
- A save from before levels existed loads at account level 1, every batter level 1, wearing ROOKIE.
- Dev menu can add XP or set the account or a batter to a level, and reset levels. See Dev Menu and Shortcuts.
Related
- Meta Progression: points and purchases the account level gates
- Customization: cosmetics and call signs opened by level
- Call Signs: every call sign and its level
- Cosmetics: every cosmetic and its required level
- Batters: every batter