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

About Hex-Editing

Discussion in 'Civ2 - Scenario Creation' started by yaroslav, Oct 23, 2002.

  1. yaroslav

    yaroslav Emperor

    Joined:
    Jan 4, 2002
    Messages:
    1,223
    Location:
    Madrid, Spain
    INFO UPDATED:

    [EDITED: I've corrected some wrong info]

    Hi! As you may know, I'm the author of Civ2 PBEM Diplomacy Utility, and I need to know about hex-editing because I'm updating my utility. I use the superb-document "All common knowledge about HEX-EDITING
    SAVED GAMES and more" of Allard H.S. Höfelt.

    I've discovered new bytes on City sections (those section that the famous Civ2-utilities related programmer Xin Yu does with Andrew Livings) that I want to make public.

    - Byte 12th [start counting on 1]: It seems to me that this bytes stores the year that city was conquered [This is related to happy/unhappyness of people: A city conquered only a few years ago have extra unhappiness]. But on a byte you can not store a short integer, only a 8bit integer, so it's very strange. Maybe each 255 turns Civ2 reset this byte. I've done two test in order to check this byte:

    * If you conquer two cities in the same year, byte 12 is the same for the two cities.
    * If you conquer two cities in different years, byte 12 is different for both. And byte 12 th of city last conquered less byte 12 of city first conquered is the difference, in turns, between the two cities conquests... (Always mod 255, because you have only 8 bits to store this info).

    - Byte 13th : This byte represent whose civs knows about the city. You can turn on the city improvement on an tile of a civ map, and put on the visibility of this tile for the same civ, and you will not see the city! Why? Because, in order to see the city, you also need to turn on a bit on this byte. Rigthmost (0th) bit is for barbarian civ,1th bit is for white civ... 7th bit is for purple.

    - Byte 14th to 21th: As you may have noticed, the size of a foreign city is not updated until you move a unit near the city... Where is this size stored? Byte 14th is the size barbarians believe the city has, Byte 15th is the size white civ believe that the city has, and so on until Byte 21th for purple civ.

    I'm pretty sure that the units has a equivalent byte to byte 13th of cities. I'm seeking for it.

    Please use this thread as a way to exchange new info about Hex-Editing...
     
  2. yaroslav

    yaroslav Emperor

    Joined:
    Jan 4, 2002
    Messages:
    1,223
    Location:
    Madrid, Spain
    TIPS

    **********That's what you must do in order to allow other civ (let's call foreign civ) to see a city that original civ has

    1) Turn on the city improvement on city's tile in foreign civ map.
    2) Turn on the foreign civ bit on city tile's visibility byte.
    3) Turn on the foreign civ bit on byte 13th of the city
    4) Put a size for the city (greater than zero) on byte 14th+number_of_the_civ (0 for barbs ... 8 for purple)


    ********If you turn on a civ's bit on byte 13th, but don't put the size, the city will be on SIFTH+C list, but doesn't appear on Map [Like city with wonders before you found them!]


    *******If you modified the size that the city's owner see [for example, if you modify byte 15th on a white city], there is not (visible) effect!
     
  3. yaroslav

    yaroslav Emperor

    Joined:
    Jan 4, 2002
    Messages:
    1,223
    Location:
    Madrid, Spain
    UNITS UPDATE:

    On units, the 10th byte [starting on 1], represents whose civs know where the units is. 0 for barbarians, 1 for romans, 2 for green…

    To the unit to be view, also the unit flag of the unit’s tile on section1 of map must be on.
     
  4. Gaius

    Gaius Chieftain

    Joined:
    Feb 5, 2002
    Messages:
    43
    Location:
    Tartu, Estonia
    I have a question, maybe bit out of this particular thread but also about hex-editing.
    As we all know, one can easily change city owner flag, but can units (which are in that city) reowned as easily? i.e. are units mapped in save file as cities?
     
  5. yaroslav

    yaroslav Emperor

    Joined:
    Jan 4, 2002
    Messages:
    1,223
    Location:
    Madrid, Spain
    I don't understand well your question (sorry my english is not very good), but If you are asking about unit's owner.

    To change a unit's owner is a easy as change the owner byte. All units have a owner byte, so you can change it - easily. But, if the unit is on a city, and you change unit's owner, the unit will be on a foreing city: this is used on some scens ;)
     
  6. Gaius

    Gaius Chieftain

    Joined:
    Feb 5, 2002
    Messages:
    43
    Location:
    Tartu, Estonia
    If it is so as You say, it's OK, what i did mean, was that if I can make a "revolter" -- on certain circumstances tell to player that start bat-file (let say, samnites captured Rome in early years, and they destroyed romans civilization), so some particular cities and units in these particular cities become labelled as new civ and his units...
    that long story in rather bad English asks...is it possible...
    thank You
     
  7. yaroslav

    yaroslav Emperor

    Joined:
    Jan 4, 2002
    Messages:
    1,223
    Location:
    Madrid, Spain
    Well. I haven't try it; is possible, but I must test it, because I don't know how to 'revival' a civ, altough I think that it will not be too dificult. Maybe when I finish 2.0 release of my PBEM utility I'll test it.

    But if the civs already exists, it's very easy...
     

Share This Page