Coder Social home page Coder Social logo

dyson-sphere-blueprints's Introduction

DSP Blueprints

Community website to share Dyson Sphere Program blueprints.

Official website: https://www.dysonsphereblueprints.com

Table of content

Roadmap

See the roadmap/todo file

Changelog

Latest: 4.4.0

  • Query and filters optimisations to fix the performance issues

Previous versions

Find the rest in the CHANGELOG

Contribute

Pull requests are always welcome, if you want a copy of the production or staging database for development purposes (meaning all emails and passwords will be randomized, I am not just gonna give away personal information to whoever wants them), just send me an email or open a ticket and we'll see to that.

Setting up

Install ruby dependencies

bundle install

Install node dependencies

yarn

Then set up the database, either using docker or your own postgresql instance. Once done, you can run the migrations and create the database:

rails db:create db:migrate db:seed

If migrations are failing the first time, just re-run them again.

You should then be able to run the application:

rails s

Seeding

The main thing you'll need to setup is to create a Mod for the blueprints. Currently there are 3 mods in production, 2 are legacy and one is for the base game. A Mod contains a field version which is a JSON like that:

{
  "0.8.19.7662" => {
    "uuid4" => "0.8.19.7662-1627063708",
    "breaking"=>true,
    "created_at"=>"2021-07-23T18:08:28.644+00:00"
  }
}

breaking is used for the display of blueprints compatibility from one version of the mod / game to another. You can also go in lib/tasks/mod.rake and have a look at the tasks, those tasks were used to seed the mods in staging and production:

noglob rake 'mod:fetch_base_game_latest[0.8.19.7662]' # Forces a game version to be added
noglob rake 'mod:fetch_base_game_latest' # Fetches the latest game versions from the Steam News API
noglob rake 'mod:flag_breaking[Dyson Sphere Program, 0.8.19.7662]'

The task rake mod:fetch_latest used to be to retrieve MultiBuild version from the Thunderstore API but we don't need it anymore.

Environment

For proper development, you also will need a .env file at the root of the project. It needs to have the following environment variables:

DISCORD_CLIENT_ID=XXX
DISCORD_CLIENT_SECRET=XXX
AWS_S3_ACCESS_ID_KEY=XXX
AWS_S3_ACCESS_SECRET_KEY=XXX
AWS_S3_REGION=eu-west-1
AWS_S3_BUCKET=dyson-sphere-blueprints
AWS_CLOUDFRONT_URL=https://XYZ.cloudfront.net

Most of those are not needed to be able to work on most features, but if you want images to display and be able to upload images for instance you will need to setup an AWS S3 and Cloudfront. An example can be found in .env.sample

Build development environment

You can also build a development environment with docker compose.

Using the docker-compose.yml, will start the following services:

  • PostgreSQL
  • Redis
  • AWS S3 (localstack)
  • SMTP (mailhog)
$ docker compose up -d

to connect each service, use these credentials:

  • PostgreSQL
    • User: dev
    • Password: password
    • Host: 127.0.0.1
    • Database: dspblueprints_development
  • Redis
    • URL: redis://127.0.0.1:6379/0
  • AWS S3
    • Access key: XXX (some non-empty string)
    • Secret key: XXX (some non-empty string)
    • Region: eu-west-1
    • Bucket: dyson-sphere-blueprints
    • Endpoint: http://localhost:4566
  • SMTP
    • SMTP Server: localhost:1025
    • HTTP Server: localhost:8025 (You can see the emails you have sent with WebUI)

The above configuration is written in .env.sample. You can simply copy it and it should be enough.

$ cp .env.sample .env

Rake tasks

There are a few rake tasks that you can use:

rake mod:fetch_base_game_latest[PATCH] # creates a new version in the DB, use like this: rake 'mod:fetch_base_game_latest[0.8.19.7662]'
rake blueprint:recompute_data # updates all blueprints summary if you have made any changes to it
rake mod:fetch_latest # currently legacy, but fetches the latest versions of all mods handled (MultiBuild and MultiBuildBeta)

Our lovely sponsors

  • Waylon - Checkout Waylon's project, We Care Tucson, a non-profit organization that refurbishes donated computers to resell at discounted prices to the community!
  • Sho918
  • Juo Nuevo

Contributors

  • Sho918, code cleanup, docker setup and many incredible features and improvements
  • Brokenmass, Wrote the 3D Preview renderer (as well as the original blueprint mod).
  • LRFalk01, DSP Blueprint Parser library and integration in the project
  • RandyCarrero, Help page and new tags for Mass construction
  • Glouel, Fixed some typos
  • David Westerink, blueprint collections bulk download

Deploy

This project is currently hosted on Heroku. Notes to self: rubocop-daemon start Make sure the Gemfile has the proper platforms set:

$ bundle lock --add-platform x86_64-linux

Staging

Copy prod DB to staging

heroku pg:backups:restore `heroku pg:backups:url --app dyson-sphere-blueprints` DATABASE_URL --app dyson-sphere-blueprints-stage

License

Important: this license only applies to the logic and application in itself and does not pertain to any data or assets coming from the game Dyson Sphere Program which is the intellectual property of Youthcat Studio.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004

Copyright (C) 2004 Sam Hocevar [email protected]

Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

You just DO WHAT THE FUCK YOU WANT TO.

dyson-sphere-blueprints's People

Contributors

davidakachaos avatar dvhg avatar gabriel-dehan avatar glouel avatar lrfalk01 avatar martin-pitt avatar mattr- avatar randycarrero avatar sho918 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dyson-sphere-blueprints's Issues

Allow restricting lower bound of version

In particular I uploaded with 2.1.4 selected, on the website it shows that 2.1.0-2.1.4 is valid. I would like to set 2.1.1 as a minimum because I use elevated belts and belt-to-belt inserters which do not work in 2.1.0.

Awesome work on the website in general, it's super polished for how fast it was put up :)

Sort by most copied

Yo, your website for BluePrinting is really cool. I was using it since MultiBuiltBeta but I'm wondering if you can change the way it shows "most hearted" to "most copied" or something. People heart stuff rarely and it doesn't help to sort by it.

If you can track people clicking the copy button that would be a better metric. Then add a filter for "Most copied" or something.

Obviously, make it so if people spam the copy button it doesn't inflate the counter. It should be based on your IP address maybe? If not IP maybe a cookie?

Just a suggestion/feature request. :)

Bring back blueprint analysis

I need to parse blueprints and validate them properly first and the new format is quite complex compared to before.

Ruby and Rails upgrades

Hi! 👋

I was looking at the source code for the site and noticed that both Ruby and Rails are a bit out of date. Would you be interested in having PRs to upgrade those?

Those upgrades can sometimes be a lot of work, so I'm asking first since I wouldn't actually be on the hook for making sure the upgrades work as part of deploying a new version of the site. 😅

Server Costs

I saw a post were you were talking about server costs being a problem. You could significantly lower your costs by making it so that you only retrieve the blueprint when specifically requested. so the blueprint is not requested in the pages or when loading the detail page. it is only requested on a user action specifically requesting to copy it. If you'd like I can work on a PR for this, although I am not a FE engineer. If you are not interested, just close the issue.

Add required power?

On the blueprint requires pane, it would be very useful to know what the total power requirements are assuming 100% uptime for everything included. I think this would probably exclude towers since their power draw is massively variable. Or perhaps a number both with and without. But knowing what all of the rest of the buildings will require would be very useful. Since planets vary, it would probably need to assume 100% for both solar and wind generators included in the blueprint, but everything else should be fairly static.

Allow a direct download of a blueprint to folder

Suggestion: Instead of requiring users copy from Dyson Sphere Blueprints to then paste them into the game, could there be an added button that downloads them intact for placing into the blueprint file of the game?

I often browse this site between sessions, and finding a nice blueprint I'd like to try is often a "bookmark this for later use, and copy paste when the game is open" type transaction instead of tossing a file into my blueprint cloud and having it available for later use.

Thoughts?

Some game entities, recipes and icons are missing

Noticed some blueprints have ? marks icons in the list of components, especially noticed it on some big malls blueprints.
Probably due to the new sorters and dark fog items, some might be missing.

Long blueprint titles can break page layout

It seems some long titles can break the pages layout, here is an example of the issue:

Screenshot 2023-08-03 at 04 13 44

I've debugged the issue and found that using word-break: break-word; would be a good way to handle this problem. I've not checked how this works across different languages but it's the most friendly typographical option of the other word-break options IMHO.

Fixed in PR #55:

Screenshot 2023-08-03 at 04 13 53

Download multiple blueprints as zip file

I sometimes find the "need" to download a whole set of blueprints to a folder. Would it be possible to create a function that lets you select multiple blueprints and then press a "Download as zip" button?

Love the site, by the way, keep up the awesome work!

Request: Automatically tag blueprints with a "produces" tag

It occurs to me that blueprints are tagged with whatever the author chooses, so if I for example search for "Interstellar logistics station", I will sometimes find blueprints that produce ILS's, and other times find those that "use" ILS's.. So it's not easy to find a factory producing ILS's.

I propose that all blueprints be automatically tagged with what they produce, maybe which recipes they're using. So that I can search for a tag (or recipe), and thereby find the factories I need :)

Looking forward to great updates on this - it's an awesome resource for the game. :)

New Blueprint Enhancement

With the new BP system now being parsed, we could make it so pasting a blueprint auto fills various form inputs. eg Title, description, version. Could probably parse the icon to fill in some tags as well. Thoughts?

This blueprint requires fill option.

instead of having the system search for the requirements have it in the submission form.

requires to have:
Mass Construction tier 1 [60 Facilities]
Mass Construction tier 2 [150 Facilities]
Mass Construction tier 3 [600 Facilities]
Mass Construction tier 4 [3000 Facilities]
Mass Construction tier 5 [unlimited Facilities]
MultiMod [Stable]
MultiModbeta [Beta ver.]

Edit: have it as a new addition to help. I can see how it works in the old one and that is really good feature to have.

Add edit to post

Hi,
It would be awesome if we can get the ability to edit an already uploaded post.
I just uploaded a blueprint and realized I would like to add some comments in the description box, but this does not seem to be possible.
Unless I'm completely blind and can't see where.

Great website!

Kind Regards,
Victor

Possible to let us upgrade blueprint components on export?

I'm at a point where I don't even bother building anything less than mk3 assemblers, belts, sorters, etc.. Would it be possible to have an option to convert everything in a blueprint to mk3(or whatever preference) before exporting from the site?

Comments

Wouldn't be great if you can leave a comment in the bp? to let know the creator of the bp if you made a mistake or simple it's a great bp!

Total Number of entities

It would be really useful to have the total number of entities to be able to tell what tech level of the blueprints tech each blueprint can be used. As well as possibly a sort by/ tag for blueprint tech level.

Counter for the number of times the blueprint was copied

Awesome site, thank you for all the work! As a blueprint creator I have a small suggestion: simple counter for the number of times each blueprint was copied. I know, I know - fake internet points, but still I think it wouldn't hurt. Some sort of simple IP check would hopefully prevent abuse.

Possibility to add collections to your favorites

Hi!
Can you make

  1. possiblity to add collections to your favorites?
  2. And filtering collections by date\ update\ likes?
  3. And the ability to find collections of a particular author by clicking in his profile?

Because clicking on a specific link https://www.dysonsphereblueprints.com/collections/early-game-d516ab23-3db3-4f83-960b-53b3396826a8 we see only the author, and it is impossible to find his other collections.
And this one can't be added to your favorites.

Bug: Sorting by Level 2 is currently 120. Should be 150.

On the Web page, when searching for Blueprints at level 2, it currently returns 120 or less. It should be 150 or less to match what is now in the game.
Edit: Mass Construction 2 (120) should be:
Mass Construction 2 (150).

More a Question than Bug

Hey,

I notice there's not a super amount of development going on any more. Would you support moving this over to a new stack & langauge to improve performance & reduce costs of running? I was thinking Golang for its nice performance level and still being really easy to learn.

Thoughts?

Updated Entities & Recipes; But what about new icons?

First, the entities and recipes data files have been updated into PRs #57 & #58

I've copy pasted in updated data that I'd been using in my calculator: Martin-Pitt/dsp-prod-ratios
The parser I created is available at: Martin-Pitt/dsp-parser

Second, there are also images available, but they are in a spritesheet format: Martin-Pitt/dsp-parser/tree/main/dist/spritesheets

I could generate individual asset files — but in my experience it is recommend to use spritesheet(s) instead of browsers making many individual small requests, especially when there are multiple image formats (or device ratios) available.

In this case we have the new .webp and .avif formats which offer significantly smaller file sizes with good cross browser support so far. There is also CSS automatically generated for the icons, feel free to use the stylesheet or modify as you need to, it does however use newer CSS like aspect-ratio, image-set and @layer.

I'm not familiar with this project code to make the modification to use spritesheets myself.

Hide or even remove blueprints for MultiBuild.

Recently I have noticed that some people are confused as to why blueprints they copied from this website don't work. So far I found at least 3 people asking about this on the modding discord.

For example one happened recently and others a while back: this or this (Unsure if this one was the case, but it seems like that to me.)
(All links point to DSP modding discord)

What they all have in common is that every user found a blueprint on this site, but did not realize that blueprint was for MultiBuild mod. I'm certain that there are more cases like these that I don't know about. MultiBuild is long ago deprecated and it's author is not intending to update it and has no reasons to do so. As such I don't see any reason apart from archival purposes that blueprints for it are stored.

I'm suggesting one of the above to be done:

  • Remove MultiBuild blueprints entirely from the site
  • Hide MultiBuild blueprints from search results and add a banner on any blueprint for MultiBuild warning the users.

Password recovery?

Hello,

forgot my password and it seems like there is no button for password recovery? How can I reset my password? :)

Regards

Tag Searching

I'm not sure if your database requesting is setup to easily do this, but it would be nice if the tags were searched for with AND instead of OR .The more values you put in, the more results you get, which seems to be kind of pointless in most use cases. Unless I'm missing something. If it was MYSQL DB I know it would be a easy change, but I know absolutely nothing about ruby or what DB system you use since all my programming knowledge is self taught from 10+ years ago.

Add comments sections

There are often some issues with blueprints and it is impossible to tell the author when there are issues. A comment section would be a way to fix that.

Add mods to seed file

One of the larger barriers to entry in spinning up this code base is the lack of seeded mods. One has to kind of guess what to put into the json value of the table. It would be really helpful to have the values seeded.

Edit:
On second thought ... I don't know if this table is even going to exist in the future with the line items to remove support for mods. Maybe that needs discussed first.

Suggest change to URL format

There are several minor concerns about the URL format.

  1. They are very long, and that length doesn't have any useful purpose.
  2. If the title of a BP is changed, the URL no longer corresponds to the title.
  3. Giving users control over the URLs can result in unexpected consequences, ie: dysonsphereblueprints.com/blueprints/are-for-losers. Or worse... much worse... :)

I would suggest a change to something simpler, like dysonsphereblueprints.com/blueprints//<sequence#>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.