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

Town name starvation leads to slow industry generation (landscape creation) #5864

Closed
DorpsGek opened this issue Jan 14, 2014 · 4 comments
Closed
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

MJP opened the ticket and wrote:

If the selected "town_name" has not enough names, the time spent to generate industry increases a lot.

On a 2048*2048 map, _GenerateWorld() takes much longer with "french" or "swiss" than "english" or "danish" (more than 150 sec vs less than 10).

This patch implements the use of an alternative town name generator when the first can't supply anymore.

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/5864
@DorpsGek
Copy link
Member Author

MJP wrote:

I realized lately it breaks savegame compatibility :(
So I replaced "guiflags = SGF_NO_NETWORK" by "flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC".

Now, a patched binary can load old savegames.
In the other way, I created a new game with the patch so there is mixed town names.
Then I checked this savegame is loadable by a version of OpenTTD without the patch.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5864#comment12920

@DorpsGek
Copy link
Member Author

andythenorth wrote:

Haven't tested the patch, but in principle this would fix https://bugs.openttd.org/task/5840


This comment was imported from FlySpray: https://bugs.openttd.org/task/5864#comment14530

@DorpsGek
Copy link
Member Author

DorpsGek commented Sep 2, 2017

andythenorth wrote:

Patch fails to apply on r27910

openttd-trunk(master)$ git reset --hard
HEAD is now at f1e54b4 (svn r27910) -Update from Eints:
openttd-trunk(master)$ curl https://bugs.openttd.org/task/5864/getfile/9586/town_name_fallback_r2.patch | patch -p1
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3777 100 3777 0 0 16695 0 --:--:-- --:--:-- --:--:-- 16712
patching file src/settings_type.h
Hunk # 1 succeeded at 285 (offset 1 line).
patching file src/table/settings.ini
Hunk # 1 succeeded at 342 (offset 6 lines).
patching file src/town_cmd.cpp
Hunk # 1 FAILED at 1881.
Hunk # 2 succeeded at 1975 with fuzz 2 (offset 75 lines).
1 out of 2 hunks FAILED -- saving rejects to file src/town_cmd.cpp.rej


This comment was imported from FlySpray: https://bugs.openttd.org/task/5864#comment14727

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
@TrueBrain
Copy link
Member

I don't like this solution, as it works around the real issue. It also adds complexity. I also wonder if this really is a problem.

For now I do not consider this a problem. If you disagree, please rebuttal!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

2 participants