Latest Posts

Topic: why are older saves not compatible with new versions?

king_of_nowhere
Avatar
Topic Opener
Joined: 2014-09-15, 17:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2016-03-27, 22:55

if one keeps updating the versions, an old saved game becomes impossible to open after one to two months.

I've always taken that as a quirk of the nature of programming; then i talked to my brother, who has a lot of experience about programming, and he said that's absolutely not normal. he was even quite emphatic about it. with a newer version, an older save should still work. thinking about it, a savegame file should be nothing but a map and a list of objects standing on it, with some instructions - at those coordinates there is a well that started working 11907 milliseconds ago, at those other coordinates there is a log directed to those other coordinates... there should be absolutely no reason a saved game stops being compatible with a newer version. and it is quite annoying to a player, especiallly coupled with the incomprehensible policy of trying to force people to update to new versions without keeping older ones - a policy that can be bypassed simply by renaming the widelands folder before installing the new version, but a policy nonetheless.

is there some reason for the version incompatibility?


Top Quote
SirVer

Joined: 2009-02-19, 14:18
Posts: 1445
Ranking
One Elder of Players
Location: Germany - Munich
Posted at: 2016-03-28, 08:37

the tl;dr answer for this is probably because Widelands is not a commercial product. But I also think your assessment is misleading and the judgment of your brother overly simplistic. Please read on.

The first sentence of your post is misleading. Yes, currently it is true, but it has not been for a long time. In fact, b18 and before we always strived to make games backwards compatible for at least three releases - and in fact, b18 can open games saved with b15, b16 and b17. For b19 I suggested that we break backwards compatibility to clean out the code base - which we did, we lost several thousand lines of code that modeled old state that would never be used again - except for loading old savegames. After b19 we will try to keep games backwards compatible as much as possible again.

at those coordinates there is a well that started working 11907 milliseconds ago, at those other coordinates there is a log directed to those other coordinates... there should be absolutely no reason a saved game stops being compatible with a newer version.

This is an oversimplification. Let me give you an example of something that broke a while ago: Militarysites used to derive from Productionsites which dervice from building which derive from map object. It makes no logical sense why a Militarysite should be a productionsite (it violates the is_a modelling scheme as well as the Liskov substitution principle and it made adding new features to either class very hard). So I wanted it changed, I think Gun did the change. For the player, this change is invisible - it does not affect the logic of the game. For the game saver though it is huge: the in-memory representation of a miltarysite looks very different now, so the old saving code is not working at all anymore.

It would have been possible to add code now that loads a building first as an old miltiarysite in memory representation and then copy the data over into the new structure one by one. But this would require that the old militarysite code would need to stay around indefinitely - still restricting the evolution of productionsites. Between b18 and b19 we opt to not do that, modernizing the code base without introducing legacy code in the process.

A second example is the introduction of Lua as our scripting language. Before, we had our own shitty trigger/event system. Lua allows us to do a lot of complex stuff (see all win conditions, the atlanteans mission with the rising water), but of course it's representation has nothing to do with trigger and events. Porting this would have been virtually impossible - I guess, some 30k lines of code or so, so we did not do it.

My stance on this is this: old code is not fun to work with and breaks more often. Programmers are customers too - even more than players, really, because they are more important to the evolution of the project. So bringing the code base into a state that it is easier to work with is worth annoying players for one version bump.

especiallly coupled with the incomprehensible policy of trying to force people to update to new versions without keeping older ones

I cannot comment on this "policy". I guess it is a default setting of our windows installer and thinking about it, it is probably the right decision for most players. Very few will be interested in having more than version of Widelands installed, so this should not happen on accident.

is there some reason for the version incompatibility?

yes, of course. :). I hope I could make it a little more understandable why we chose to do things for one version bump this way. I am sorry that you find it annoying.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2016-03-28, 08:47

What SirVer said - this is still alpha software, so we have to break things sometimes.

Regarding the Windows installer thing, I also preferred like it was before - Build 18stopped working on my Linux setup, so it would be nice to have it installed on Windows, so I can have a look at what things used to be like (for example, if a bug is old or new). However, I can't keep it around and test current builds as well. I also can't compare the behaviour of trunk and a current branch on Windows-. I expect that I could copy the folder though before overwriting the old installation, and both should still work.

If TIno is up for it, maybe we could have an "easy" and an "advanced" option for the Windows installer?


Busy indexing nil values

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 19:48
Posts: 2439
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2016-03-28, 10:32

I don't know if it was possible to load a savegame form settlers1 into settlers2 or later. I believe it wasn't.

As GunChleoc says, all versions after build18 are currently development versions (alpha versions) and thus it is under development and things can change. So your question is some kind of unfair because it is related to development versions and not to final releases.

But your question is importand in so far, as we have to tell the widelands players that savegames from build18 are not compatible with build 19... once build19 will be released...

Edited: 2016-03-28, 10:33

Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2016-03-28, 18:00

Also AI is a culprit here. It did not save anything in b18, but now it does - and this also means incompatibility in save format...


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2016-03-28, 20:48

I hope you don't feel like we're ganging up on you here - I do understand why you would find it annoying. I do as well when I'm trying to fix a bug and the attached savegame can't be loaded any more face-wink.png


Busy indexing nil values

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 19:48
Posts: 2439
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2016-03-28, 21:54

Yes it bothers me also a lot...

Just like the changes to the lua files which broke my own data directory several times. GunChleoc, are these changes completed now?


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
king_of_nowhere
Avatar
Topic Opener
Joined: 2014-09-15, 17:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2016-03-29, 00:24

ok, thanks for explaining, but i still would like one more clarification.

so sirver said that there used to be backwards compatibility, but it was broken to "straighten" the code. which is ok. but then, i would expect that the versions would remain backwards compatible up to a certain point, then the code was rewritten, and then future versions would still be bckwards compatible down to that point. even if the new code is written and implemented a bit at a time, i would expect that at some point the backwards compatibility would be restored. so by the fact that 7907 can't open 7852 I should surmise that there are still those kind of code changes being introduced? if so, how long before we could reasonably expect that backwards compatibility will be restored from that point into the future?

One thing that probably backfires against the development is that the unofficial trunks have become something of an "unofficial official build". all the maps posted in the last year or 2 are incompatible with build18, and there are new features that people take for granted, to the point that the first thing a new guy on the forum is told is that he should try the latest versions. even the tournament was played mostly on the trunks, and it was one year ago. if those trunks were really unofficial it would be less bothering, but it feels like they are really the official build.


Top Quote
SirVer

Joined: 2009-02-19, 14:18
Posts: 1445
Ranking
One Elder of Players
Location: Germany - Munich
Posted at: 2016-03-29, 07:21

if so, how long before we could reasonably expect that backwards compatibility will be restored from that point into the future?

With b19 onwards we will start to try to stay backwards compatible again.

One thing that probably backfires against the development is that the unofficial trunks have become something of an "unofficial official build".

That is very true - b19 already took way to long to manufacture and there are still some critical bugs that needs fixing. As far as I can tell, the team has doubled down on fixing bugs now though, so we are working towards b19 as fast as possible.

even the tournament was played mostly on the trunks,

this on the other hand is desired - tournaments give us a lot of insight in the current balance and bug situation, so we always want them to be played on trunk. but you are very right about the map situation - not ideal.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2016-03-29, 07:58

kaputtnik wrote:

Yes it bothers me also a lot...

Just like the changes to the lua files which broke my own data directory several times. GunChleoc, are these changes completed now?

Except for the help system that I am currently still working on, yes. Unless I encounter something unexpected.

Oh, and I'm still trying to get the new font renderer to work. That will have an impact on all formatting an scenario/campaign/help scripts. So, I think we get that one into Build19 in some form, so we won't break everything again during the next release cycle.


Busy indexing nil values

Top Quote