Simulating weather
Ok, so this is a technical post, but not a programming one, so in this forum it goes.
In my MUD (multi user dungeon) I''m programming, I am trying to get a decent simulation of the weather going. This is for 2 reasons: firstly, to make the world seem more diverse and believable. Changing weather patterns help someone to really feel that the environment is not static. Secondly, it provides a few extra challenges for the players. They can''t see into adjacent rooms when it''s foggy. The temperature rises in the sunlight and drops at night, affecting the character''s choice of clothing and whatever.
I have a reasonably good system at the moment, but it''s not very realistic, and I''d like to improve it. In particular, something I''d like to be able to do is have a deterministic system so that players can predict the weather using magic.
My current plan is to use a sine wave representing the annual weather pattern (the peak in Summer, the trough in Winter), another smaller sine wave daily (peak in mid-afternoon, trough in the middle of the night), and probably another couple of sine waves at other intervals to give a ''random'' variation over time. The product of these waves can give me a temperature. But it doesn''t account for wind speed, direction, the amount of precipitation, storms, or other weather phenomena (hurricanes, tornados, etc).
Does anyone have any ideas on how to implement a fairly realistic (or at least believable) system? Or have any links to sites online that give example data for temperatures, rainfall patterns, weather patterns, storm conditions, and so on? Suggestions for a better system than just multiplying a few sine waves together, that still allows for somewhat deterministic weather that flows smoothly from one day to the next? Any opinions on weather issues that would make good gameplay factors in a text-based persistent environment?
I can''t think of any ways you could accurately simulate weather, but you could use it as a balancing agent for magic.
For instance, if people hadn''t been using fire magic much, the temperature would begin to fall, making fire magic more effective and even necessary for survival. If wind magic was overused, you''d get cyclones and hurricanes ripping the land apart, and so on.
As for magic users predicting the weather, you could just let them ''peek'' at the levels of magic use, to have a rough idea of what weather was likely to show up.
For instance, if people hadn''t been using fire magic much, the temperature would begin to fall, making fire magic more effective and even necessary for survival. If wind magic was overused, you''d get cyclones and hurricanes ripping the land apart, and so on.
As for magic users predicting the weather, you could just let them ''peek'' at the levels of magic use, to have a rough idea of what weather was likely to show up.
How about using the sine waves you described along with a "random" element thrown in by digits of pi? I don''t know if it would work (you''d have to figure out how to continuously calculate pi efficiently), but it would seem random and actually be deterministic. Of course, if you just want a random number you can get again, seed a random number generator with, say, (some encoding of) the date and time in the game; that''s deterministic, right? Of course, doing it with pi makes for better cocktail party conversation.
Then based on the sine waves for seasons and days you could decide what the different ranges of "random numbers" mean what; i.e. (I guess you could research weather patterns to see what''s more likely to happen in different seasons at different times of the day, but for example) you could have 1-4 mean rain in the spring... I don''t know, my point is, I think it''s fairly easy to produce a random number which you can reproduce later or predict in advance, if that helps at all.
Then based on the sine waves for seasons and days you could decide what the different ranges of "random numbers" mean what; i.e. (I guess you could research weather patterns to see what''s more likely to happen in different seasons at different times of the day, but for example) you could have 1-4 mean rain in the spring... I don''t know, my point is, I think it''s fairly easy to produce a random number which you can reproduce later or predict in advance, if that helps at all.
I cant really coment on the subject but the MUD i used to play (and still occasionally do),
although not really contaiing temerature, climate or much weather at all, did have a believable sense of weather,
occasionally it rained, it got dark and some other things like that.
Though it probably wot help you make you weather system the game ight enspire you in other wayts. (After all it is the only mud ive played that was actually good.)
Heres the site: www.threshold-rpg.com
Shouldn''t weather also depend n where you are? ie the farther north you are the colder it is.
i like the idea of extensive magic affecting what theweather wouldb like, you should definatly add that in some form or another.
although not really contaiing temerature, climate or much weather at all, did have a believable sense of weather,
occasionally it rained, it got dark and some other things like that.
Though it probably wot help you make you weather system the game ight enspire you in other wayts. (After all it is the only mud ive played that was actually good.)
Heres the site: www.threshold-rpg.com
Shouldn''t weather also depend n where you are? ie the farther north you are the colder it is.
i like the idea of extensive magic affecting what theweather wouldb like, you should definatly add that in some form or another.
"Though i walk through the valley of the shadow of death, iwill fear no evil, for i am the meanest motherfucker in the valley."
Hi there!
Interesting question concerning weather.
I worked out something a while ago - so here''s what I did:
I used a finite state machine. That means weather has a state, ie. it''s either raining or snowing or sunny...Then i had the transitions from one state to another. To some of these transitions I assigned probability percentages. This system is kinda turn-based and in each new turn there''s a probability that the weather changes - based on the probability.
Example
I assigned SUNNY->RAINY a percentage of 20% probability. SUNNY-THUNDERSTORM was 1%.
It sometimes happens that it''s sunny and then it starts to rain (usually when you want to wash your car). And there''s a slim chances that the sun is shining and the next thing you know is there''s a thunderstorm.
This model is fairly simplistic and meteorologically speaking total grabage, but it does some decent "weather forecasting" and is fairly easy to implement. Of course you can refine it and add more detail or combine it with other systems if you wish to.
Juz my 0.02 €...
- Sleepwalker
Interesting question concerning weather.
I worked out something a while ago - so here''s what I did:
I used a finite state machine. That means weather has a state, ie. it''s either raining or snowing or sunny...Then i had the transitions from one state to another. To some of these transitions I assigned probability percentages. This system is kinda turn-based and in each new turn there''s a probability that the weather changes - based on the probability.
Example
I assigned SUNNY->RAINY a percentage of 20% probability. SUNNY-THUNDERSTORM was 1%.
It sometimes happens that it''s sunny and then it starts to rain (usually when you want to wash your car). And there''s a slim chances that the sun is shining and the next thing you know is there''s a thunderstorm.
This model is fairly simplistic and meteorologically speaking total grabage, but it does some decent "weather forecasting" and is fairly easy to implement. Of course you can refine it and add more detail or combine it with other systems if you wish to.
Juz my 0.02 €...
- Sleepwalker
- Sleepwalker
I had a similiar problem once and I solved it by actual using the real weather. I got the data for my weather simulation from a website and just parsed it in. An easy approach but very complex weather patterns indeed. It had the funny side effect that the people living in the part of the world where I got my weather data from had the same weather RL and in my game.
Humanity's first sin was faith; the first virtue was doubt
Kylotan, expanding on your original idea, why not use the randomness in determining the amplitude of the sine waves? That way you can get off-peak weather that suddenly becomes a storm. It''s just a simple idea on factoring in random figures with your current set up. If you give it a run, let me know how it turns out, i''d be interested in trying to improve upon it further.
J
J
Here's some tips:
Your daily troughs and peaks should be moved ahead a few hours. The warmest time of day is not mid-day, but a little later. Likewise for the coldest, it is probably more around 4:00 AM.
Also, your troughs and peaks should be lowered according to altitude. And they should also be lowered according to latitude.
As for humidity, this occurs in warmer climates near the coast. The further inland one goes, the more arid the climate becomes. This will affect rainfall.
Additionally, mountain ranges act as rain shaodows for inland valleys. In other words, the mountains catch all the rain before it has a chance to move inland, thus adding to the aridity of more inland areas.
Coastal areas also tend to be a little cooler and temperate (the sine wave becomes more flat) because air blowing across the ocean is moderated in temperature by the ocean which retains heat or cold. The oceans do not heat or cool as fast.
Moutnains are often low pressure zones and attract bad weather. You can count on it. Bad weather moves from high pressure zones to low pressure zones simply because the air flows from the high pressure zone to the low pressure zone bringing in a new mixture of weather elements. Thunderstorms are often common in mountain areas even when the neighboring low areas are temperate and dry.
Dangers of weather are hypothermia, frostbite, heatstroke, flooding, and lightning strike, among others.
Edited by - bishop_pass on September 3, 2001 4:45:01 AM
Your daily troughs and peaks should be moved ahead a few hours. The warmest time of day is not mid-day, but a little later. Likewise for the coldest, it is probably more around 4:00 AM.
Also, your troughs and peaks should be lowered according to altitude. And they should also be lowered according to latitude.
As for humidity, this occurs in warmer climates near the coast. The further inland one goes, the more arid the climate becomes. This will affect rainfall.
Additionally, mountain ranges act as rain shaodows for inland valleys. In other words, the mountains catch all the rain before it has a chance to move inland, thus adding to the aridity of more inland areas.
Coastal areas also tend to be a little cooler and temperate (the sine wave becomes more flat) because air blowing across the ocean is moderated in temperature by the ocean which retains heat or cold. The oceans do not heat or cool as fast.
Moutnains are often low pressure zones and attract bad weather. You can count on it. Bad weather moves from high pressure zones to low pressure zones simply because the air flows from the high pressure zone to the low pressure zone bringing in a new mixture of weather elements. Thunderstorms are often common in mountain areas even when the neighboring low areas are temperate and dry.
Dangers of weather are hypothermia, frostbite, heatstroke, flooding, and lightning strike, among others.
Edited by - bishop_pass on September 3, 2001 4:45:01 AM
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
I think this idea is really cool. The question really becomes one of scale and the level of complexity that you want to go to. Even serious meterologists with all their computing powere can only roughly model the 100 million billion tonnes of air that gives us our weather... and take a wild guess at the effect of ocean current etc and their effects.
Some good posts here as well, I love the idea about using magic as a means of controlling the weather and linking it into existing web sites etc could be amazing, but you lose your determinism pretty quickly.
I think you are onto a fairly good model from what you have said so far with your sine waves creating cyclical effects. AS well as that you can factor in the lattitude to make it more hot or cold and distance from coastlines maybe.
I would split your play area up into segments sort of like a cellular automaton which you then apply rules to and take into consideration the effects of the adjacent cells to generate the weather. Then, you scale the number of cells you have depending on the processing power you can generate, obviously the more you have, the more interesting it will be and the more local effects that will be emergent.
-- That''s my $0.02 worth --
Hang on, where I come from, $0.02 is rounded down. Does that mean my opinion is worthless or priceless?
CHROM
Some good posts here as well, I love the idea about using magic as a means of controlling the weather and linking it into existing web sites etc could be amazing, but you lose your determinism pretty quickly.
I think you are onto a fairly good model from what you have said so far with your sine waves creating cyclical effects. AS well as that you can factor in the lattitude to make it more hot or cold and distance from coastlines maybe.
I would split your play area up into segments sort of like a cellular automaton which you then apply rules to and take into consideration the effects of the adjacent cells to generate the weather. Then, you scale the number of cells you have depending on the processing power you can generate, obviously the more you have, the more interesting it will be and the more local effects that will be emergent.
-- That''s my $0.02 worth --
Hang on, where I come from, $0.02 is rounded down. Does that mean my opinion is worthless or priceless?
CHROM
-- That's my $0.02 worth --
Hang on, where I come from, $0.02 is rounded down. Does that mean my opinion is worthless or priceless?
CHROM
Hang on, where I come from, $0.02 is rounded down. Does that mean my opinion is worthless or priceless?
CHROM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement