All Notes
Generated by
_meta/wiki-check.ps1against45a2167. Don't edit by hand.
Start here
- Glossary: A-Z of the game and code terms used across the wiki, each with a one-line meaning and the note that explains it.
- index: Front page of the Home Run Derby wiki; what the game is, how a run flows, and where every section starts.
Game
- At-Bat Loop: The round loop in AtBatController that throws pitch after pitch, resolves each swing, plays the hit show and the ball’s flight, updates the count and score, and ends the inning when the goal is reached or the outs run out.
- Batting Cage: The practice mode, endless pitches from a pitching machine in any ballpark with no outs, score goal or rewards, built by handing the normal at-bat an unwinnable round.
- Batting Explained: The batting system rebuilt after Mario Superstar Baseball (PR
- Batting Feedback: Every way the game tells the player how a swing went - before, during and after it - in pictures, sound, text and numbers, as one outcome-by-outcome matrix, plus an analysis of where the player gets no clear reason why a swing went bad.
- Controls: Every player input - mouse aim, Space / click / gamepad A to swing and to skip, A/D and W/S (arrows, gamepad stick) to aim the hit, Esc to pause, Tab and M in the batting cage - and where each one is read.
- Core Loop: The whole game loop from the title screen through map select, the match intro, innings, shops, the end-of-game cutscenes and the results screen to meta rewards, and which screen and class owns each step.
- Count and Outs: Derby count rules in CountTracker - 3 strikes is an out, any fair ball that is not a home run is an out, fouls cannot strike you out, and ball four only resets the count.
- Customization: The CUSTOMIZE screen from a player’s view, how cosmetics (hats, glasses, shoes, bats) are bought and worn, how a cosmetic bat relates to the shop bat, and call signs.
- Cutscenes: The broadcast-style cutscenes around a run (the match intro with its reading stops and walk-up, and the BOSS DOWN, MAP BEATEN and GAME OVER outros), when each plays, how to skip them, and how co-op keeps everyone in step.
- Daily Seed and Leaderboard: The daily challenge (one seed per UTC date, a seed-picked map on Normal) and the local leaderboards that record every solo run.
- Difficulty: What Normal, Medium and Hard change in a run (goals, pitch speed, special balls, shop prices, outs, meta points and XP), all tuned in one file.
- GREEN Swings: A GREEN is the top swing - a perfect-zone hit (the sweet spot) that is also on time - with its own feedback (longer hit stop, replay, flash, shake, green crack and cheer), a streak counter, and a score multiplier from the GreenBonus and GreenStreakBonus stats.
- Hit Physics: HitPhysics simulates a batted ball deterministically the instant it is hit - flight with gravity, drag, park wind and the hit’s own curve, then bounces, rolls, wall caroms, the stands and the scoreboard - so the home run, foul or out is known before the ball is shown flying.
- Hit Show: PR
- Index Screen: The INDEX screen on the main menu, a browsable list of every batter, pitcher, ballpark, piece of equipment and special ball in the game plus planned “coming soon” items, built automatically from the content.
- Map Select and Unlocks: The PICK A BALLPARK carousel (park pictures, easiest to hardest) and the rules that open maps and difficulties in order (Normal, then Medium, then Hard and the next map).
- Meta Progression: What carries over between runs (meta points, unlocked batters, perks and cosmetics, map progress, lifetime stats) and how a finished run pays out.
- Pitching: How PitcherAI picks each pitch’s type, location, speed, special balls and decoys from seeded random streams, and how PitchData turns that into a looping, breaking path to the plate that the bat, timing ring, replays and spectators all read.
- Run Structure: How a run is built from its seed (9 innings at one park, pitchers, bosses in 3, 6 and 9, a score goal per inning) and how it is checkpointed and resumed.
- Scoring: Only home runs score - points are carry distance times the best outfield target, times the HR Multiplier stat, times the green multiplier - and each home run also pays coins at the end of the inning.
- Shop and Economy: How coins are earned in a run and spent in the between-innings shop, with offer rolls, rarity weights, prices and rerolls.
- Special Balls: Special balls ($$$, Super Fast, Anti-Gravity, Ghost, Sticky, Wiffle, Headwind, Tailwind) come from two stacking slots - the park’s ball and the pitcher’s own ball - on a separate seeded roll, and change the pitch’s flight in PitchData so the bat, timing ring, replay and spectators all agree.
- Swing and Timing: How the mouse aim, the timestamped swing press and the held A/D, W/S direction become real bat-ball contact, how far the bat can reach, and how the aim helper and the optional timing ring show it; the grading rules live in Batting Explained.
- Upgrades and Synergies: How in-run upgrades work (slots, replacing versus stacking, stat modifiers) and how tags on owned upgrades switch synergies on.
- XP and Levels: The two XP tracks every run feeds (account level up to 50, character level per batter up to 10), their curves, and what each level opens or adds.
Content
- Ballparks: Catalog of every ballpark (five run maps plus one practice park) with their dimensions, physics, special balls, final bosses, targets and goal scaling side by side.
- Farmyard: The second run map: an open farm field with a wooden fence, a light breeze, Sticky mud balls on off-speed pitches, bullseye and barn targets, and Farmer Fitz in inning 9.
- Midnight Yard: The fourth run map: a night game under floodlights that shrinks the timing window by 10%, with Ghost balls on any pitch, one Neon Sign target and The Phantom as its final boss.
- Moon Stadium: The fifth and last run map: a crater stadium on the moon with 0.75 gravity, Anti-Gravity balls, the deepest fences, eight flat-bonus locations past the stands (four floating in the air) and The Alien in inning 9.
- Sandlot Field: The first run map, always open: short fences, a small wooden-bleacher crowd, $$$ money balls, two multiplier targets and Backyard Benny’s wiffle balls in inning 9.
- Scoreboard Smash: A practice-only park for the batting cage: a short open field with the scoreboard low and right behind the fence so fly balls can smash it.
- Windy City Yard: The third run map: a big overcast stadium with a 12 mph wind blowing out to left, Super Fast fastballs and sliders, Rooftop and Lake targets, and The Gale’s gusts in inning 9.
- Batters: Catalog of the four playable batters (Peapod, Baked Bean, String Bean, Pinto) with unlock price, required account level, stat modifiers, batting style, starting kit, level perks and model.
- Call Signs: Catalog of the seven call signs, free name-tag titles that open with account level and show over your batter on the title screen.
- Cosmetics: Catalog of all 17 cosmetics (hats, glasses, shoes, bat models) with slot, style, point price, required account level and colours; looks only, no stats.
- Pitch Types: Catalog of the six pitch types with speed, break, knuckleball wobble, arc, visual spin, hit power by contact zone and colour, plus who throws each and which special balls ride on it.
- Pitchers and Bosses: Catalog of the eleven pitchers (four regulars, two roaming bosses and five park bosses) with speed, strike rate, pace, pitch mix, boss penalties, boss balls and decoys, plus which inning each can appear in.
- Run Config: Every global run tuning value in RunConfig (innings, boss cadence, outs, inning goals, pitch speed, coins, shop) with its default and where it is used.
- Stats: Catalog of the ten batter stats (StatType) with base values, display names and formats, what reads each one, and every batter, upgrade, synergy, park, boss and level perk that changes it.
- Synergies: Catalog of the five synergies (tag-count bonuses), which upgrades feed each tag, and which combinations can actually reach them given the one-item slots.
- Upgrades: Catalog of all 16 shop upgrades with slot, rarity, coin price at each difficulty, tags, stat modifiers and which ones must first be unlocked with meta points.
Co-op
- Co-op Overview: What co-op is (2 to 4 players take turns batting in one shared run, refereed by the host) and how its pieces fit together, with what is built and what is not.
- Co-op Rules: Everything the host referees in a co-op inning (batting order, opener rotation, the shared outs pool, second life, drops, team score) and how coins are split, with exact numbers.
- Co-op Run Flow: A co-op run from START RUN to the results screen - the host’s map and difficulty, the match intro gate, turns as mini-rounds, inning end, own shops and READY, the end-of-game cutscenes, run over and how meta points, unlocks and XP are awarded.
- Live Spectating: How co-op spectators watch the batter’s at-bat live from the batting camera - the pose stream, the batter’s own pitches and results, and the delayed playback clock that hides network jitter.
- Lobby and Session: The co-op lobby screen and the NetSession behind it - hosting, joining by code, the roster, names, the version check and how the host starts the run.
- Net Messages: Every co-op network message - id, name, direction, reliability and payload fields in wire order - plus how bytes are encoded and how messages are routed.
- Protocol Versions: The co-op version check (NetSession.Protocol plus Application.version) and the history of the protocol string, so mismatched builds are refused instead of misreading messages.
- Steam Test Guide: Practical steps for two people to test co-op over Steam (and one person on one PC over LOCAL), the NET TEST overlay, and a troubleshooting table of the messages you may see.
- Transports: The two network transports behind co-op - LocalTransport (UDP with its own reliable channel, for one PC or a LAN) and SteamTransport (friends-only lobby plus Steam relay) - and the HOMERUNDERBY_STEAM define that compiles Steam in.
Engineering
- Architecture: The big picture of the codebase on main: which systems exist, how data flows between them, and the six ideas every change has to respect.
- Audio: How every sound in the game is synthesized in code at boot (no audio files), how GameAudio turns GameEvents into sounds, and where the music and sound volumes come from.
- Ballpark Building: How BallparkBuilder turns a BallparkDefinition into a 3D park in code (ground, walls, targets, stands and crowd, light towers, sky, ambience, scoreboard, props), and how hand-placed park dressing works.
- Boot and GameRoot: How pressing Play in any scene builds the whole game from code, in what order GameRoot creates its services, and the navigation methods every screen uses.
- Build and Release: How to make a Windows build to send to friends (Build > Windows Player zip), how Steam is switched on (the HOMERUNDERBY_STEAM define and steam_appid.txt), and how the game version is used for co-op compatibility.
- Characters and Rigs: How the batter and pitcher figures are built and animated (rigged beans, the library human, the code-built bean), how cosmetics hang on sockets, and which Blender scripts make the models.
- Code Map: The lookup table for “where is X in the code”: every folder under Scripts and Editor, every C# file with a one-line role, and the wiki note that explains it.
- Dev Menu and Shortcuts: The F1 developer menu (every tab and button, including TEST HITS, hit replays and the CUTSCENES tab added in
- Editor Tools and Tests: Every Tools > Home Run Derby menu item and every self-test in the Editor assembly, what each one does or checks, and how to run the tests from the menu or headless from the command line.
- Fit Mode: The dev-only fit editor on the Customize screen that moves, tilts and sizes cosmetic sockets, single items and the bat alignment live, and where its SAVE writes in the Editor and in builds.
- Game Events: Every event on the GameEvents bus, its payload, who raises it and who listens, so you can hook sound, effects or UI onto gameplay without touching gameplay code.
- Game States and Screens: Every GameState (12 on main, including the Intro, Outro and Index screens) and the IMGUI view that draws it, the overlays that sit on top (dev menu, NET TEST, Fit Mode, settings, pause, cutscene transitions), and the transitions between screens.
- Rendering: How the game looks the way it does: the URP setup, the BeanToon shader that every object gets, the Visuals material helpers, post-processing, the per-park sky and the code-generated ground textures.
- Save System: The three JSON files the game writes (save.json, run.json, fit-overrides.json) plus the swings.csv log, how writes stay crash-safe, everything SaveData and RunSaveData hold, and when each is saved.
- Scoreboard: The big center-field scoreboard (PR
- Seeds and Determinism: How one run seed reproduces the innings, the pitches, the special balls and every shop, why rerolling in the shop can never change the pitches, and how the daily and co-op seeds work.
- Stats System: The one stacking system behind every batter number: StatType, StatModifier and PlayerStats, which sources feed it, the formula, and where each stat is read.
- Swing Log: SwingLog appends one CSV line per pitch the local player sees to swings.csv in Unity’s persistent data folder - pitch, timing, where on the bat, zone, held aim, launch, exit velocity, result - so the batting numbers can be tuned from real players instead of the balance sim.
- UI System: How every screen is drawn with Unity’s IMGUI from code, with no image files: UIRoot, the theme (UITheme, UIDraw, UIGlyphs, UITextures) with the points and coins currency icons, the broadcast kit for cutscenes, the shared top bar and build panel, the screen fade, and the item and park pictures.
How-To
- Add a Ballpark Modifier: Recipe for adding a new kind of ballpark modifier - a physics change through GetEnvironment or a batter stat change through batterModifiers - and making it show on the map card.
- Add a Batter: Recipe for adding a playable batter - the Batter line in DefaultContent, their stats, batting style, starting kit and model, the account level needed to buy them, and their character-level perks at levels 2, 5 and 10.
- Add a Cosmetic: Recipe for adding a hat, glasses, shoes or bat cosmetic - the Cosmetic line in DefaultContent, its account level gate, and a new code-built look, prefab or bat model when needed.
- Add a Final Boss: Recipe for giving a park its own final boss who always pitches the last inning, using BallparkDefinition.finalBossId.
- Add a Map: Recipe for adding a ballpark that can be played as a run map - the Park line in DefaultContent, its targets, look, special ball, final boss and where it sits in the unlock order (which sets its goals).
- Add a Net Message: Recipe for adding a co-op network message - picking an id in the right range, writing and reading it with NetWriter / NetReader, sending and handling it, and bumping NetSession.Protocol.
- Add a Pitcher or Boss: Recipe for adding a pitch type, a regular pitcher or a boss pitcher (handicap, own special ball, decoys) in DefaultContent, and how the run picks pitchers by inning.
- Add a Screen: Recipe for adding a top-level screen - a GameState value, an IMGUI view class, a case in UIRoot, and a GameRoot method that switches to it - plus the other places that check the state.
- Add a Setting: Recipe for adding a player option - a field in GameSettings (saved with the game), a row or slider in SettingsView, and the code that reads it.
- Add a Sky: Recipe for adding a sky preset - a SkyPreset value, its tuning case in SkyBuilder.Tune, and setting it on a park - plus the stars, clouds and ambience that follow the preset.
- Add a Sound: Recipe for adding a sound effect - synthesise it in SoundBank from AudioSynth pieces, then play it from a GameEvents handler (or a UI one-liner) in GameAudio.
- Add a Special Ball: Recipe for giving a park or a boss a special ball (an existing BallEffect on some pitch types) and for adding a brand-new kind of special ball, with every place that must learn about it.
- Add a Stat: Recipe for adding a new batter stat - the StatType value, its base value, name and format in StatInfo, and the code that reads it with stats.Get.
- Add a Synergy: Recipe for adding a synergy, a bonus that switches on when the player owns enough upgrades sharing one tag, as one line in DefaultContent.
- Add an Upgrade: Recipe for adding a shop upgrade (bat, glove, cleats or charm) as one line in DefaultContent, with its stat modifiers, tags, price and optional meta unlock.
Workflow
- Git and PRs: How changes reach main - branch names, pull requests, review and merge from CONTRIBUTING, plus this team’s local rules (never push to main, playtest in the dev folder first, Claudio clicks Merge).
- History: Every pull request merged into main, newest first, with what it added; answers “when did X arrive and in which PR”.
- Known Issues: Bugs, design holes and out-of-date docs and comments found while writing this wiki, each with the code that shows it; a to-do list for fixes.
- Testing: How the project is tested - the Editor self-tests under Tools → Home Run Derby (menu or headless), the headless compile check with the Editor closed, what to playtest by hand, and the GitHub templates.
- Unity Setup: One-time setup to work on the project - the exact Unity version, Git LFS, the UnityYAMLMerge driver, and the project settings that matter (URP, Input System set to Both, the Steam define).