How to approach procedural planets

I think the main problem will be figuring out what formula to use, which is pretty hard even now without the calculus. However, I’m not sure that we’ll actually have to use it. I’ve been thinking about the formula for the latitude for quite a while, but the tj’s proposal is the best we have so far.

1 Like

You don’t need to code to contribute, you seem capable enough to join the theory team. (Though I am not the expert on this ofc)

Also, could it be possible to just calculate currents/cloud movements/etc. with a couple (relatively simple) flow simulations? This seems a tad easier than creating an algorithm that complex for the sole purpose of calculating the average temperatures.

2 Likes
In fact, in the theory team, you need to code a bit, but with scripts (e.g. python). But with the prototype, it seems more like a C++ program.

P.S.: This prototype.

1 Like

I do not think I am knowledgeable enough for that, I just love to learn new stuff and I love problem solving. Plus my time management is w h a c k and I would feel guilty if I had not contributed in a long time, being just an eager fan is much less commitment and responsibility.

And I am not 100 % certain, but I think that fluid simulations (which use a lot of ugly, ugly math) require much more computing power, as opposed to some sort of an equation and a few “if” statements. But maybe I am wrong and it would be much better approach, but I’m not sure.

I love that prototype. And yes, you should be able to code a bit in order to be able to prototype your theories and such.

1 Like

But again, what’s the matter with calculus?

It’s a bit less intuitive. Not so much differential as integral. I don’t like integral calculus. Don’t get me wrong, it’s a beautiful piece of math that is incredibly useful, it’s just that I struggle with coming up with the formula even without it.

1 Like

Good question. The current goal is if I have an average temperature for the planet, say 14c or whatever and I have a list of patches with lat, long and depth then what temperature should those patches be?

And what I’m thinking of doing with that so far is if a patch is on the surface and it’s below 0c then it becomes an ice shelf. So I guess for now depth doesn’t matter so much, if it’s more than 100m or something then for now the temperature won’t matter.

Ok so one point about how to model stuff in general. It’s a good idea to start with the simplest possible thing, get that working, understand it and then increase the complexity over time.

For example we could just say every patch is equal to the average planet temperature. So either all surface patches are frozen or none of them are. And that’s pretty wrong, but not totally insane. For a very hot planet or an iceball planet all the right patches will be frozen or not frozen, however for ones inbetween it will be kind of wrong.

And then we could say maybe the temperature just decreases linearly towards the poles or something. Which again makes the approximation better, it’s less wrong, however we’re having to work harder with more complexity to get it better.

So the question you have as the modeler is how far do you want to go? You could build a model of an entire planet and run a fluid dynamics simulation across it equal in complexity and detail to that of a national weather forecasting agency. That is even less wrong, however it’s hard to do.

Do you see what I mean? How much detail to put in is ultimately up to you and how much you care about being wrong.

1 Like

In that case I think we can use the cos function for the latitude. However I think that we still should consider the currents (atmospheric and oceanic) at least a bit. That, however, does not mean we should do fluid simulations. My entire idea behind this is not using fluid simulations. I think that the atmosphere model is as easy as I could make it - you throw in the speed and direction of rotation of the planet and you get the preset borders of the cells and the direction of the wind there (just as a variable, not actually simulating them).
As for the simplification of the currents, the only thing I can think of is placing “squares made of vectors” from the equator to the 1/4 or 1/2 of the next atmospheric cell (again, than would be still stored just as a variable). Then just as a rule of thumb, vectors pointing towards the equator are cold, vectors pointing towards the poles are warm.
If that is still too much, I guess the cosine function will be enough for now, but in the future we will need much more. As for the decline of temperature with depth, here on wiki there are two really neat graphs depicting the temperature change with increasing depth.

1 Like

Each time you evolve twice, the randomization happens again except for things like temperature, star size, rotation, etc. That way you will see only slight changes each million years? Maybe work on it in a later update.

1 Like

Why would the properties be randomized? That doesn’t make sense to me. In the real world stars don’t just randomly change properties. We know a lot about how stars change over time:

3 Likes

What would be getting randomised then? The temperature is determined by the star flux (therefore more or less by the star size), the distance of the planet from the star, the reflectivity of the planet and so on. So in order to have the temperature not changing, these things would have to stay the same as well. Local temperature is then determined by amplitude, latitude, axial tilt and boides of water. Rotation determines all of the air and ocean circulations, which determine things like humidity.
One thing that would be a great step when making the environment dynamic over long periods of time would be plate tectonics, which would change quite a lot and would be something wonderful to have in the game, but I doubt that anyone sane would even consider programming plate tectonics.

I didn’t really mean randomized as in change with no knowing of prediction, but changing over every 2 evolutions over strict rules refined by what happened last generation.

Still, what would be getting “non-randomly randomized”? And based on what rules? I’m afraid I need a bit more elaboration to understand.

2 Likes

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?