DSP Planner Export
Serves live game state to the DSP Ultimate Suite planner over localhost: research, production rates, blueprint protos — plus an in-game advisor & deficit HUD.
模組介紹 作者原文
DSP Planner Export (BepInEx plugin)
Serves live game state from a running Dyson Sphere Program game over a small
localhost HTTP server, so the DSP Resource Tree Planner (dsp-ultimate-suite.html)
can show a live view. Three endpoints:
GET researched tech / upgrade levels
{ "version":1, "running":true,
"states":[ {"id":1131,"level":1,"max":1,"unlocked":true},
{"id":2101,"level":4,"max":6,"unlocked":true} ] }
GET full item proto dump (static, built once)
{ "version":2, "items":[
{"id":1101,"name":"Iron Ingot","grid":1101},
{"id":2303,"name":"Assembling Machine Mk.I","grid":2404,"model":65,
"w":3,"h":3,"zstep":5.05,"slots":[3,3,3,3]},... ] }
GET cumulative production/consumption counters
{ "version":1, "running":true, "gameTick":123456,
"items":[ {"id":1101,"p":12345,"c":678},... ] }
- /state: id is the in-game TechProto id. Leveled upgrades report level
(curLevel); the planner expands consecutive ids per level using FactorioLab's id map.
- /protos: every item gets id/name/grid (inventory grid index); buildings
additionally get model (modelIndex), w/h (blueprint footprint in cells from
prefabDesc.blueprintBoxSize), zstep (vertical offset per stacked level,
prefabDesc.lapJoint.y) and slots (per-side sorter slot counts [N,E,S,W] from
prefabDesc.slotPoses). The mapper's "Load protos (plugin)" button consumes this
for exact blueprint export.
- /rates: counters accumulate across all factories since plugin load via a
Harmony prefix on FactoryProductionStat.GameTick, which reads
productRegister/consumeRegister just before the game folds and zeroes them
(the same approach the BetterStats mod uses). The planner polls twice and computes
items/min from deltas: rate = Δcount / Δtick × 3600 (60 ticks/s). The planner's
Plan vs actual card does this automatically.
Prerequisites
- BepInEx 5.x installed into Dyson Sphere Program (the usual DSP modding setup).
-.NET SDK to build (dotnet build), or open the.csproj in Visual Studio / Rider.
Build
BepInEx and HarmonyX are restored from the official BepInEx NuGet feed
(nuget.config points at — they are
compile-time references only; the game's BepInEx install provides them at runtime.
The only machine-specific path is the game install (for Assembly-CSharp.dll and
the Unity 2022.3 engine assemblies, which have no NuGet package):
- Edit DSPManaged in DSPPlannerExport.csproj to match your install, or pass it
on the command line:
dotnet build -c Release -p:DSPManaged="C:\...\Dyson Sphere Program\DSPGAME_Data\Managed"
- Copy the resulting bin\Release\DSPPlannerExport.dll into
…\Dyson Sphere Program\BepInEx\plugins\.
- Launch the game. The BepInEx console log should show:
DSP Planner Export: serving /protos, /rates
Publishing
The plugin ships as Suite/DSP_Planner_Export (community
dyson-sphere-program). Publishing is a local, one-command step — it can't run in CI
because the build needs the game's Assembly-CSharp.dll, which a runner doesn't have.
One-time setup:
- Restore the CLI (pinned in.config/dotnet-tools.json): dotnet tool restore — invoked as
dotnet tcli. (publish.ps1 runs the restore for you.)
- Get a service-account token:.io → the Suite team → Service Accounts
→ Add service account → copy the token. (tcli is stateless — no login / credential store —
so the token is supplied per publish; the script sources it for you.)
- Save it once to Windows Credential Manager:
pwsh./publish.ps1 -SaveToken # prompts for the token (hidden), stores it encrypted
It's kept under your Windows account (DPAPI-encrypted at rest, target
DSPPlannerExport:ThunderstoreToken — visible in Control Panel → Credential Manager →
Windows Credentials), outside the repo. publish.ps1 then reads it automatically — no
pasting. Resolution order: $env:TCLI_AUTH_TOKEN (for CI / op run) → Crede
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。
下面這些內容需要先安裝,否則該模組不會生效: