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.
About this mod Author’s original text
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
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.
Install these first, or the mod will not work: