thombruce / verse

🚀 A universe in progress
Other
8 stars 0 forks source link

Improved Planet/Moon Spawning #39

Open thombruce opened 11 months ago

thombruce commented 11 months ago

The way planets and moons are presently spawned is awkward. We execute three systems in this order:

  1. Star spawning system places a star at [0., 0.]
  2. Planet spawning system places a planet in orbit around the star (could be generalised to any number of planets if not for animation system)
  3. A "demo" system places a moon in orbit around the planet (this could again be generalised for any number of moons around any number of planets)

The problem?

Too much repetition and far from enough generalisation. We should prefer something like a spawn_celestial_body function that can be reused. And we want to be able to generalise this to spawn bodies recursively (moons can have satellites too, binary star systems exist).

Prefer to be able to run one system that is capable of executing other functions to construct the system. The limiting factor to this is the necessity of "parent" bodies existence prior to querying when creating children; presently systems run in the same step are executed in parallel, so bodies end up missing.

thombruce commented 11 months ago

Related: #33