OpenRCT2 / OpenRCT2

An open source re-implementation of RollerCoaster Tycoon 2 🎢
https://openrct2.io
GNU General Public License v3.0
13.27k stars 1.51k forks source link

Opening park of newer version in older OpenRCT2 reports the file is corrupt #22229

Open Basssiiie opened 1 month ago

Basssiiie commented 1 month ago

Operating System

Windows 10, 64-bit

OpenRCT2 build

OpenRCT2, v0.4.11-280-gae9ebe9 (ae9ebe9 on develop) provided by GitHub

Base game

RollerCoaster Tycoon 2

Area(s) with this issue?

No response

Describe the issue

When you have a park file that has been created in a newer OpenRCT2 with a higher park version number, and then open it in an older OpenRCT2 that has a lower park version number, you get the following error: image

This can be very confusing and seems to be a bug, since there are strings to deal with these situations, but they do not seem to be triggered in this case:

STR_6489    :Error: Incompatible Park Version
STR_6490    :Warning: Semi-compatible Park Version
STR_6491    :This park was saved in a later version of OpenRCT2. The park was saved in v{INT32} and requires at least v{INT32}. You are currently on v{INT32}.
STR_6492    :This park was saved in an old version of OpenRCT2, and can not be opened with this version of OpenRCT2. Park is v{INT32}.
STR_6493    :This park was saved in a later version of OpenRCT2, some data may be lost. The park was saved in v{INT32}. You are currently on v{INT32}.

From here.

Steps to reproduce

  1. Get a save file from the newest OpenRCT2 version.
  2. Open it in an older OpenRCT2 version.

Attachments

This save file has park version 34 (both current+min, from this PR before the min. got reverted) and should fail in any OpenRCT2 version (develop+release) from before today. Six Flags Holland with frozen peep with flags.zip

AaronVanGeffen commented 1 month ago

The LoadSave window actually hardcodes this message:

// Not the best message...
ContextShowError(STR_LOAD_GAME, STR_FAILED_TO_LOAD_FILE_CONTAINS_INVALID_DATA, {});
InvokeCallback(MODAL_RESULT_FAIL, pathBuffer);

Unfortunately, the LoadParkFromFile function invoked by the window catches all std::exceptions, including the UnsupportedVersionException thrown in these cases. This code flow will need to be revised for better error messages to happen.

Basssiiie commented 1 month ago

Update, the semi-compatible warning does actually work:

image

It seems to be just the full incompatibility error that doesn't work, where I presume the file's minimum park version exceeds the game's current park version?