Steam 包上传完整流程
Steam 包上传完整流程
把一个 Windows 构建放上 Steam,本质就两件事:在 Partner Center 建好 depot,再用 SteamPipe(命令行 steamcmd 或 GUI)把内容推上去、设为 live。下面按我实际跑通的顺序记,命令和 VDF 字段保留原样。
官方文档:https://partner.steamgames.com/doc/sdk/uploading
后台先建 depot 和分支
进 https://partner.steamgames.com/dashboard,选中要发的 app。没有权限会是一片空白,得让制作人或客户给你加。
一个新建的 app 默认没有 depot,必须先建一个,否则没法上传:
- 进 app → Technical Tools → Edit Steamworks Settings
- SteamPipe 标签 → Depots → Add New Depot,给个名字和 depot ID
- 设置这个 depot 的 language / OS / Architecture / Platform
- Save 之后改动只是暂存,要到 Publish 标签点 "Prepare for Publishing" 才真正生效
建好 depot 后还有一步容易漏:回到 app 主页,在 packages 区找到当前开发用的 package(开发期通常是 "Developer Comp" 之类),进 "Depots included" → "Add/Remove depot",把刚建的 depot 勾上保存,depot 才算可用。
准备上传内容和 VDF
SteamPipe 的内容靠两个 VDF 脚本描述:app_build_<appid>.vdf 管整个 build,depot_build_<depotid>.vdf 管单个 depot 的文件映射。
先把 SteamSDK 解压,在 {SteamSDK_Root}\tools\ContentBuilder\builder 里先跑一次 steamcmd.exe 让它自举补齐文件。然后把构建产物拷到 {SteamSDK_Root}\tools\ContentBuilder\content\<your_content_dir>。
app_build_<appid>.vdf:
"AppBuild"
{
"AppID" "<appid>" // Your AppID
"Desc" "This is a test build" // internal description for this build
//"Preview" "1" // make this a preview build only, nothing is uploaded, For test when upload build firstly
"SetLive" "<branch>" // set this build live on beta branch
"ContentRoot" "..\content\" // content root folder relative to this script file
"BuildOutput" "..\output\" // put build cache and log files on different drive for better performance
"Depots"
{
// file mapping instructions for each depot are in separate script files
"<depot_id>" "depot_build_<depot_id>.vdf"
}
}
depot_build_<depotid>.vdf,最常见就是整目录递归打包:
"DepotBuild"
{
// Set your assigned depot ID here
"DepotID" "<depot_id>"
// include all files recursivley
"FileMapping"
{
// This can be a full path, or a path relative to ContentRoot
"LocalPath" "*"
// This is a path relative to the install folder of your game
"DepotPath" "."
// If LocalPath contains wildcards, setting this means that all
// matching files within subdirectories of LocalPath will also
// be included.
"Recursive" "1"
}
}
关于 SetLive:
- 填了一个存在的分支名,上传完会直接分发到该 branch,有 Steam key 的人切到对应分支就能拉到新版本。
- 没填的话,版本只到 Partner Center,玩家下不到,得手动去 https://partner.steamgames.com/apps/builds/ 设 live。
- 填了一个不存在的分支名,上传成功但 commit 时会报
ERROR! Failed to commit build for AppID xxx : Failure,build 其实已经传上去且可用,只是 setlive 那步失败了。
命令行上传
把两个 VDF 拷到 {SteamSDK_Root}\tools\ContentBuilder\scripts,然后一条命令搞定登录加上传:
{SteamSDK_Root}\tools\ContentBuilder\builder\steamcmd.exe +login <account> <password> +run_app_build ..\scripts\app_build_<appid>.vdf +quit
新机器第一次登录会发确认邮件,把邮件里的验证码输进去完成验证。
如果想分步跑,就先 steamcmd.exe,再依次 login <account> <password>、run_app_build ..\scripts\app_build_<appid>.vdf、quit。
GUI 上传(SteamPipeGUI)
不想写 VDF 的话用 SteamPipeGUI,从 https://partner.steamgames.com/downloads/list 下,运行 SteamPipeGUI.exe,界面里填:
- App ID
- build description
- 加 depot:depot ID + 内容路径
- 想设 live 就填非 default 的分支名
- Generate VDFs 生成上传用 VDF
- ContentBuilder 路径
- 登录用的 Steam 账号
填完点 Upload。它本质就是帮你生成 VDF 再调 steamcmd。
用 steamcmd 下载验证
SteamCMD 是 Steam 客户端的命令行版,除了上传也用来在没装 Steam 的机器上拉版本验证。下载地址 https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip,解压即用。
参数说明:-beta <betaname> 指定私有分支名,-betapassword <code> 是该分支的密码,validate 会校验所有文件是否和服务器一致(怀疑文件缺失或损坏时很有用)。
steamcmd +login <account> <password> +app_update <app_id> [-beta <betaname>] [-betapassword <beta_code>] [validate] +quit
eg:
1. 下载 appid 的 test 分支
steamcmd +login <account> <password> +app_update <appid> -beta test -betapassword <beta_password> +quit
2. 下载 appid 的默认分支
steamcmd +login <account> <password> +app_update <appid> +quit
3. 下载到指定路径(目录不存在会自动建,但建出来的文件夹名是全大写)
steamcmd +force_install_dir <download_dir> +login <account> <password> +app_update <appid> +quit
如果一个游戏有多语言 depot,默认只下英文,要靠 -language 指定:
steamcmd +login <account> <password> +app_update <appid> -language japanese -beta test -betapassword <beta_password> +quit
更多参数见 https://developer.valvesoftware.com/wiki/Command_line_options/en。
设为 live 并下载
上传完在 SteamPipe → Build 页能看到包。如果只有 default 分支,先 "Create new app branch" 建个带密码的分支。然后在 builds 区选分支 → Preview Change → Set Build Live Now。
玩家侧拉私有分支:Steam 库右键游戏 → Properties → Betas,在 Private Betas 里输分支密码点 Check Code,然后在 Beta Participation 下拉里选分支即可。别忘了 launch options 决定点 Play 时跑哪个 exe。