Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old June 19, 2015, 17:48   #11
Carnivean
Knight
 
Join Date: Sep 2013
Posts: 526
Carnivean is on a distinguished road
Quote:
Originally Posted by Derakon View Post
Someone has to write the code to do the conversion. If you have that code, you might as well just use it to automatically upgrade savefiles when run under the new version -- you don't gain anything by making it a separate process. The entire point of breaking savefile compatibility is to not have to write that code in the first place.
Ok, if we assume that to be true (and I have no reason to doubt it), then how hard is that process? Assume that only version X-1 is required.
Carnivean is offline   Reply With Quote
Old June 19, 2015, 21:11   #12
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,367
AnonymousHero is on a distinguished road
Quote:
Originally Posted by Carnivean View Post
I get that.

However, you have 2 defined file types, with largely overlapping data. Outside of the core game, it seems like it should be possible to fill as much of the new file as exists in the old file, and fill the rest with an acceptable default value. This would leave you with a save file that loads in the new version, without having to change the core game code to facilitate it.

Is there a technical challenge to doing this that I'm not aware of?
Yes. It's -- as they usually say in techincal litterature -- a highly non-trivial undertaking. In this case for mostly practical reasons having to do with numbers and positions of those numbers changing all over the place in unpredictable ways.

You can certainly mitigate some of this by choosing a standardized and self-describing file format for savefiles (e.g. JSON or XML), but that's only 1% of the solution.

Quote:
Originally Posted by Carnivean
Ok, if we assume that to be true (and I have no reason to doubt it), then how hard is that process? Assume that only version X-1 is required.
Incredibly hard, unfortunately -- even for a single version. You'd be suprised if you tried it.

(At bottom it all has to do with the non-linearity of changes to programs and the effects of those programs, but I won't bother you with the abstract details.)

EDIT: I should say, that avoiding breaking compatibility is a lot easier (if you have good testing in place and/or are extremely focused on it), but that constrains the things you can do enormously. It's always a trade-off.

Last edited by AnonymousHero; June 19, 2015 at 21:20.
AnonymousHero is offline   Reply With Quote
Old June 20, 2015, 01:09   #13
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,860
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by tumbleweed View Post
As far as I can tell from glancing over the savefile howto, Angband should already have the facilities in place to support gracefully rejecting whole savefiles or even just the individual parts it can't load any more.

Which makes me wonder why current iterations of 4.0beta crash and burn horribly when attempting to load old 4.0beta saves from before the break.
You'll notice that the method in the howto relies on there being a new function to read items every time items are changed. My plan in the restructure process was to have no savefile compatibility with previous versions. So I blew away all the old item readers, and started with just one. Thing is, this one has changed during the rewriting process, so it is no longer compatible with savefiles form early in the rewrite, and there is no nice system of tiered item readers to allow it to fail gracefully.

So this behaviour is not unexpected; it shouldn't ever happen for savefiles from actual proper versions, though.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old June 20, 2015, 01:12   #14
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,860
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by AnonymousHero View Post
However, there is one case where it might conceivably be desirable, namely Linux distributions where you might get updated from 8.1.3 to 8.2.0 semi-automatically. However, people using those usually know what they're doing -- as long as you get a reasonably clear error message from the game (and it doesn't corrupt the save file) people could just downgrade.
Thanks - this is a good point. I will make sure to make the error message helpful.

It's also good for me to see that sometimes it's Linux that makes my life more difficult rather that one of the other OSes
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old June 20, 2015, 02:05   #15
Carnivean
Knight
 
Join Date: Sep 2013
Posts: 526
Carnivean is on a distinguished road
Quote:
Originally Posted by AnonymousHero View Post
Yes. It's -- as they usually say in techincal litterature -- a highly non-trivial undertaking. In this case for mostly practical reasons having to do with numbers and positions of those numbers changing all over the place in unpredictable ways.
Thanks. Without looking into the code, and I'm hopeless at reading C, I wouldn't have known that.
Carnivean is offline   Reply With Quote
Old June 20, 2015, 02:10   #16
tumbleweed
Adept
 
tumbleweed's Avatar
 
Join Date: May 2015
Posts: 112
tumbleweed is on a distinguished road
Quote:
Originally Posted by Nick View Post
Thing is, this one has changed during the rewriting process, so it is no longer compatible with savefiles form early in the rewrite, and there is no nice system of tiered item readers to allow it to fail gracefully.
Yeah, fair enough.

Then again, I'd still call it "failing gracefully" if it at least told me to kindly fuck off with pre-230 (iirc) savefiles. But instead it just falls flat on its face with assertion failures and access violations.
tumbleweed is offline   Reply With Quote
Old June 20, 2015, 02:20   #17
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,942
Derakon is on a distinguished road
Quote:
Originally Posted by tumbleweed View Post
Yeah, fair enough.

Then again, I'd still call it "failing gracefully" if it at least told me to kindly fuck off with pre-230 (iirc) savefiles. But instead it just falls flat on its face with assertion failures and access violations.
Sounds like all that's really needed is to stick a version number in the header and error out if that version doesn't match the version of Angband currently running.
Derakon is offline   Reply With Quote
Old June 20, 2015, 02:37   #18
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,860
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by tumbleweed View Post
Then again, I'd still call it "failing gracefully" if it at least told me to kindly fuck off with pre-230 (iirc) savefiles. But instead it just falls flat on its face with assertion failures and access violations.
Yes, I think assertion failure just from loading something invalid is a bit rude. I'll fix that.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old June 20, 2015, 03:39   #19
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,367
AnonymousHero is on a distinguished road
Quote:
Originally Posted by Nick View Post
It's also good for me to see that sometimes it's Linux that makes my life more difficult rather that one of the other OSes
Hey! I'm sure I should feel insulted, but somehow I don't...?!? Dude?!?
AnonymousHero is offline   Reply With Quote
Old June 20, 2015, 03:43   #20
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,367
AnonymousHero is on a distinguished road
Quote:
Originally Posted by Carnivean View Post
Thanks. Without looking into the code, and I'm hopeless at reading C, I wouldn't have known that.
I don't mean to (metaphorically) apply a trounce to anyone, so please do ask if you have any questions about coding (or otherwise). EDIT: ... and I also want to sell you the true awesome of programming in case you're not acquainted already.
AnonymousHero is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
request for a savefile fizzix Development 2 July 26, 2011 02:01
Save File Compatibility dhegler Vanilla 2 September 25, 2009 15:33
Savefile Migration EvilMarshmallow Vanilla 9 May 20, 2009 17:39
[3.1.0] Savefile bug? CunningGabe Vanilla 2 January 16, 2009 03:37
Savefile breakage happening soon takkaria Vanilla 11 May 17, 2008 19:04


All times are GMT +1. The time now is 20:37.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.