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

Industries built in scenario editor can have incorrect closure-risk #9918

Closed
nielsmh opened this issue Jun 8, 2022 · 0 comments · Fixed by #9920
Closed

Industries built in scenario editor can have incorrect closure-risk #9918

nielsmh opened this issue Jun 8, 2022 · 0 comments · Fixed by #9920

Comments

@nielsmh
Copy link
Contributor

nielsmh commented Jun 8, 2022

Version of OpenTTD

12.2

Expected result

All industries at the start of a game should have the same risk of closing (from inactivity/low production) whether they were built automatically by the map generator, or manually in the scenario editor.

Actual result

If the scenario starting date is changed after building an industry, the industry might have a risk of closing very soon after scenario start, instead of the usual grace period of 5 years from its construction.

Steps to reproduce

  1. Start scenario editor
  2. Place some towns and some industries
  3. Save the scenario as name A
  4. Change the starting year of the scenario to 10 years later (e.g. from 1950 to 1960)
  5. Save the scenario again as name B
  6. Start a new game from scenario A, let it run for a long time, and take note of how many of the placed industries close
  7. Start a new game from scenario B, and similarly let it run and take note of industry closures

The scenario with changed starting year has more industries closing, because their build year (and thus recorded "last production date") is 1950, but the scenario starts in 1960 so they all appear to have been idle for 10 years.

Attached sample files made according to these instructions

In scenario A (start 1950), the first industry closure is recorded in February 1956, and 10 years after game start 3 industries have closed.
In scenario B (start 1960), the first industry closure is recorded in February 1960, and years after game start 7 industries have closed.
This isn't a great demonstration, simply because it's too small sample size, but it's at least convinced myself!
Industry closure test A and B.zip

Thoughts

I see three possible places to fix this:

  1. During starting a new game from scenario.
  2. During saving a scenario in the editor
  3. Each time the starting year is changed in the editor

All three would need a thing to reset the "last production year" for all industries. All three have the issue that there isn't really a precedent for "fixing up" things like this. In fact, for the first option, the game can't tell the difference between starting a new game from a scenario and loading a saved game, so that would require introducing a new flag somewhere.

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

Successfully merging a pull request may close this issue.

1 participant