"RPG file appears to be corrupt (bad header)"

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
Seamus Moore
Slime
Posts: 19
Joined: Mon Mar 16, 2020 9:39 pm
Location: Seamus Moore's House

"RPG file appears to be corrupt (bad header)"

Post by Seamus Moore »

Recently I unintentionally closed the window of ohrrpgce while it was in the middle of "lumping data" to save the changes I had made to the game. And now when trying to open the game it gives the error message:

"Fatal Error. General data is missing: RPG file appears to be corrupt (bad header)"

I do have backups, but the newest backup is from around a week ago, and it would take hours to redo the work.

Is there any way I can save my corrupted RPG file so that I don't have to redo work on my backup?
dQw4w9WgXcQ
User avatar
Bird
Slime Knight
Posts: 227
Joined: Thu Jan 26, 2012 2:19 pm
Location: Germany

Post by Bird »

Terrible! Still, the newer OHR versions do automatic backups every time you close Custom in a folder called "autobackups". Maybe a more current version is there?
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Yes, every time you save the game (not just when quitting but also "Save and continue"), the .rpg is also copied to autobackups.

It's probably also possible to recover data out of that corrupt .rpg since it doesn't sound like it's completely empty. I could take a look if you want, but basically you unlump the .rpg, unlump an older copy of the same game, and copy all the files over from the new to the old except for the last one, which is probably cut short and corrupt.

But what I don't understand is how you managed to accidentally force quit the program. I would think the OS would ask first, and wouldn't even give the option unless the program is frozen for several seconds. What OS is that?
Last edited by TMC on Sat Mar 21, 2020 12:21 pm, edited 2 times in total.
User avatar
Seamus Moore
Slime
Posts: 19
Joined: Mon Mar 16, 2020 9:39 pm
Location: Seamus Moore's House

Post by Seamus Moore »

I wasn't aware of the auto backups folder, It had the latest version of my game, and my progress is saved! thank you.

My computer had started freezing up in the middle of saving due to being a potato and having too many apps open at once, trying to close more apps to get my computer going at normal speed again, I had impatiently clicked on the x button repeatedly until it force quit, not realizing it would corrupt my file.
dQw4w9WgXcQ
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Ah OK, it's not strange that programs freeze while they compete for harddisk access.

You aren't the first person asking for help with a corrupt file who didn't know about autobackups. The only hint in the engine is the brief message when you save, "Saved, and copied to autobackups" (which I added in Fufluns for this exact reason). Maybe I need to make the message display longer. And ideally the corrupt .rpg error message should mention it too.

Also, I thought maybe it would be nice to have a list of tips randomly displayed on Custom's splash screen. We have a lot of somewhat obscure features.
Last edited by TMC on Sun Mar 22, 2020 12:24 am, edited 3 times in total.
Post Reply