Skip to main content
Topic: New city placement function (Read 8310 times) previous topic - next topic

New city placement function

From my topic about new city placement function:
That's freakin' sweet. Something I hope comes to Standard (as with many Experimental features, but this one stands out for me personally hehehe)

So. Simutrans-Standard port.

Re: New city placement function

Reply #1
I could live with the water option; but the other require many parameters to handle in the new world dialog. No way to put players off like this. Furthermore the water search seem to me much to heavy. I would have rather build two maps with the lateral distance to the next water. The probability for town generation could then depend directly on this factor without much influence the time needed.


Re: New city placement function

Reply #3
Thank you for your work on this, Inkelyad. I am thinking of including this in Experimental, but if there is going to be a better algorithm for the water search that is faster (map generation speed is quite important for Experimental, as larger map sizes are to be preferred for more realistic play), then that should be looked into. I am not as worried as Prissi about the number of different settings in the new world dialogue (and, if desirable, they can simply be moved to the "climates" dialogue), but, if performance is seriously impacted on a generation of a map of, say, 3072 * 1024 tiles with 175 - 200 cities, this might be an issue.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: New city placement function

Reply #4
Right now I make profiling data. It is not that slow. For example(20 maps, 512x512, 50 cities):
Code: [Select]
index % time    self  children    called     name
---------------------------------------------
                0.95  504.55      21/21          karte_t::enlarge_map(einstellungen_t*, signed char*) [4]
[5]     89.5    0.95  504.55      21         karte_t::distribute_groundobjs_cities(einstellungen_t const*, short, short) [5]
                0.00  429.65   18416/19009       wegbauer_t::calc_route(koord3d const&, koord3d const&) [6]
                0.01   45.47   17346/17346       route_t::calc_route(karte_t*, koord3d, koord3d, fahrer_t*, unsigned int, unsigned int) [20]
                0.00   13.95      21/21          karte_t::create_rivers(short) [41]
                2.50    5.57      21/21          stadt_t::random_place(karte_t const*, vector_tpl<int> const*, unsigned int, unsigned int, short, short) [61]
                0.00    3.20    1001/1001        stadt_t::stadt_t(spieler_t*, koord, int) [101]
my new function(random_place) uses only small % of total map generation time.

Re: New city placement function

Reply #5
How does that compare to the profile for city generation in Experimental without that patch applied?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

 

Re: New city placement function

Reply #6
I not finish profiling yet. But does it really matter? It just 5 seconds out of 500.