Dyson Sphere Program Blueprint Toolkit

Overview

dspbptk

This is dspbptk, the Dyson Sphere Program Blueprint toolkit. Dyson Sphere Program is an amazing factory-building game by the incredibly talented indie-dev Youthcat Studio. It allows blueprinting files to disk and then reusing them in other parts of your game.

There are some cool things that could be done with this import/export functionality, and what I had in mind was something like:

  • Editing blueprints outside the game, using maybe other/better tools
  • Automatic upgrade/downgrade of blueprints, e.g., upgrading belts Mk1 to Mk2 or Mk3. This would allow easy generation of a template book (where you could e.g., create a set of Mk3 balancers and then automatically create the books for Mk1/Mk2 balancers)
  • Automatic parametrization of blueprints, e.g., you have a smelter blueprint that requests Titanium ore via an Interstellar Logistics Station, smelts them and returns Titanium Ingots. You could update automatically generate the same blueprint for iron/copper/silicon/steel so that you don't have to manually change the request, assign the Logistics output and change the smelter recipes all in one go.
  • Parametric generation of blueprints, e.g., automatically generate a row of 1, 2, 4, 8, 10 Energy Exchangers/etc.
  • Plot blueprints outside the game, e.g., to generate "birds eye view" of the blueprints for library organization.

The possibilities are endless!

Now, all of this can obviously done in the game. So there are two possible solutions that you could take:

  1. Spend some time to do this by hand.
  2. Spends hours reverse engineering DSP and implementing the necessary bits

Obviously, I prefer option (2).

Why is this difficult?

Dyson Sphere Program kindof "authenticates" blueprints. Essentially, the blueprint strings are Base64-encoded, gzipped binary data that are also hashed. This hash function is key: while initially my assumption was that this is MD5, none of the combinations I tried actually yielded the correct result. So I reverse engineered the code and found out that actually they do use a proprietary, modified variant of MD5 that produces completely different results. They call this algorithm MD5F in their code. There's also a variant with even other constants, called MD5FC, which I don't know what it is used for. But it's implemented too.

So essentially, there are two pieces to this puzzle:

  1. Reverse engineer the hash function (done)
  2. Reverse engineer the internal format of the blueprint binary (done)

If anyone from Youthcat Studio reads this: Pleeeease don't make it more difficult to mod your game. It's fun reversing it and whatnot, but it's also ultra cool to have a command line tool interface with your game.

How to use it?

Right now, very little functionality is implemented. But you can kind of see how it works in the code. For example, there is a command that lets you see what's in a blueprint:

$ ./dspbptk dump "bps/Processor Factory.txt"
Name: Processor Factory
Total building count: 1149
  879  ConveyorBeltMKIII
  183  SorterMKIII
   61  AssemblingMachineMkI
   23  TeslaTower
    2  PlanetaryLogisticsStation
    1  Splitter

You can also convert the blueprint to JSON (so you have a very clear idea of the internal structure of the file). Note that reverse conversion is not implemented (yet):

$ ./dspbptk json --pretty-print "bps/Processor Factory.txt" procfac.json
$ cat procfac.json
[...]
            {
                "area_index": 0,
                "filter_id": 0,
                "index": 16,
                "input_from_slot": 0,
                "input_object_index": 4294967295,
                "input_offset": 0,
                "input_to_slot": 1,
                "item_id": "ConveyorBeltMKIII",
                "local_offset_x": 69.99999237060547,
                "local_offset_x2": 69.99999237060547,
                "local_offset_y": 25.000001907348633,
                "local_offset_y2": 25.000001907348633,
                "local_offset_z": -2.2910537609277526e-06,
                "local_offset_z2": -2.2910537609277526e-06,
                "model_index": 37,
                "output_from_slot": 0,
                "output_object_index": 12,
                "output_offset": 0,
                "output_to_slot": 1,
                "parameter_count": 0,
                "parameters": [],
                "recipe_id": 0,
                "yaw": 315.07470703125,
                "yaw2": 315.07470703125
            },
[...]

And there is some example code that edits blueprints, although the only thing it can do right now is edit the short text. It's mainly to demonstrate that I can correctly put a blueprint file back together and recompute the correct hash so that it's accepted in DSP:

$ ./dspbptk edit --short-desc "New description" "bps/Processor Factory.txt" new.txt

Thanks

Thanks to Youthcat Studio for an incredible game. You are absolutely fantastic and your game is ridiculously good and addictive.

License

GNU GPL-3.

Owner
Johannes Bauer
$super_witty_bio
Johannes Bauer
Simple utlity for sniffing decrypted HTTP/HTTPS traffic on a jailbroken iOS device into an HAR format.

Description iOS devices contain a hidden feature for sniffing decrypted HTTP/HTTPS traffic from all processes using the CFNetwork framework into an HA

83 Dec 25, 2022
chiarose(XCR) based on chia(XCH) source code fork, open source public chain

chia-rosechain 一个无耻的小活动 | A shameless little event 如果您喜欢这个项目,请点击star 将赠送您520朵玫瑰,可以去 facebook 留下您的(xcr)地址,和github用户名。 If you like this project, please

ddou123 376 Dec 14, 2022
MiniJVM is simple java virtual machine written by python language, it can load class file from file system and run it.

MiniJVM MiniJVM是一款使用python编写的简易JVM,能够从本地加载class文件并且执行绝大多数指令。 支持的功能 1.从本地磁盘加载class并解析 2.支持绝大多数指令集的执行 3.支持虚拟机内存分区以及对象的创建 4.支持方法的调用和参数传递 5.支持静态代码块的初始化 不支

keguoyu 60 Apr 01, 2022
Mahadi-6 - This Is Bangladeshi All Sim 6 Digit Cloner Tools

BANGLADESHI ALL SIM 6 DIGIT CLONER TOOLS TOOLS $ apt update $ apt upgrade $ apt

MAHADI HASAN AFRIDI 2 Jan 23, 2022
E5 自动续期

请选择跳转 新版本系统 (2021-2-9采用): 以后更新都在AutoApi,采用v0.0版本号覆盖式更新 AutoApi : 最新版 保留1到2个稳定的简易版,防止萌新大范围报错 AutoApi'X' : 稳定版1 ( 即本版AutpApiP ) AutoApiP ( 即v5.0,稳定版 ) —

95 Feb 15, 2021
A Klipper plugin for accurate Z homing

Stable Z Homing for Klipper A Klipper plugin for accurate Z homing This plugin provides a new G-code command, STABLE_Z_HOME, which homes Z repeatedly

Matthew Lloyd 24 Dec 28, 2022
Arknights gacha simulation written in Python

Welcome to arknights-gacha repository This is my shameless attempt of simulating Arknights gacha. Current supported banner types (with potential bugs)

Swyrin 3 May 07, 2022
This python module allows to extract data from the RAW-file-format produces by devices from Thermo Fisher Scientific.

fisher_py This Python module allows access to Thermo Orbitrap raw mass spectrometer files. Using this library makes it possible to automate the analys

8 Oct 14, 2022
Simple Python-based web application to allow UGM students to fill their QR presence list without having another device in hand.

Praesentia Praesentia is a simple Python-based web application to allow UGM students to fill their QR presence list without having another device in h

loncat 20 Sep 29, 2022
PyPIContents is an application that generates a Module Index from the Python Package Index (PyPI) and also from various versions of the Python Standard Library.

PyPIContents is an application that generates a Module Index from the Python Package Index (PyPI) and also from various versions of the Python Standar

Collage Labs 10 Nov 19, 2022
Leveraging pythonic forces to defeat different coding challenges 🐍

Pyforces Leveraging pythonic forces to defeat different coding challenges! Table of Contents Pyforces Tests Pyforces Pyforces is a study repo with a c

Igor Grillo Peternella 8 Dec 14, 2022
A visidata plugin for parsing f5 ltm/gtm/audit logs

F5 Log Visidata Plugin This plugin supports the default log format for: /var/log/ltm* /var/log/gtm* /var/log/apm* /var/log/audit* It extracts common l

James Deucker 1 Jan 06, 2022
A tool to flash .ofp files in bootloader mode without needing MSM Tool, an alternative to official realme tool

Oppo/Realme Flash .OFP File on Bootloader A tool to flash .ofp files in bootloader mode without needing MSM Tool, an alternative to official realme to

Italo Almeida 70 Jan 02, 2023
京东热爱狂欢趴&京东扫码获取cookie

京东热爱狂欢趴 一键完成任务脚本来袭 活动地址: https://wbbny.m.jd.com/babelDiy/Zeus/2s7hhSTbhMgxpGoa9JDnbDzJTaBB/index.html#/home 2021-06-02更新: 1、删除京东星推官 2、更新脚本,修复火爆问题 2021

xoyi 48 Dec 28, 2022
Tips that improve your life in one way or another

Tips that improve your life in one way or another. This software downloads life tips from reddit.com/r/LifeProTips and tweet the most upvoted tips on Twitter.

Burak Tokman 2 Aug 04, 2022
Compile Binary Ninja's HLIL IR to LLVM, for purposes of compiling it back to a binary again.

Compiles BinaryNinja's HLIL to LLVM Approach Sweep binary for global variables, create them Sweep binary for (used?) external functions, declare those

Kyle Martin 31 Nov 10, 2022
tg-nearby Trilateration of nearby Telegram users as described in my corresponding article.

tg-nearby Trilateration of nearby Telegram users as described in my corresponding article. Setup If you want to toy with the code in this repository

Maximilian Jugl 75 Dec 26, 2022
Hands-on machine learning workshop

emb-ntua-workshop This workshop discusses introductory concepts of machine learning and data mining following a hands-on approach using popular tools

ISSEL Soft Eng Team 12 Oct 30, 2022
CD for MachineLearnia

Codebase supporting my talk on CI/CD for MachineLearnia (Nov 12 2021) The dataset used is available here. The point of the talk is to demonstrate a si

0 Feb 23, 2022
Developing a python based app prototype with KivyMD framework for a competition :))

Developing a python based app prototype with KivyMD framework for a competition :))

Jay Desale 1 Jan 10, 2022