 |
|  |
 |
|
Gary Thomas
|
 |
New Zealand
Mar 2001 time: 17:22
|
|
In accordance with Mark's suggestion, I am starting a thread dedicated to issues relating to random map scenarios.
Demo 7.1 does have random maps, but they are not yet scenarios, since they have no civilizations.
The maps are simple fractals using a midpoint algorithm, with a sea level added later to set the amount of land.
Since the only variable is altitude, only altitude related characteristics are used. This means that the available terrain types are ocean, coastal sea, flat land, rolling, broken and mountains, in increasing order of altitude.
As Laurent said:
quote: Then we need hygrometry (desert/humid squares) and vegetation (forests/plains). |
Both of these models are dependent on climate patterns, which I will add when I figure out how to do it. If anyone has any references on coding such things I would much appreciate any help here.
I certainly do want this completed in time for D8.
Cheers
|
|
|  |
 |
|
Mark_Everson
|
 |
Canton, MI
Jan 1970 time: 00:22
|
|
Hey Gary. On climate...
Here's a link to a site with an interesting digram of wind patterns and how they emerge. Just scroll down a little bit
http://www.franksingleton.clara.net/tw2001.html
I presume a crude estimate of water put into the air, combined with where the winds tend to blow it would be a first step. When you think you're a few weeks from doing the first crude pass at the climate coding let me know, and I'll see if I can lure Paul Crocker into working on it a bit. Paul was responsible for the first shot at a map generation model way back, and seemed to know his stuff! An eight-zone model like that shown in the diagram on that web page is the sort of thing he wanted to use.
Last edited by Mark_Everson on 31-08-2002 at 07:40
|
|
|  |
 |
|
Simon Loverix
|
|
Tongeren, Belgium
Apr 2001 time: 05:22
|
|
Please take a look at the ecology model. I have designed it with map generation in mind and set up a way to link climate with disasters, vegetation etc.
http://apolyton.net/forums/showthre...&threadid=36592
Last edited by Simon Loverix on 02-09-2002 at 17:03
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:22
|
|
I thought there was an effect of altitude stated in the model, like moving climate zone 110km towards the pole for every 100feet altitude or something, and a repartition of zones per latitude.
|
|
|  |
 |
|
Simon Loverix
|
|
Tongeren, Belgium
Apr 2001 time: 05:22
|
|
Gary, are you referring to the most recent version of the ecology model (3.0)? Follow the link I pasted into my previous post, you can download it from there.
|
|
|  |
 |
|
RM
|
|
Uppsala, Sweden
Sep 1999 time: 05:22
|
|
Wind directions, as can be seen in one of the pictures on the page Mark_Eversons linked to:
0-30: east to west, trades
30-60: west to east, westerlies
60-90: east to west, polar easterlies
A rough way to similute moisture would be to see how long stretch of water a wind has covered before reaching land, and let the air moisture be proportional to that. Then for each land square, the moisture in the air is decreased, and instead the moisture on the land for the square is increased. Mountains should be more wet than plains, since they generate more rainfall.
Water currents often go in the same direction as the winds, but follow circular patterns. A sea large enough to be swept by both westerlies and trades, will have a clockwise current (if it lies on the northern hemisphere) because the south of it will be swept to the west, and the north of it to the east. When the water moves north it will be warmed, and by the time it moves back it will have cooled. So on the northern hemisphere east coasts should be warmer than west coasts.
There is an animated picture that illustrates the principle on http://mbgnet.mobot.org/salt/motion/current.htm
|
|
|  |
 |
|
Simon Loverix
|
|
Tongeren, Belgium
Apr 2001 time: 05:22
|
|
I did include a similar way to handle wind currents in the ecology model. But the page on the web site was never upgraded, though I sent a copy to Dom. Mark, can you put it on it's place? (link in the above post)
Thanks.
|
|
|  |
 |
|
RM
|
|
Uppsala, Sweden
Sep 1999 time: 05:22
|
|
I have taken a look at ecology model 3.0 and have some suggestions on wind and moisture distribution. It departs much from model 3.0 in these two areas, but I think it will lead to generation of smoother worlds and less special cases in the code. It is a rather long description, be warned.
It seems that in the model winds will be represented by vectors, and they will be rare compared to the number of squares. Why not let each square have its own (smaller) wind vector? It seems to me that if you want to use the winds for things like sailing movement you will still need the wind at each square, and then you will have to interpolate, if you use model 3.0. I would suggest generating wind direction for each square when generating the world and then be done with it.
I do not think mountains should turn the winds away completely, as suggested by model 3.0. Perhaps slowing windspeed (If you use 1 wind/square, then the vector length can be used as windspeed rather than actual stretch) is reasonable though.
Winds move mostly in west-east direction or east-west direction in 7 bands. The direction can be approximated for each square by something like f(y) = sin(5*pi*y/total_height_of_map) ), where positive direction is west. But you probably want to modify the strength of the winds by some latitude dependent amplification, and add some random noise, both in north-south and east-west directions, to make it less uniform and predictable. And change the winds with respect to mountains, of course.
Moisture can be generated by
1. First approximating general air humidity in each square using solar flux as suggested by Mark_Everson. Air humity near the equator should be very high, near the poles low. Air humidity in land squares should initially be zero.
2. Air humidity can then be "smudged" by the winds by an iterated process moving some of the air humidity in the wind direction for each square.
3. Moisture on land can then be calculated by some nice formula using air humidity, altitude and distance to poles and equator. You probably want to test empirically which formula makes the nicest moisture distributions before deciding exactly which. When you are done, you can release the air humidity data from memory, if you do not wish to use it any more. You probably only want it when generating the world.
Later when rivers and lakes are implemented, that can also be taken into account for in the moisture calculation process.
The main benefits of my suggestions:
1. One way to calculate moisture and winds for all squares regardless of climate zone ( temperate, tropical etc. ), no special cases in the code needed and most likely worlds that seem less "discrete".
2. Winds calculated for all squares ONCE at world generation. No interpolation between longer windstretches needed. (Local wind changes near cities, like Lord God Jinnai suggested, can of course still be implemented.)
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:22
|
|
Interesting post, RM. And it wasn't that long, either.
I am a bit afraid that per-square (or -polygon) winds would still need some smoothing. Winds in a square depend on the neighbouring squares, so some interpolation is inevitable if you don't want to have winds like WWEWW in neighbouring squares, with the Eastward anomaly explained by nothing. I am not sure whether it would change the generation of terrain enough to bother with, though.
|
|
|  |
 |
|
RM
|
|
Uppsala, Sweden
Sep 1999 time: 05:22
|
|
LDiCesare:
How smooth the winds will be depends on how smooth the wind generating function will be. I think a sine function with a small random disturbance should be smooth enough. And if it is not, and interpolation is necessary, at least the interpolation is done only once.
I am thinking of the possible use of winds in the actual game as well as world generation. A ship moving from Spain to the Caribbean by sail should go faster than it will go in the opposite direction, for example. That would require interpolation during gameplay unless all squares already has a wind of their own, and unnecessary computations during gameplay will slow the game down. Perhaps this is a bit off topic for world generation, but I believe it is better to consider this problem/possibility before it arises.
As a side note about WWEWW winds, it is possible with a high pressure very close to a low pressure creating such patterns. But I guess winds involved have to be weak in order for it to be realistic.
Lord God Jinnai:
The ocean filling idea could work, depending on how common land below sea level that is not sea is. It is very rare, except in Netherlands.
Another idea for creating lakes, is to create them at the same time as rivers. Select areas with high altitude and moisture as starting points for a river, and let the river always move to the lowest adjacent square. If there are no adjacent square that is lower than the current square, then create a lake on the current square. Let the river continue from the lake to the lowest adjacent square.
|
|
|  |
 |
|
Simon Loverix
|
|
Tongeren, Belgium
Apr 2001 time: 05:22
|
|
LGJ:
Wetlands and lakes are generated separately, but only if a lake is adjacent to sea it becomes a wetland.
Erosion should be used when generating the height, terrain, etc. Especially if we are going to use tectonics. The river starting points used there can be used for the final rivers also.
A major city area is rather similar to a desert area considering vegetation, but the temperature rise is important for generating disasters.
RM:
The moisture takes into account latitude, height, climate zone, nearby rivers, ocean or sea and wind and water currents. It is in a step-by-step format and not in a formula because all those influences are themselves only generated in steps, they are not all available at once.
Wind and water currents are fairly complicated to generate, since they form one big system adapted to itself, so in fact you can't place them one by one if you want to be correct. As is said above, it is best to depart from certain latitudes (the roaring forties fe) that have a uniform direction for the entire planet and then make deviations. In fact, it is not that bad if we generate them rather randomly if we can't easily find a simple pattern.
Winds were indeed intended to stay the same for the whole game, except in the case of a major climatic disturbance, where they would be regenerated from scratch.
Winds per square could be possible if you can find a way to backtrack their effects. Since winds influence moisture, there should be a change when they are deleted and regenerated anew.
The effects of the currents as I described them are quite significant, so better don't put in too much of them. It was my aim to be able to use them for custom scenario's, where you want a certain area to be desert. If there is no reason for the ecology model that it should be desert, it will be fertile grassland soon enough. So you'd better place a dry wind.
|
|
|  |
 |
|
RM
|
|
Uppsala, Sweden
Sep 1999 time: 05:22
|
|
Mark_Everson:
OK, if you want a formula, here is one:
Moisture = altitude*a + air_humidity * b + distance_from_the_equator * c,
where a,b and c are constants.
But I think the only way to get a function that get the wanted result, is to try different functions and see which works best. Too many details may distract from what is important.
Simon_Loverix:
The way I see it is that there are two ways to generate wind patterns.
One way is to take a brief look at a wind map for Earth, and try to estimate a rough formula ( i.e. a sine function with a small random disturbance ) for the winds, and then use that formula.
The second way is to try to construct a physical model for winds, generate a few random(?) winds, and then try to make it fit together, perhaps by using an iterated procedure, like a numerical solution to a differential equation.
It is clear that it is more difficult to take the second way, and not even certain to get better results. That is why I would recommend the first method. If you can formulate a procedure using the the second way, it is worth a try, but noone has suggested any such algorithm yet.
And now to answer some of the more detailed objections to my proposal:
"Wind and water currents are fairly complicated to generate"
The generation will not be more complicated than we make it. I think a goal should be to make as simple algorithm as possible, while still getting good results.
"As is said above, it is best to depart from certain latitudes (the roaring forties fe) that have a uniform direction for the entire planet and then make deviations"
I think you will find that a sine pattern scaled correctly will give the correct direction of wind for those latitudes that are fairly uniform. And for latitudes where the winds are often unpredictable, it will give winds that are close to zero (which would be the average wind). But I agree that some randomness should be taken into account. (And mountains, if we can find an easy enough way to do it).
"It was my aim to be able to use them for custom scenario's, where you want a certain area to be desert. If there is no reason for the ecology model that it should be desert, it will be fertile grassland soon enough. So you'd better place a dry wind."
With my suggestions, you can still make sure winds face the directions you want, you just have to do it square by square. At least until there is a good map editor. Besides, I think reevalution of moisture should not be done very often, since things like that do not usually change over night, and it will probably involve costly calculations to evaluate it, regardless of which of our methods are chosen.
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:22
|
|
quote: OK, if you want a formula, here is one:
Moisture = altitude*a + air_humidity * b + distance_from_the_equator * c,
where a,b and c are constants.
|
That is precisely the values of a,b,c, or at least a relative value that we need. As long as this is a mathematical model with no randomness, it can be tested on paper. Having no idea what the values should be like, the coder may come up with silly default values and never be able to get them right. We need rough starting values. You don't have any idea how much tuning values is long and difficult. With every change in the military code, I am afraid the cost values I carefeully balanced get totally changed because one unit will become too string for its cost, for instance. I iterated thousands of automated fights and could get short results for 1000 fights when I checked the costs of units. Checking 1000 maps is not that fast, but that would be needed if we start from scratch.
Even if we delivered a program that generates moisture correctly, there are many other factors, like wind, size of the world, etc., which makes lots of variables to tune. If you could provide some starting figures, it would really be very useful.
|
|
|  |
 |
|  |
 |
|
Gary Thomas
|
 |
New Zealand
Mar 2001 time: 17:22
|
|
Bump
This is another project dear to my heart, which I had partly implemented.
Cheers and PF
Last edited by Gary Thomas on 11-01-2004 at 00:07
|
|
|  |
All times are GMT. The time now is 05:22. Apolyton Time is 00:22. |
top of page
|
|
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|