colsaves - Updates

henryjfry

Chieftain
Joined
Jul 26, 2022
Messages
2
I've recently got back into playing colonization and had been looking on the internet for strategies and other useful info and had stumbled across some of the post here about decoding the save games.
I found ColSaves and having gotten into python in the last few years i have been able to make some modifications and improvements to make it a bit more useful that it already was.

I've forked it on my github and the readme contains an example usage on a windows machine with python:


So the attached map.png and savegame.txt are the current output (on lines 1097-1099 it opens the image and txt file which you might want to comment out).
I added additional lookups/textures to the map output so you can see where your colonies are (white text) vs other powers colonies (red text) vs Indian villages (green text)

Using some information found here and in viceroy I was able to decode the indian Scouted/Capital/Learned/Artillery(??) status, which are the S/*/L/A against the indian nation name and population number.
I wasnt able to find the right texture for the colonist orders or how to display that with readable text but tinier letters, so the black on flag is best I could figure. But the flags should be correct for each country (plus the E/F/S/D indicator for English/French/Spanish/Dutch).
And I was also able to figure out how to decode the colonies fortification status, im not convinced the original code is doing it correctly.

The original tool seems to only tile sea/forest/mountain tiles. I dont know enough about decoding the hex to better figure how to get the map to use all the correct textures but I dont think it would take much tweaking to get a game accurate map.

So im hoping this is useful, the map is maybe a bit busy but thats mostly the PIL text which i dont know how to make look better and still be readable so anyone who has an idea on that feel free to make suggestions.
 

Attachments

  • map.png
    map.png
    446.5 KB · Views: 52
  • savegame.txt
    283.3 KB · Views: 29

Bladrov

Chieftain
Joined
Apr 2, 2020
Messages
99
Location
Sacramento, CA
That's great! But, when I run it (per the README.txt), I get:

ModuleNotFoundError: No module named 'PIL'

I must be missing something or doing something wrong.

Also, we could save space on the map by not indicating Capital, since that already shows on the game map.
 

henryjfry

Chieftain
Joined
Jul 26, 2022
Messages
2
The PIL module is the python image library and its installed like this:

pip install Pillow

In a python terminal.

The capitals would probably be easily commented out, so comment out this section??


if tribe_bin_state[1] == '1':

#tribe_state = tribe_state + 'C'
tribe_name = i.nation + '*('+ str(i.population) + ')'

However thats the least obstructive text on it so isnt likely to make it look that much better.

Im hopeing someone round here with a better handle on texture might pick it up and integrate the texture tiles better.
If it accurately could portray the terrain that would be awesome.
 

Bladrov

Chieftain
Joined
Apr 2, 2020
Messages
99
Location
Sacramento, CA
I've managed to install it in Linux with sudo apt install python3-pip and pip install Pillow. However, when I run reader.py against a save file, I get an odd cursor shaped a bit like an Iron Cross and the blinking terminal cursor disappears, and the computer just sits there. If I Ctrl-C or whatever out of there, I get a bunch of lines like

./reader.py: line 18: trade route,: command not found
./reader.py: line 19: go to,: command not found
./reader.py: line 20: 0x04,: command not found
./reader.py: line 21: 0x05,: command not found
./reader.py: line 22: fortify,: command not found
./reader.py: line 23: 0x07,: command not found
./reader.py: line 24: plow,: command not found
./reader.py: line 25: road: command not found
./reader.py: line 26: ]: command not found
./reader.py: line 28: NATION_FLAG: command not found
./reader.py: line 29: icons.ss_118.png,: command not found
./reader.py: line 30: icons.ss_119.png,: command not found
./reader.py: line 31: icons.ss_120.png,: command not found
./reader.py: line 32: icons.ss_121.png,: command not found
./reader.py: line 33: ]: command not found
./reader.py: line 35: CONTROL: command not found
./reader.py: line 36: player,: command not found
./reader.py: line 37: ai,: command not found
./reader.py: line 38: withdrawn from new world: command not found
./reader.py: line 39: ]: command not found
./reader.py: line 41: DIFFICULTY: command not found
./reader.py: line 42: Discoverer,: command not found
./reader.py: line 43: Explorer,: command not found
./reader.py: line 44: Conquistador,: command not found
and
./reader.py: line 146: 6:: command not found
./reader.py: line 147: 7:: command not found
./reader.py: line 148: 8:: command not found
./reader.py: line 149: 9:: command not found
./reader.py: line 150: 10:: command not found
./reader.py: line 151: 11:: command not found
./reader.py: line 152: 12:: command not found
./reader.py: line 153: 13:: command not found
./reader.py: line 154: 14:: command not found
./reader.py: line 155: 15:: command not found
./reader.py: line 156: 16:: command not found
./reader.py: line 157: 17:: command not found
./reader.py: line 158: 18:: command not found
./reader.py: line 159: 19:: command not found
./reader.py: line 160: 20:: command not found
./reader.py: line 161: 21:: command not found
./reader.py: line 162: syntax error near unexpected token `}'
./reader.py: line 162: `}'
 
Last edited:

pbsite

Chieftain
Joined
Jan 9, 2023
Messages
19
I've managed to install it in Linux with sudo apt install python3-pip and pip install Pillow. However, when I run reader.py against a save file, I get an odd cursor shaped a bit like an Iron Cross and the blinking terminal cursor disappears, and the computer just sits there. If I Ctrl-C or whatever out of there, I get a bunch of lines like

Great tool! It worked for me, bitmap and savegame.txt produced ok. You should fix your Python installation. Maybe you should try installation of an IDE for working with Python. PyCharm for example.
 

Bladrov

Chieftain
Joined
Apr 2, 2020
Messages
99
Location
Sacramento, CA
Ah, got it working. In Xubuntu Linux at least, you have to also install python3-pip (I used Synaptic). I then ran pip install Pillow in a terminal (not sure if necessary), then I ran it. In Linux the command will be more like:

Then run python3 ~/dos/COLONIZE/colsaves-master/colsaves/reader.y ~/dos/COLONIZE/COLONY##.SAV

I take it that Artillery is for European colonies, showing how many artillery units in town? And the number next to Indian settlements, is that the tribe number?

And the Learned variable - when it shows L, does that indicate the village no longer teaches any skills?

Any chance of being able to see what a given village teaches?
 

pbsite

Chieftain
Joined
Jan 9, 2023
Messages
19
I'm now working on a utility for enchanced study and modification of Colonization .SAV files - to make it as handy and simple as possible.

There's one interesting thing I already discovered about Warehouse/Warehouse Expansion info. It turns out that it is stored not like other 2-level buildings like carpenters shop, church or printing press. There is only one bit for storing "warehouse" flag inside the 6 bytes buildings struct, right after "schoolhouse". But the next bit is not a flag for Warehouse Expansion! This bit is actually not used and always equals to 0.

The thing is there is a separate BYTE for storing LEVEL of Warehouse Expansion: 0x95 in colony record (0x93 or 147 (dec) steps after the first char of colony's name, right after "building in production" byte), and it is not just a boolean flag but a full level. It equals 0 if there is no warehouse, 1 for warehouse, 2 for warehouse exp. And you can set it to any value, even 0xFF (255)! In this case the storage capacity for any cargo type will be 100 * (LEVEL+1). No more 300 tons limit!


2023-01-30_17-34-11.png
 

Attachments

  • 2023-01-30_17-12-36.png
    2023-01-30_17-12-36.png
    5.3 KB · Views: 4
Last edited:

AyCe

Warlord
Joined
Mar 3, 2019
Messages
106
I'm now working on a utility for enchanced study and modification of Colonization .SAV files - to make it as handy and simple as possible.

There's one interesting thing I already discovered about Warehouse/Warehouse Expansion info. It turns out that it is stored not like other 2-level buildings like carpenters shop, church or printing press. There is only one bit for storing "warehouse" flag inside the 6 bytes buildings struct, right after "schoolhouse". But the next bit is not a flag for Warehouse Expansion! This bit is actually not used and always equals to 0.

The thing is there is a separate BYTE for storing LEVEL of Warehouse Expansion: 0x95 in colony record (0x93 or 147 (dec) steps after the first char of colony's name, right after "building in production" byte), and it is not just a boolean flag but a full level. It equals 0 if there is no warehouse, 1 for warehouse, 2 for warehouse exp. And you can set it to any value, even 0xFF (255)! In this case the storage capacity for any cargo type will be 100 * (LEVEL+1). No more 300 tons limit!


View attachment 652420
Yep, cheats can also increase the warehouse level up to 255.
 
Top Bottom