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 than 327 Finnish cities or towns cannot be created. #8088

Open
agentw4b opened this issue Apr 15, 2020 · 7 comments
Open

More than 327 Finnish cities or towns cannot be created. #8088

agentw4b opened this issue Apr 15, 2020 · 7 comments

Comments

@agentw4b
Copy link

@agentw4b agentw4b commented Apr 15, 2020

Version of OpenTTD

OpenTTD 1.10.0 (Maybe also older or newer ...)

Expected result

The ability to create thousands of cities or towns , just like other game countries.

Actual result

More than 327 Finnish cities or towns cannot be created.

Steps to reproduce

Create more than 327 Finnish cities or towns.

@agentw4b agentw4b changed the title More than 327 Finnish cities cannot be created. More than 327 Finnish cities or towns cannot be created. Apr 15, 2020
@James103
Copy link
Contributor

@James103 James103 commented Apr 15, 2020

  1. What NewGRFs are you using?
  2. Are you using the OpenTTD supplied Finnish town name set?
  3. Can you reproduce this with other OpenTTD-supplied town name sets?
@agentw4b
Copy link
Author

@agentw4b agentw4b commented Apr 16, 2020

  1. No NewGRF
  2. Game Options/Town Names/Finnish
  3. Thousands of cities can be created with English and Czech city names, but with a Finnish set of only 327 cities. Normally, I don't use the Finnish name set. I ran into the problem by accident.
@agentw4b
Copy link
Author

@agentw4b agentw4b commented Apr 16, 2020

The problem was found in the discussion on the JGRPP version forum, but I found that the problem is not in JGRPP but in OpenTTD.

https://www.tt-forums.net/viewtopic.php?f=33&t=73469&start=2720

@Eddi-z
Copy link
Contributor

@Eddi-z Eddi-z commented Apr 16, 2020

This problem exists with several of the town name generators, especially some NewGRF ones. Back when they were introduced, we had only 256x256 maps, which never had much more than 100 towns. but now we have 4kx4k maps which can easily fit 10k towns, and the town name generators run out of names.

unfortunately, we cannot really modify the town name generators, as that might break(*) old savegames.

(*) they could still be loaded, but the names will be diffferent, and duplicates may appear.

@JGRennison
Copy link
Contributor

@JGRennison JGRennison commented Apr 16, 2020

(Ignoring the savegame compatibility issue momentarily).

The Finnish town name tables and algorithm should support 780 names (which is better than 327 but still quite poor).
31 using "real" table.
27 using table 1.
722 using table 1/2 + table 3.

The use of SeedChance is such that which method to use and the indices into the various tables are linearly related due to use of overlapping or the same parts of the seed bits.
In general SeedChance and related methods are not a good way to extract bits from a random seed.

@lanurmi
Copy link

@lanurmi lanurmi commented Apr 17, 2020

While it is entertaining to point out how bad the Finnish name generator is, as @Eddi-z pointed out, it was made back in the days when maps were smaller, and running out of unique town names was not an issue. And also it is not likely to be the only generator suffering from the same problem.

Additionally, at the time (~15 years ago) there was no specification as to how many unique names should a generator be able to produce. Is there such a specification even today?

Moreover, the fact that generators can never ever be modified due to save game compatibility is clearly a design flaw of OpenTTD itself, not of any particular generator.

@nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Apr 17, 2020

Can we somehow keep the original (broken) Finnish generator around while also making an improved/fixed one? The original only gets used during savegame loading, to convert all town names into strings (as if they were renamed by the player) rather than the seed, and the new generator gets used for all new towns in old and new games.

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

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.