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

Modding Civilization I - Data Tables

Discussion in 'Civ1 - General Discussions' started by Gowron, Aug 9, 2009.

  1. darkpanda

    darkpanda Dark Prince

    Joined:
    Oct 28, 2007
    Messages:
    607
    Ah :) In fact there are many things, unordered, and not enough time to do them... The current functionality is quite extensive - you can do many things with JCivED - but the way to do them is not very friendly. So Before adding new features, I really want to improve the UI intuitiveness, responsiveness, look&feel, etc.
     
  2. RecycledElectro

    RecycledElectro Chieftain

    Joined:
    Jul 3, 2012
    Messages:
    20
    Location:
    Texas
    Wow...Good Work!

    Now, we could customize Civ 1 to have all European countries playing the game, or all nations from one era, or all American states, or all Native American tribes.
     
  3. kirkham7

    kirkham7 Warlord

    Joined:
    Dec 22, 2012
    Messages:
    288
    Location:
    Hayward, CA
    I think he's going to focus on making it easier to use before even thinking about new features.
    Thanks a lot for all of this, you've definitely added some spice to civilization.
     
  4. darkpanda

    darkpanda Dark Prince

    Joined:
    Oct 28, 2007
    Messages:
    607
    Gowron,

    I've been following your steps in looking at the disassembled data segment of CIV.EXE (version 474.01), and in addition to everything you already listed, I found the following data regarding Space ship:
    • data segment starts at 0x314B0
    • it is composed of 10 blocks of 26 bytes each, totally 260 bytes
    • each 26-byte block stands for 1 space ship part:
      • offset 0x00: Structure1 (horizontal)
      • offset 0x1A: Structure2 (vertical)
      • offset 0x34: Structure3 (intersection)
      • offset 0x4E: Propulsion
      • offset 0x68: Fuel
      • offset 0x82: NONE (cockpit)
      • offset 0x9C: Habitation
      • offset 0xB6: Life Support
      • offset 0xD0: Solar Panel
      • offset 0xEA: Support
    • the 26 bytes are divided as below:
      • bytes 0 to 11 (12 bytes): a string describing the ship part, padded with 0's
      • bytes 12 to 25 (14 bytes): a series of 7 little-endian short integers, identified as follows:
        • [12 13]: unknown
        • [14 15]: unknown
        • [16 17]: unknown
        • [18 19]: sprite horizontal coordinate (x)
        • [20 21]: sprite vertical coordinate (y)
        • [22 23]: sprite width in pixels
        • [24 25]: sprite height in pixels
    • when restructured, the data looks as below:
      Code:
      'Structure1',  0   0   1   0  16  16  16
      'Structure2',  0   0   1  16  16  16  16
      'Structure3',  0   0   1  32  16  16  16
      'Propulsion',  0   0   4 256  48  32  16
      'Fuel',        0   0   4   0  80  16  16
      'NONE',        0   0   4 192  96  32  32
      'Habitation',  0   0  16 224  96  32  32
      'Life Support',0   0  16 288  96  32  32
      'Solar Panel', 0   0   4   0  96  32  32
      'Support',     0  16 256  96  32  32   0
      
    • the sprites' locations and dimensions perfectly match the contents of DOCKER.PIC shown below:
     

    Attached Files:

  5. Gowron

    Gowron Chieftain

    Joined:
    May 21, 2007
    Messages:
    62
    While I was aware of that table, I didn't have an in-depth look at it so far.

    Thanks for adding it :)

    [12 13] and [14 15] are not variables, this space seems to have been reserved for the strings as well.

    [16 17] looks like the mass of the space ship part.

    Good job with identifying the graphical values. Comparing them with docker.pic was a smart move :)

    The last line got shuffled.
     
  6. darkpanda

    darkpanda Dark Prince

    Joined:
    Oct 28, 2007
    Messages:
    607
    You're right, it makes a lot more sense that "Support" is actually the "red" style module, which is actually not available in CIV by default... But it can be added by hacking the SVE file and putting one of the Space Ship parts value to "9" ! The result in-game is shown below:

     

    Attached Files:

  7. jetnightshade

    jetnightshade Chieftain

    Joined:
    Jan 12, 2009
    Messages:
    8
    I swore I used to edit Civ 1 with a notepad but that's impossible right? I must be confusing it with Civ II?
     
  8. Whelkman

    Whelkman Phantom Taxman

    Joined:
    Mar 16, 2007
    Messages:
    524
    You can edit the introduction text and news blurbs via text editor but that's about it.
     
  9. mcdogli

    mcdogli Chieftain

    Joined:
    Jul 28, 2014
    Messages:
    2
    Here is another contribution. The table for how to position spaceship parts starts at address 0x29E60 in version 475.01. The table consists of 68 entries where each is tree bytes.

    relative offset: 0x00
    position X

    relative offset: 0x01
    position Y

    relative offset: 0x02
    spaceship part as mentioned by darkpanda in post #24

    The last position has -1 for X, Y, and part to indicate that there is no more positions. There are five duplicates of structures, which are counted twice towards the spaceship’s weight when built. Placement of components and modules is strictly in the first unbuilt position for the selected part.

    Placement of structures, on the other hand, is intended to support components and modules that are already built by selecting between the first unbuilt structure in the components section (position 0-32) and modules section (position 33-66). The selection is based on how far the structure’s position index is from the highest position index of built components or modules, respectively. The structure that is furthest away is selected, with a preference for module structures in case of a tie. If no components or modules are built the reference index is -1, which means a preference for structures in the components section.

    On a side note, a component or module is considered supported if it has a structure in one of the surrounding positions. This may potentially give erroneous results when checking for support at the back of propulsion components for Indian and Mongol spaceships. The reason is that these spaceships are last in the data structure for spaceships and there are no boundary checks.
     
  10. kirkham7

    kirkham7 Warlord

    Joined:
    Dec 22, 2012
    Messages:
    288
    Location:
    Hayward, CA
    I am getting the hang of this finally. I just made it possible to mine an ocean into grassland! Mountains, arctic, and tundra can now be irrigated. Also, I just made it possible for the AI to irrigate or mine under despotism... This is going to be fun to see what happens. :)

    Hmm, I don't see government types listed here, where exactly are they? (And can I change them?)
     
  11. ottolotto

    ottolotto Chieftain

    Joined:
    Jan 24, 2016
    Messages:
    1
    Hello Fans,
    I know this was possible because i modified my german Version civ.exe with a hex-editor just to give settlers the ability to irrigate/Mine every terrain Type to anything more suiteable to you. So you could make ocean to grassland, mountains tograssland,etc. Some terraforming needed a combiniation of irrigate andere mining, but all was possible.
    This modification by hex-editing civ.exe was described in a german game magazine -i believe to 90% it was powerplay, to a very Small degree it was maybe PC Joker or ASM. The Design of the Header of this small article (and the Rest of the page) leads me to this conclusion.
    It was a small article AT the bottom of the page (only a quarter of a page maximum) . Some lines Text as an introduction to the article, then a few lines o hex-codes from different adresses . Left Side adress in civ.exe, in the middle the original Code, on the right Side modified Version. The few Bytes that had to be changed were marked with a line under that bytes .
    It was done in 2 minutes, just searched for the few marked bytes AT the told position and simply edited that Bytes. Saving file and it was done. But unfortunately i really ddon't knie of i had to unpack the civ.exe. i know the Tool "unp", so it could be possible.
    I Made a copy from that page back in that days (20-23 years ago) but lost it some years ago. I still had a Backup, but After a hd-crash.. and searchinge desperately the Internet i am Here.
    Need to so some testing...
     
  12. kirkham7

    kirkham7 Warlord

    Joined:
    Dec 22, 2012
    Messages:
    288
    Location:
    Hayward, CA
    Using the information found here, I was able to change the attitudes of the various leaders. However none of the civilizations seems to be researching technology. Is there a certain combination that makes them more adept to researching techs?
    I've made most of the civs aggressive, expansionistic, and civilized..
     
  13. Lone Wolf

    Lone Wolf Deity

    Joined:
    Dec 4, 2006
    Messages:
    9,907
    Amazing thread, I used it to change the Chariot attack to 3 in the 474.05 patch. Now the Chariot is no longer so dominant, and there's some point in researching Knights:



    I'd post the modded exe here, but I'm not sure if it's legal...
     
  14. Lone Wolf

    Lone Wolf Deity

    Joined:
    Dec 4, 2006
    Messages:
    9,907
    Another possible easy modification - I made Invention require Philosophy, and Democracy require University. This increases the time to railroads and the no-corruption government, slightly increasing the difficulty of the game for the human player.

    I also upped the cost of Diplomats to 50 shields. They are still powerful! Nice that Civilopedia reflects these changes automatically.

    And I changed the Republican ruler title from President to Proconsul. It was boring how both Republic and Democracy had the same title.
     
    Last edited: Sep 27, 2018
  15. Lone Wolf

    Lone Wolf Deity

    Joined:
    Dec 4, 2006
    Messages:
    9,907
    Anyway, I've decided to post my modded *.exe here, since it's, like all other modified files posted in CivII-CivVI modding, useless without the complete game. I also removed the quiz, made building RR's possible in cities, and modified the look of jungle/swamp concentrations with CIVed.
     

    Attached Files:

    • CIV.zip
      File size:
      131.5 KB
      Views:
      86
  16. Alberto Schroth

    Alberto Schroth Chieftain

    Joined:
    Apr 1, 2019
    Messages:
    5
    Gender:
    Male
    omg...I wish I had this 20 years ago when I first started playing! lol. Good stuff
     

Share This Page