Save game compat format

Isabelxxx

Prince
Joined
Sep 26, 2010
Messages
387
Just visited the official web of the mod and seen that there is some type of work in progress announced so here are my suggestions for the next update. Pretty useful for the modders I think.

Have been considered the addition of that well known characteristic from the mod C2C?

http://forums.civfanatics.com/showthread.php?t=426653

Since I started contributing to the C2C modding efforts (and more recently AND) I have become increasingly frustrated by incompatibility of save games from one version into a slightly changed version as the XML assets evolve. Basically this means I never get beyond the middle ages before new assets render my games uncontinuable.

As a result I decided to do something about it.

This post is a slight pre-announcement, but I'm very excited about this change, so hopefully you'll foregive me for that. I am currently in the final stages of testing, but I expect to be pushing the changes to SVN in the next day or two. After I do I'll make a detailed technical post giving the details of how it all works for modders reference, but for now here's a brief summary in the form of a FAQ list:

What do I mean by saying the changes will enable save-game compatibility between mod releases?

An option will be provided on save, to save in an extended format, which will be loadable even after fairly radical changes to the mod XML, or future DLL changes. In particular you should be able to expect to continue existing games in updated versions of a mod, unless the changes to the mod are of an extremely radical nature.

What are some examples of mod changes that will NOT prevent save games from loading with the new format?

Most changes frankly. For example, adding buildings, units, civics, techs, improvements, resource types and so will no longer break saves. Removing these things will also not break saves, though in cases where removed entity is in use in the save it will be removed on load if no longer valid (and you'll get a visible warning that this has occurred). Obviously if the mod changes relationships between already-extant (in the save game) entities (e.g. - changes requirements for building something) then the save game will potentially contain things that you would not be able to create in the same conditions after the mod update (so if a building got a new required tech say, you would still have the building if you had already built it previously).

What will still make a save game unloadable?

Pretty much just DLL changes that don't stick to certain rules (which I'll clarify in a technical post after this gets pushed)

So should I continue old games just because I can?

Up to you. If the load gives you warnings that some of the types it needed could not be found (which implies units/buildings/resources or whatever it warns you about have been removed) then you need to weigh the loss of fidelity against the benefits of not losing your investment in time in that game.

What are the downsides?

Using the new format will result in larger save files (about 40%) and slightly slower loading and saving.

When will the new format be used, and when will the old format be used?

Auto saves will continue to always use the old format because it's smaller and faster. This means you can't assume autosaves will be loadable in future releases (so same as now). Explicit save requests from the main save menu will now pop up an additional question asking you which format to use.

When do I recommend using the new format?

Depends who's asking ;-) This new format should be considered beta functionality, so for most end users I would say from day to day continue to use the old format. When a new mod release or patch becomes available make a save in the new format so that you'll be able to load it again after updating the mod. Modders on the other hand might want to save in the new format all the time since they are likely to be making XML changes frequently (and because they want to be helpful and give it some additional testing!)

I hope everyone enjoys the ability to continue games even on mods that change very frequently (looking at you C2C), and I trust you'll forgive my excitement with this.

The code is already available in the SVN and it has been working in the mod since months.

http://forums.civfanatics.com/showthread.php?t=429816

That would definitively eliminate the need of starting a new game after an update.

There are also other debugger utilities recently added in their dll which could help to understand and fix those bugs some users are experiencing at the start.

Minidump mod component included. On a crash a MiniDump.dmp file will be created where the BtS exe is. This should be uploaded for easier debugging.
If there is a significant performance loss, report
 

Tigranes

Armenian
Joined
Sep 11, 2008
Messages
9,867
I think this belongs to C2C thread :p
 

Isabelxxx

Prince
Joined
Sep 26, 2010
Messages
387
I was suggesting to included that here. The code was not made specifically for C2C but for BTS, and therefore it would be possible to do something with it.

I still don't understand why others modders are not using that since the first moment it was made... it seems that the feature has been overseen due to being included in such big mod.
 

raystuttgart

Civ4Col Modder
Joined
Jan 24, 2011
Messages
8,854
Location
Stuttgart, Germany
I still don't understand why others modders are not using that ...

1. Because this cannot work with heavily modified DLL between 2 releases.
2. Negative impact on performance.
3. Modders are interested in modding features and not that much in savegames.

This might be nice for mods that are mostly about XML (Units, Buildings, Professions, ...).
But that is it. :dunno:

For all the big mods around CivCol, this is pretty much useless ...
(There are usually many months between releases and DLL changes are often quite heavy.)

I really cannot imagine any major CivCol-modding-project trying to adapt this.
(This would never work for all big CivCol-Mods anyways and would need to be adjusted probably every major release.)
 

JosEPh_II

TBS WarLord
Joined
Jun 20, 2007
Messages
16,536
Location
Western IL. cornfields
In response to Tigranes and raystuttgart

1. Yes it does work with heavily modded .dll
2. Impact is minimal
3. Short sighted view

It's Nice for ALL mods

Stretch your imagination a bit ray! And no it does Not need adjusted for every major release.

By now I hope you have researched this better and have a better understanding of it's usefulness and superiority over normal save game format.

JosEPh :)
 

Isabelxxx

Prince
Joined
Sep 26, 2010
Messages
387
In response to Tigranes and raystuttgart

1. Yes it does work with heavily modded .dll
2. Impact is minimal
3. Short sighted view

It's Nice for ALL mods

Stretch your imagination a bit ray! And no it does Not need adjusted for every major release.

By now I hope you have researched this better and have a better understanding of it's usefulness and superiority over normal save game format.

JosEPh
It's in my TODO list. But right now I still have some minor things to finish before adding that.
 

JosEPh_II

TBS WarLord
Joined
Jun 20, 2007
Messages
16,536
Location
Western IL. cornfields
Too bad this wasn't followed up.

Both Tigranes and Ray have No Idea how much better it is to be able to continue a Game after a Mod is Updated instead of having to start all over.

And Koshling will work with anyone interested in using it.

Isabelxxx, are you still active in this development?

JosEPh
 

JosEPh_II

TBS WarLord
Joined
Jun 20, 2007
Messages
16,536
Location
Western IL. cornfields
This is simply something like point 10001 of my prioritized list of todos. :dunno:

Wow ray, do you develop DoaNE too?

I thought this was their forum? As I was hoping to get Isabelxxx to respond.

If you don't want to use it in RaR that's up to you. But you Are missing out on a super innovation. Like I said your choice.

JosEPh
 

Nightinggale

Deity
Joined
Feb 2, 2009
Messages
5,002
Is There a standalone version of this new save format?
That is highly unlikely.
However this thread inspired me to code this feature for Medieval Conquest (well entire Colonization Mod Collection due to shared source code). However I don't like the C2C solution due to performance and savegame size issues as well as a general not that readable code. I made a totally different design with minimal performance impact. If anybody is really interested in details for this, then read the CMC git log and/or goto M:C's subforum.
 
Top Bottom