1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Colonization DOS Utility to keep track of Indian settlements

Discussion in 'Other Sid Meier Games' started by Bladrov, Feb 26, 2021.

  1. Bladrov

    Bladrov Chieftain

    Joined:
    Apr 2, 2020
    Messages:
    59
    Gender:
    Male
    Location:
    Sacramento, CA
    Yeah, that might be. But there should be a level of alarm kept track of somewhere. They don't go from !!!! to ! (or vice versa) at random.
     
    Last edited: Apr 3, 2021
  2. AyCe

    AyCe Chieftain

    Joined:
    Mar 3, 2019
    Messages:
    73
    Yes, maybe 4 bytes in a row, and when they are very angry and you are dutch its 00 00 00 FF or something.
     
  3. Bladrov

    Bladrov Chieftain

    Joined:
    Apr 2, 2020
    Messages:
    59
    Gender:
    Male
    Location:
    Sacramento, CA
    Could be. Or maybe the "Alarmed by ____" fills in the blank with the nearest colony's owner. I tried to test that idea this morning by changing the flag of who owns a given colony: change one of my Dutch colonies to an English one or something - but I don't see that in the save file. The colony's name is preceded by the coordinates, which are preceded by several 00s. Following the name is data about the colonists working inside and their SoL levels (as http://www.colonization.biz/hack.htm said it would be). So ownership of colonies seems strangely absent from the save file. This is very odd! You'd think that, and that other data I mentioned, would be right here, stored with the colony/settlement, but I don't see it.
     
    Last edited: Mar 4, 2021
  4. AyCe

    AyCe Chieftain

    Joined:
    Mar 3, 2019
    Messages:
    73
    Savegame where dutch have a colony and you are spanish. Then use cheats to spawn a soldier next to it and capture it. Then compare the bytes around the colony name. Somewhere 03 should have switched to 02. Just an idea.
     
  5. Bladrov

    Bladrov Chieftain

    Joined:
    Apr 2, 2020
    Messages:
    59
    Gender:
    Male
    Location:
    Sacramento, CA
    Yes!! Found it. The 25th character after the start of the name is a flag for the owner. Changing it to something other than me (Dutch) activates my soldier inside. I can move it out; I can even move it onto that square again and off again if I want. But I can't open the colony any more.
    00 English
    01 French
    02 Spanish
    03 Dutch
    04 Nothing (shows a box with an X in place of a flag)
    05 Rebel (shows the American Revolutionary flag)
    06 Royal (shows a crown)
    07 ??? (shows a non-veteran soldier instead of a flag)
    08 ??? (shows a cavalry unit instead of a flag)
    09 ??? (shows a man-o-war instead of a flag)
    10 or above Makes the game crash

    Two characters further is a mysterious 40 value. I found that changing that to 02 increases the food and sugar produced on my colony square by one each. Changing it to, say, 01, doesn't seem to do anything.
     
    Last edited: Mar 9, 2021
  6. AyCe

    AyCe Chieftain

    Joined:
    Mar 3, 2019
    Messages:
    73
    Food and yield on the colony tile is dependent on difficulty. I noticed that if you look in the AI colonies it will report numbers as they would be for your difficulty, but when you look a turn later what was produced it will be a different value. Maybe it's somehow set there?
     
  7. Bladrov

    Bladrov Chieftain

    Joined:
    Apr 2, 2020
    Messages:
    59
    Gender:
    Male
    Location:
    Sacramento, CA
    Oh wait, the whole reason I was looking for colony country code was to test how "Alarmed by ____" was determined. I'll have to check that out later.

    And yes, maybe that 0A 08 03 FF 00 FF FF FF 00 00 00 00 00 00 00 00 holds the alarm level somewhere. I'll have to play the game, save, watch for when a settlement's level of alarm changes, and compare stats for that village in the save files.

    So, it looks like the first Indian settlement starts at 6432 and the last at 7744, and each is 18 characters long.

    Of course the tricky part at some point would be writing a program or script that will parse the data, convert values to strings, and interpret it all. I've been poking around with doing this in Ruby, but it's slow going since I don't know what I'm doing.
     
    Last edited: Mar 9, 2021
  8. Bladrov

    Bladrov Chieftain

    Joined:
    Apr 2, 2020
    Messages:
    59
    Gender:
    Male
    Location:
    Sacramento, CA
    Ok, I've created a ruby file that will give you a list of all the Indian settlements. It displays the coordinates followed by all the data characters after them. That should help us work out what it all means.

    Unzip this file to your COLONIZE folder, open a command prompt there, and enter ruby ind.rb. Of course you have to have ruby installed first.
     

    Attached Files:

    • ind.zip
      File size:
      554 bytes
      Views:
      14
  9. Bladrov

    Bladrov Chieftain

    Joined:
    Apr 2, 2020
    Messages:
    59
    Gender:
    Male
    Location:
    Sacramento, CA
    Hum, good news and bad. I might have worked out how Capital is stored: it looks like the first 8 settlements in the file are the Indian capitals. That's possibly why, if a capital is destroyed, another settlement doesn't become the new capital for the tribe.

    In less good news, I just ran the file against my save from last night. It's the same game, but late in it - I'm getting ready to declare independence. I'm getting a lot of incongruent data from it now: some normal-looking values, but also things like
    (1,1)
    1 0 0 0 0 26 0 0 0 191 0 0 0 34 28
    (0,0)
    0 0 0 1 176 64 0 2 1 13 0 0 0 0 0
    (0,0)
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    (0,0)
    255 255 255 255 255 255 255 255 255 255 255 255 255 255 255

    A lot of this (esp. the (0,0) ones) could be destroyed villages, but what's the rest? I see the file size has increased substantially from 26.6k to 36k, so maybe data gets pushed into it over time and I can't rely on searching from x position to y position in the file.

    Edit: looks like my suspicion there is confirmed. I see last night's save file has data for European colonies a bit further down (6848dec) than the first Indian settlement started in the original file (6432dec), and that first settlement's been pushed down to 16160dec. So it looks like new colonies are additional data inserted into the save file rather than filling previously empty "placeholder" space. I don't see anything to distinguish where the first Indian village occurs. Here are the characters preceding the first Indian settlement in the old vs. later save; there's a number of 00s before them:
    00 00 00 00 00 00 00 00 00 00 00 38 FF FF FF 38 FF FF FF 06 FF FF FF
    00 00 00 00 00 00 00 64 00 00 00 70 FE FF FF D4 FE FF FF A2 FE FF FF
     
    Last edited: Apr 3, 2021
  10. AyCe

    AyCe Chieftain

    Joined:
    Mar 3, 2019
    Messages:
    73
    Found a colony, see how many bytes were added to the savegame? You may also need to test this when spawning a unit, since the unit disappeares when it founds the colony.
     
  11. Bladrov

    Bladrov Chieftain

    Joined:
    Apr 2, 2020
    Messages:
    59
    Gender:
    Male
    Location:
    Sacramento, CA
    Well, but...how does that help us tell the script where to look for the start of the settlement data? There are strings of at least 12 00s in other parts of the file; I don't see a marker we could look for.
     
    Last edited: Mar 11, 2021
  12. Bladrov

    Bladrov Chieftain

    Joined:
    Apr 2, 2020
    Messages:
    59
    Gender:
    Male
    Location:
    Sacramento, CA
    Hey, I found something else! It looks like the number of European colonies is stored in the 46th spot in the file. Here's a screenshot with the Value Coding set to decimal; this save has 32 colonies. I opened the save, founded a colony, and saved again, and the number incremented to 33.
     

    Attached Files:

    Last edited: Mar 13, 2021
  13. Bladrov

    Bladrov Chieftain

    Joined:
    Apr 2, 2020
    Messages:
    59
    Gender:
    Male
    Location:
    Sacramento, CA
    I've tried changing the place it starts looking for data from 6394 to i = 4778 + colonies.to_i * 202. That works great for that save COLONY00.SAV from earlier, but other saves return jumbled-up data again. I think I have this right, except can't find the value of x for x + (# colonies) * 202. Unless, of course, there's other data pushed in front of the Indian settlements - in which case this is probably a dead end, and I really need to find a marker for where the Indian settlement data starts. But I don't see anything consistent between saves!

    Might be that new European units get created in between colony info and Indian settlements. If we could work out some of that data, it might let us determine where the Indian data starts.
     

    Attached Files:

    Last edited: Apr 2, 2021

Share This Page