The Weather Vortex of Despair
One of the major features that’s been in my mind about Itinerant since its inception is that in some way, the worlds within the Itinerant universe should be constantly evolving and changing. I feel that a big problem with procedurally-generated planets is that it’s hard to make them really seem ‘alive’; often they are just a collection of predetermined biomes that are scattered across a planet using noise functions. It all gets a bit repetitive after a while, and there isn’t necessarily much that changes from one place to another.
One way to stop this from happening in Itinerant would be to have a method of determining where vegetation should grow based on the surrounding conditions. I tried to break this down further by thinking I could set things up so you could plant trees in the ground and each tree would grow uniquely depending on local environmental factors.
It seemed a good place to start would be to try to simulate light and heat on a planet. I figured, if I can quickly calculate how much average light would fall on a specific point on the planet, plus what the surface temperature was, I could make a guess at how much vegetation would grow. Factor in a few other things like rainfall and ground type, and my biomes would start generating themselves in (hopefully) unique and dynamic ways not just from planet to planet, but that planets themselves could vary massively across their surfaces.
However, the more I thought about this, the more complex it got. You can fairly easily determine the average amount of sunlight a planet will get at any specific point on its surface if you know a few basic variables such as rotation speed, axial tilt, distance the planet is from its star and the output of the star. But of course, that’s only part of the story - how these factors interact with the atmosphere, and how the atmosphere interacts with the surrounding terrain is a far more daunting undertaking. Before you know it (as I’ve found out these past few weeks), you’re thinking about how you calculate air movements over an entire planet just to know what the surface temperature and air pressure is going to be on a single spot on the ground.
Since I’ve spent so much time building up the data formats, storage mediums, rendering mechanisms and building mechanics for the planets, I hadn’t given much thought about how I would turn these static environments into living, breathing worlds that slowly change over time. I knew I’d be able to do it somehow, and I genuinely thought I’d just be able to bolt a single environmental metric (such as surface temperature) into my model fairly easily, and then I’d slowly over time add more realism to it as I went along.
I got off to a good start - I understand that stars emit something we refer to as flux, which is a value of energy per m2 (W/m2), and that flux decreases over distance using the inverse square law. I also knew that you can pretty easily figure out how much of this flux actually hits the planet if you know the surface area of the planet itself (which can be determined from the radius).
You can take this further by factoring in the albedo of the planet, which can be used to determine how much energy is reflected back into space. Once you’re at that point, figuring out how much flux hits any particular point on the planet becomes fairly trivial - assuming the planet is roughly a sphere and taking a line through the center of the sphere out to a point on the surface, you can figure out the angle between that and the sun and know roughly how much flux will hit that point (eg, if the sun is directly overhead, 100% of the calculated flux will hit it. But as the sun moves to more oblique angles, less and less of the flux will heat the surfce).
I messed about with the formulae that govern these elements for quite a while, hoping I’d get a good idea of what the temperature might be at any point on a planet, and indeed I did get that, but it turned out it wasn’t really what I wanted. When you’re looking at flux values and not considering the atmosphere, you’re basically left with temperature values that are more like the planet Mercury - ridiculously high on the side facing the sun, and near to zero degrees Kelvin on the dark side.


Still, I was fairly happy with the output as shown in the above screenshots. At a first glance, it looked like I had a world with a cold north pole, a temperate zone, and then a higher heat zone as you head towards the equator. But actually, the hottest temperatures here were around -14 degrees Celcius, and the lowest temperatures were absolute zero. Factoring in for the greenhouse effect got me closer to 17 degrees Celcius at the hottest point. Since my planet is currenly modelled on the Earth and the Sun, this is obviously too low - even if I am in the right ball-park.
I kept thinking I just needed to retain some heat on the dark side, and not let the planet warm up so quickly on the light side, and I’d get some sort of temperate climate where vegetation can grow naturally. But I also wanted to do this using something leaning towards actual physics rather than hacking something together - my view is I want plants to spontaneously grow because the maths say it should, rather than me hacking it into appearing with some noise and elevation functions. I lost track of how many hours I spent trying to account for things like the specific heat capacity of the surface to slow the rate of temperature loss at night (this didn’t half get complicated - you have to know the mass of the material that’s losing heat, so I was trying to make estimates as to the mass of rock under the player’s feet that might be storing heat, plus the mass of the atmosphere above the player), trying to understand how the greenhouse effect helps trap heat in at night, factoring in the altitude at each spot on the planet… and then thinking, I probably also need to account for air movements as well - hot, higher pressure air will move towards lower pressure colder air, potentially distributing heat that way - suddenly I was now trying to simulate wind, all because I wanted to add a little graphic somewhere to say what the temperature was when you were standing on the planet.
Whatever I did, my planet with an atmosphere became a variety of temperatures on the light side (ranging from excruciatingly hot to not hot enough), and near to zero degrees Kelvin on the dark side and at the poles. I had a good base for planets and asteroids without an atmosphere, which will come in handy later, but I just wanted to know the surface temperature of the first procedural planet my system had spat out and try to figure out if my player was going to die or not.
I ended up spending hours and hours looking at this code, thinking I must be close to something but never quite getting there. I have to say I have started to feel somewhat dejected by this stage. It feels a lot like I’ve spent several years building a rendering and creation engine and I’m in danger of getting stumped by the survival mechanics - which I thought I’d be able to hook up pretty quickly. I know I could ‘fake’ it somehow, but I want the variety and unpredictability in my systems that can only come from something that’s more simulated on real physics.