How to edit savgame file

For topics that do not fit in another sub-forum.

Moderator: Oberlus

Message
Author
husky0001
Space Krill
Posts: 3
Joined: Thu Apr 21, 2016 2:48 pm

How to edit savgame file

#1 Post by husky0001 »

Maybe there is an answer already here, but I could not find it.

So how to edit a sav file? When I open in Notepad++ i just get lot of hieroglyphs and nulnulnul i such characters. What software(s)/tool(s) is/are needed to see savegame data as something "normal" and to change it?

Reason why I ask is because AI is cheating and I need some edge. I really don't have anything against really strong AI, but here is just plain cheating. After lots of games that reached up to about 300 turns, and one AI always have 3 times more ships than me (others are not the problem), I really got tired and started small game with just 10 systems and just one AI.

This AI starts with just one ship, that looks exactly like mine (MARK I), and kills my fleets that are several time bigger. I have to produce 4 Mark I to kill its 1. This is just plain stupid ratio.

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: How to edit savgame file

#2 Post by MatGB »

The AI does not, and cannot, cheat, it is given zero advantages over you other than occasional random chance better early system grabs(1). That's a deliberate design goal of the game, if you're sure it's otherwise it's a bug, and we need savegames and evidence.

However...

I've never tried this, but if you tell your game to save games in XML format and not Binary format (in Options), then it'll create larger, human readable save files.

One observation: check that the AI in question isn't starting as an Eaxaw species, or using Mu Ursh to build its ships. And that you're not using Gysache or similar to build yours. What you describe in the combat should not be happening, on the other hand you're playing with an older version (Mark 1s were renamed Frigates since the last official Release) and there may have been a previously unreported glitch.

When you're done with your current game, download the most recent Test version, it's stable enough and has had a lot of changes including improved introductory/help stuff.



(1): By this I mean that it's always possible one player starts with a better selection of nearby planets to colonise and/or nearby natives that are more useful, but this shouldn't be game breakingly out of kilter.
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

defaultuser
Juggernaut
Posts: 854
Joined: Wed Aug 26, 2015 6:15 pm

Re: How to edit savgame file

#3 Post by defaultuser »

I would suggest that you post a save file from a game that demonstrates the combat result you are seeing, and the version of course, then people could take a look and explain it. As Mat notes, the AIs don't have cheat boosts (the lazy way to improve AIs).

As far as an AI having more resources, you're probably just getting outplayed. In particular, new players often waste resources building poor warships before they are needed rather than developing their area. That's also a problem I tend to see with "Maniacal" AIs. It sometime annoys me when I take over their area and see good colonizable worlds that weren't developed because they were trying to attack others.

husky0001
Space Krill
Posts: 3
Joined: Thu Apr 21, 2016 2:48 pm

Re: How to edit savgame file

#4 Post by husky0001 »

I'm playing v0.4.3-6281. There is no option to save as xml, or any other option. After I updated to 4.5 there is option for that.

Here is sav file just before battle. It is 5th turn from the begining. I have one Mark I as human, enemy, Eaxaw, have 3 Mark 4 ships. There is apsolutely no way that I can reach that kind of fleet in 5 turns.
Attachments

[The extension sav has been deactivated and can no longer be displayed.]


husky0001
Space Krill
Posts: 3
Joined: Thu Apr 21, 2016 2:48 pm

Re: How to edit savgame file

#5 Post by husky0001 »

Here is another example. Again I am human, turn 19 and have 4 Mark 1 ships right next to enemy system. Enemy, gysache, has 1 Mark 1 and 1 Colony.

I attack and after 2 turn, my fleet is destroyed completely. If ratio was reversed my Mark 1 certainly can't kill 4 Mark 1's from enemy.
Attachments

[The extension sav has been deactivated and can no longer be displayed.]


User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: How to edit savgame file

#6 Post by Geoff the Medio »

v0.4.3 is two and a half years old... whatever issues it had with balance are probably very out-of-date, and not really worth investigating. Update to a newer build.

If the combat result is in v0.4.5, can you post a screenshot of the combat report event log? Accessed by clicking the link in the sitrep line about the combat, then going to the log tab. If it's v0.4.3, then, as above, you'll really need to update to get any meaningful support...
Attachments
combat log from sitrep link
combat log from sitrep link
combat_log.png (86.38 KiB) Viewed 13849 times

User avatar
Bromstarzan
Dyson Forest
Posts: 206
Joined: Sun Feb 28, 2016 9:56 pm
Location: Sweden

Re: How to edit savgame file

#7 Post by Bromstarzan »

Perhaps you're taken out by the combined forces of the enemy's system shields/defences + warships (if you attack them at their homeworld etc.)? Hard to say unless you provide the combat log as Geoff suggested.
| i7 7700K [email protected] | GTX 1080 Ti | RAM: 32GB | PSU: 750w | W10 x64 | 2xAcer1920x1080 |

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: How to edit savgame file

#8 Post by Vezzra »

Well, he provided two savegames, so it should be possible to take a look ourselves. @husky0001, which version/build exactly did you use for those games? The 0.4.5 stable release, a recent test build, or 0.4.3?

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: How to edit savgame file

#9 Post by MatGB »

Ah, no.

In 0.4.3, Eaxaw didn't get the weapons bonus, instead they started the game with lasers unlocked and an additional laser armed warship. That was stupidly powerful, but it wasn't an AI cheat, it was something any Eaxaw player could get.

We changed it for a reason and the current system is much more balanced.

Regarding the second save, 4 Mark 1 ships have been built. That's back in teh days before weapon refinements, ergo that's 3 ships that were already obsolete before they were finished.

0.4.3 also predates the combat changes, the outnumbering player always had an advantage, but planetary defences and similar could deal with an attacking fleet really easily, IIRC M1s back then didn't even have armour so that's a ship per turn destroyed by the defences.

All of which is to say: they were known balance bugs that were removed from the game 2 years ago and are no longer relevent (worth noting that some Linux distros may still be on 0.4.3 in their repos, for some reason 0.4.4 never got picked up at all and not all have switched to 0.4.5 yet).
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

User avatar
LienRag
Cosmic Dragon
Posts: 2148
Joined: Fri May 17, 2019 5:03 pm

Re: How to edit savgame file

#10 Post by LienRag »

I like the idea of "Space Monsters" and want to add a few nests to a seed-generated game I've played (probably a Snowlake nest near my starting planet and a Kraken nest farther) so I tried to open the saved game as explained here after verifying that the "create binary saves" was unchecked. I do see some XML but most of the file is under a "compressed" XML tag and unreadable.

Is there a way to uncompress and modify it? Or is there a better way to edit a galactic map?

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: How to edit savgame file

#11 Post by Ophiuchus »

LienRag wrote: Fri May 17, 2019 5:33 pm Is there a way to uncompress and modify it? Or is there a better way to edit a galactic map?
I think there is no better way. There is an option for non-binary save files. Load your game, change the setting and save again. Good luck
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: How to edit savgame file

#12 Post by Geoff the Medio »

At least if you update to a newer version, there is also an option to enable/disable compression for XML saves.
option to enable / disable xml compression in save file
option to enable / disable xml compression in save file
xml_compression_option.png (69.83 KiB) Viewed 12770 times

User avatar
LienRag
Cosmic Dragon
Posts: 2148
Joined: Fri May 17, 2019 5:03 pm

Re: How to edit savgame file

#13 Post by LienRag »

Thanks.
I upgraded via the PPA (hope someone checked it...) and I now have the ability to save files without compressed XML indeed.
Alas I cannot load my old savefiles anymore and I don't get the same universe (or at least starting position) if I use the same seed that I used on 0.4.7.
Could there be one of the new options that I need to set to a certain value in order to get the same correspondence between seed and starting position?

I saved one of the newly seeded game to learn how to edit the savefile, but I'll have to confess that I'm a bit at a loss there.

I found my starting planet (it's not what I want to change but at least I was sure it was there and I knew its name) but I'm not sure of what to do with all the parameters.
I get the coordinates, system Id, and owner empire, but not at all what the <first> and <second> tags refer to?

Code: Select all

<first>404124</first>
	<second>
		<px class_id_reference="111" object_id="_16715">
			<UniverseObject>
				<m_id>404124</m_id>
				<m_name>Tork δ II</m_name>
				<m_x>1.74339213359930955e+03</m_x>
				<m_y>6.95271798517759748e+02</m_y>
				<m_owner_empire_id>-1</m_owner_empire_id>
				<m_system_id>403998</m_system_id>
					<m_specials>
						<count>0</count>
				<item_version>0</item_version>
					</m_specials>
					<m_meters>
						<count>25</count>
				<item_version>0</item_version>
					<item>
						<first>0</first>
							<second>
								<c>0.000000000e+00</c>
								<i>0.000000000e+00</i>
							</second>
					</item>
					<item>
						<first>1</first>
							<second>
								<c>0.000000000e+00</c>
								<i>0.000000000e+00</i>
							</second>
					</item>

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: How to edit savgame file

#14 Post by Geoff the Medio »

LienRag wrote: Tue May 21, 2019 5:31 pmCould there be one of the new options that I need to set to a certain value in order to get the same correspondence between seed and starting position?
Not sure what you mean... If you mean can you reproduce the universe generation in an old version using a newer version by setting an option, no. You'd probably need to edit the Python universe generation scripts for that to be possible.
I get the coordinates, system Id, and owner empire, but not at all what the <first> and <second> tags refer to?

Code: Select all

<first>404124</first>
	<second>
		<px class_id_reference="111" object_id="_16715">
			<UniverseObject>
				<m_id>404124</m_id>
				<m_name>Tork δ II</m_name>
				<m_x>1.74339213359930955e+03</m_x>
				<m_y>6.95271798517759748e+02</m_y>
				<m_owner_empire_id>-1</m_owner_empire_id>
				<m_system_id>403998</m_system_id>
					<m_specials>
						<count>0</count>
				<item_version>0</item_version>
					</m_specials>
					<m_meters>
						<count>25</count>
				<item_version>0</item_version>
					<item>
						<first>0</first>
							<second>
								<c>0.000000000e+00</c>
								<i>0.000000000e+00</i>
							</second>
					</item>
					<item>
						<first>1</first>
							<second>
								<c>0.000000000e+00</c>
								<i>0.000000000e+00</i>
							</second>
					</item>
Keep in mind that the format isn't primarily intended for being user-readable and editable, although editing it should work if you don't break the formatting. The first and second tags refer to the internal organization of data as a C++ pair object, which consists of two data structures combined, one of which is itself a combined data structure. The first in your example text is the number representing what kind of meter value is being recorded, and the second is a pair of floating point numbers that store the current and initial values of that meter for an object. The correspondance of numbers to meter types is sequentually in this list: https://github.com/freeorion/freeorion/ ... nums.h#L89 There will be a lot of that sort of not-obvious-meaning stuff in the save files, which will require looking through some C++ code to fully understand, or posting to ask. I think for your purposes, editing most of that isn't necessary, though.

User avatar
LienRag
Cosmic Dragon
Posts: 2148
Joined: Fri May 17, 2019 5:03 pm

Re: How to edit savgame file

#15 Post by LienRag »

Well, what I mean is that I've read somewhere in the forum that stability of universe generation for a given seed across versions of FreeOrion was a thing, and that's why I upgraded though I suspected that I wouldn't be able to load my old saved games.
Since there are new options with the new version, I wanted to know which ones need to be turned to what value to keep this stability of universe generation.
I'll be quite disappointed if I was deluded to believe in that universe generation stability acroos versions, since I much liked the starting position I got (no easily colonisable planet near my starting point but a Tae Ghirus native planet without shields quite near) but I guess I'll have to make do...

The other problem I have is that since I can't load old saved games to resave them with uncompressed XML, I can't look at their uncompressed XML to find how monster nests are described in the XML file?

Post Reply