• We are currently performing site maintenance, parts of civfanatics are currently offline, but will come back online in the coming days. For more updates please see here.

Extract info from Save Files?

RaidandTrade

Prince
Joined
Oct 26, 2013
Messages
358
Hi - Not a programmer, please be gentle...

I'd like to be able "read" a save game file to be able to pull some key info out to have on a second screen while I'm playing and then be able to refresh it (i.e., read in the last autosave). For example, I'd like to be able to "read" my leader's unlock "attributes" so that I can better spend my legacy points during the age transition. Similarly, it would be nice to be able to see the settlement list with resource allocations and yields in a sortable list so I can quickly identify the settlement with highest production, science, culture, etc.

I currently manually track my attributes in an Excel sheet but there's got to be a better way! Achievable or pipe dream?
 
That doesn't seem feasible to me. Using the sniping tool to capture the information you need would be far more feasible. W3Schools has a free HTML tutorial that will show you the basics of displaying those images in a simple HTML document if just viewing the images isn't good enough. It's only slightly more difficult than displaying an image in this thread. AutoHotKey can automate the sniping. If you're not actually in the game it doesn't help that much, but, by far, the easiest way to get data out of a save game is to load it into the game. A bit more advanced would be a script in game to post the data you need into a csv format on the clipboard. UI.setClipboardtext() can be used to export data out of the game. XML would give you more control but be a bit more involved to format. Excel uses XLSX which is a variant of XML. So it likely imports XML and allows you to set formating and all kinds of stuff.

The problem with the save game is it's binary, the format is unknown and it's base data. Much of what you see in game is derived data. You call functions that gather it from various places and performs calculations on it. All they put in the save game is what it's derived from. Often it's just codes that decode into a useable string. Like maybe unitIType is 0x0394 in the file but that gets translated to "slinger" in the game. Usually people that hack those are just looking for where your gold balance is stored and such. They aren't interested in reading the whole file. So, realistically, you have to load it into the game to make it useable.
 
Thanks for coming back on this. Appreciate the detailed “why not” explanation and suggestions. I’ll take a look at AutoHotKey and see how I get on!
 
My apologies. I just did a cursory search for the type of program. AutoHotKey is a scripting tool for automating windows. That's not real appropriate for a non-programmer. TinyTask would be more appropriate. With their download page if you get the With Editor that's actually reMouse which has a $20/year licensing fee. The versions below that are shareware. You can record and save macros. I gave it a try and it's just start recording, do whatever, stop recording then run macro. I would suggest start with TinyTask. If you find you would like to edit those macros maybe license reMouse. If you're going to spend money there's Simple Macro Recorder and JitBit Macro Recorder. There's likely more. So I would suggest looking around. Another free tool is Power Automate. I haven't played with that, but it seems many people automate their whole job with power automate.
 
Back
Top Bottom