Author Topic: Migrating old saved games  (Read 7225 times)

loom_weaver

  • Newcomer
  • Posts: 23
  • Karma: +0/-0
    • View Profile
Migrating old saved games
« on: November 25, 2011, 08:01:20 AM »
I'm trying to determine if there is any feasibility to allow the player to migrate and load old saved game versions.

My initial thought is that it is pointless because old saved games will have pointers to obsolete data and some things such as zones should not be loaded back in as they were if you've added new content.

In a traditional application (e.g. a word processor) one can create simple content with limited functionality and it still makes sense to be able to load that simple content into a future version of the product.  However this doesn't really apply to roguelikes because content is often completely replaced.

Any other thoughts on this concept?  Do you know of any roguelikes that went out of their way to allow players to load their old saved games?

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Migrating old saved games
« Reply #1 on: November 25, 2011, 08:38:00 AM »
Any other thoughts on this concept?

It makes sense only if two versions are similar enough to use the old save game. Then it's just a matter of writing a conversion routine. I think the whole thing a waste of time and a non-issue, but if you have some free time then why not.

alexbard

  • Newcomer
  • Posts: 26
  • Karma: +0/-0
    • View Profile
    • Ignite Roguelike
Re: Migrating old saved games
« Reply #2 on: November 25, 2011, 09:43:07 AM »
You can write separate loading functions for every game version (and generate missing data for old save files)..
but
Quote
I think the whole thing a waste of time and a non-issue, but if you have some free time then why not.

Z

  • Rogueliker
  • ***
  • Posts: 905
  • Karma: +0/-0
    • View Profile
    • Z's Roguelike Stuff
Re: Migrating old saved games
« Reply #3 on: November 25, 2011, 09:35:20 PM »
My Hydra Slayer (which uses a binary savefile format):

- saves the version number in the beginning of the savefile
- when loading each field, a check is made "if savefile's version number is at least ..."; this makes sure that fields which did not exist in older versions do not cause save compatibility problems (for example, hydras get a "bloody" field in version 13.0, but loading "bloody" is skipped if the savefile version number is smaller than 13.0)
- arrays include some reserve (for example, there is an array which lists the number of kills for each type of attack; this array is bigger than needed, so that I do not break savefile compatibility by adding new attacks)

And that's mostly all that is required to have savefile compatibility. No problem. There would be a problem if you remove something, (say a PC race, as Crawl often does), but why not just remove this race from the list, still allowing it internally?

Savefile compatibility is a good thing if the new version just fixes some bugs, or for a long games which take, say, a week to complete (either by design or for a challenge, e.g. get as deep as you can in ADOM's Infinite Dungeon), if I were playing such a game and a new version came out after 2 days of playing, I would like to update to the new version.

Also I prefer to keep my high score lists from the old version when I update.

If you have changed the game balance, then updating the game in progress gives you unbalanced characters. For example, if an old version has powerful equipment and powerful enemies, and the new version has weak equiment and weak enemies, you can update in progress to get powerful equipment and weak enemies. Or, if the old version gave you an artifact on level 10, and a new version gives you it on level 12, and you update on level 11, you get it twice. But I don't think this is important unless you really change something. Hydra Slayer never had a change which justified breaking savefile or highscore compatibility IMO. I think the thing about doubling/missing artifact could happen, but I think it just causes the player to think that the RNG has generated a weird game (and it states it in the log if it finds out that the game version has been changed in progress).

Bear

  • Rogueliker
  • ***
  • Posts: 308
  • Karma: +0/-0
    • View Profile
Re: Migrating old saved games
« Reply #4 on: November 26, 2011, 07:42:01 PM »
http://www.roguebasin.com/index.php/Save_Files

is an article that contains a lot of my thinking about save files and migrating saved games. 

I don't think any of it is "standard practice," if such a thing exists at all.  Mostly it's my own design decisions for the game I'm working on (Neohack). I want it to become as much a "utility" as possible, with few dependencies and lots of flexibility.  If someone has the latest-and-greatest version on his home machine but carries his game around on a thumb drive and can play occasionally at three different places with three different other versions, some of which have different content installed (no succubi, for example, on the public server that hosts games played by 12-year-olds) and can convert easily between them every time he sits down -- that would mean to me that I did the right thing.