Skip to main content

This is a small project to generate blueprint to the game Dyson Sphere Program (DSP)

Project description

dsp_bp_generator (Work in progress)

This is a small project to generate blueprint to the game Dyson Sphere Program (DSP). The project is inspired from the awesome work put into dspbptk, from where the MD5 implementation and the DysonSphereItem enum is taken.

In the beginning, the project aimed to be a tool only to generate a production factory of a user defined item. But since then, it have evolved to be a more generic implementation of a library, to generate and connect various buildings, due to the complexity of the way the blue print is encoded.

How to use

A few small examples show how to run the parser and the serializer of blueprints. As well as a small example of how to generate blueprints from scratch:

(tested using Python 3.8.10)

Create virtual environment:

python -m venv venv

Activate the virtual environment:

source venv/bin/activate

Install dependencies:

pip install -r requirements.txt

Install this package:

pip install .

To run the blueprint parser, save your blueprint in a file, and run:

python parse.py --input_file=bp_input.txt --output_file=bp_output_data.txt

To run the blueprint parser- editer & serializer, save your blueprint in a file, and run:

python parse_edit_and_serialize.py --input_file=bp_input.txt --output_file=bp_output.txt

To generate and serialize a blueprint, try running:

python generate_and_serialize.py --output_file=bp_output.txt

Blueprint encoding

A blueprint in Dyson Sphere Program is a list of binary data blobs, each representing a building (this protocol is derived from the awsome work done in dspbptk).

Building Pose Connection
Name Type
index int32
area_index int8
pose Pose
item_id int16
model_index int16
connection Connection
recipe_id int16
filter_id int16
parameter_count int16
parameters [int32]
Name Type
x1 float32
y1 float32
z1 float32
x2 float32
y2 float32
z2 float32
yaw float32
yaw2 float32
Name Type
output_index int32
input_index int32
output_to_slot int8
input_from_slot int8
output_from_slot int8
input_to_slot int8
output_offset int8
input_offset int8

All these field is used to specify settings for each single object. The simple ones are for instance the postions (some buildings have two positions such as Sorters), but more complex ones are the indicies, which can be linked together to specify for instance a connection between two Belts, or a connection from a Sorter to an Arc Smelter. Small helper functions to handle all these settings for each building type have growned into a small library of tools to generate generic blueprints.

Before this big datablob, represnting a list of buildings, is a couple of headers.

Blueprint Header Area
Name Type
header Header
building_count int32
buildings [Building]
Name Type
version int8
cursor_offset_x int8
cursor_offset_x int16
cursor_target_area int16
dragbox_size_x int16
dragbox_size_y int16
primary_area_index int16
area_count int16
areas [Area]
Name Type
index int8
parent_index int8
tropic anchor int16
area segments int16
offset x int16
offset y int16
width int16
height int16

This whole data blob is finnaly compressed using gzip and then base64 encoded. Furthermore a fixed string is prepended, and a hash is appended.

Bluepring structure

For now only the most basic features is implemented. Generate and connects:

  • Belts
  • Smelters
  • Sorters
  • Assemblers
  • Splitters
  • Power poles

Forthermore, functionality to generate a production bus for an specific item at a user defined rate is implemented. However, only smelters and assemblers are supported. Which means no support for oil refinaries, chemical plants, etc.

alt text The factory above is generated by dsp_bp_generator

Limitations:

  • Do only support one recipe per item
  • Does only support smelter- and assembler factories
  • Does only support single output recipies
  • Does not (fully) support prolifirator (Mk.I, Mk.II, Mk.III)
  • Assumes all sorters and belts lives up to the requirements of throughput
  • Does not support multiple belts of same item
  • Does not support different tiers of sorters, factories nor belts
  • Documentation...

TODOs

For now only the very basic support of structures are implemented.

Buildings to implement:

  • Tesla Tower
  • Wireless Power Tower
  • Satelite Substation
  • Wind turbine
  • Thermal Power Plant
  • Solar Panel
  • Accumulator
  • Geothermal Power Station
  • Mini Fusion Power Plant
  • Energy Exchanger
  • Ray Receiver
  • Conveyer Belt MK.I
  • Conveyer Belt MK.II
  • Conveyer Belt MK.III
  • Splitter
  • Automatic Piler
  • Traffic Monitor
  • Spray Coater
  • Depot MK.I
  • Depot MK.II
  • Storange Tank
  • Logistic Distributor
  • Planeraty Logistics Station
  • Interstellar Logistic Station
  • Orbital Collector
  • Sorter MK.I
  • Sorter MK.II
  • Sorter MK.III
  • Pile Sorter
  • Mining Machine
  • Advanced Mining Machine
  • Water Pump
  • Oil Extractor
  • Oil Refinary
  • Fractionator
  • Chemical Plant
  • Quantum Chemical Plant
  • Miniature Particle Collider
  • Arc Smelter
  • Plane Smelter
  • Assembling Machine Mk.I
  • Assembling Machine Mk.II
  • Assembling Machine Mk.III
  • Matrix Lab
  • EM-Rail Ejector
  • Vertical Launching Silo
  • Gauss Turret
  • Missile Turret
  • Implosion cannon
  • Laser Turret
  • Plasma Turret
  • SR Plasma Turret
  • Battlefield Analysis Base
  • Jammer Tower
  • Signal Tower
  • Planetary Shield Generator

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dsp_bp_generator-0.1.0.tar.gz (41.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dsp_bp_generator-0.1.0-py3-none-any.whl (51.3 kB view details)

Uploaded Python 3

File details

Details for the file dsp_bp_generator-0.1.0.tar.gz.

File metadata

  • Download URL: dsp_bp_generator-0.1.0.tar.gz
  • Upload date:
  • Size: 41.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.1 Linux/6.5.0-1022-azure

File hashes

Hashes for dsp_bp_generator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a961f1d9d8234a0536a9cd8471935307f63478f5e3c559a740bc87459af6eb13
MD5 b579c6cdb6012242b1d0a0485dbbdc89
BLAKE2b-256 4b929a24357e36cd00006c65fa0a2e8e1eb16009d7df2ec8100e1bafe5d968bd

See more details on using hashes here.

File details

Details for the file dsp_bp_generator-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dsp_bp_generator-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 51.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.1 Linux/6.5.0-1022-azure

File hashes

Hashes for dsp_bp_generator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 81600db89bb1ccb37380b16968f2463ce8f7c2aade81e014b7f96b7c2c08440d
MD5 5cf406781cc3e2e09bc80fccdb26ff85
BLAKE2b-256 e24a43cf8d0cfaeef42096661752fe03ab4a59cbaf78467926112c96a2087b3e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page