# Designing a weather system for biomes in a roguelike

I'm making a roguelike game similar to dwarf fortress. So far, I have an average temperature map and average yearly precipitation map generated with simplex noise. Now, I'm trying to implement a weather system that seems realistic, as in it rains more often in biomes with higher precipitation rates, but still seems coherent.

Some of my thoughts on designing this system would be to have a weather object for each individual biome, and every time it rains (and the startup) it picks the next time it will rain based on the biomes precipitation rate.

One problem with this approach is that it would always rain within the exact edges of a biome, and I don't think it would look very realistic.

Another option could be to have cloud objects move around the map, and have them pick up water while in biomes with high precipitation rates, and when reaching the max, they rain.

This seems like a good approach to me that could be very realistic, I would just have no idea how to program the movement for the clouds.

Any thoughts on a better approach or how to implement either of these to make them work?

[It may be worth noting that I have never played dwarf fortress]

Both approach seem relevant. Also usually in games the most complex part about weather systems is often the equation behind it. As you seem to already know when it has to rain you seem to have done the most of the job.

Even if both approach are OK I prefer the second one which brings, to me, more coherency with a global world.

It seems you simply need a vector for clouds direction and a value for their speed. The idea there is to move the cloud in the direction indicated by the vector every turn (I think dwarf fortress is a turn based game). If the cloud shape is big enough you will have the illusion of long period of rain alternating with sunny ones.

However, as I see it, it would be a binary rain system : it rains or it doesn't. As you seem to want some "realistic" system, I would suggest to add another property to the clouds which would represent the epicenter radius of the rain. According to this value, you will be able to change the intensity (surely described with a color gradient) of the rain.

edit: also note that if you like your clouds to a specific biome, you can play with the intensity value when they reach a biome frontier then you won't have the "no rain to full storm in the next cell" effect.

For reality purpose you need to have various sizes and shapes for them.

I hope it helps.

tl;dr

I really think this holds minor value to a game (and sounds like a bike-shed problem), if the actual gameplay is not robust and appealing already, nobody will care what the level of realism of the rain is and if the gameplay is good, again, no one will notice the level of realism involved in the rain mechanic. For now, randomizing c for chance, (x, y) for position and i for intesity values and simply raining here and there, perhaps increasing the amount of rain during the winter seasons is quite sufficient.

Long version:

You could randomize a map with a voronoi diagram, picking rainy areas and arid ones. Then steal some precipitation statistics graph and mimic them with the rain in your game (i.e x rain during the winter and y rain during spring).

The cloud idea seems superior to me, though it would probably be more CPU-intensive. You'd have to simulate (or approximate) even more variables to make this work, though - the clouds move with wind and atmospheric pressure, temperature, etc..

If you wanted to do the other idea, you could make a transitional area around the biome with a randomly interpolated amount of precipitation between one biome and the other, i.e., if it's raining in biome A, and drizzling in biome B, as you move from B to A add arbitrary small amounts of precipitation until it reaches the value in A and vice versa for the other direction.