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

Updating add-ons in the NewGRF settings window don't take into account the compatibility parameter #8846

Closed
LC-Zorg opened this issue Mar 11, 2021 · 3 comments
Labels
bug Something isn't working component: NewGRF This issue is related to NewGRFs

Comments

@LC-Zorg
Copy link

LC-Zorg commented Mar 11, 2021

Version of OpenTTD

1.10.3

Expected result

It should only be possible to upgrade a add-on to a newer version if both old and new are compatible.

Actual result

The game allows you to update the add-on to a version that is incompatible, which may cause problems.
For example if you update Wasteland from 0.4.0 (version 7) to 0.7.0 (version 100), the new version has the old version settings after the update.

It is about an update before the game starts. The newgrf_developer_tools and similar settings have no effect on the occurrence of the error. The error also occurs with the default settings.
Incompatibile versions

Steps to reproduce

  1. Download Wasteland 0.7.0alpha1 - here
  2. Start the game (any version)
  3. Open the NewGRF settings window
  4. For the clean list, select Wasteland 0.4.0 (or earlier)
  5. Press Upgrade
  • The add-on will be updated to 0.7.0 which is incompatibile with any pervious version
  • Version 0.7.0 will still be shown also on the inactive side
  • The replaced version will not be reverted to the inactive side
  1. Open the add-on's settings
  • New version will have incorrect settings
@LordAro
Copy link
Member

LordAro commented Mar 11, 2021

Actual bug, in my view: NewGRF settings are not reset (or at least migrated) after upgrading a NewGRF

@Andrew350
Copy link

So I'd just like to call attention to this again and maybe expand on the issue, as I've since had two more reports in the span of about 3 months claiming my NewGRF is broken, when in fact it is this bug causing the issues, and this last time it has genuinely broken someone's game.

In addition to the parameters window not being updated (as described by the OP), any new parameters added by the newer version will simply be set to a 0 value when starting a new game. This can cause major problems if these new parameters are not supposed to ever have a 0 value, like in my case, it will completely break the gameplay leading to reports that the NewGRF is broken (which it now is). Normally this should never be possible, as newer versions are set as incompatible, but as shown here the "upgrade" button disregards that completely allowing users to unknowingly break their own game.

Worse yet, this effect is persistent, meaning restarting the program will not reset the parameters for subsequent new games; the offending NewGRF must be removed from the list (including any presets) in the main menu and re-added manually to fully resolve the issue, which is not an obvious solution. In this case the upgrade button effectively "permanently" breaks the NewGRF configuration until the user manually resets it, which renders the upgrade button not only useless, but even dangerous.

In case it may be useful, I've attached a .zip which contains two NewGRFs to help show the issue: an older version, and a newer version which is incompatible with the older one and has two new parameters added to the bottom of the list which should have a minimum possible value of 1.

wasteland_0.7.zip

@andythenorth
Copy link
Contributor

I have seen Iron Horse grf bug reports in Discord that appear to be caused by the behaviour described by Andrew350. i.e. I bumped incompatible version between 2 releases, but players with older savegame appear to have been able to upgrade to the newer release, breaking their game in the process. This isn't confirmed though and when I asked for more info, it wasn't provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component: NewGRF This issue is related to NewGRFs
Projects
None yet
Development

No branches or pull requests

5 participants