Prog8 language and compiler topic
Posted: Mon Sep 28, 2020 6:53 am
Just not related to prog8 but to Elite. You may want to lookup how the 256 planets worked in Elite. (check the source code I linked) It has a very good writeup how that works.
In short:
You have a pseudo random generator that is seeded by the galaxy seed (4 bytes). This seed is then taken through iterative random numbers to allways generate the same parameters for a specific planet.
So if you feed in 240 into this generator (System Number), it will allways get the same result back to you, which is then feeded into the the System generator and gets you the name and the description. All of that is also generated and not stored anywhere.
The marked prices are as well generated but also only varried with a random difference.
/Edit: ah forgot the galaxies ... So if you jump the galaxy. the 4 bytes above will be all rotated left by 1 bit. That results into a different seed for each galaxy and will also return back to 1 for if you jump through 8 galaxies back to the first one.