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.
| Date uploaded | 2 weeks ago |
| Version | 1.9.0 |
| Download link | Suite-DSP_Planner_Export-1.9.0.zip |
| Downloads | 35 |
| Dependency string | Suite-DSP_Planner_Export-1.9.0 |
This mod requires the following mods to function
BepInEx-BepInExPack
BepInEx pack for Mono Unity games. Preconfigured and ready to use.
Preferred version: 5.4.2100README
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 http://localhost:8765/state 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 http://localhost:8765/protos 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 http://localhost:8765/rates cumulative production/consumption counters
{ "version":1, "running":true, "gameTick":123456,
"items":[ {"id":1101,"p":12345,"c":678}, ... ] }
/state:idis the in-gameTechProtoid. Leveled upgrades reportlevel(curLevel); the planner expands consecutive ids per level using FactorioLab's id map./protos: every item getsid/name/grid(inventory grid index); buildings additionally getmodel(modelIndex),w/h(blueprint footprint in cells fromprefabDesc.blueprintBoxSize),zstep(vertical offset per stacked level,prefabDesc.lapJoint.y) andslots(per-side sorter slot counts [N,E,S,W] fromprefabDesc.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 onFactoryProductionStat.GameTick, which readsproductRegister/consumeRegisterjust 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.csprojin Visual Studio / Rider.
Build
BepInEx and HarmonyX are restored from the official BepInEx NuGet feed
(nuget.config points at https://nuget.bepinex.dev/v3/index.json) — 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
DSPManagedinDSPPlannerExport.csprojto 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.dllinto…\Dyson Sphere Program\BepInEx\plugins\. - Launch the game. The BepInEx console log should show:
DSP Planner Export: serving http://localhost:8765/state, /protos, /rates
Publishing to Thunderstore
The plugin ships on Thunderstore 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 asdotnet tcli. (publish.ps1runs the restore for you.) - Get a service-account token: thunderstore.io → the
Suiteteam → Service Accounts → Add service account → copy the token. (tcli is stateless — nologin/ credential store — so the token is supplied per publish; the script sources it for you.) - Save it once to Windows Credential Manager:
It's kept under your Windows account (DPAPI-encrypted at rest, targetpwsh ./publish.ps1 -SaveToken # prompts for the token (hidden), stores it encryptedDSPPlannerExport:ThunderstoreToken— visible in Control Panel → Credential Manager → Windows Credentials), outside the repo.publish.ps1then reads it automatically — no pasting. Resolution order:$env:TCLI_AUTH_TOKEN(for CI /op run) → Credential Manager → a one-off secure prompt if neither is set. Treat the token like a release key; to rotate it, re-run-SaveToken.
Each release:
- Bump
VERSIONinPlugin.cs(single source of truth — flows to the csproj manifest and the Thunderstoreversion_number). Thunderstore versions are immutable and must strictly increase, so re-publishing the same number fails. - From this folder:
pwsh ./publish.ps1— builds the DLL, packages the Thunderstore zip (thunderstore.toml+icon.png+README.md+ the DLL underBepInEx/plugins/…), and uploads it viatcli. Usepwsh ./publish.ps1 -DryRunto build + package only (inspect./build/*.zip) without uploading.
The package metadata lives in thunderstore.toml; icon.png (256×256) is the listing icon and
is committed so every publish reuses it. Keep this in step with the web release: when the app
ships a version that changes the live-link contract, bump + publish the plugin too.
Use with the planner
- Open
dsp-ultimate-suite.html. - Research tab → Live: on polls
/stateevery ~3 s and repaints the trees as you research in-game. (While Live is on, manual ticks are overwritten on each poll.) - Planner tab → Plan vs actual → Live: on polls
/ratesevery 3 s and compares the plan's computed per-item rates with what your factories actually produce and consume (needs two samples before the first numbers appear). - Mapper tab → Load protos (plugin) pulls
/protosfor exact model indices, footprints, z-steps and sorter slots when exporting blueprints.
In-game HUD & advisor (T99)
The optional overlay (toggle with F8) draws live deficits and — when
[Advisor] Enabled — a "Upgrades available" section listing researched building
tiers worth switching to (e.g. Conveyor Belt MK.II researched). It mirrors the
planner's 💡 Advisor. Configure which kinds appear in the BepInEx config (live-reloaded):
[Advisor] Enabled— master toggle for the advisor section.[Advisor] Belts / Sorters / Machines / Proliferator— pick which recommendations show.[Advisor] DismissKey(default F9) — hide the current tips; each returns only when a still-newer tier unlocks (dismissals are remembered in[Advisor] Acknowledged).
The advisor flags the highest unlocked tier above the base in each family (belts, sorters, assemblers/smelters/chemical plants/miners, proliferator) — Dark-Fog-only tiers are excluded.
Notes / troubleshooting
- The page is
file://, fetchinghttp://localhost— allowed because the plugin sendsAccess-Control-Allow-Origin: *. No HTTPS issues since the page isn't HTTPS. - If the listener fails to start, another app may hold port 8765, or Windows needs a URL ACL.
Either change
PortinPlugin.cs, or run once as administrator. - Game API used:
GameMain.history.{techStates,ItemUnlocked},TechState.{unlocked,curLevel,maxLevel},LDB.items/models,PrefabDesc.{blueprintBoxSize,lapJoint,slotPoses},FactoryProductionStat.{GameTick,productRegister,consumeRegister},GameMain.gameTick. All verified to compile against the current build (Unity 2022.3.62, 2026-06). If a future patch renames them, the compiler will point at the exact spot — the planner side needs no change. - The HTTP thread never touches Unity objects: the main thread refreshes JSON snapshots ~once per second and the listener just serves the latest strings (thread-safe).
/ratescounters reset when the plugin reloads; the planner detects the tick going backwards and re-seeds automatically.