• Civilization 7 has been announced. For more info please check the forum here .

Change player data in multiplayer save?

Alekseyev_

Warlord
Joined
Jul 18, 2014
Messages
259
Hey there - I found no information at all on how to modify multiplayer saves, so I'm asking here. I made a mistake in scenario data when setting up a game, and now we're about 1000 of 2000 turns in (using Realism Invictus mod) and I would like to fix the issue (restarting would lose us literal weeks of progress). Namely, the player I am playing with incorrectly had bonus coastal trade routes set at 0 at the scenario start rather than the 1 he deserved. So this has cost him lots, and I would like to not just restore that trade route, but also giving him some compensation of techs and money. I was wondering if it'd be possible to make a script that (of course installed for everyone) would on launch raise the coastal trade routes by 1 and give a specific player/civ some techs and coin. We could then leave the game and remove the script again from each of our computers.

Can anyone help me out here? It sounds like something doable in python, but I'm really inexperienced.
 
That would be possible to change using programming. It certainly is in C++, but it might be doable in python too. The problem is that it would require somebody with knowledge to work on it and given that I'm not sure of the scope of the issue in code, I don't know how long it would take. Also it might require network sync code or just run to make the change, save and then load. This way the change will be distributed.

The savegame file itself is not encrypted, so in theory it can be edited. The problem is that it is compressed. Also it's not labeled which number goes where so finding the right byte to change would be a hassle.

I would need to get the source code to the mod to give a better answer so maybe somebody who already has the source code can say something here.
 
Hey, thanks for the quick reply. I believe the code is not actually mod-specific, since all that is missing is the same effect that would be received from e.g. the Great Lighthouse in vanilla via its
Code:
<iCoastalTradeRoutes>1</iCoastalTradeRoutes>
. It's just that the mod adds a trait ("seafaring") that also has this effect, but apparently for scenarios, it does not take effect, so the player data in the scenario file has to specify the trade route itself - the part that I failed to account for, for not knowing better at the time. (At least when checking from the world builder's player data view in singleplayer, adding the great lighthouse had exactly the same effect of raising the desired variable as I was missing in the scenario data).

Is the compression of savegame files known how to reverse?

The mod source code is public and can be found here: https://sourceforge.net/p/civ4mods/code/HEAD/tree/realism/bts/trunk/mod/GameCore/CvGameCoreDLL/
 
Top Bottom