Weather engine using a finite state machine
Hey guys,
I''m writing a generic game engine using OpenGL, and I need to know how I can incorporate a weather engine into it. I''ve seen one done before using a finite state machine, and I was wondering if people have done this sort of thing before. I''ve already coded a particle engine that produces realistic-looking rain and snow.
I guess some of the states would be:
Fine
Cloudy
Raining (+ Cloudy)
Lightning (+ Cloudy + Raining)
Snowing (+ Cloudy)
I suppose these states would be calculated based on the current state, a percentage chance of changing to each of the other states, and what time of year it was (ie. it wouldn''t be snowing in summer unless it was the polar regions or something)...
I already posted this in the AI section, but I thought I''d post here too...
Samah
"...the grave is no bar to my call..." - The Horn Of Valere
You might try Fuzzy State Machines. They are more suited to things that have "in between states" like weather... I don''t know much about them though, so I couldn''t really explain them. There is some stuff about them in Tricks of the Windows Game Programming Gurus, and I''m sure you can find some info on the net. (Fuzzy State Machine = FuSM)
Tropical ocean currents bring humidity from the coast inland. High mountains suck in the bad weather with low pressure zones. Mountain ranges inland from the coast get progressively less precipitation as they are farther inland because each one catches some and passes the rest on. Coldness is a function of altitude and latitude and season.
Consider just these factors:
Weather migrates from the high pressure zones to the low pressure zones, attempting to balance things out. Humidity is greater near the ocean. Arid areas also get precipitation, often in late summer in the form of afternoon thunderstorms. Deserts also get snow, (high deserts, that is) and arid (desert) environments do not retain the heat like moist environments.
Oh, so many things to think about. And you probably just wanted some rain on a city street.
Consider just these factors:
Weather migrates from the high pressure zones to the low pressure zones, attempting to balance things out. Humidity is greater near the ocean. Arid areas also get precipitation, often in late summer in the form of afternoon thunderstorms. Deserts also get snow, (high deserts, that is) and arid (desert) environments do not retain the heat like moist environments.
Oh, so many things to think about. And you probably just wanted some rain on a city street.
_______________________________
"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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement