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
Purge all transformation orientations addon for Blender 2.8 and newer versions

CTO Purge This add-on adds a new button to Blender's Transformation Orientation panel which empowers the user to purge all of his/her custom transform

MMMrqs 10 Dec 29, 2022
emoji-math computes the given python expression and returns either the value or the nearest 5 emojis as measured by cosine similarity.

emoji-math computes the given python expression and returns either the value or the nearest 5 emojis as measured by cosine similarity.

Andrew White 13 Dec 11, 2022
Bring A Trailer(BAT) is a popular online auction website for enthusiast cars. This traverse auction results and saves them as CSV

BaT Data Grabber Bring A Trailer(BAT) is a popular online auction website for enthusiast cars. This traverse auction results and saves them as CSV Bri

Elliot Weil 2 Oct 31, 2021
A curated collection of Amazing Python scripts from Basics to Advance with automation task scripts

📑 Introduction A curated collection of Amazing Python scripts from Basics to Advance with automation task scripts. This is your Personal space to fin

Amitesh kumar mishra 1 Jan 22, 2022
Python module to work with Magneto Database directly without using broken Magento 2 core

Python module to work with Magneto Database directly without using broken Magento 2 core

Egor Shitikov 13 Nov 10, 2022
ColabFold / AlphaFold2_advanced on your local PC (or macOS)

LocalColabFold ColabFold / AlphaFold2_advanced on your local PC (or macOS) Installation For Linux Make sure curl and wget commands are already install

Yoshitaka Moriwaki 207 Dec 22, 2022
An Advanced Wordlist Library Written In Python For Acm114

RBAPG -RBAPG is the abbreviation of "Rule Based Attack Password Generator". -This module is a wordlist generator module. -You can generate randomly

Aziz Kaplan 11 Aug 28, 2022
VCM EE1.2 P-layer feature map anchor generation 137th MPEG-VCM

VCM EE1.2 P-layer feature map anchor generation 137th MPEG-VCM

IPSL 6 Oct 18, 2022
Retrying is an Apache 2.0 licensed general-purpose retrying library, written in Python, to simplify the task of adding retry behavior to just about anything.

Retrying Retrying is an Apache 2.0 licensed general-purpose retrying library, written in Python, to simplify the task of adding retry behavior to just

Ray Holder 1.9k Dec 29, 2022
Cup Noodle Vending Maching Ordering Queue

Noodle-API Cup Noodle Vending Machine Ordering Queue Install dependencies in virtual environment python3 -m venv

Jonas Kazlauskas 1 Dec 09, 2021
Declarative and extensible library for configuration & code separation

ClassyConf ClassyConf is the configuration architecture solution for perfectionists with deadlines. It provides a declarative way to define settings f

83 Dec 07, 2022
Create a simple program by applying the use of class

TUGAS PRAKTIKUM 8 💻 Nama : Achmad Mahfud NIM : 312110520 Kelas : TI.21.C5 Perintah : Buat program sederhana dengan mengaplikasikan pengguna

Achmad Mahfud 1 Dec 23, 2021
Script to quickly get the metrics from Github repos to analyze.

commit-prefix-analysis Script to quickly get the metrics from Github repos to analyze. Setup Install the Github CLI. You'll know its working when runn

David Carpenter 1 Dec 17, 2022
Fastest python library for making asynchronous group requests.

FGrequests: Fastest Asynchronous Group Requests Installation Install using pip: pip install fgrequests Documentation Pretty easy to use. import fgrequ

Farid Chowdhury 14 Nov 22, 2022
A python implementation of differentiable quality diversity.

Differentiable Quality Diversity This repository is the official implementation of Differentiable Quality Diversity.

ICAROS 41 Nov 30, 2022
Xoroshiro-cairo - A xoroshiro128** pseudorandom number generator implementation in Cairo

xoroshiro-cairo A xoroshiro128** pseudorandom number generator implementation in

Milan Cermak 26 Oct 05, 2022
Easy installer for running Amazon AVS Device SDK on Raspberry Pi

avs-device-sdk-pi Scripts to enable Alexa voice activation using Picovoice Porcupine If you like the work, find it useful and if you would like to get

4 Nov 14, 2022
Inacap - Programa para pasar las notas de inacap a una hoja de cálculo rápidamente.

Inacap Programa en python para obtener varios datos académicos desde inacap y subirlos directamente a una hoja de cálculo. Cómo funciona Primero que n

Gabriel Barrientos 0 Jul 28, 2022
Here is my Senior Design Project that I implemented to graduate from Computer Engineering.

Here is my Senior Design Project that I implemented to graduate from Computer Engineering. It is a chatbot made in RASA and helps the user to plan their vacation in the Turkish language. In order to

Ezgi Subaşı 25 May 31, 2022
Shopify Backend Developer Intern Challenge - Summer 2022

Shopify Backend Developer Intern The task is build an inventory tracking web application for a logistics company. The detailed task details can be fou

Meet Gandhi 11 Oct 08, 2022