Broken scenario file

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
User avatar
adde
Engineer
Engineer
Posts: 6
Joined: 06 Oct 2007 23:44

Broken scenario file

Post by adde »

Please help!
I have had the worst of luck recently, as I have managed to overwrite a grand Scandinavia scenario that I have been working on since 2018.

Basically, I miss-clicked in the menu when starting it for doing some more work on it: I clicked scenario editor and an empty new map appear (as it should) then, instead of clicking load scenario, I clicked save scenario - and by habit i clicked on the file name of my scenario. Thus overwriting it. I panicked, and downloaded a file recovery program, that found the previous version of the file. But, alas, when trying to load it in Openttd it gave me the error message: "Broken save file - inconsistent size".

I am grasping for straws here, but is there anyone here who can fix this SCN-file? I understand that its is probably beyond repair, but any help would be immensely appreciated! I feel so stupid, as you might understand...
Version: Openttd 1.8.0.

Norden3.scn
Broken scn-file
(4.1 MiB) Downloaded 37 times
QOUD ERAT DEMONSTRANDUM
skc
Traffic Manager
Traffic Manager
Posts: 175
Joined: 17 Sep 2022 02:02

Re: Broken scenario file

Post by skc »

The short answer: It's essentially toast, it's most likely that you'll be better off starting again.

Longer answer:
Because of the way filesystems work, uploading the 'recovered' .scn won't have gotten everything needed to recover the scenario as you had it.
It MIGHT be possible for someone to work out what edits need to be manually made to the file to get it to a loadable state, but that's the best I would be hoping for.
To get it back to how you had it will require a LOT of good luck and the original hard drive that the file was on - there might be sectors that hold the original's data that haven't yet been overwritten.
Eddi
Tycoon
Tycoon
Posts: 8271
Joined: 17 Jan 2007 00:14

Re: Broken scenario file

Post by Eddi »

since the savegame format is compressed, any missing parts will render the recovered parts unreadable. there's really not much hope for you.
User avatar
jfs
Tycoon
Tycoon
Posts: 1760
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Broken scenario file

Post by jfs »

Your best bet is to see if your OS has some kind of backup of your file.

If you're on Windows, you may be able to find the scenario in File Explorer and see if it there is anything in Previous versions.
If you're on Windows 10 or 11, you may also be set up with your Documents folder stored on OneDrive, and in that case OneDrive might have a backup of your scenario you can restore from.
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7249
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: Broken scenario file

Post by Redirect Left »

So after playing about, it seems the file, as it was uploaded, is definitely irreversibly damaged. I downloaded 1.8.0, confirmed the error, so went to the source, and edited the code to simply not bother with the verification the loading file is intact, incase OpenTTD was being overly protective, with the plan of if I can load it, even in a very messed up state, I can save it again using OTTDs normal saving, producing a normal file again with expected sums & sizes. No, straight up crashed OpenTTD, unhelpful.

So i dug deeper with a hex editor. Honestly, this should have been step one but I'm slightly dense. I compared it with a fully working scenario i have been working on, also probably since 2018, with yours. There's a lot of gaps of straight 0's, which never occured in a tested & working scenario. Those banks of 0's are also spread all around the file, rather than just the end of it, so I have nothing to really go on to try and fill things in from known working files. There's simply a ton of missing data, being represented here with 00's.

Working:
2023-06-05 10_27_41-HxD - [E__Sym Links_Documents_OpenTTD_scenario_WYUA_2.scn].png
2023-06-05 10_27_41-HxD - [E__Sym Links_Documents_OpenTTD_scenario_WYUA_2.scn].png (43.14 KiB) Viewed 546 times
Yours:
2023-06-05 10_18_27-HxD - [E__Sym Links_Downloads_Norden3.scn].png
2023-06-05 10_18_27-HxD - [E__Sym Links_Downloads_Norden3.scn].png (26.01 KiB) Viewed 549 times


I did all I reasonably could to try resurrecting it for you, but I'm afraid, it's beyond what I can resolve, I hope you're able to get it from old files somehow, I know the pain of losing years worth of work!
Speaking of, I should try getting down to that scenario of mine and finishing it off, heh. I'd almost forgot about it.
Last edited by Redirect Left on 05 Jun 2023 15:58, edited 3 times in total.
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
ebla71
Transport Coordinator
Transport Coordinator
Posts: 346
Joined: 14 Apr 2021 21:48
Location: Earth

Re: Broken scenario file

Post by ebla71 »

I'm really sorry for the person who lost a lot of work and a treasured scenario but this is also a lesson for all: MAKE BACKUPs REGULARLY

How regularly depends on how long you work on something, how often you change things, and how important it is to you not too loose something.

Suggested backup intervals can range for "a couple of hours maximum" to "once a year".

With OTTD I usually save things to a different filename at least once a day - usually at the end of playing - and put a copy on an external device (harddrive or USB stick) at least once a month. When only playing, I'm usually less strict about it then when working on a scenario, but to loose a weekend of gameplay is also not fun.

And I'm saying this out of own painful experience.

Also on the job have seen people loose work equivalent to a few weeks to a few months.
User avatar
adde
Engineer
Engineer
Posts: 6
Joined: 06 Oct 2007 23:44

Re: Broken scenario file

Post by adde »

Thank you all, especially Redirect Left, for the answers!
At least now I have tried everything I can do, since I have 0 coding knowledge...
On the positive side, it was only half-done so I was probably looking at at least 1-2 years more work on it before it was finished..
But yeah, there was probably 300 hours in it already so..
I have a really old savefile of it that i copied from my last computer in 2018, where I had only just started, that I can go back to and redo everything (and saving copies this time). But I think I rather just play the scandinavia maps already published by others...

Anyway, thank you for checking!
Appreciate it!
QOUD ERAT DEMONSTRANDUM
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 12 guests