Build and Release
In short
Tools > Home Run Derby > Build > Windows Player (zip) makes a 64-bit Windows build from an empty boot scene, copies
steam_appid.txtnext to the .exe and zips the folder for sending. Steam code compiles only with theHOMERUNDERBY_STEAMdefine. Co-op refuses players whoseApplication.versionor protocol differs from the host’s.
How it works
Windows Player (zip)
BuildPlayer.BuildWindowsZip:
- Deletes and recreates
Builds/HomeRunDerby-Windows/(git-ignored). - Ensures
Assets/_Project/Scenes/Boot.unity, an empty scene (the game boots from code, see Boot and GameRoot). If the open scene is untitled and unchanged it is replaced; if it is saved, the boot scene is made beside it; if it is untitled with unsaved edits, the build stops with a “Save your scene first” dialog. BuildPipeline.BuildPlayerwith that one scene,StandaloneWindows64,BuildOptions.None, toHomeRunDerby.exe.- Copies
steam_appid.txtfrom the project root next to the .exe (warns if missing: run Enable Steam first). - Zips the folder (with its base folder) to
Builds/HomeRunDerby-Windows.zipand reveals it in Explorer.
Steam
- Steam uses Facepunch.Steamworks:
Assets/Plugins/Steamworks/Facepunch.Steamworks.Win64.dllandsteam_api64.dll. - Tools > Home Run Derby > Steam > Enable Steam (
SteamSetup.Enable) checks both DLLs are there (else a dialog says where to get them), writessteam_appid.txtwith app id 480 at the project root, and addsHOMERUNDERBY_STEAMto the Standalone scripting defines. - Disable Steam removes the define; only the Local transport is compiled then.
- With the define,
SteamTransportandSteamOverlayJoincompile,NetRuntime.SteamCompiledis true, and the lobby’s STEAM button is enabled. Steam must be running when you press Play. See Transports and Steam Test Guide.
Versioning
Application.versionis Player Settings’bundleVersion,1.0on main. Nothing in the code bumps it.NetRuntimepasses it toNetSession. The host refuses a client whoseNetSession.Protocol(HRD-COOP-7on main since #46; it wasHRD-COOP-3at e7dba51) or version differs: “different game version (host X, you Y)“. See Protocol Versions.- Product name
RoguelikeHomeRunDerby, companyDefaultCompany.
Numbers
| What | Value | Where to tune |
|---|---|---|
| Build target | StandaloneWindows64 | BuildPlayer.BuildWindowsZip |
| Build options | None (a release build) | BuildPlayer.BuildWindowsZip |
| Output folder / zip | Builds/HomeRunDerby-Windows/, Builds/HomeRunDerby-Windows.zip | BuildPlayer.BuildFolder |
| Executable | HomeRunDerby.exe | BuildPlayer.ExeName |
| Boot scene | Assets/_Project/Scenes/Boot.unity | BuildPlayer.ScenePath |
| Steam app id | 480 (Valve’s test app) | SteamSetup.TestAppId, steam_appid.txt |
| Bundle version | 1.0 | Project Settings > Player |
| Co-op protocol | HRD-COOP-7 | NetSession.Protocol |
In the code
| File | What it does |
|---|---|
Editor/BuildPlayer.cs | BuildWindowsZip, EnsureBootScene. |
Editor/SteamSetup.cs | Enable, Disable, WriteAppIdFile, SetDefine. |
Scripts/Net/NetRuntime.cs | SteamCompiled; picks the transport; passes Application.version. |
Scripts/Net/NetSession.cs | Protocol and the version check in Admit. |
steam_appid.txt | Committed at the repo root; contains 480. |
Gotchas
Steam is already on in main
SteamSetup’s comment and the README say the Steam DLLs are not committed and the define must be added. On main the DLLs are tracked inAssets/Plugins/Steamworks/(even though.gitignorelists them),HOMERUNDERBY_STEAMis already set for Standalone inProjectSettings.asset, andsteam_appid.txtis committed.
- The zip is a release build, so the F1 dev menu is not in it (Dev Menu and Shortcuts). Ctrl+Shift+F and Ctrl+Shift+N still work.
- Since the version is never bumped, two builds with different code but the same protocol string can join each other. Bump
NetSession.Protocolwhen messages change. Assets/_Project/Scenes/is not in the repo on main; the first build creates it.- Only Windows has a build command.
- The release build has no dev menu, so its only way to watch a cutscene is a real run with Settings > CUTSCENES on. The Editor-only Preview menu items and run-map keys are not in it (Dev Menu and Shortcuts).
- Testers can send
swings.csvfrom the build’spersistentDataPath(Swing Log).
Related
- Git and PRs: how changes reach main
- Steam Test Guide: testing co-op over Steam
- Protocol Versions: the co-op protocol history
- Editor Tools and Tests: every Tools menu item