Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More Mountain Levels #188

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

More Mountain Levels #188

wants to merge 3 commits into from

Conversation

tcld
Copy link
Contributor

@tcld tcld commented Nov 6, 2015

While I was at it I thought I might make the new satellite-map use the proper mountain-heights instead of the ones defined in draw.py - that way the output should coincide better with the other maps.

I then noticed that the mountain-thresholds were kind of improperly used. Hills were used as mountains and the higher mountainous areas probably never existed in any world because the values were too high.

Data for this PR can be found here.

hl = find_threshold_f(e, 0.35, ocean=ocean) # the highest 35% are declared hills
ml = find_threshold_f(e, 0.10, ocean=ocean) # the highest 10% are declared low mountains
mml = find_threshold_f(e, 0.06, ocean=ocean) # the highest 10% are declared medium mountains
hml = find_threshold_f(e, 0.02, ocean=ocean) # the highest 10% are declared high mountains
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added in values for the different mountain-levels. The percentages, however, are merely guessed so far. I could use some better suggestions on those ( @ftomassetti maybe? Also, @esampson seems to know things like these).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a note: Neither these values nor the corresponding functions in World.py have really been used before (maybe in one or two places). So this shouldn't cause terribly broken code and might offer some opportunities for future improvements to some of the generation-algorithms.

@tcld tcld force-pushed the mountain_levels branch 4 times, most recently from 87aef2a to 8180b2e Compare November 16, 2015 16:01
required double heightMapTh_hill = 9;
required double heightMapTh_low_mountain = 10;
required double heightMapTh_med_mountain = 11;
required double heightMapTh_high_mountain = 12;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it problematic to add the new variables in the "middle" instead of the end?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, that breaks compatibility but in this case I would say it is intended

@tcld tcld mentioned this pull request Nov 18, 2015
@tcld tcld changed the title WIP: Change to mountain levels More Mountain Levels Nov 18, 2015
hl = find_threshold_f(e, 0.50, ocean=ocean) # the highest x% are declared hills
ml = find_threshold_f(e, 0.25, ocean=ocean) # the highest x% are declared low mountains
mml = find_threshold_f(e, 0.12, ocean=ocean) # the highest x% are declared medium mountains
hml = find_threshold_f(e, 0.06, ocean=ocean) # the highest x% are declared high mountains
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I picked these values after inspecting the results of #203 and Earths hypsographic curve. The real world seems to follow something like 2^x according to that graph.

@tcld
Copy link
Contributor Author

tcld commented Nov 18, 2015

I updated this one to make it use values that are close to Earth's. I am now satisfied with the results, the satellite-output looks almost like it did before - but everything is tied to the worlds mountain-thresholds (and could be globally changed) instead of fixed in the code. :)

@ftomassetti
Copy link
Member

Restarting tests

# values chosen to emulate the exponential behavior seen here:
# http://www.ngdc.noaa.gov/mgg/global/etopo1_surface_histogram.html
pl = find_threshold_f(e, 0.95, ocean=ocean) # the highest x% of land are declared plains; save some for beaches (?)
hl = find_threshold_f(e, 0.50, ocean=ocean) # the highest x% are declared hills
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

50% isn't a lot? It is based on real data?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

50% of only the land. "Hills" to me sounds like those small bumps in the world - 50% sounded reasonable. What would you suggest?
I basically tried to emulate this:
hypsographic curve Earth
And that seemed like 2^x to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could use the definition of hill as 300m of elevation. I am not sure if it is w.r.t. to the surrounding terrain or to the level of the sea. I am looking for more precise data. to understand better

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the two images above, the scale of the platec-world to Earth seems to be roughly 1000:1. So hills right now are at roughly 1000m (wrt. sea-level) - the value would be lower if the first part of the graph wasn't as steep as it is.
You said 50% seemed like a lot. Moving hills down will increase that number even further - to maybe 75%.

The graphs can probably be used to find reasonable values. Although the definitions of hills, mountains etc. are kind of arbitrary at the moment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hill used to represent the top 10% of all the world, if land is 1/3 of the world it means they used to ~33% of land, right? So that mean we are getting 50% more hills than before. Mountains should roughly stay the same instead (if I am not wrong)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually my former comment in the code was off: Plains used to be the top 10% of the world (total), hills only the top 3% (total). The current value pushes that to 15% (total). So if we wanted less, we should pick a base other than 2...so more like 10^x? That sounds very drastic to me. The values would be [0.95, 0.10, 0.01, 0.001, 0.0001].

Don't forget, though, that hills were the highest portion of the world before the new levels were added. From that point of view it might be perfectly fine to have 50% (of land) be hills and maybe equate the new medium mountains with the former hills. (Or something along those lines.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first two plots in #203 show the difference of the values pretty nicely (old levels first, then new levels). The new hills are below the old plains. The old hills are roughly where the new medium mountains are.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just checked something: Look at the first image in swipe-mode.
Doesn't really tell anything about the quality of the chosen values, only that I should check if the ancient maps need a little tweak to make use of the new levels.
(Also, check the biome-map in swipe-mode - there is quite a bit of fine detail added due to the height-levels! It's caused by the temperature-map, which does include an altitude-factor.)

The values themselves seem pretty good to me; the old ones seem much more sketchy, with hills being the substitute for a proper mountain-level. Once we agree on good values, I will check the three places that actually make use of them (river-generation, temperature-generation and ancient map-generation). I think there is some detail to be gained in those. :)

@tcld
Copy link
Contributor Author

tcld commented Nov 19, 2015

Also: There is data that comes with this, Mindwerks/worldengine-data#17.
Most of the output slightly changes due to the change to the mountain-levels. (I don't think the tests should pass without that data.)

EDIT: Right, the world-file cannot even be loaded due to the new variables.

Altitude-factor for temperature-calculation makes use of the new levels.
River-generation makes use of the new levels.
Ancient map-generation makes use of the new levels.
hl = find_threshold_f(e, 0.40, ocean=ocean) # the highest x% are declared hills
ml = find_threshold_f(e, 0.20, ocean=ocean) # the highest x% are declared low mountains
mml = find_threshold_f(e, 0.10, ocean=ocean) # the highest x% are declared medium mountains
hml = find_threshold_f(e, 0.05, ocean=ocean) # the highest x% are declared high mountains
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the values a bit, created new plots and want to collect all the important points in a single post:
The former "hills"-level was assigned to the highest 3% of the world, the following 7% (for a total of 10%) was declared plains.

The new values declare the following values, in relation to total land (in the code the values are relative to non-submerged land):
plains ~28%, hills 14%, low mountains 7%, medium mountains 3.5% and high mountains 1.8%.

So the former "hills" roughly correspond to "medium mountains" now. Thus the changes to river-, temperature- and ancient map-generation. The choices in there made sense, but the hill-level was very high.

The following two plots show the old and new height-levels:
seed_13051_hypsographicseed_13051_hypsographic

The plains are set to 80% (of non-submerged land) since due to possible depressions in the land 100% would end up below sea-level. 80% leaves a little wiggle-room.
Everything else is chosen to follow a rough 2^x shape, as I estimated it from here (supposedly real data): hypsographic curve Earth

If anybody has more accurate data, please point me to it (other criticism is welcome, too). For now the values seem reasonable and the results of world-generation look good to me.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 61.183% when pulling a3d048f on tcld:mountain_levels into 6d83ba9 on Mindwerks:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants