News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Rivers on large maps

Started by jamespetts, August 02, 2012, 11:27:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

Looking into generating very large maps for Experimental, I am finding that, for some reason, the larger the map, the fewer rivers that seem to be generated. Initially, I thought that the problem was that the river density decreased logorithmically with size so that there merely appeared to be fewer rivers, so I increased the maximum number and length of rivers to 32767 (the maximum value of a signed 16 bit integer, used for rivers), but found that, on a 4096x4096 map, not a single river was generated (as far as I could see). The river generation algorithm in Experimental is not much different from Standard, and where it does deviate, it simply removes some of the code in Standard designed to moderate the number of rivers generated (such as to give more rivers in Experimental), so I doubt that this is the problem.

An appreciable number of rivers seem to be generated in a 2048x2048 map, but these seem to be clustered along certain coasts and entirely absent for much of the rest of the map, even though I had set both the number and length of rivers to their new maximum numbers, 32767. What might be the issue here, do people think?

ӔO

maybe map roughness?

I've found that a map roughness of 5 or higher resulted in successively fewer rivers being generated.

prissi

The simple retry routine was too unprobably on large maps. New one should do a little better.

jamespetts

Thank you very much - I shall incorporate your changes into Experimental when I get a moment!

jamespetts

Hmm - trying this again, it has not helped as much as I'd hoped that it might help: on a really very large map (7552 x 2048), I still only get about 20 rivers. Reducing the roughness helped a little, but even at roughness 4, there were only about 64 rives. Because there are so few rivers, they are scattered all over the map, and end up as being non-navigable streams along their entire length because there are no tributaries. I tried increasing the number of random locations tried from 256 to 1024, but this did not seem to help much. Any thoughts would be appreciated.

prissi

There was a little bug, only 100 trys were made. Shorter distance now actually increase likelhood that something is constructed sucessfully.

jamespetts

Quote from: prissi on August 03, 2012, 07:47:35 PM
There was a little bug, only 100 trys were made. Shorter distance now actually increase likelhood that something is constructed sucessfully.

By shorter distance here do you mean a shorter number for the river's maximum length in the climates dialogue?

Edit: Incidentally, increasing the retry count from 100 to 256 significantly increases river generation, albeit at the expense of much slower map generation.

prissi

Usually there is not place with length 512 which only goes downward, Thus the likelhood for rivers as well as the map generation speed is increase by not increasing the river length at all.

jamespetts

#8
Ahh, I see! For very large maps, what do you recommend as the optimal maximum river length - 128? 256?

Edit: Incidentally, using a release rather than a debug build drastically improves generation time with this new sequence - indeed, it seems better than it was before, which is consistent with the notes on the commit stating that it makes it faster - this is a good enhancement.

prissi

The river length rather should depend from the roughness. For smoother maps you need longer lengths. I would be happy, if anyone would test that, so I can cahnge the default variables, when the map roughness is altered.