Utilitarian Star System Generator

My mind is blown.
I'm not sure whether its possible, but could it be possible to include a field which presets the stellar data be included further to the star type? Such as the Star size, mass, temp, luminosity and diameter, as shown in the Traveller Wiki on a given system?
Definitely possible. I took a quick look and it's going to take a bit of refactoring.

Not too terribly difficult, but it's enough effort that it will have to wait until my real work life settles down a bit - things have gotten a bit crazy all of a sudden.
 
Definitely possible. I took a quick look and it's going to take a bit of refactoring.

Not too terribly difficult, but it's enough effort that it will have to wait until my real work life settles down a bit - things have gotten a bit crazy all of a sudden.
Epic! Mongoose should pay you for your work IMO. Now that Mongoose owns Traveller lock stock, I can totally see your work supplanting the T5 Worlds system linked via the Traveller Wiki. The WBH is a more scientifically up to date basis for system generation so I believe.
 
Amazingly difficult feature request:

If a user enters custom data (either a UWP, and specific modifications to it; or a random seed and a few specific modification to the resulting system) would it be possible to have your software generate the appropriate pseudo-random seed which would (if taken as the sole input) 'randomly' generate the final (as tweaked earlier by the user) system?

This would allow far more compact 'save files'.
 
Last edited:
Thank you for developing this. I got this error message as soon as I opened the page:
"Error
Looks like something went wrong!"

I am running Ubuntu 24.04.1 LTS x86_64, Firefox 131.0.2
I looked at the HTML file in emacs 29.3 and it froze. Then it crashed. Opened it again in emacs and it didn't crash.
 
Thank you for developing this. I got this error message as soon as I opened the page:
"Error
Looks like something went wrong!"

I am running Ubuntu 24.04.1 LTS x86_64, Firefox 131.0.2
I looked at the HTML file in emacs 29.3 and it froze. Then it crashed. Opened it again in emacs and it didn't crash.
Mine seems fine using Chrome on Windows.
 
OK. So the first time I did this, I went to the GitHub page, right-clicked on star_gen.html and saved the file to my drive.

So, a second time around, I clicked on the green "<>Code" button, chose "Download ZIP", unzipped it, clicked on the HTML file in the file manager (Nautilus) and it burst into life!
Glad you got it sorted out.

Out of curiosity, how did you download the file the first time? You should be able to just click the "Download Raw" button, which should download a text file with the .html extension:

1729185673883.png

If that's what you did, and it didn't work, I have no idea why lol.
 
Amazingly difficult feature request:

If a user enters custom data (either a UWP, and specific modifications to it; or a random seed and a few specific modification to the resulting system) would it be possible to have your software generate the appropriate pseudo-random seed which would (if taken as the sole input) 'randomly' generate the final (as tweaked earlier by the user) system?

This would allow far more compact 'save files'.
If you mean can I reverse-engineer the seed that would be required to generate a system with specific outputs, alas no, I do not believe that is possible, sorry.
 
Amazingly difficult feature request:

If a user enters custom data (either a UWP, and specific modifications to it; or a random seed and a few specific modification to the resulting system) would it be possible to have your software generate the appropriate pseudo-random seed which would (if taken as the sole input) 'randomly' generate the final (as tweaked earlier by the user) system?

This would allow far more compact 'save files'.
If you mean can I reverse-engineer the seed that would be required to generate a system with specific outputs, alas no, I do not believe that is possible, sorry.
Could be implementation specific: "Reversing" is different to "Reverse Engineering." With the latter, you treat the mapping as an unknown implementation. The former requires understanding of the pseudo-random number generator (PRNG).

Here are two possible approaches:


 
Glad you got it sorted out.

Out of curiosity, how did you download the file the first time? You should be able to just click the "Download Raw" button, which should download a text file with the .html extension:

View attachment 2415

If that's what you did, and it didn't work, I have no idea why lol.
The first time round, I went to "https://github.com/coolAlias/star_gen/tree/master", right-clicked on star_gen.html and selected "save link as". The result was a 2.4MB file. Opening it in Firefox failed, in Chromium web browser, it showed the GitHub screen. I suspect the first time round I downloaded far more than I expected, resulting in an error message.

Thanks to your reply, I think I see what I should have done:
1. Go to "https://github.com/coolAlias/star_gen/tree/master"
2. Click on star_gen.html
3. Click on "Download raw file" option (as indicated on your image above).
4. Open star_gen.html in a web browser.
 
Could be implementation specific: "Reversing" is different to "Reverse Engineering." With the latter, you treat the mapping as an unknown implementation. The former requires understanding of the pseudo-random number generator (PRNG).

Here are two possible approaches:


Thanks for those links, those will be very interesting to read.

From a quick skim, though, it looks to be far beyond my current skills:
We must do some preparatory steps before applying this common theory, and those steps are non-trivial and depend on particular PRNG type.
Still, that's cool to know it's not as impossible as I thought!

That said, it's one thing to be able to determine what the next number will be, and another entirely to find a seed that will have a specific ordered set of outcomes.
 
Thanks for those links, those will be very interesting to read.

From a quick skim, though, it looks to be far beyond my current skills:

Still, that's cool to know it's not as impossible as I thought!

That said, it's one thing to be able to determine what the next number will be, and another entirely to find a seed that will have a specific ordered set of outcomes.
I was thinking of 'start with given data', then generate a 'random seed' of all zeros. Do the first step of 'generate system from seed' to generate the first feature, and compare it to the first feature in the 'given data'. If it doesn't match, change the first digit of the 'random seed' and repeat. Once the first digit of the seed matches the output, work on the second digit, and etc.

That is an entirely naive 'brute force' approach, and will probably fail -- but that is what I was thinking of as a start point.
 
I was thinking of 'start with given data', then generate a 'random seed' of all zeros. Do the first step of 'generate system from seed' to generate the first feature, and compare it to the first feature in the 'given data'. If it doesn't match, change the first digit of the 'random seed' and repeat. Once the first digit of the seed matches the output, work on the second digit, and etc.

That is an entirely naive 'brute force' approach, and will probably fail -- but that is what I was thinking of as a start point.
The same thought occurred to me, and while from a technical standpoint it could work, I do wonder at the performance and memory implications.

That's all assuming there's a known output we're trying to generate, in which case, why not just use that output as is since we already have it?

If the concern is file size, there are lots of ways to reduce that without resorting to something so drastic as trying to find a pre-determined PRNG matrix.

The simplest would be to use standard file compression, which is generally quite good for text, and slightly more complex but still easy would be to adopt what I would call a versioned data stream, i.e. rather than storing all the headers and data keys and all that, just store the numeric values in a known sequence and format and rebuild the output from that.

For example, instead of storing "Component => Aa, Class => G1 V, Mass => 1.27, etc.", you could store "[0 => [4, 1, 5, 1.27, ...], ...]"
 
The same thought occurred to me, and while from a technical standpoint it could work, I do wonder at the performance and memory implications.
It is brute-force, so yeah -- wildly inefficient with resources while it runs. When it is done though, all you need to allocate resources for is the seed. I envisioned doing it only 'on demand', not constantly.
That's all assuming there's a known output we're trying to generate, in which case, why not just use that output as is since we already have it?
I just thought the seed would be easier to jot down, or to share. But yes; the known output is the whole point, as well as the thing which makes this possible at all.
If the concern is file size, there are lots of ways to reduce that without resorting to something so drastic as trying to find a pre-determined PRNG matrix.

The simplest would be to use standard file compression, which is generally quite good for text, and slightly more complex but still easy would be to adopt what I would call a versioned data stream, i.e. rather than storing all the headers and data keys and all that, just store the numeric values in a known sequence and format and rebuild the output from that.

For example, instead of storing "Component => Aa, Class => G1 V, Mass => 1.27, etc.", you could store "[0 => [4, 1, 5, 1.27, ...], ...]"
A UWP is already a 'versioned data stream', so none of this is new ground. I just guessed that the 'random seed' is shorter than the compressed output, since your generator provides all the formats and 'unpack' process.

Anyhow -- I figured this feature would take serious (possibly infeasible) effort to make; and the work already done so far is already amazing. Thanks!
 
I was thinking of 'start with given data', then generate a 'random seed' of all zeros. Do the first step of 'generate system from seed' to generate the first feature, and compare it to the first feature in the 'given data'. If it doesn't match, change the first digit of the 'random seed' and repeat. Once the first digit of the seed matches the output, work on the second digit, and etc.

That is an entirely naive 'brute force' approach, and will probably fail -- but that is what I was thinking of as a start point.
Well actually, this approach will almost certainly eventually succeed... with the caveat that "eventually" could well be well after your computer system fails due to component degradation. This is a nontrivially complex problem, which grows - massively! - with every additional feature which needs to be calculated.
 
Well actually, this approach will almost certainly eventually succeed... with the caveat that "eventually" could well be well after your computer system fails due to component degradation. This is a nontrivially complex problem, which grows - massively! - with every additional feature which needs to be calculated.
A better way may be to reverse the RNG to give you a list of all seed numbers that include the following data sets, then input the data that you want and maybe get a list of seed numbers that have all of those.

Not sure if this will work. Just an idea. It is not like a RNG is actually random.
 
A better way may be to reverse the RNG to give you a list of all seed numbers that include the following data sets, then input the data that you want and maybe get a list of seed numbers that have all of those.
For the sake of argument and since it's Traveller, let's say that each RNG value we generate results in a number between 1 and 6.

Let's then say that for any given system, we're rolling about 50 times (no idea, just for the sake of an example), but many of these rolls call for 2D6 so let's double it to 100 for simplicity.

Doesn't sound too crazy, right? Well, you're asking to determine a specific permutation with repeat elements allowed, and with a possible value of 1-6 for each and 100 values, that gives us the following number of possible sequences to check:

653,318,623,500,070,897,423,596,169,561,540,920,217,390,783,243,900,597,935,846,601,233,315,745,759,232

That's what we mean by "non-trivial" - while not theoretically impossible, it is most definitely a practical impossibility given current hardware and techniques.

Not sure if this will work. Just an idea. It is not like a RNG is actually random.
It's not random, but a good PRNG is effectively indistinguishable from random.
 
Well actually, this approach will almost certainly eventually succeed... with the caveat that "eventually" could well be well after your computer system fails due to component degradation. This is a nontrivially complex problem, which grows - massively! - with every additional feature which needs to be calculated.
The problem seems to be that it is not a simple 'first digit of seed = first die roll' relationship. Changing any digit changes the whole generated system.

I plugged in a modified UWP (A63445A-F) & other known system data for Drinax (plus the caveat that I want Drinax to be the moon of a Gas Giant), and tinkered with the seeds. Best I have found so far is f5f5ab85bcee. There is another nice seed at 423353892895, but there is another moon which seems like paradise compared to Drinax, and the Aslan would have taken it.
663353892895.
842b7da455c7.
996f9a34f8fff.
 
Last edited:
For the sake of argument and since it's Traveller, let's say that each RNG value we generate results in a number between 1 and 6.

Let's then say that for any given system, we're rolling about 50 times (no idea, just for the sake of an example), but many of these rolls call for 2D6 so let's double it to 100 for simplicity.

Doesn't sound too crazy, right? Well, you're asking to determine a specific permutation with repeat elements allowed, and with a possible value of 1-6 for each and 100 values, that gives us the following number of possible sequences to check:

653,318,623,500,070,897,423,596,169,561,540,920,217,390,783,243,900,597,935,846,601,233,315,745,759,232

That's what we mean by "non-trivial" - while not theoretically impossible, it is most definitely a practical impossibility given current hardware and techniques.


It's not random, but a good PRNG is effectively indistinguishable from random.
I will take your word for it, since honestly, this is likely above My level of understanding. lol
 
I will take your word for it, since honestly, this is likely above My level of understanding. lol
Don't sell yourself short! :D


Permutations with Repetition
When a thing has n different types ... we have n choices each time!

For example: choosing 3 of those things, the permutations are: n × n × n (n multiplied 3 times)

More generally, the formula is n^r

n is the number of things to choose from (e.g. 1-6, as in a 6-sided die)
and we choose r of them (e.g. 100 in my example),
repetition is allowed (e.g. 1, 1, 2, 1, ...),
and order matters.
So if n=6 and we need 100, that's 6 to the 100th power, which is that ginormous number I mentioned earlier.

I hope 653,318,623,500,070,897,423,596,169,561,540,920,217,390,783,243,900,597,935,846,601,233,315,745,759,232 is clear enough in its impossibility even without factoring in the additional complexity of calculating an RNG matrix for each of those... ;)
 
Back
Top