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.txt next to the .exe and zips the folder for sending. Steam code compiles only with the HOMERUNDERBY_STEAM define. Co-op refuses players whose Application.version or protocol differs from the host’s.

How it works

Windows Player (zip)

BuildPlayer.BuildWindowsZip:

  1. Deletes and recreates Builds/HomeRunDerby-Windows/ (git-ignored).
  2. 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.
  3. BuildPipeline.BuildPlayer with that one scene, StandaloneWindows64, BuildOptions.None, to HomeRunDerby.exe.
  4. Copies steam_appid.txt from the project root next to the .exe (warns if missing: run Enable Steam first).
  5. Zips the folder (with its base folder) to Builds/HomeRunDerby-Windows.zip and reveals it in Explorer.

Steam

  • Steam uses Facepunch.Steamworks: Assets/Plugins/Steamworks/Facepunch.Steamworks.Win64.dll and steam_api64.dll.
  • Tools > Home Run Derby > Steam > Enable Steam (SteamSetup.Enable) checks both DLLs are there (else a dialog says where to get them), writes steam_appid.txt with app id 480 at the project root, and adds HOMERUNDERBY_STEAM to the Standalone scripting defines.
  • Disable Steam removes the define; only the Local transport is compiled then.
  • With the define, SteamTransport and SteamOverlayJoin compile, NetRuntime.SteamCompiled is 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.version is Player Settings’ bundleVersion, 1.0 on main. Nothing in the code bumps it.
  • NetRuntime passes it to NetSession. The host refuses a client whose NetSession.Protocol (HRD-COOP-7 on main since #46; it was HRD-COOP-3 at e7dba51) or version differs: “different game version (host X, you Y)“. See Protocol Versions.
  • Product name RoguelikeHomeRunDerby, company DefaultCompany.

Numbers

WhatValueWhere to tune
Build targetStandaloneWindows64BuildPlayer.BuildWindowsZip
Build optionsNone (a release build)BuildPlayer.BuildWindowsZip
Output folder / zipBuilds/HomeRunDerby-Windows/, Builds/HomeRunDerby-Windows.zipBuildPlayer.BuildFolder
ExecutableHomeRunDerby.exeBuildPlayer.ExeName
Boot sceneAssets/_Project/Scenes/Boot.unityBuildPlayer.ScenePath
Steam app id480 (Valve’s test app)SteamSetup.TestAppId, steam_appid.txt
Bundle version1.0Project Settings > Player
Co-op protocolHRD-COOP-7NetSession.Protocol

In the code

FileWhat it does
Editor/BuildPlayer.csBuildWindowsZip, EnsureBootScene.
Editor/SteamSetup.csEnable, Disable, WriteAppIdFile, SetDefine.
Scripts/Net/NetRuntime.csSteamCompiled; picks the transport; passes Application.version.
Scripts/Net/NetSession.csProtocol and the version check in Admit.
steam_appid.txtCommitted 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 in Assets/Plugins/Steamworks/ (even though .gitignore lists them), HOMERUNDERBY_STEAM is already set for Standalone in ProjectSettings.asset, and steam_appid.txt is 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.Protocol when 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.csv from the build’s persistentDataPath (Swing Log).