JSON Import
Since we can already export a sector, how about importing one? It would be nice if I could export, then run through some program and then import it back in.
Mostly because I'm thinking of writing something that would give more details to the generated stars and planets. Think temperature, star's luminosity and spectral class, etc. And I would love to have that information as comments. But copy pasting it all in would be quite the chore.
I'm not trying to make that a pr because:
- I don't know enough javascript to do it myself
- It is probably way more complicated than what most people playing SWN really need.
Also, it would allow people to store sectors offline. Thus being able to keep an old sector that they don't play with anymore, without it affecting their limit.
Now as I programmer, I know that this would mean committing to some kind of standard to not break backwards compatibility, so I'm just putting this up as a wish list item.
Do you have an idea in mind for the generation of all those star/planet attributes? I've wanted to do something like this from the very beginning of SectWN and if you have the options and the probabilities I'd be more than willing to work something into the site.
Anything non-standard I'm defaulting to a disabled state in the configuration so it would just be off by default and then you can toggle it on if the user would prefer but... we all know everyone will want them :)
I am actually working on the tables, before working on the code, so that I had some idea of what the process would be like. Currently I'm looking through other books to see what they've done, so I'll see about posting the markdown guide once it is done? If it could be directly implemented that would be really cool! Perhaps we won't have Gas Giant Mines in normal planets anymore... :)
But, so far what I've got is rolling to determine the spectral class of the primary star in the system, then based on that we roll on a separate table to determine how many "orbits" are inhabited, and then place those.
Quick example, a sun like star (G2V), would roll a 1d10+2, so that gives it anywhere between 3 and 12 "orbits" occupied. Each orbit could anything from a "Deep" Space Station, to a massive Gas Giant, or an asteroid belt. Then each of those can roll to see what it has around itself, so a Gas Giant would roll for moons/mines/stations, while an asteroid belt would roll for asteroid bases.
I'm still trying to figure it all out in detail, but I thought I might as well ask about importing first, as that was independent of myself.
Also, this level of generation might be a bit more demanding server side, as it requires far more than a single roll and has a chance for somewhat deeper nesting. However, since the things in the orbits don't need to know about each other, each one of those could be handled asynchronously, so that would make the process slightly faster.
All the sector generation code lives on the client and was designed to be highly hierarchical so it really should all be set up to do something like this. I'd be really interested to see how the tables turn out.
The tables you are creating. Are they based on real world data? It was going to be way down the road but I was hoping to find some actual data on all this with associated probabilities for generation. Quite the pipe dream but who knows.
Let me know when you have some more information and we can go from there. I still think your original request of a JSON import is important. Thanks for submitting!
Np, I wasn't trying to make it super accurate, but definitely a lot more than the current system. However I think I did see the chances of certain stairs being somewhere on wikipidea so I could take a look at super realism. Still I think finding a balance might be better, after all the book does say that:
For simplicity’s sake, it’s often best to just stick with one inhabited world. The original colonists would have chosen the most human-habitable planet in the system, and unless they grew dramatically in the time before the Scream they wouldn’t have had reason to colonize less favorable planets before the catastrophe knocked out their spaceflight capabilities. Other rocks might be floating in the system, but they’re probably barren and uninhabited.
So, with the mindset that it is a game, I think giving higher chances to more interesting systems should be fine. Thus I wasn't intending to fully mimic reality, but I could make a "more realistic but still a game" version and a "as real as possible" version. Though the latter might take significantly longer, as I probably have to read research papers to get the data...
I'd like to chime in and say I'd also like to be able to import the JSON the site puts out. I often find myself wanting to do things that would be super easy to do in something like a Python script, but which are specific enough or hard enough that it doesn't really make sense to put the effort into making them part of the generator (like set the tech level in all planets in the lower half of the sector to TL3 or below, or rename all the science stations with a particular name generator, etc). Being able to export the map as JSON, edit it programatically, and import it back into the generator would be fantastic.
I have implemented a first draft of a import function here: Irame/sectors-without-number/dev The main thing that's missing here is the JSON validation, which i am currently trying to implement with jsonschema. I will make a pull request as soon as my last pull request is resolved. I also noticed, layers aren't exported currently.