Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Lord Einstien and Daryn Alsup's "Evolution": Weather Simulation

Author
Message
Daryn Alsup
15
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 25th Apr 2009 21:33 Edited at: 16th Jun 2009 09:16
Code(s) is To-Be-Posted

WIP: "Evolution" can be found here-

http://forum.thegamecreators.com/?m=forum_view&t=149174&b=8&p=0


Currently Lord Einstein and I are working on a simulation similar to that of Spore (but not so kiddy) and TESIV: Oblivion. We are currently developing two sections at a time. Lord Einstein is heading the life and creature editor section of the game- and I- the weather and atmospheric alterations area of the game. If you would like to see L.E.'s work in action just follow the link.

The W.E.-Sim or "Weather-Environment-Simulator" generates weather on the basis of

-The suns heat converted to radial and kinetic energy
-The planets many faces which reflect and absorb radiation/energy differently on the basis of color (Lord Einstein's method of diffused vertexes on the planet object)
-The amount of water
-The amount of wind (which is generated on the basis of planetary rotation and tilt of axis)
-The amount of oxygen produced by the number of plants/trees/vegetation (Photosynthesis)
-The amount of animals breathing oxygen
-The amount of "fumes" released by an animal (thus giving the plants food too... (Photosynthesis))
-The amount/percent of Ice/water,Heat/molten material entered into the atmosphere by means of asteroids, comets and other solar bodies.


All of the above directly affect

The rain cycle
Thermodynamic climate cycle
Plant cycle
Color cycle
- Subtle alterations in the vertex's diffuse color based on wet/dry conditions, rainy/raining so on and so fourth.

From all of the above we can then tell the game how to display the dynamic weather... what the user will see.

Keeping all of the above in mind, each vertex acts as a weather station- reporting all this information in a manner that can display the dynamic weather to the user. In space mode, every vertex will report this data to then display the dynamic weather (clouds and such) for the user to see- but in creature mode, only the vertexes in the creatures view will convert their data to display dynamic weather. This keeps the game fast and when you can see the full global dynamic weather in space mode, enough features from creature mode will be disabled that speed and CPU/Virtual memory cost will stay at about the same.

I am on a mac at the moment, out of town. But in about 6 hours I will begin positing some code for you to actually see this in action. Believe me it is something to behold.

There is still much that needs to be worked out and I am open to anyone who would like to help. NOTE that I can't autherize the altering of any code without Lord Einstein's permission... but as for the W.E.-Sim, I am open to anything.

-Daryn


More to come!

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
andycb
16
Years of Service
User Offline
Joined: 12th Jan 2008
Location:
Posted: 26th Apr 2009 16:42
This looks great, cant wait to hear and see more about the project.
Daryn Alsup
15
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 16th Jun 2009 09:16 Edited at: 16th Jun 2009 09:31

UPDATE:


Here is what I've put up with and why the absence. My father passed not long ago and not very long after- so did my PC. So with my brand new PC along with having to rewrite this whole project (which wasn't fun I might add... remembering is such a b****) I present to you what I've accomplished so far. It is a new approach and Thanks to Math89 for the help with the vector3/vector4/matrix4 commands I give you the calculation of heat via sun light and the manual setup of colored light rather than implied lighting of an object.



With the vertexdata diffuse commands we can tell the weather sphere object where to position clouds on the basis of water(dew) percent, temp and pressure. This is all based on the output of radiation from the sun. By making a DIM array and creating the right algorithm for weather generation, we can accurately display changing dynamic weather for the entire world! I will post more soon and remember that this is only one part of the we-sim. Shaders will need to be designed in order to give some level of detail to the clouds. More soon!

-Daryn

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 16th Jun 2009 10:17
Sounds good, but for me compilation fails on this line shortly after the start of the Do loop:

Object Matrix4 1, 1

Your signature has been erased by a mod because it is way too awesome!
Math89
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 16th Jun 2009 12:09
You need IanM's plugin (and you should be ashamed of not having it yet ).
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 16th Jun 2009 12:23 Edited at: 16th Jun 2009 12:23
I had them but they kept crashing my code every time I compiled it so I removed them.

Your signature has been erased by a mod because it is way too awesome!
Daryn Alsup
15
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 16th Jun 2009 13:17
If you follow the link to the actual "Evolution" WIP topic... I posted the link there (For IanM's Plugins) For anyone who wishes to compile... sorry for the blond-ness.

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Daryn Alsup
15
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 18th Jun 2009 01:40
So I need a little help with creating a reasonable algorithm to simulate the weather. The reason I am asking for help is as follows:

1= the position of the sun dictates the amount of solar radiation (IE heat when converted at the planets surface)

2= The amount of water in the air dictates clouds

3= the amount of pressure (high or low) dictates cloud patterns

4 = The temp dictates pressure and the water in the air.

5 = the time of day dictates falling/rising temp

6 and the hardest = the type of terrain dictates the amount of solar radiation reflected back into space. (This is per poly)

If anyone has any ideas using the code I posted above i will ask you to take a bow and show me. If not, thanks for trying and take a bow. I AM NOT ASKING FOR CODE necessarily but I am asking for some points in the right direction.

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
qwe
20
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 18th Jun 2009 07:49
dont do per poly on the last one. calculate, for an entire region of the planet (say divide the planet into, 16 or 32 or 64 zones) the average color, the blackbody spectrum for the star, and how much light gets reflected off. also, calculate, from concentrations of greenhouse gases like CO2, how much energy gets sent BACK to the planet, and you could have global warming effect

it sounds like the system will be very dynamic. it would be cool if you could stand on mars and watch it be terraformed, the sea level rising, etc
Daryn Alsup
15
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 18th Jun 2009 08:21 Edited at: 18th Jun 2009 09:06
Well the only reason I am thinking per poly is on the basis of how Lord Einstein is using the diffuse vertex method. This sphere is merely the weather sphere. It needs to be able to pull data from another land sphere and compute how clouds are to be drawn on the weather sphere. Because L.E. uses the diffuse method I was thinking that by being able to call and read the color of a vertex of index, we could specify the amount of reflection for each color... This could be done with the right "pairing equation." Because the data may be to great in value to be read in DBPro, we can use LUA to externally call variables and then delete them when they are not needed. This also makes saving games easier and loading the weather data that was last saved from each planet you visit... this is still in the works and I am digressing... so back on subject.

Well your image of mars- that's really what I'm going for. The effects need to somehow all be routed/connected together... when you alter one variable such as the water level by adding water... you up the amount of water in the air and atmosphere (via the water cycle.) But doing this is confusing to me and I need a little direction. Right now I have a dim (array) that looks like this for example. (Note the below is not the actual code)

Example:


That was just a confusing example. Run this code if you want to see for yourself. I need to be able to update the temp at each vertex. Because we can dictate when each vertex is recieving or not receiving light, we can tell the app/game when to let the temp start to cool or rise on this basis. This means pressure needs to also rise and fall on the basis of temp. Clouds need to form on the basis of water/precipitation in the air. Last but least, high pressure, lower water %, vice versa... have a go at altering the code before. The clouds do not display. I haven't altered the code correctly but can do so myself. (Thanks Math89! otherwise I would be so lost!)



Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Lord Einstein
18
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 20th Jun 2009 15:56
AH! LAG!

What I have been working on is an update to the planet rendering. I have decided that it might be best to sepearte the planet into 6 equal sections simular to the faces of a cube. This allows me to specify a terrain type for each one. All of the terrain types have an open space for a city in the center and roads heading to the 4 surrounding tiles. The corners make up the wilderness where animals will be free to roam. This system is much simpler, faster and allows the terrain to suit the game better as the city areas are acturly flat. This prevents the anoying ground, originaly generated through fractles, from going throught the buildings. I also plan to place 4 villages around each city taking the total per planet to 6 main cities and 24 villages. The nice thing about this system is it not only makes roads and cities so much easier but may allow me to add real time vertex editing (as the terrain is no longer generated by fractles) and, even coller, it allows planets to be destroyed and seperated into 6 segments which may be still habitable. The system looks pretty gooda nd terrain looks slightly nicer than before.

Anyway. The reason I have told you this is that you could use this to improve number 6) by just using the six terrain tiles instead of per polygon. The weather sim has to be quite fast and you may wish to consider batch processing.

I think that a simpler system may be to have several objects that drift around the planet. These could have a pressure, water and storm value.

The pressure value could push other objects away (if it is too high) or draw them closer. The water would effect how dense the cloud coverage was and the storm value could effect the intensity of the storm, ranging from wind to tornadoes. These values could depend upon the terrain tile they are currently over (whilst over a sea tile then absorb more water) and whether the sun is beating down on them. A temperature value could be added if required.

Basicly objects over the poles or land/mountainus terrain are not able to hold as much water and so drop some of it as rain till they reach their max water level. Over the sea tiles they can absorb much more water. The water level can also be increased by whether the sun is directly above them or not. The pressure can be increased the longer they are in the sun and how directly above them the sun is (use the z axis to measure this). If a high pressure and low pressure formation are nearby then their storm values could increase. The end result of this would be that the tropics would have very few formations but due to the vast variations they will most likly have more violent storms and more extream rainfall. Temprete zones will have more constant rainfall if there is sufficient water tiles. Poles will have probably quite a bit of cloud coverage. This system might be a little simpler and much quicker. (Remember that the tempret zone streches over the central and polar terrain tiles - just imagine the planets as cubes with their corners bent inwards).
Daryn Alsup
15
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 21st Jun 2009 09:14
Wow a lot of neat ideas LE. I am going to take all of this into account and post what I come up with. (Oh the joy of batch renders ) As for pressure... I really like the idea of having a unique value per vertex. this way we can create a modulating weather system based on the planet, it's water and the sun's heat/radiation.

I am thinking more along the lines of dot values for water and pressure (not only -1,0,1 but maybe -50,0,50. Where 0 = 50% per particle. or to make it a simple calculation, -5,0,5 and the value could be * 10 + 50) and as for density, (#6 in the above thread I posted) all that you really need to do now is make a dim menu and assign values to it based on the size of the object (mesh vertex count/ limb vertex count) and the number of terrain types.

Say you have a sphere with 25 vertexes you would

DIM Terrain#(Get Vertexdata Vertex Count() result, and a number)

For lo= 0 to Get Vertexdata Vertex Count() result

If vertex diffuse=(Whatever color)
Terrain#(Get Vertexdata Vertex Count() result, and a number)=0.1144
<<<If there are more types per vertex just repeat the process>>>

Then I can call the array in the weather function and set the density of the planet by adding each array value to an empty float

TotalDens#=TotalDens#+Terrain#(Get Vertexdata Vertex Count() result, and a number)

next lo

This also means we can set certain colors of planets to have different weather systems on the basis of density which constructs pressure directly and thus the actual weather itself.

That was where I was going with this.

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Daryn Alsup
15
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 21st Jun 2009 21:53
Okay I figured pressure out finally! What I do is I take the planet sphere and grab the number of vertices the entire object has. Then I grab the weather sphere. I see how many total vertexes it has (it must be equal to or dividable by the power of two of the planets vertex count) I make a dim array like stated in the above threads. In one of them I write the color of the planets vertex diffuse. For each color (or a specific if you don't want to write a mile long.) I specify a density. From the color I can tell the app. How much sunlight to reflect and absorb. From this I can grab the heat, from the heat, then and last but not least... particle density which is the planets mass * atmospheric height (planets radius +10, if the planets 100 in size) and particle density is just another way of saying PRESSURE

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Daryn Alsup
15
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 22nd Jul 2009 04:49
Okay so here's a bit of an update-

First we're going to be abandoning certain things for the simple matter of in game complexity. This comes out of my own will to keep things looking great and the user always interested in the environment around her/himself.

What the Weather Environment Simulator will rely on are two very simple ideas-

#1
The planet moves on an elliptical orbit around a sun(s) which means that the closer to the sun the planet is, the more radiation will be converted into heat @ the planets surface.
#2
The size of the planet (actual size) dictates what the maximum number of particles can be ***collectively.

(*** Because it is a planet, there is primarily CO2 at the beginning of the simulation. This means there is nothing but green house gasses (or a single G.H. gas) which keeps all moisture locked under its cloud cover. As you add Oxygen, the amount of CO2 lowers, giving the user the power to "balance" the system for his/her needs. After reaching a certain level. we can tell the game where and why to place the first lower types of trees and plants ferns and so on...)

FROM THE TWO IDEAS ABOVE I give you the first rough draft of the weather simulator. The folder is attached.

NOTE: the password is "goodforuse"

By entering the password you agree to not steal my work. You agree in your admission to ask before using or altering any code.

Sorry for being a B&^$% about my code... I've had some of it stolen already!

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-20 09:21:49
Your offset time is: 2024-04-20 09:21:49