How to approach procedural planets

Okay, so I struggled quite a bit with the latitude question and I decided to take it a few steps back and have some concrete answers for the previous steps in order to have something to build upon. So here it is, the atmosphere vol. 2 and ocean currents. I will try my best to keep it brief. The reason why these two topics are important is

Atmosphere

First, let’s take a look at the Earth and I will try my best to explain why it looks how it looks and how would it look under different conditions. Here is a pic for reference so you can check anytime I mention something. Also, the wind I will be talking about is the “lower layer” of it. We don’t really care about the wind above that one.
Air-circulation-pattern

What do we see?
  1. There are three cells per hemisphere.
  • Cause - the speed of the rotation around the axis.
  1. The direction of the wind (0°-30° east to west equatorward, 30°-60° poleward, 60°-90° east to west equatorward)
  • Cause - The direction of the Earth’s rotation around it’s axis (counterclockwise)
Non-Earth-like conditions

The number of cells
Here is a rough table for different speeds of rotation

  • Rotation speed 1/2, 1/4, 1/8 or 1/16 that of Earth
    1 cell/hemisphere
    Borders of the cells = 0°, 90°
  • Rotation speed 1-2x that of the Earth
    3 cells/hemisphere
    Borders of the cells = 0°, 30°, 60°, 90°
  • Rotation speed 4x that of the Earth
    7 cells/hemisphere
    Borders of the cells = 0°, 24°, 27°, 31°, 41°, 58°, 71°, 90°
  • Rotation speed 8x that of the Earth
    5 cells/hemisphere
    Borders of the cells = 0°, 23°, 30°, 47°, 56°, 90°

The direction of the winds

  1. Equatorward/Poleward
    This does not change and will apply for every (?) planet - The cell closest to the equator is equatorward (the wind travels towards the equator), the second closest is poleward, the third one is equatorward. You get it, an alternating pattern, always starting equatorward on the equator, altering towards the poles.
  2. East/West direction
    The east-west/west-east flow of air also has an alternating pattern. If the planet is rotating counterclockwise (Earth), the cell closest to the equator will blow from east to west, the second one west to east and so on. If the planet rotates clockwise, however, the directions will be flipped, with the cell closest to the equator blowing from west to east.
Why do we need to know this

Humidity

  1. Where hot air raises (where the arrows “meet”), there’s lower pressure = higher precipitation and where cold air sinks (where the arrows diverge), there’s higher pressure = lower precipitation
  2. Where wind blows from ocean to land, it carries water vapor = higher precipitation
  3. Where there’s a mountain range “blocking” the general direction of the wind, the leeward side of the mountain will get close to no precipitation, the windward will get much more precipitation

Ocean currents

Some questions to ponder:
Why exactly are the borders or the cells where they are? Sure, it’s because angular momentum and such, but how can we calculate for them (even though this template is more or less enough).
How exactly does the rotation affect the number of the cells and why is there the irregularity with the 4x rotation of the Earth?

Ocean currents

I wasn’t really able to explain it better, I’m sorry. If anything was unclear, don’t be afraid to ask or check out my sources. Here is another pic for reference.

How to create an ocean current
  1. Create two currents (neutral) on each side of the equator flowing a) east to west with counterclockwise rotating planets b) west to east with clockwise rotating planets
  2. Once they hit a continental shelf (land, basically), split them into two - a poleward one (warm) and a equatorward one (neutral)
  3. The equatorward ones create equatorial counter-current, which, once it hits another continental shelf splits into two poleward ones looping back into the first two initial currents.
  4. The warm poleward current advances in the poleward direction until it crosses the border of the atmospheric circulation cell (mentioned in the chapter above), where circa in the quarter of the cell it becomes neutral again and starts moving east (for counterclockwise planets), until it hits another landmass. There it splits into a equatorward current (cold) and a poleward current (warm) (or neutral in case of closing the loop).
  5. Repeat until all the currents are closed.
Why do we need to know this

The warm/cold currents often run along the shore and affect it dramatically. This is how:

  • Cold currents = cold water = colder air = less evaporation = less humidity
  • Warm currents = the exact opposite
Sources

https://en.wikipedia.org/wiki/Atmospheric_circulation
https://en.wikipedia.org/wiki/Ocean_current
https://www.youtube.com/watch?v=LifRswfCxFU
https://www.youtube.com/watch?v=n_E9UShtyY8
A lot more sites, videos and blogs that are probably forever lost to my searching
A world atlas
And much more

Also, @tjwhale, I think you might be interested in these links. I myself might not have a use for them right now, but judging by the code you have written on planet generation, I bet they might come in handy!

Links for TJ

http://www.astronomynotes.com/solarsys/s3c.htm
http://www.am.ub.edu/~jmiralda/fsgw/lect1.html
https://www.visionlearning.com/en/library/Earth-Science/6/Factors-that-Control-Earths-Temperature/234

In my opinion best to worst top to bottom, but all are great!

Thank you all for sitting though another episode of “Zahyyy rambles unstoppably about geography at almost 4 AM”, I appreciate it. :slightly_smiling_face: If anyone had any questions, don’t be afraid to ask!
Edit: Also, trust me. I tried my best to keep it brief.

4 Likes

I think, that is the biggest theoretical contribution, i’ve ever seen. How old are you? If not secret, of course)

2 Likes

Thank you! :slightly_smiling_face: And it is not a secret; I am 20 years old and I just think that procedural planet generation deserves a lot of love because, well, 90 % of the game will take place on your planet and I think that the planet should be as realistic and as beautiful as possible. I think that the place where the hefty majority of the game takes place should have a great atmosphere (pun not intended) and give you a reason to explore. But before making fancy texturing and such, you need the planet itself to be beautiful. And that is what I’m trying to accomplish here. Thank you one more time.

4 Likes

Yeah nice stuff. I think at first it’s ok to leave out air and ocean currents however they would be a nice thing to add in eventually, especially for things like rain shadows creating deserts behind mountains.

So it’s enough to just have the temperature decrease with latitude. However with these currents there is a nicer approximation :slight_smile:

Good stuff.

2 Likes

I predict that @Zahyyy will become a developer! :wink:

2 Likes

Well, they affect the climate quite a lot. They are the reason why there are things like rainforests instead of deserts, deserts within temperate zones and basically the entire biome layout is dependent on them.
This brings out an important question as to what is our primary goal right now. What is going to be our first use for this system? What is going to be the second one? And so on. Because even for the procedural patch map they are quite important - they determine what parts of the ocean will be warm and which are going to be cold. Which then affects how the organisms develop in those parts. We can ditch land for now, but I think that the atmospheric circulation, ocean currents AND THAT GODDAMN LATITUDE are quite crucial for us, whatever our current goal (pun not intended) is. The question still stands - what is our current goal?

I think that (‑25)+​50​cos(​x​π/​180) as you proposed might be enough as a basic placeholder, until we figure out a better way to do it (which might take a long time). Perhaps the “-25” and “50” might be variables based on the top temperature and the speed of it’s decline if that’s something that might change (which sounds like we might have to use calculus in the future, oh no). As for the second part “However with these currents there is a nicer approximation” I don’t quite understand what you mean. Is there a better way to approximate the currents? Or is the model with currents better for approximating the temperature? One more time thank you for the feedback! :slightly_smiling_face:

Haha, if I will, it will take a few more years. However, I’ve started studying on a uni focused on software engineering, so perhaps a few years of practice and I might be actually able to contribute. Either way, thank you, it’s flattering! :slightly_smiling_face:

2 Likes
What’s the problem with calculus? I’m currently learning calculus. and I haven’t had any problem so far…

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