How to approach procedural planets

A feedback on the first post

If space stage takes place in a short amount of time such as thousands of years, (so no plane tectonics, no evolution, no generational ships, ftl travel) the planets can remained unchanged, with the exception of extinction events and terraforming acts. (what would you do in a million years anyway? how many technologies there can be to discover? the game would need to slow down if there is no ftl or there isn’t ascension)

We can still add a tool to space stage to simulate the future evolution in a planet, and it wouldn’t take too much computational power, because it is happening to just one planet (or however many you placed)

Which would be a way to have this

inside the game too.

There are limitations to a planets diameter. It can’t be too large, because it would keep a hydrogen atmosphere, becoming a hycean planet or a gas giant. If the atmosphere blocks the sun, there can’t be photosynthesis on the surface, and if photosynthesis happens on the atmosphere, there is no access building material for cities. If it is too small, it would lose its atmosphere and wouldn’t have enough pressure for liquid water.

The speed of rotation around the star only depends on the distance to the star, which is limited by the goldilocks zone, not an independent variable that can be random.

Rivers or pre-river water can also be used to create terrain itself

Animating erosion and plate tectonics would make planet features dynamic.

The planet would start flat when its crust first solidifies, and some time after that it would get covered with water. Tectonic plates, which are all similar at first, would move randomly, and in places they move into each other, they would rise up to create a continental crust, which is above water. In places they move away from each other, new oceanic crust would be created. In time, the oceans would get deeper and the percentage of land would increase*, but not forever because two lands can crush into each other too. Simulating erosion would keep the land shapes realistic, there wouldn’t be mountains that are too high and there would be large regions of land that have a low elevation, just above the sea level[1], creating the second hump*. When sea levels increase, some of the continental crust would fall under the sea level, and deltas would turn into estuaries. Any geologic formation can be simulated the same way they appear in nature.

Having a planet that changes also has implications for seeds. In many games, you can enter a seed to create the same map again, but for that to happen in a realistic Thrive, the forces behind plate tectonics should be deterministic and erosion needs to give the same result every time. And even after that, you wouldn’t find yourself in the same continent when you start building cities if you didn’t spent the same amount of time evolving.

It would have been cool, but ocean patches don’t have anything to do with currents.

Abyssopelagic, bathypelagic, mesopelagic, epipelagic and coastal patches differ by depth. For “different” regions in the same depth, we can call each biogeographic realm a different patch. They differ by climate and whether the ocean surface has sand or rock. And they only exist for shallow waters.

So something like the North America colliding with South America and seperating the tropical region of the Atlantic from the Pacific causes the species in the different sides to diverge, but unlike a land, an ocean current can’t restrict the spread of a sessile species that is adapted to a certain climate and create different realms.


  1. because that’s when the rivers slow down and stop eroding the land ↩︎

We would certainly want to have movements in the landmasses over time, but it would be best to avoid unnecessary complexity. There are some ways it could be done, though. For instance, using the height map created via Perlin noise, we could have regions marked as distinct land masses, perhaps by colouration. Then, every so often, we could have the height map altered by moving each region in a random direction, and overlaying the results. It would probably be a good idea to then have some erosion of the results. The Coding Adventures video you linked to is really good, but we’d need a much more efficient way of doing it.

The comment about the invariable planet orbit speed is quite right. If the average speed of the planet is higher, it will simply be orbiting further away from the star. We could have elliptical orbits, but these wouldn’t be necessary, and would be something that mainly affects the space stage.

I don’t think I described a complexity that is unnecessary, if realism is one of the goals of the game. The way the shape of the land changes depends on the collision of tectonic plates and erosion. We can add volcanism and meteor impacts to that list.

What does perlin noise represent? The changes in land shapes that happened before the game started to simulate them? Does the simulation start a very long time after the planet first forms?

That is true. There needs to be a code that says how the elevation map changes after a certain amount of time, depending on the slope, and this code should replicate the results of the raindrop simulation. But I don’t know how that can be done.

The noise texture is basically a simple way of simulating terrain that’s already been shaped by planetary and cosmic forces. On Earth’s timescale, it would be from at least the 500-million-year mark (just before the first life develops). But, unless the player would have a view of the whole planet as it develops, there would be no reason to simulate the terrain immediately on the game starting. It would be unnecessary for the game to include such a planetary view, until the player’s species has spread across the world. If lifeforms can’t go onto land yet (and the player can’t view the whole planet yet), there’s no need to fully simulate the terrain on the land -it would just be wasting processing power and game time. A more basic simulation of land movements would be sufficient for the earlier stages, and then simulation of the terrain under sea, then at the coast, before covering the whole planet. Any areas without full terrain simulation could still have continental movements simulated.

As for plate tectonics and meteors, I think this would mostly be unnecessary for the game. Thrive aims at being a realistic simulation of the evolution of life. This would inevitably involve a lot of factors such as continental drift (with the number, size and spacing of continents shaping the chemicals in the sea at different points, and whether species become isolated from each other). However, simulating the shaping, wobbling and interaction of tectonic plates is a whole level of complexity that would:

  1. require a whole load more time to develop,
  2. take a lot more time to process, while the player sits and waits, and
  3. make no actual difference to the gameplay once the loading has finished.

It would be something that’s nice to look at, and could be educational, but I think it’s a whole other simulation in itself.

As for meteors: having them simulated as a planet shaping force in general would probably not get into the game, for the same reasons. Having them as random events, though, would be great. And as the project develops further, I’m sure a lot of people will want to have mass-extinction events. It would be unrealistic for the evolution of life to not have any such things. I know there’s been talk of putting the Great Oxygenation Event into the game - which would be a mass extinction caused by life itself. Having a massive meteor hit the planet occasionally, with a huge impact on what life can survive would be a great addition. I’m not sure how this should affect gameplay, but it’ll be worked on in future. Also, having smaller meteors occasionally drop in near the player would be cool. If Lawk is turned off, they could even have new microscopic lifeforms in them!

With volcacoes, it’s pretty much the same as for meteors. Simulation the heat and pressure of liquid rock across the planet would be another burden on game devs, and on the player’s patience, But, volcanoes popping up sometimes - brilliant. Games generally have to cut corners for a lot of things, such as having the emergence of a volcano be isolated from anything else going on, rather than have multiple extra algorithms constantly running to determine the emergence and activity of volcanoes across the globe.

tl;dr: We can’t fully simulate everything. Continental drift, volcanoes, meteors, etc. will probably go into the game only as much as necessary.

It is also possible to simulate the geography beforehand and load the changed versions of the planet

Yes, that might be doable, if most areas of land stay the same shape while continents are moving.

Do you suggest generating planets by adding different continents from the thrivepedia?

Hello everyone, necro time!

I’ve been gone for quite some time, but now it’s time for my return. Recently I have been working on the planet generation. To be more specific, I plan to generate everything from the solar system to the climates. I’ve talked to @HyperbolicHadron to make sure we are on the same page and to make sure what I’ll be doing might actually help.

The prototype is currently written as a web app in NodeJS and if the devs decide to use it, it will need to be translated or serve just as a theoretical guide during the implementation.

I currently have a working prototype generating stars, both main sequence and post main sequence, though the post-MS part still needs a bit of love. Right now, it takes initial mass and age as input values and produces a list of properties based on the input, along with a little visual showing the star and a black body radiation graph showing the peak wavelength.

I am currently finalizing planets and orbits, though I will need to come back to them later. Luckily, I am trying my best to make to prototype modular.

After that, I will try to create a placeholder for the terrain generation, inspired by what Hadron has been doing and then finally I can start modelling the climate.

If anyone would like, I can post an explanation of how everything is created, e.g. the star creation, or possibly I could try to make the code public, e.g. by setting up a public repo.

9 Likes

I recall there already was a website with a planet generator for thrive set up sometime ago…

1 Like

Here is a bit of what we have discussed:

This is the way I see the Universe Generation System Structured:
The Generators are arranged in a hierarchy where the output of one generator is the input of the next generator.

  1. Galaxy Generator: The galaxy generator determines the galaxy that a game is within. The Galaxy is generated with a specific number of stars and planets in it which are then distributed across the galaxy. The galaxy will represent each individual star system in the galaxy as a collection of abstract data which will be converted into a specific Star System in the Star System Generator. This data would be something like: 1 Red Giant Star, 2 Class M Planets.
  2. Star System Generator: This will generate a specific star system based on the parameters given to it by the galaxy generator. These parameters given are fairly abstract, so the Star System Generator has a lot of leeway in the actual result. For example, the Universe Generator might say that this Star System has 2 Class M Worlds, but the star system generator could determine where they are and decide if they are moons or planets, and what their actual size and specifications are. The specific specifications of each planet is then passed onto the World Generator.
  3. World Generator: This generates a specific World based on the parameters given to it by the Star System Generator.

We could even add a toplevel universe generator that creates a number of different galaxies in the universe, but I don’t think we need to worry about that right now.

And for the Worlds themselves:
There are two scales that a World has: Grand Scale and Local Scale

The Grand Scale is the scale at which the large features such as continents, oceans, mountain ranges are generated. This is also where the climate simulations and biome partitioning is done. The simulation can use global data here in its calculations, as the entire Grand Scale is generated at a specific resolution across the entire World, such as 1kmx1km samples.
This would result in something like this being generated for the Grand Scale: This is an example of 1024x512 image of Earth Heightmap

In the actual World Generator, the data is stored as a number of square planes. In the current prototype it uses 6 square planes in a cubemap, this is what one plane looks like on the world: (One plane had the continent partitioner run on it, which looks different than the other 5 planes on the world)

In the code, the representation of a plane is fairly simple, it is just a 2D array of values. Each element in the array is associated with a specific coordinate on the planet in 3D space; and this coordinate can be easily converted into latitude and longitude if needed. For example, the heightmap is just a 2D array of floats, and each float is the height of the Terrain above sea level.

The Local Scale is where fine details are added onto the world, and it uses a quadtree structure on each plane to subdivide it into smaller chunks.
The local scale chunks will use the simulated climate and other data created on the Grand scale, and just interpolate the data or add small amounts of detail. It would be far more complex, and probably unnecessary, to run the full climate simulation on small chunks of the world, so just using the global Grand Scale calculations seems to be the best idea.

5 Likes

I don’t think we’ll need this EVER.

2 Likes

Need? Probably not, but once the galaxy generator is set up creating multiple instances of it should be fairly simple. Just like once I had the prototype world generator start to work it was simple to extend it to generate multiple worlds. I think we would want to be able to generate multiple galaxies at least for cosmetically applying them to the skybox.

This did make me think of the rationale for why the game would be limited to a single galaxy when the distance between galaxies is usually only about one order of magnitude larger than the diameter of a galaxy. I thought of one idea:
FTL travel requires a ‘medium’ to travel through which does not exist in the void between galaxies. Perhaps that ‘medium’ could be dark matter in galaxies. Or it might require moving through a gravitational field, which is strong enough between stars in a galaxy but not between galaxies themselves. Thus you would be limited to slower than light travel, which would be easy to disallow to locations too distant.

This idea also has the benefit of perhaps being applicable to creating a separation between a star cluster and its parent galaxy. Thus if we need to limit gameplay to a star cluster on the order of only hundreds or thousands of stars, then we can still have it be realistically a part of a galaxy while blocking travel between them.

1 Like

Would players be able to travel to satellite galaxies of their galaxy, like the magellanic clouds?

1 Like

I think that if you can support travelling to satellite galaxies, then you might as well go all the way and open up the rest of the universes galaxies, or at least perhaps a galaxy cluster’s worth.

As I talked about here in How Big Should Space Be, I think that our solution for generating large scale features at a wide range of scales should be applicable to all levels of the universe. For the world generator it would be impractical to generate the entire world at the full resolution you need when at ground level (It requires Gigabytes of data just to store the Earth at kilometer-scale), so it needs to be generated at different resolutions depending on how relevant it is to the player/observable by the camera. This is the same on the star system scale, you don’t need to generate every moon around a gas giant until it is needed (later in the game). It is the same on the scale of a single galaxy, as you need to generate all of the stars visible from the starting planet to create the skybox at least, but that would only be a couple hundred or thousand visible from the planet compared to the billions of stars that a full galaxy would have. And so, that system would easily extend to dealing with multiple galaxies as well. If we are able to manage all of the other scales, then doing the universe-scale shouldn’t be a huge difference to what we have to do in the other scales.

1 Like

How heavy should a complete playthrough file even be?

I think the best comparison would be with a Minecraft World. A ‘Complete’ playthrough of Minecraft can have very different file sizes of the World based on how much you choose to explore. A Minecraft World might be around 10MB on the low end, 100MB on the medium end, and 1GB on the large end. It could get way bigger than that as well, but that requires a focused effort to explore vast regions. And similarly to Thrive, it should only need to grow the saved file size if the player is choosing to explore and expand, so it only takes up the space proportional to the amount of time the player spends on it.

The world saves likely won’t need to save minute world changes of the chunks between editor sessions, so there shouldn’t need to be much data saved in the Macroscopic and Aware stages. The game saves requiring larger amounts of persistent terrain to be saved instead of just regenerated would only likely need to start in the Awakening stage, so we have a while until players would encounter that on a non-experimental way.

3 Likes

Hm. Well Thrive has the potential to generate quite the heavy savefiles considering the scale of things in the later stages…

1 Like

I have a better suggestion: until someone can make a realistically sized galaxy in Thrive, we are good with a single galaxy as multiple would be pointless in terms of game size as they’d just require making the galaxy smaller.

3 Likes

By the way, how complex are we planning to make the galaxies again? Since generating a realistic galaxy like Milky Way is completely unviable.

Alright, I’ll take that challenge.

Turns out it really didn’t take much effort to turn the world generator into a (really basic) galaxy generator. Right now it just uses a galaxy image to generate the density distribution of stars. (NGC 1300 here)

The galaxy generator is currently generating a 17B star equivalent galaxy, which is a bit less than the Large Magellanic Cloud has. Of Course, it only needs to generate the relevant stars visible from the starting planet, so there are only ~10K stars generated directly. (The dim local stars, and the distant bright stars. The points visible on the grandest scale of the galaxy would really be globular clusters, not individual stars.)

4 Likes