Author Topic: [Bug] ironman game saved/exited in battlescape, yet no battleGame in the save  (Read 511 times)

Offline psavola

  • Commander
  • *****
  • Posts: 829
    • View Profile
While playing XCF (the most recent github snapshot) with OXCE 7.14.3, I experienced something strange. I had been playing a battle mission (STR_UCITY) for an hour or two and was almost complete (turn about 20 or so), but had to stop for a couple of hours so I saved the game and exited (ironman mode). The timestamp of the save (today 17:22) matches the time I saved and stopped. Now that I reloaded the save, the game brought me to the geoscape (centered on the mission site) as if I had never went on the mission (also no returning craft from the mission).

There must have been some problem with saving, and for some reason OXCE failed to create battleGame entry in the savefile. No returning craft is probably related to this (and would have been created only after the mission was success or failure?). Unfortunately, I no longer remember the exact gametime, so I don't know if the time also rolled back somehow or the game continues from the time mission previously started.

If the game had crashed, the save entry would have been a battlescape save from turn 20 or so (save every 5 turns).

Unfortunately, I doubt there is anything that would give away the problem in the save or help in reproducing the issue. But I'd love to be proven wrong. So I'm attaching the save.

If there could have been something special in openxcom.log, the log has been overwritten when the game was next run with nothing suspicious on it. (I wonder if it would make sense to store multiple versions of openxcom.log, say 5 latest runs, to separate files).

As said I fear nothing can be done about this, but I'm posting this in any case if
a) someone has encountered something similar, and/or
b) by some miracle a bug would be found and this could be prevented from happening in the future.

Offline Delian

  • Commander
  • *****
  • Posts: 500
    • View Profile
On ironman, as soon as you enter the mission, the game normally autosaves. So even if the last saving failed, the save should have contained battlescape game. This means that the game saving process on your machine has been failing for a while, not just the last time you exited the game.

The save file is also not corrupted (if only battlegame entry in the save file failed to be created, then when you loaded, your craft would remain above the mission site). I tested this by entering a battlescape game and saving, then manually removing the battlegame part. And when I loaded, the craft with soldiers was right above the mission site and immediately asked me if I wanted to start the mission. In other words, you didn't lose the craft or the soldiers, they're simply in a base somewhere. Or perhaps the last time saving worked, you haven't even hired those soldiers yet.

Why has saving been failing? Who knows. Problem with your device most likely. I don't notice any recent changes to the game saving process in the code. And we can't do much without openxcom.log file.

Offline Delian

  • Commander
  • *****
  • Posts: 500
    • View Profile
One possible suggestion that you could make would be to change the logger code so that when a new openxcom.log file is created, the previous one isn't deleted, but is instead renamed to openxcom.log.bak. So once someone gets such an error again, they would have a backup log file they could provide.
« Last Edit: October 07, 2024, 07:11:20 pm by Delian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9091
    • View Profile
Reproducible steps or didn't happen :)

PS: Seriously though, I'm not wasting my time on anything Ironman-related, unless it's 100% clear.