News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

[BUG] Pak64.Experimental not generating world properly with alt. cityrules

Started by passengerpigeon, May 12, 2020, 02:11:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

passengerpigeon

I am currently in the process of trying to update Carl Baker's Pak64.Experimental to take advantage of new Simutrans Extended features. In order to work around a bug with the default city generation that I posted an earlier report about, I copied the cityrules.tab file from Pak128.Britain over to the 64 pakset. This, however, creates one good town with the correct number of people, one half-baked town with only a few inhabitants, and several town halls where the map generator gave up placing the other buildings, all of this after the map generation takes much longer than usual. By trying map creation with various combinations of Pak.Britain and Pak.64 simuconf.tab and cityrules.tab code, I have worked out that it is the Pak128.Britain road generation code causing the problems. Does anybody know what the issue is?
Thank you,
Passengerpigeon.

Mariculous

The issue is located deep in extendeds citygrowth algorithm, more specifically, shortages can cause the citygrowth algorithm to never find any suitable location to build anything.

passengerpigeon

Quote from: Freahk on May 12, 2020, 03:02:31 PM
The issue is located deep in extendeds citygrowth algorithm, more specifically, shortages can cause the citygrowth algorithm to never find any suitable location to build anything.

It seems to be specific to Pak64, though; I tested similar map sizes and town numbers in Pak64 and Pak.Britain, and the latter generated towns correctly whereas the former didn't. Also, what do you mean by "shortages"? Of what?

jamespetts

I suspect that this is ultimately caused by using town growth algorithms optimised for an older version of "Simutrans-Experimental" as then it was known with current Simutrans-Extended. You might try starting with the Pak128.Britian-Ex road and town settings and modifying those as necessary.
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.

Ranran(retired)

The old cityrule tab became incompatible when the cityrule.tab was modified some month ago.
When you create a new town with the old cityrule.tab, the whole city is filled with the lowest level buildings.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

passengerpigeon

Quote from: jamespetts on May 13, 2020, 02:01:04 PM
You might try starting with the Pak128.Britian-Ex road and town settings and modifying those as necessary.

That's what I already tried and am having problems with; pasting in the building generation code from Pak.Britain alongside the default road generation code worked well, but generated too many roads in towns; pasting in both the building and road generation rules from Pak.Britain caused the bugs.

jamespetts

Quote from: passengerpigeon on May 13, 2020, 11:49:20 PM
That's what I already tried and am having problems with; pasting in the building generation code from Pak.Britain alongside the default road generation code worked well, but generated too many roads in towns; pasting in both the building and road generation rules from Pak.Britain caused the bugs.

I am not sure that I have a clear understanding of precisely what happens when you use the exact same cityrules.tab file as in Pak128.Britain-Ex - can you elaborate?
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.

passengerpigeon

To illustrate the problem I created a 384x384 world in 1950 with nine towns, three large towns and no city clusters; cities_like_water at zero and cities_ignore_heights enabled. The world took a long time to generate, and as always with this configuration, I got one city that looked like this...

...with the buildings at the top of the screenshot actually belonging to a different city, with a townhall sited far away, and all of the other cities looked something like this:

I have also attached the config folder that causes this issue. I say that it is specific to Pak128.Britain's road generation rules because when I replace those rules (but not the building generation rules) with the ones from default Pak.64, the generator has no problem placing properly-sized towns, but this isn't an adequate solution as the default road rules generate too many roads in towns when combined with Pak128's building rules.

jamespetts

There are a number of city settings that are contained in simuconf.tab; you might find that you need to update those, too, using Pak128.Britain-Ex as a starting point. Some city related settings include:


# The rate at which towns grow depends on their size. There are three different size categories:
# "Villages", "Cities" and "Capitals". The following settings define the thresholds (in numbers
# of population) above which towns become "Cities" and "Capitals". Anything smaller than
# city_threshold_size is a "Village". These settings are overriden if any value in
# city_threshold_percentage or capital_threshold_percentage be set.

city_threshold_size = 2500
capital_threshold_size = 25000

# These values determine which rates of town growth apply depending, not on the absolute size
# of the city, but rather its size relative to other cities in the game. If capital_threshold_percentage
# is 5, for example, any city in the top 5% of cities by population count will be a capital.
# These settings override the absolute values in city_threshold_size and capital_threshold_size
# unless their values are 0, which is the default. It is recommended to use these rather than absolute
# values, especially in longer games, where all towns may grow to the size of "capitals" eventually.

city_threshold_percentage = 20
capital_threshold_percentage = 2

# These values are used in the city generation algorithm to determine the maximum size of cities.
# max_city_size is the maximum size, in citizens, of any city at the point of generation.
# max_small_city_size is the size, in citizens, of any city other than a "big city" at the point of generation.
#
# TIP: Set a lower number for these values the earlier that the game is started.

max_city_size = 20000
max_small_city_size = 3000

# These values represent the rate at which towns grow. The raw growth number is *divided*
# by the growth factors; ergo, the lower the number, the higher the growth. Longer games
# should have less growth, whereas shorter games do better with more growth.

growthfactor_villages = 832
growthfactor_cities = 480
growthfactor_capitals = 120

# Enable this to use the old algorithm for city growth from Standard.
# NOTE: The renovation_percentage in cityrules.tab should be increased if this be done.
quick_city_growth = 0

# These settings determine the population, visitor demand, jobs and mail per "level" of building.
# Each of these things can be set independently in the buildings' .dat files, but for older paksets
# or paksets from Standard, only a "level" will be supplied, so these conversion factors are
# important in those cases.
population_per_level = 4
visitor_demand_per_level = 4
jobs_per_level = 3
mail_per_level = 1

...

# This setting determines the extent to which cities should be built far away from
# other cities when the map is first generated. The higher the number, the further
# away from each other that the cities are built.

city_isolation_factor = 48

# Minimum distance of a city attraction to other special buildings
special_building_distance = 2
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.


jamespetts

That would suggest that there is something fundamentally different in the design of Pak64.Experimental that is giving these differences. It does not follow that this is a bug in the Simutrans-Extended code, as Pak128.Britain-Ex and Pak.256 produce workable towns without the problems that you describe (although I am not sure what you mean by "too many roads" in this context).

I am afraid that I cannot at this time prioritise this issue at present because of many years' worth of other things necessary for the game to work properly, because of the large amount of time that it would take to deduce where the difference occurs and because of the high probability that this can be fully resolved at pakset level alone by working out by experimentation what makes this pakset different from Pak128.Britain-Ex or Pak.256 that causes this and modifying the pakset so as no longer to have this difference. Indeed, once this work has been done, it will be easier to understand whether this difference in behaviour is a bug or is a side-effect of intended behaviour.
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.