The International Simutrans Forum

 

Author Topic: Simutrans-Extended and -64 not working...  (Read 373 times)

0 Members and 1 Guest are viewing this topic.

Offline emirkir se

  • *
  • Posts: 108
  • Languages: SV, EN, FI
Simutrans-Extended and -64 not working...
« on: June 12, 2018, 01:36:03 PM »
Hi again!
As you've been told in my latest posts I have this issue that I can't use Simutrans-Extended and the -64 version.
As @Ves said, to redownload from the Bridgewater-Brunel server didn't work.. So on this link I provided a screen-share of when I recreate the problem:
https://drive.google.com/file/d/1CLO4jARQNvvyK_zl4UrD7dOf09vBJ2DU/view?usp=sharing (mp4-file)

Please help!

Offline ACarlotti

  • *
  • Posts: 165
Re: Simutrans-Extended and -64 not working...
« Reply #1 on: June 12, 2018, 03:51:10 PM »
The problem is that the algorithm (lines 970-983 in simworld.cc) for generating a list of population sizes is taking an inconsistent set of parameters. In particular, it is currently impossible to generate cities with a population smaller than half of median_population, which you set to 7500. However, in pak128.sweden we have max_small_city_size=3000. This means that it gets stuck in an infinite loop once it starts trying to generate 'small' cities, since each number it tries is at least 3750.

To avoid this, you can set median_population to less than 6000. There should probably be some checks in the code to prevent this situation arising; in the long term I think the city generation algorithm is likely to be rewritten without this code for generating population sizes.

Offline emirkir se

  • *
  • Posts: 108
  • Languages: SV, EN, FI
Re: Simutrans-Extended and -64 not working...
« Reply #2 on: June 12, 2018, 04:47:05 PM »
Okay I understand, but is it impossible then to make bigger cities or am I understanding the mechanics wrong?

EDIT: Why don't make a warning with the maximum set value?

Offline emirkir se

  • *
  • Posts: 108
  • Languages: SV, EN, FI
Re: Simutrans-Extended and -64 not working...
« Reply #3 on: June 12, 2018, 07:45:39 PM »
IMPORTANT! This problem was found in PAK SWEDEN.

Offline ACarlotti

  • *
  • Posts: 165
Re: Simutrans-Extended and -64 not working...
« Reply #4 on: June 12, 2018, 08:59:12 PM »
There are a couple of relevant settings you can change - click settings, and select the Extended tab, and there should be a couple of settings called something like max_city_size and max_small_city_size. You could also increase these to solve the problem (although it looks like the world generation will create fewer cities than specified if there isn't enough room for them all).

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2342
  • Languages: EN
Re: Simutrans-Extended and -64 not working...
« Reply #5 on: June 12, 2018, 09:24:24 PM »
Please try running Pak128-Britain and with localization set to English. This is to rule out the crash being caused by the pakset and not the x86-64 build.
Quote
The problem is that the algorithm (lines 970-983 in simworld.cc) for generating a list of population sizes is taking an inconsistent set of parameters. In particular, it is currently impossible to generate cities with a population smaller than half of median_population, which you set to 7500. However, in pak128.sweden we have max_small_city_size=3000. This means that it gets stuck in an infinite loop once it starts trying to generate 'small' cities, since each number it tries is at least 3750.

To avoid this, you can set median_population to less than 6000. There should probably be some checks in the code to prevent this situation arising; in the long term I think the city generation algorithm is likely to be rewritten without this code for generating population sizes.
This sounds like a bug. It really should not allow one to do this if it should never happen. Otherwise it should work with what it is given and just generate stupid results, possibly with a warning.
Quote
EDIT: Why don't make a warning with the maximum set value?
The game should not even be allowing you to set impossible settings. It should warn one if the results will be stupid but if a setting is impossible it should refuse to progress.

Offline ACarlotti

  • *
  • Posts: 165
Re: Simutrans-Extended and -64 not working...
« Reply #6 on: June 12, 2018, 09:44:23 PM »
Please try running Pak128-Britain and with localization set to English. This is to rule out the crash being caused by the pakset and not the x86-64 build.

This has nothing to do with the pakset or which system the game was built for. It's basically a bug that's present in all versions; no further testing is needed to diagnose it. The only reason I haven't offered a fix is because I'm not sure what would be most appropriate in the short term.

One option (a quick botch) would be to increase max_small_city_size to median_population and max_city_size to 2*median_population when these values are too small for the specified median_population. A good solution long-term might involve a more significant redesign of the city building code, so will probably have to wait.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2342
  • Languages: EN
Re: Simutrans-Extended and -64 not working...
« Reply #7 on: June 12, 2018, 10:31:35 PM »
Use a conditional test to check the values before trying to build the cities. If one is too small then make it bigger. When this occurs, if Simutrans supported warning dialogs then show one, but since it does not then maybe send a warning to the command console that this occurred. The end user experience might not be what is expected with cities being the wrong size, but it will not freeze in an infinite loop which is a much better result.

Another solution, which should be done on top of the above, is to have the UI clamp the values that can be chosen so a user cannot input impossible values into it however this takes extra development time so might not be worth it for now.

Offline emirkir se

  • *
  • Posts: 108
  • Languages: SV, EN, FI
Re: Simutrans-Extended and -64 not working...
« Reply #8 on: June 13, 2018, 11:00:33 AM »
Ok, so you mean Shift+P and "Increase City-population by 100"?

Thanks!

Offline Matthew

  • *
  • Posts: 98
  • Languages: EN, some ZH, DE & SQ
Re: Simutrans-Extended and -64 not working...
« Reply #9 on: June 13, 2018, 01:22:03 PM »
Ok, so you mean Shift+P and "Increase City-population by 100"?

Thanks!

If you press 'i', then you'll see a special Settings dialogue. These settings can also be changed in the simuconf.tab files (one in simutrans/config, one in the pakset, and one in your user directory).

Offline emirkir se

  • *
  • Posts: 108
  • Languages: SV, EN, FI
Re: Simutrans-Extended and -64 not working...
« Reply #10 on: June 13, 2018, 05:46:19 PM »
Ok, I'll try that!
Thanks Matthew!

Offline emirkir se

  • *
  • Posts: 108
  • Languages: SV, EN, FI
Re: Simutrans-Extended and -64 not working...
« Reply #11 on: June 15, 2018, 05:49:10 PM »
I got it to work by not having cities bigger than 6000. It worked smoothly and without further visual/graphics/UI-problems.
But something I noticed was when I entered my values, it didn't spawn what I set in the "create-a-map" start-screen.
I set number of cities to 20 and it only spawned 4.

EDIT: The edit I made before is moved because it don't place in this board...

Thanks!
« Last Edit: June 15, 2018, 06:22:41 PM by emirkir »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 17397
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Simutrans-Extended and -64 not working...
« Reply #12 on: June 16, 2018, 12:25:00 PM »
Thank you for your report, and apologies for the delay in replying. I think that I have managed to fix this, which fix I have pushed to the master branch. The town generation/growth system will eventually need to be overhauled entirely, but this should at least prevent the infinite loops/freezes.

Offline emirkir se

  • *
  • Posts: 108
  • Languages: SV, EN, FI
Re: Simutrans-Extended and -64 not working...
« Reply #13 on: June 17, 2018, 01:16:46 PM »
OK nice!