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

SVE file format

Discussion in 'Civ1 - General Discussions' started by darkpanda, Apr 15, 2013.

  1. Gowron

    Gowron Chieftain

    Joined:
    May 21, 2007
    Messages:
    62
    "Vendetta" happens when you break a peace treaty. You know that you have Vendetta status if the other civ addresses you as "O most undertrustworthy leader of the infidels". Civs with Vendetta status are less likely to accept peace offers, let alone giving in to demands.

    "Alliance" was probably planned as a feature, but not implemented.
     
  2. Dack

    Dack Terra Form Moderator

    Joined:
    Nov 26, 2003
    Messages:
    532
    Location:
    civ dos 474.05
    8AA0 pollution sun level
    Code:
    values
    0             none 
    123           dark red 
    4567          light read 
    89AB          yellow
    CDEF & 10     white 
    the next transition causes global warming
    _______________________________________
    8AA4 Option bits
    Code:
    	8-Palace
    	4-Civlopeida text
    	2-Enemy moves
    	1-Sound
    	8-Animations
    	4-End of Turn
    	2-Auto save
    	1-Instant advice	
    _______________________________________
    8BAC Future Tech.
    Only human player has future tech
     
  3. darkpanda

    darkpanda Dark Prince

    Joined:
    Oct 28, 2007
    Messages:
    603

    SVE data reference table



    The table below is a high-level list of the SVE data structure.
    You can click on the data elements to jump to their detailed description, located in the further posts.

    The offset values are provided for both English and French versions of Civ DOS; there is a known difference with FR versions, namely a 56-byte offset starting at Unit Types.

    Column 1 Column 2 Column 3 Column 4 Column 5 Column 6 Column 7 Column 8 Column 9
    RANGE (EN) [start:end] SIZE (EN) RANGE (FR) [start:end] SIZE (FR) DATA
    dec. hex. dec. hex. dec. hex. dec. hex.
    [0:1] [0x0:0x1] 2 0x2 [0:1] [0x0:0x1] 2 0x2

    Game turn counter

    [2:3] [0x2:0x3] 2 0x2 [2:3] [0x2:0x3] 2 0x2

    Human player Civ

    [4:5] [0x4:0x5] 2 0x2 [4:5] [0x4:0x5] 2 0x2

    Human player Civ bitflag

    [6:7] [0x6:0x7] 2 0x2 [6:7] [0x6:0x7] 2 0x2

    Random map seed

    [8:9] [0x8:0x9] 2 0x2 [8:9] [0x8:0x9] 2 0x2

    Current year

    [10:11] [0xA:0xB] 2 0x2 [10:11] [0xA:0xB] 2 0x2

    Game difficulty level

    [12:13] [0xC:0xD] 2 0x2 [12:13] [0xC:0xD] 2 0x2

    Active Civilizations

    [14:15] [0xE:0xF] 2 0x2 [14:15] [0xE:0xF] 2 0x2

    Current researched Civ Advance

    [16:127] [0x10:0x7F] 112 0x70 [16:127] [0x10:0x7F] 112 0x70

    Leader names

    [128:223] [0x80:0xDF] 96 0x60 [128:223] [0x80:0xDF] 96 0x60

    Civ names

    [224:311] [0xE0:0x137] 88 0x58 [224:311] [0xE0:0x137] 88 0x58

    Citizens name

    [312:327] [0x138:0x147] 16 0x10 [312:327] [0x138:0x147] 16 0x10

    Treasury gold

    [328:343] [0x148:0x157] 16 0x10 [328:343] [0x148:0x157] 16 0x10

    Research progress

    [344:791] [0x158:0x317] 448 0x1C0 [344:791] [0x158:0x317] 448 0x1C0

    Units active

    [792:1239] [0x318:0x4D7] 448 0x1C0 [792:1239] [0x318:0x4D7] 448 0x1C0

    Units in production

    [1240:1255] [0x4D8:0x4E7] 16 0x10 [1240:1255] [0x4D8:0x4E7] 16 0x10

    Discovered Advances Count

    [1256:1335] [0x4E8:0x537] 80 0x50 [1256:1335] [0x4E8:0x537] 80 0x50

    Discovered Civ Advances

    [1336:1351] [0x538:0x547] 16 0x10 [1336:1351] [0x538:0x547] 16 0x10

    Civ Govnernment

    [1352:1607] [0x548:0x647] 256 0x100 [1352:1607] [0x548:0x647] 256 0x100

    Per-continent Civ AI strategy

    [1608:1735] [0x648:0x6C7] 128 0x80 [1608:1735] [0x648:0x6C7] 128 0x80

    Diplomacy

    [1736:1751] [0x6C8:0x6D7] 16 0x10 [1736:1751] [0x6C8:0x6D7] 16 0x10

    City counts

    [1752:1767] [0x6D8:0x6E7] 16 0x10 [1752:1767] [0x6D8:0x6E7] 16 0x10

    Unit counts

    [1768:1783] [0x6E8:0x6F7] 16 0x10 [1768:1783] [0x6E8:0x6F7] 16 0x10

    Land counts

    [1784:1799] [0x6F8:0x707] 16 0x10 [1784:1799] [0x6F8:0x707] 16 0x10

    Settler counts

    [1800:1815] [0x708:0x717] 16 0x10 [1800:1815] [0x708:0x717] 16 0x10

    Total Civ size

    [1816:1831] [0x718:0x727] 16 0x10 [1816:1831] [0x718:0x727] 16 0x10

    Military power

    [1832:1847] [0x728:0x737] 16 0x10 [1832:1847] [0x728:0x737] 16 0x10

    Civ Rankings

    [1848:1863] [0x738:0x747] 16 0x10 [1848:1863] [0x738:0x747] 16 0x10

    Tax rate

    [1864:1879] [0x748:0x757] 16 0x10 [1864:1879] [0x748:0x757] 16 0x10

    Civ score

    [1880:1895] [0x758:0x767] 16 0x10 [1880:1895] [0x758:0x767] 16 0x10

    Human contact turn counter

    [1896:1911] [0x768:0x777] 16 0x10 [1896:1911] [0x768:0x777] 16 0x10

    Starting position X coordinate

    [1912:1927] [0x778:0x787] 16 0x10 [1912:1927] [0x778:0x787] 16 0x10

    Civ identity / Leader graphics

    [1928:2183] [0x788:0x887] 256 0x100 [1928:2183] [0x788:0x887] 256 0x100

    Per-continent Civ defense

    [2184:2439] [0x888:0x987] 256 0x100 [2184:2439] [0x888:0x987] 256 0x100

    Per-continent Civ attack

    [2440:2695] [0x988:0xA87] 256 0x100 [2440:2695] [0x988:0xA87] 256 0x100

    Per-continent Civ city count

    [2696:2823] [0xA88:0xB07] 128 0x80 [2696:2823] [0xA88:0xB07] 128 0x80

    Continent sizes

    [2824:2951] [0xB08:0xB87] 128 0x80 [2824:2951] [0xB08:0xB87] 128 0x80

    Oceans sizes

    [2952:2983] [0xB88:0xBA7] 32 0x20 [2952:2983] [0xB88:0xBA7] 32 0x20

    Continent building site counts

    [2984:4183] [0xBA8:0x1057] 1200 0x4B0 [2984:4183] [0xBA8:0x1057] 1200 0x4B0

    Score chart (a.k.a Civ POWERGraph)

    [4184:5383] [0x1058:0x1507] 1200 0x4B0 [4184:5383] [0x1058:0x1507] 1200 0x4B0

    Peace chart data (unused?)

    [5384:8967] [0x1508:0x2307] 3584 0xE00 [5384:8967] [0x1508:0x2307] 3584 0xE00

    Cities

    [8968:9919] [0x2308:0x26BF] 952 0x3B8 [8968:9975] [0x2308:0x26F7] 1008 0x3F0

    Unit types

    [9920:22207] [0x26C0:0x56BF] 12288 0x3000 [9976:22263] [0x26F8:0x56F7] 12288 0x3000

    Units

    [22208:26207] [0x56C0:0x665F] 4000 0xFA0 [22264:26263] [0x56F8:0x6697] 4000 0xFA0

    Map visibility

    [26208:26335] [0x6660:0x66DF] 128 0x80 [26264:26391] [0x6698:0x6717] 128 0x80

    Strategic locations status

    [26336:26463] [0x66E0:0x675F] 128 0x80 [26392:26519] [0x6718:0x6797] 128 0x80

    Strategic locations policy

    [26464:26591] [0x6760:0x67DF] 128 0x80 [26520:26647] [0x6798:0x6817] 128 0x80

    Strategic locations X

    [26592:26719] [0x67E0:0x685F] 128 0x80 [26648:26775] [0x6818:0x6897] 128 0x80

    Strategic locations Y

    [26720:26863] [0x6860:0x68EF] 144 0x90 [26776:26919] [0x6898:0x6927] 144 0x90

    Tech first inventors

    [26864:26991] [0x68F0:0x696F] 128 0x80 [26920:27047] [0x6928:0x69A7] 128 0x80

    Civ-to-Civ destroyed unit counts

    [26992:30319] [0x6970:0x766F] 3328 0xD00 [27048:30375] [0x69A8:0x76A7] 3328 0xD00

    City names

    [30320:34417] [0x7670:0x8671] 4098 0x1002 [30376:34473] [0x76A8:0x86A9] 4098 0x1002

    Replay

    [34418:34461] [0x8672:0x869D] 44 0x2C [34474:34517] [0x86AA:0x86D5] 44 0x2C

    Wonders

    [34462:34909] [0x869E:0x885D] 448 0x1C0 [34518:34965] [0x86D6:0x8895] 448 0x1C0

    Units lost

    [34910:35485] [0x885E:0x8A9D] 576 0x240 [34966:35541] [0x8896:0x8AD5] 576 0x240

    Source Civs for Technologies

    [35486:35487] [0x8A9E:0x8A9F] 2 0x2 [35542:35543] [0x8AD6:0x8AD7] 2 0x2

    Polluted square count

    [35488:35489] [0x8AA0:0x8AA1] 2 0x2 [35544:35545] [0x8AD8:0x8AD9] 2 0x2

    Pollution effect level

    [35490:35491] [0x8AA2:0x8AA3] 2 0x2 [35546:35547] [0x8ADA:0x8ADB] 2 0x2

    Global warming count

    [35492:35493] [0x8AA4:0x8AA5] 2 0x2 [35548:35549] [0x8ADC:0x8ADD] 2 0x2

    Game settings

    [35494:35753] [0x8AA6:0x8BA9] 260 0x104 [35550:35809] [0x8ADE:0x8BE1] 260 0x104

    Land pathfinding

    [35754:35755] [0x8BAA:0x8BAB] 2 0x2 [35810:35811] [0x8BE2:0x8BE3] 2 0x2

    Max tech count

    [35756:35757] [0x8BAC:0x8BAD] 2 0x2 [35812:35813] [0x8BE4:0x8BE5] 2 0x2

    Player future tech.

    [35758:35759] [0x8BAE:0x8BAF] 2 0x2 [35814:35815] [0x8BE6:0x8BE7] 2 0x2

    Debug switches

    [35760:35775] [0x8BB0:0x8BBF] 16 0x10 [35816:35831] [0x8BE8:0x8BF7] 16 0x10

    Science rates

    [35776:35777] [0x8BC0:0x8BC1] 2 0x2 [35832:35833] [0x8BF8:0x8BF9] 2 0x2

    Next anthology turn

    [35778:35793] [0x8BC2:0x8BD1] 16 0x10 [35834:35849] [0x8BFA:0x8C09] 16 0x10

    Cumulative Epic rankings

    [35794:37255] [0x8BD2:0x9187] 1462 0x5B6 [35850:37311] [0x8C0A:0x91BF] 1462 0x5B6

    Space ships

    [37256:37303] [0x9188:0x91B7] 48 0x30 [37312:37359] [0x91C0:0x91EF] 48 0x30

    Palace

    [37304:37559] [0x91B8:0x92B7] 256 0x100 [37360:37615] [0x91F0:0x92EF] 256 0x100

    Cities X coordinates

    [37560:37815] [0x92B8:0x93B7] 256 0x100 [37616:37871] [0x92F0:0x93EF] 256 0x100

    Cities Y coordinates

    [37816:37817] [0x93B8:0x93B9] 2 0x2 [37872:37873] [0x93F0:0x93F1] 2 0x2

    Palace level

    [37818:37819] [0x93BA:0x93BB] 2 0x2 [37874:37875] [0x93F2:0x93F3] 2 0x2

    Peace turn count

    [37820:37821] [0x93BC:0x93BD] 2 0x2 [37876:37877] [0x93F4:0x93F5] 2 0x2

    AI opponents

    [37822:37837] [0x93BE:0x93CD] 16 0x10 [37878:37893] [0x93F6:0x9405] 16 0x10

    Spaceship population

    [37838:37853] [0x93CE:0x93DD] 16 0x10 [37894:37909] [0x9406:0x9415] 16 0x10

    Spaceship launch year

    [37854:37855] [0x93DE:0x93DF] 2 0x2 [37910:37911] [0x9416:0x9417] 2 0x2

    Civ identify flag

    [37856] [0x93E0] [37912] [0x9418] END OF FILE
     
  4. darkpanda

    darkpanda Dark Prince

    Joined:
    Oct 28, 2007
    Messages:
    603

    Game turn counter

    (back to table)
    Data range/length: [0:1] / 2 bytes - (hex: [0x0:0x1]/0x2)

    • Game turn counter:
    • starts at 0 for first turn (4000 BC)
    • increases by +1 at every turn
    • turns match to years as follows:
      • Turns 0 to 250 (4000 BC to 1000 AD): 1 turn = 20 years
      • Turns 250 to 300 (1000 AD to 1500 AD): 1 turn = 10 years
      • Turns 300 to 350 (1500 AD to 1750 AD): 1 turn = 5 years
      • Turns 350 to 400 (1750 BC to 1850 AD): 1 turn = 2 years
      • Turns 400 onwards (after 1850 AD): 1 turn = 1 year
    • if this value is 0 (4000 BC) and value of game.year is -4000, loading this savegame will prompt the user to the Civ selection screen


    Human player Civ

    (back to table)
    Data range/length: [2:3] / 2 bytes - (hex: [0x2:0x3]/0x2)

    • Player Civ ID:
    • valid values are 0 to 7:
      • 0 - Barbarians
      • 1 - Russians/Romans (white)
      • 2 - Zulu/Babylonians (green)
      • 3 - German/French (blue)
      • 4 - Egyptians/Aztecs (yellow)
      • 5 - Americans/Chinese (cyan)
      • 6 - English/Greek (magenta)
      • 7 - Mongol/Indians (gray)
    • this value determines what Civilization the human player is controlling


    Human player Civ bitflag

    (back to table)
    Data range/length: [4:5] / 2 bytes - (hex: [0x4:0x5]/0x2)

    • Player civ flag
    • the low-order byte is used as a 'bit flag' to indicate the human player Civ; example below for a human playing a Zulu or Babylonian:
      Code:
      bit: 8 7 6 5   4 3 2 1
      val: 0 0 0 0   0 1 0 0 
      dec: 4
      hex: 0x04
      
    • this value does NOT determine what Civ the human player is controlling, so changing it does not seem to affect the game
    • its exact usage is still unclear


    Random map seed

    (back to table)
    Data range/length: [6:7] / 2 bytes - (hex: [0x6:0x7]/0x2)

    • Random seed:
    • this value was determine to control the pattern of special resources and tribal huts on the world map


    Current year

    (back to table)
    Data range/length: [8:9] / 2 bytes - (hex: [0x8:0x9]/0x2)

    • Year of the current turn:
    • value range matches that of signed short integer, i.e. -32768 to 32767
    • if this value is -4000 (4000 BC) and value of game.game_turn is 0, loading this savegame will prompt the user to the Civ selection screen


    Game difficulty level

    (back to table)
    Data range/length: [10:11] / 2 bytes - (hex: [0xA:0xB]/0x2)

    • Game difficulty level:
    • valid values range from 0 to 4:
      • 0 = Chieftain (easiest)
      • 1 = Warlord
      • 2 = Prince
      • 3 = King
      • 4 = Emperor (hardest)
    • Civ's behaviour is unknown if the value is outside the valid range…


    Active Civilizations

    (back to table)
    Data range/length: [12:13] / 2 bytes - (hex: [0xC:0xD]/0x2)

    • Active Flag for Civs:
    • this value is a bitflag whose bits determine which Civs are active (i.e. not annihilated); example below show active bit flag where Babylonian (2), Americans (5) and English (6) are still active; Barbarians (0) are always active:
      Code:
      bit: 8 7 6 5   4 3 2 1
      val: 0 0 1 1   0 1 0 1 
      dec: 101
      hex: 0x65
      


    Current researched Civ Advance

    (back to table)
    Data range/length: [14:15] / 2 bytes - (hex: [0xE:0xF]/0x2)

    • ID of the Civ Advance that the current human player is researching; refer to Civ Advances table for the list of valid IDs


    Leader names

    (back to table)
    Data range/length: [16:127] / 112 bytes - (hex: [0x10:0x7F]/0x70)

    • Name of Civilization leader:
    • represents the name of a Civ's leader
    • it is a 0-terminated String, of maximum length 14
    • occurs 8 times, once for each Civ


    Civ names

    (back to table)
    Data range/length: [128:223] / 96 bytes - (hex: [0x80:0xDF]/0x60)

    • Name of Civilization:
    • represents the name of a Civilization
    • occurs 8 times, once for each Civ


    Citizens name

    (back to table)
    Data range/length: [224:311] / 88 bytes - (hex: [0xE0:0x137]/0x58)

    • Name of Civ's citizens:
    • represents the ajdective used to determine all things related to a Civ: citizens, units, spaceship, etc.
    • occurs 8 times, once for each Civ


    Treasury gold

    (back to table)
    Data range/length: [312:327] / 16 bytes - (hex: [0x138:0x147]/0x10)

    • Treasury gold:
    • amount of gold in a Civ's treasury
    • ranges from 0 to 32767 (signed short maximum positive value, 0x7F)
    • occurs 8 times, once for each Civ


    Research progress

    (back to table)
    Data range/length: [328:343] / 16 bytes - (hex: [0x148:0x157]/0x10)

    • Research progress:
    • amount of 'research' accumulated for the advance currently research by a Civ
    • ranges from 0 to 32767 (signed short maximum positive value, 0x7F)
    • occurs 8 times, once for each Civ


    Units active

    (back to table)
    Data range/length: [344:791] / 448 bytes - (hex: [0x158:0x317]/0x1C0)

    • Units active
    • The data below is a block of 8 sets of 28 short integers (totally 8*28*2 = 448 bytes)
    • There is 1 set for each Civ
    • each of the 28 integers defines the number of active units that a particular Civ currently possesses, for the 28 possible unit types


    Units in production

    (back to table)
    Data range/length: [792:1239] / 448 bytes - (hex: [0x318:0x4D7]/0x1C0)

    • Units in production
    • The data below is a block of 8 sets of 28 short integers (totally 8*28*2 = 448 bytes)
    • There is 1 set for each Civ
    • each of the 28 integers defines the number of units that a particular Civ is currently building, for the 28 possible unit types


    Discovered Advances Count

    (back to table)
    Data range/length: [1240:1255] / 16 bytes - (hex: [0x4D8:0x4E7]/0x10)

    • Advances count
    • This data block is an array of 8 short integers (8*2 = 16 bytes)
    • Each integer s the count of how many Advances a Civ has already discovered


    Discovered Civ Advances

    (back to table)
    Data range/length: [1256:1335] / 80 bytes - (hex: [0x4E8:0x537]/0x50)

    • Advances already discovered by a Civ:
    • a series of 10 bytes, 5 short bitflags, where each indicates whether an Advance was discovered or not
    • refer to Civ Advances table for the list of valid IDs
    • the discovered Advance bits are orderes in the same order as in the Civ Advances table (see this thread by Gowron, section 6. 'Tech Tree');
    • the flag bits must be read as follows:
      Code:
      flag_tech0 bit: 16 15 14 13   12 11 10  9     8  7  6  5    4  3  2  1
      advance ID:     15 14 13 12   11 10 9   8     7  6  5  4    3  2  1  0
      
      flag_tech1 bit: 16 15 14 13   12 11 10  9     8  7  6  5    4  3  2  1
      advance ID:     31 30 29 28   27 26 25 24    23 22 21 20   19 18 17 16
      
      flag_tech2 bit: 16 15 14 13   12 11 10  9     8  7  6  5    4  3  2  1
      advance ID:     47 46 45 44   43 42 41 40    39 38 37 36   35 34 33 32
      
      flag_tech3 bit: 16 15 14 13   12 11 10  9     8  7  6  5    4  3  2  1
      advance ID:     63 62 61 60   59 58 57 56    55 54 53 52   51 49 48 47
      
      flag_tech4 bit: 16 15 14 13   12 11 10  9     8  7  6  5    4  3  2  1
      advance ID:     79 78 77 76   75 74 73 72    71 70 69 68   67 66 65 64
      
    • this 10-byte series occurs 8 times, once for each Civ


    Civ Govnernment

    (back to table)
    Data range/length: [1336:1351] / 16 bytes - (hex: [0x538:0x547]/0x10)

    • Government type for a Civ:
    • valid values range from 0 to 5:
      • 0 = Anarchy (revolution)
      • 1 = Despotism
      • 2 = Monarchy
      • 3 = Communism
      • 4 = Republic
      • 5 = Democracy
    • unknown behaviour if value is outside range


    Per-continent Civ AI strategy

    (back to table)
    Data range/length: [1352:1607] / 256 bytes - (hex: [0x548:0x647]/0x100)

    • Per-continent Civ strategy:
    • a series of 8 data blocks (1 for each Civ)
    • each data block contains 16 short integers, 1 for each continent (16*2 = 32 bytes)
    • total size is 8*32 = 256 bytes
    • each short integer is a value that describes the Civ's AI strategy for this continent (values below suggested by Gowron):
      • 0 = to settle
      • 1 = to attack
      • 2 = to defend
      • 5 = to transport units to


    Diplomacy

    (back to table)
    Data range/length: [1608:1735] / 128 bytes - (hex: [0x648:0x6C7]/0x80)

    • Diplomatic status of a Civ:
    • this is a series of 8 shorts (8*2 = 16 bytes)
    • each of the 8 short describe the status between the Civ and one of the 8 other Civs (seems to include Barbarians…)
    • each short value is a bitflag whose bits describe a particular diplomatic status
    • currently known bits are as follows:
      Code:
      bit | meaning of bit value = 1
        0 | at war 
        1 | at peace
        2 | alliance
        3 | vendetta
        4 | ?
        5 | ?
        6 | embassy established
        7 | ?
      
        8 | ?
        9 | ?
       10 | ?
       11 | ?
       12 | ?
       13 | ?
       14 | ?
       15 | ?
      
    • this series of 16 bytes is repeated 8 times, once for each Civ (totally 8*16 = 128 bytes)


    City counts

    (back to table)
    Data range/length: [1736:1751] / 16 bytes - (hex: [0x6C8:0x6D7]/0x10)

    • City counts:
    • this is a series of 8 shorts (8*2 = 16 bytes)
    • each of the 8 short describe total number of citiesthat a Civ owns



    Unit counts

    (back to table)
    Data range/length: [1752:1767] / 16 bytes - (hex: [0x6D8:0x6E7]/0x10)

    • Unit counts:
    • this is a series of 8 shorts (8*2 = 16 bytes)
    • each of the 8 short describe total number of units that a Civ owns



    Land counts

    (back to table)
    Data range/length: [1768:1783] / 16 bytes - (hex: [0x6E8:0x6F7]/0x10)

    • Land counts:
    • this is a series of 8 shorts (8*2 = 16 bytes)
    • each of the 8 short describe total land area that a Civ owns
    • this value may be related to .MAP layer 8, that represents the total area belonging to Civs… (to be confirmed)



    Settler counts

    (back to table)
    Data range/length: [1784:1799] / 16 bytes - (hex: [0x6F8:0x707]/0x10)

    • Settler counts:
    • this is a series of 8 shorts (8*2 = 16 bytes)
    • each of the 8 short describe total number of Settlers that a Civ owns, +1 (reason for the +1 is unknown, but is empirically observed…)



    Total Civ size

    (back to table)
    Data range/length: [1800:1815] / 16 bytes - (hex: [0x708:0x717]/0x10)

    • Total Civ size:
    • this is a series of 8 shorts (8*2 = 16 bytes)
    • each of the 8 short describe total sum of city sizes for all of aCiv's cities



    Military power

    (back to table)
    Data range/length: [1816:1831] / 16 bytes - (hex: [0x718:0x727]/0x10)

    • Military Power:
    • this is a series of 8 shorts (8*2 = 16 bytes)
    • each of the 8 short is the sum of nominal attack and defense strengths of all units under a Civ's control



    Civ Rankings

    (back to table)
    Data range/length: [1832:1847] / 16 bytes - (hex: [0x728:0x737]/0x10)

    • Civ Rankings:
    • this is a series of 8 shorts (8*2 = 16 bytes)
    • each of the 8 short is a ranking value representing the Civ's relative power in the world; the highest rank is 7, the lowest is 0 (Barbarians)


    Tax rate

    (back to table)
    Data range/length: [1848:1863] / 16 bytes - (hex: [0x738:0x747]/0x10)

    • Tax rate of a Civ:
    • valid values range from 0 to 10; 0 represents 0% tax rate, 10 represents 100% tax rate, N represents N*10% tax rate
    • combined with Science Rate (see REF) the determine the rate of 'Luxury'
    • occurs 8 times, once for each Civ


    Civ score

    (back to table)
    Data range/length: [1864:1879] / 16 bytes - (hex: [0x748:0x757]/0x10)

    • Civ scores:
    • this is a series of 8 shorts (8*2 = 16 bytes)
    • each of the 8 short describes the score of a Civ, as shown in the F9 screen in-game



    Human contact turn counter

    (back to table)
    Data range/length: [1880:1895] / 16 bytes - (hex: [0x758:0x767]/0x10)

    • Contact turn counter:
    • this is a series of 8 shorts (8*2 = 16 bytes)
    • each of the 8 shorts seems to describe the number of turns when a Civ is willing to contact the human player again



    Starting position X coordinate

    (back to table)
    Data range/length: [1896:1911] / 16 bytes - (hex: [0x768:0x777]/0x10)

    • Starting position X:
    • this is a series of 8 shorts (8*2 = 16 bytes)
    • each of the 8 shorts represents the Horizontal (X) coordinate of a Civ's starting position


    Civ identity / Leader graphics

    (back to table)
    Data range/length: [1912:1927] / 16 bytes - (hex: [0x778:0x787]/0x10)

    • Civ 'ID':
    • for each of the 7 (8 ?) civ 'flavor', this value determines which one is the 'actual' Civ, out of the 2 possible for that flavor
    • for example, for flavor 'white', the Civ can be Romans or Russians; if the Civ is Romans, the value of 'who' will be '1'; if it is the Russians, this value will be '9' (1+8)
    • this value controls what graphics will be used to display an AI leader in diplomatic screens:
      Code:
      1 = Romans      = Caesar      = KING10.PIC
      2 = Babylonians = Hammurabi   = KING07.PIC
      3 = German      = Frederick   = KING12.PIC
      4 = Egyptians   = Ramesses    = KING01.PIC
      5 = Americans   = Abe Lincoln = KING04.PIC
      6 = Greek       = Alexander   = KING13.PIC
      7 = Indians     = Gandhi      = KING02.PIC
      9 = Russians    = Staline     = KING08.PIC
      10 = Zulu        = Shaka       = KING03.PIC
      11 = French      = Napoleon    = KING11.PIC
      12 = Aztecs      = Moctezuma   = KING09.PIC
      13 = Chinese     = Mao Zedong  = KING06.PIC
      14 = English     = Elizabeth   = KING00.PIC
      15 = Mongols     = Gengis Khan = KING05.PIC
      
    • it is possible (tested) to set any value for any Civ, so that any leader can have any other leader graphics
    • Barbarians have value 0xFFFF


    Per-continent Civ defense

    (back to table)
    Data range/length: [1928:2183] / 256 bytes - (hex: [0x788:0x887]/0x100)

    • Per-continent Civ defense:
    • a series of 8 data blocks (1 for each Civ)
    • each data block contains 16 short integers, 1 for each continent (16*2 = 32 bytes)
    • total size is 8*32 = 256 bytes
    • each short integer is the sum of a Civ's units' defense strengths, limited to units located on that continent


    Per-continent Civ attack

    (back to table)
    Data range/length: [2184:2439] / 256 bytes - (hex: [0x888:0x987]/0x100)

    • Per-continent Civ attack:
    • a series of 8 data blocks (1 for each Civ)
    • each data block contains 16 short integers, 1 for each continent (16*2 = 32 bytes)
    • total size is 8*32 = 256 bytes
    • each short integer is the sum of a Civ's units' attack strengths, limited to units located on that continent


    Per-continent Civ city count

    (back to table)
    Data range/length: [2440:2695] / 256 bytes - (hex: [0x988:0xA87]/0x100)

    • Per-continent Civ city count:
    • a series of 8 data blocks (1 for each Civ)
    • each data block contains 16 short integers, 1 for each continent (16*2 = 32 bytes)
    • total size is 8*32 = 256 bytes
    • each short integer is the count of a Civ's cities located on that continent


    Continent sizes

    (back to table)
    Data range/length: [2696:2823] / 128 bytes - (hex: [0xA88:0xB07]/0x80)

    • Continent sizes:
    • the first 32 bytes are a series 16 short integers (2*16=32)
    • each integer is the total size of the corresponding continent
    • note how continents are indexed by size (was remarked by Dack before)
    • if there are more than 15 continents, all continents above and including '15' are labelled as '15'


    Oceans sizes

    (back to table)
    Data range/length: [2824:2951] / 128 bytes - (hex: [0xB08:0xB87]/0x80)

    • Oceans/seas sizes:
    • the first 32 bytes are a series 16 short integers (2*16=32)
    • each integer is the total size of the corresponding ocean/sea
    • note how oceans and seas are indexed by size (was remarked by Dack before)
    • if there are more than 15 seas/oceans, all seas above and including '15' are labelled as '15'


    Continent building site counts

    (back to table)
    Data range/length: [2952:2983] / 32 bytes - (hex: [0xB88:0xBA7]/0x20)

    • Continent building sites:
    • the first 32 bytes are a series 16 short integers (2*16=32)
    • each integer is the number of initial building sites on the corresponding continent
    • a 'building site' is a map square whose 'land value' is not 0
    • the 'land value' of a map square is a score (whose formula is unknown yet) that CIV computes for each map square to represent the appeal of asquare for building a city on it (it has been observed that computer Civs use this value to build cities)
    • land value are stored in the .MAP file, alongside geography and terrain improvements...
    • note: for some reason, CIV doesn't seem to update land values when the player modifies terrain with settlers...


    Score chart (a.k.a Civ POWERGraph)

    (back to table)
    Data range/length: [2984:4183] / 1200 bytes - (hex: [0xBA8:0x1057]/0x4B0)

    • Score chart data:
    • Score chart is stored as a sequence of 8-bytes blocks
    • The chart covers totally 1200 bytes (approx.), equivalent to 150 8-byte blocks
    • each 8-byte block contains the scores of all 7 Civs for one of the chart's X plot
    • Each X plot of the score chart seem to cover 4 in-game turns
    • 150 times 4 turns can cover up to turn 600, which correspond to Civ year 2050 AD
    • Each 8-bye block contains 1 byte per Civ; each byte is an unsigned 1-byte integer, represneting that Civ's score for the block; the score value ranges from 0 to 255 (0xFF)


    Peace chart data (unused?)

    (back to table)
    Data range/length: [4184:5383] / 1200 bytes - (hex: [0x1058:0x1507]/0x4B0)

    • Peace chart data:
    • This data is stored as a sequence of 8-bytes blocks
    • It covers totally 1200 bytes, equivalent to 150 8-byte blocks
    • each 8-byte block contains the Peace status of all 7 Civs with all other Civs
    • each 8-byte block seems to cover 4 in-game turns
    • 150 times 4 turns can cover up to turn 600, which correspond to Civ year 2050 AD
    • Each 8-byte block contains 1 byte per Civ; each byte is a 8-bit flag, where each bit represents the Peace status between the byte's Civ and the bit's Civ: 1 if they are at Peace, 0 if they are not
    • Current investigations could not determine that this data is actually used anywhere in CIV (except being computed and stored in the SVE file)



    Cities

    (back to table)
    Data range/length: [5384:8967] / 3584 bytes - (hex: [0x1508:0x2307]/0xE00)

    • Cities
    • there are totally 128 data blocks representing the 128 possible cities supported by CIV
    • each City data is a 28-byte data block, as described below:

      Column 1 Column 2 Column 3 Column 4
      Offset/start Size Data
      dec hex
      0 0 4 Building flags
      4 4 2 Map coordinates
      6 6 1 City status flag
      7 7 1 Actual size
      8 8 1 Visible size
      9 9 1 Current production
      10 A 1 Base trade
      11 B 1 Owning Civ
      12 C 2 Food storage
      14 E 2 Shields storage
      16 10 6 City squares / specialists
      22 16 1 City name ID
      23 17 3 Trading cities
      26 1A 2 unknown


      Building flags

      • a series of 4 byte bitflag, where each bit indicates whether a given City improvement is built in the city
      • the building bits are ordered in the same order as in the City Improvements table (see ref);
      • the flag bits must be read as follows:
        Code:
        buildings_flag0 bit:  8  7  6  5    4  3  2  1
        building ID:          7  6  5  4    3  2  1  0
        
        buildings_flag1 bit:  8  7  6  5    4  3  2  1
        building ID:         15 14 13 12   11 10  9  8
        
        buildings_flag2 bit:  8  7  6  5    4  3  2  1
        building ID:         23 22 21 20   19 18 17 16
        
        buildings_flag3 bit:  8  7  6  5    4  3  2  1
        building ID:          .  .  .  .    .  .  .  .
        
      • the last byte is actually unused, at least not for city buildings

      Map coordinates

      • Two bytes represneting the X and Y coordinates of the city on the world map;
      • Values range from 0 to 79 (for X) and from 0 to 49 (for Y)

      City status flag

      • a single byte used as bitflag representing the city status:
      • currently known bits are as follows:
        Code:
        bit | meaning of bit value = 1
          0 | Civil disorder
          1 | Costal city (used by AI to build ships)
          2 | something related to city celebration/rapture
          3 | Hydro-powered: city benefits from hydro-electrical power bonus
          4 | Auto-build: city is in auto-build mode
          5 | Stolen tech: unclear, related to diplomats stealing techs from cities
          6 | Something else related to celebration/rapture
          7 | A city improvement was sold during this turn (cannot sell another one)
         
      • if the city does not exist (not built yet or destroyed) all flags are set to 1 and this byte's value is 0xFF

      Actual size

      • City 'true' size, as opposed to visible size below

      Visible size

      • City size as visible by the human player; if the city belongs to the human player, this value is ignored

      Current production

      • ID of the current city production; refer to CITY PROD table (TODO)

      Base trade

      Owning Civ

      • ID of the Civ who owns the city

      Food storage

      • Current amount of food available in storage

      Shields storage

      • Current amount of shields accumulated for production

      City squares / specialists

      • A series of 6 bytes used to store information for city square usage and city specialists (see this post by darkpanda)

      City name ID

      • ID of the name used for the city; this is an index to another data block, which is the list of city names

      Trading cities

      • ID of up to 3 other cities with which this city is trading; value 0xFF means that no trade route is established

      unknown

      • Bytes whose usage is still unknown yet



    Unit types

    (back to table)
    Data range/length: [8968:9919] / 952 bytes - (hex: [0x2308:0x26BF]/0x3B8)

    • Unit types
    • The Unit Type data is a 34-byte sequence repeated 28 times (totally 952 bytes), representing all of the 28 unit types available in Civ (TODO: unit type ref table)
    • The following 34 bytes represent a Unit Type

      Column 1 Column 2 Column 3 Column 4
      Offset/start Size
      dec hex
      0 0 12 Unit type name
      12 C 2 Cancelling tech
      14 E 2 Terrain category
      16 10 2 Total moves
      18 12 2 Turns outdoors
      20 14 2 Attack
      22 16 2 Defence
      24 18 2 Cost
      26 1A 2 Sight range
      28 1C 2 Transport capacity
      30 1E 2 Unit role
      32 20 2 Unlocking tech

      Unit type name

      • Name of unit, up to 12 chars (in French version of Civ, this data is extended to 14 chars)

      Cancelling tech

      • Civ Advance ID whose discover cancels this unit type; Civs can no longer build it after the discovery is made; see table of Civ Advance for list of IDs

      Terrain category

      • Terrain category: specifies that movement behaviour for this unit type:
        • 0 = Land: can only move on land squares; can embark on transport ships
        • 1 = Air: can move on land and sea squares; can embark on carriers
        • 2 = Sea: can only move on sea squares and (coastal) cities; cannot fortify
      • Other values are untested

      Total moves

      • Total moves per turn:
        • this value is the base to compute movement turns for a unit
        • it is the number of possible movements for a Land unit on plains/grasslands/river/desert without road or railroad
        • it is also the number of movement per turn for any air unit
        • it is also the number of movement per trun for sea units, not taking into account Wonder bonuses (Magellan, Lighthouse)

      Turns outdoors

      • Number of turns that the unit can stay outdoors, meaning outside a city, a transport or a carrier:
        • if value is 0, there is no limitation
        • if value is 1 or more, the unit will be destroyed after it finished its Nth turn outside a city (if value is 1, then the unit can NEVER end its turn outdoors)
     
  5. darkpanda

    darkpanda Dark Prince

    Joined:
    Oct 28, 2007
    Messages:
    603


    • Attack

      • Attack value for this unit; this value is used in the battle algorithm as explained in this thread by Gowron

      Defence

      • Defence value for this unit; this value is used in the battle algorithm as explained in this thread by Gowron

      Cost

      • Unit cost:
        • the actual shield cost (amount of shileds needed to produce the unit) is tenfolds this value:
        • if the cost is 45, then a city needs 450 shields to produce the unit

      Sight range

      • The range of sight of the unit, i.e. how 'black' squares are revealed when the unit moves towards them:
        • 0 means that the unit will only reveal its own square and the 8 squares surrounding it; this is the default value, for most unit types; if the unit's terrain category is Land (0),
        • 2 means that the unit will reveal two 'rings' of squares surrounding it: the first 'ring' corresponds to the same 8 squares as for value 0; the second 'ring' is compomsed of the 16 additional squares surrounding the 8 squares of the first ring; this is the value for jetfighters and bombers
        • 3 is the same as 2, but is assigned to ships (cruiser, battleship, submarine); other difference not identified yet
      • other values are untested

      Transport capacity

      • Amount of units it can transport:
        • if this amount is not null, and the unit moves from a location where there are sleeping units, then it will bring as much sleeping units as this amount allows, keeping them asleep
        • this works on any unit category or terrain category

      Unit role

      • Category indicating the *nature* of a unit:
        • this primarily controls what the unit can do
        • values range from 0 to 6:
          • 0 = settler: can improve terrain and build cities
          • 1 = land attack: can attack ground units (catapult, bomber, ...)
          • 2 = defence: primarily used for defence
          • 3 = sea attack: can attack units at sea
          • 4 = air attack: can attack units in the air
          • 5 = transport: can transport units on the sea
          • 6 = civilian: can move through enemy lines (caravan and diplomats)

      Unlocking tech

      • ID of the Civ Advance that makes this unit available for production (see this thread by Gowron, section 6. 'Tech Tree')


    Units

    (back to table)
    Data range/length: [9920:22207] / 12288 bytes - (hex: [0x26C0:0x56BF]/0x3000)

    • Units
    • the following 12 bytes represent a Unit
    • this 12-byte sequence is repeated 128 times for each Unit of a Civ
    • the 12*128 bytes block is then repeated 8 times, once for each Civ (totally 12*128*8 = 12288 bytes), representing all of the units available in Civ (TODO: unit type ref table)
    • this also means that Civ only supports 128 active units per civ at any single time

      Column 1 Column 2 Column 3 Column 4
      Offset/start Size
      dec hex
      0 0 1 Unit status
      1 1 2 Map coordinates
      3 3 1 Unit type
      4 4 1 Remaining moves
      5 5 1 Special moves
      6 6 2 Goto coordinates
      8 8 1 unknown
      9 9 1 Visibility
      10 A 1 Next unit in stack
      11 B 1 Home City


      Unit status

      • Unit status flag:
        • a single byte used as bitflag representing the unit status:
        • bits are as follows:
          Code:
          bit | meaning of bit value = 1
            0 | Sentry/sleeping
            1 | Improving terrain; see below
            2 | Fortifying (non-settler unit marked with an 'F', fortified this turn)
            3 | Fortified (non-settler unit surrounded with 'walls', fortified before this turn)
            4 | ? (unknown, thought to be related to sea transport, somehow)
            5 | Veteran
            6 | Improving terrain; see below
            7 | Improving terrain; see below
          
        • Flags 1, 6 and 7 are combined as below to determine the current terrain improving task of a settler:
          Code:
          bit1 | bit6 | bit7 | Task
             1 |    0 |    0 | Road/rail
             0 |    1 |    0 | Irrigation
             0 |    0 |    1 | Mining/forest
             0 |    1 |    1 | Building fortress
             1 |    0 |    1 | Cleaning pollution
          

        Map coordinates

        • Two bytes representing the X and Y coordinates of the unit on the world map;
        • values range from 0 to 79 (for X) and from 0 to 49 (for Y)

        Unit type

        • Unit Type: this value is actually the ID of the Unit Type from the types table (TODO: Unit Type ref table)

        Remaining moves

        • Moves remaining for the unit:
          • this value is actual expresses in *thirds* of moves:
          • if a unit has totally 1 move available, and has not moved yet, this value is *3*, that is 3 thirds of movement
          • moving alongside a road decreases this value by 1 (i.e. moving on road consumes 1 third of movement)

        Special moves

        • Special counter:
          • for aerial units that have a 'turns_outdoor' value different from 0, this value counts that number of turns that the unit spent outside *already*
          • for colonizing units (settlers), this value counts the number of turns already spent doing the current task (typically terrain improvement)

        Goto coordinates

        • The X and Y coordinates of the GoTo destination of the unit:
          • values range from 0 to 79 (for X) and from 0 to 49 (for Y)
          • if GoToX value is 0xFF (-1 or 255), then those coordinates are ignored
          • if GoToX value is different from 0xFF, then the unit is in 'GoTo' mode

        unknown

        • unknown

        Visibility

        • Visibility flag indicating what Civ can see this unit on the world map; each bit of the byte acts as a flag for on the 7 Civs + Barbarians

        Next unit in stack

        • ID of the next unit in this unit's stack:
          • when several units are located on the same map cell, Civ records them as a 'stack', which is actually a linked list;
          • this value is the link to the next unit in the stack;
          • the full linked list is closed loop, i.e. the last unit of the stack has a pointer to the first one
          • the stack/list is used to decide in which order units are activated;
          • for some operations where the maximum number of units is 10 (battle, nukes), this list is also controls which of the 10 units will be affected (first 10 units of the stack)

        Home City

        • ID of the city where this unit was built (home city); if this value is 0xFF (-1 or 255), then the unit has no home city (marked as NONE ingame)


    Map visibility

    (back to table)
    Data range/length: [22208:26207] / 4000 bytes - (hex: [0x56C0:0x665F]/0xFA0)

    • Map visibility
    • Map visibility for all Civs:
      • this data block contains 1 byte per map cell (80*50 = 4000)
      • each byte contains 8 bits, each bit acts as a 'flag' to determine whether the map cell is revealed (i.e. not black) for a particular Civ
      • bit 0 determines whether Barbarians can see a cell: it has a particular role, to also indicate whether a tribe hut was visited or not (see Random Seed regarding Tribe Huts)
      • bits 1 to 7 indicate whether Civ 1 to 7 can see the map cell


    Strategic locations status

    (back to table)
    Data range/length: [26208:26335] / 128 bytes - (hex: [0x6660:0x66DF]/0x80)


    Strategic locations policy

    (back to table)
    Data range/length: [26336:26463] / 128 bytes - (hex: [0x66E0:0x675F]/0x80)


    Strategic locations X

    (back to table)
    Data range/length: [26464:26591] / 128 bytes - (hex: [0x6760:0x67DF]/0x80)


    Strategic locations Y

    (back to table)
    Data range/length: [26592:26719] / 128 bytes - (hex: [0x67E0:0x685F]/0x80)


    Tech first inventors

    (back to table)
    Data range/length: [26720:26863] / 144 bytes - (hex: [0x6860:0x68EF]/0x90)


    Civ-to-Civ destroyed unit counts

    (back to table)
    Data range/length: [26864:26991] / 128 bytes - (hex: [0x68F0:0x696F]/0x80)

    • Civ-to-Civ destroyed unit counts
    • Data block containing the total number of Units of 1 Civ destroyed by another Civ
    • For each attacking Civ A, a block of 16 bytes, so totally 16*8 = 128 bytes
    • Each 16-byte block is an arrays of 8 values (2-byte words); each value is the total number of Units belonging to Civ B (whose ID is the offset of the value within the 16-byte block) that Civ A has destroyed
    • for more details, see this post: http://forums.civfanatics.com/showthread.php?p=12733796&post12733796


    City names

    (back to table)
    Data range/length: [26992:30319] / 3328 bytes - (hex: [0x6970:0x766F]/0xD00)

    • City names
    • the next data block is a list of 16 times 16 city names, each being 13-byte long (totally 3328 bytes)
    • the first 14 sets of city names are specific to the 14 playable Civs
    • the last 2 sets of city names are common names used whenever a Civ exhausted its specific names


    Replay

    (back to table)
    Data range/length: [30320:34417] / 4098 bytes - (hex: [0x7670:0x8671]/0x1002)

    • Replay data: this block stores data used to generate the replay at the end of a Civ game; (see this post by darkpanda)


    Wonders

    (back to table)
    Data range/length: [34418:34461] / 44 bytes - (hex: [0x8672:0x869D]/0x2C)

    • Wonders
    • this data element is a short integer (2 bytes) that occurs 21 times, once for each Wonder
    • it is the ID of the City where the Wonder with the current offset ID (TODO: ref table of Wonders) is built
    • if the wonder is not built yet, this value is 0xFFFF (-1)
    • if this city ID is *not* 0xFFFF and the city corresponding to this ID has size '0' (city destroyed), then the Wonder is marked as Destroyed by CIV


    Units lost

    (back to table)
    Data range/length: [34462:34909] / 448 bytes - (hex: [0x869E:0x885D]/0x1C0)

    • Units lost
    • The data below is a block of 8 sets of 28 short integers (totally 8*28*2 = 448 bytes)
    • There is 1 set for each Civ
    • each of the 28 integers defines the number of units that a particular Civ has already lost in battle, for the 28 possible unit types


    Source Civs for Technologies

    (back to table)
    Data range/length: [34910:35485] / 576 bytes - (hex: [0x885E:0x8A9D]/0x240)

    • Source Civs for technologies:
    • For each civ and each technology, the game stores where the technology came from
    • This only applies to technologies what were acquired via espionage, conquest or diplomatic exchange
    • If a tech is not acquired yet, the value is 0xFF (-1)
    • If a tech was self-discovered, or discovered in a hut, the value is 0
    • It has been observed that for AI Civs, their own Civ ID is stored instead of '0' when they make the discovery themselves
    • 1 byte per technology, 72 technologies per civ, 8 civs ==> total size: 576 bytes


    Polluted square count

    (back to table)
    Data range/length: [35486:35487] / 2 bytes - (hex: [0x8A9E:0x8A9F]/0x2)

    • Polluted square count:
    • a short integer whose value is the total count of all map squares currently polluted


    Pollution effect level

    (back to table)
    Data range/length: [35488:35489] / 2 bytes - (hex: [0x8AA0:0x8AA1]/0x2)

    • World pollution accumulated level (see post by Dack)
    • this is a single byte controlling the level of global warming / world pollution:
      Code:
            values | sun color
               0   | none
             1,2,3 | dark red
           4,5,6,7 | red
           8,9,A,B | yellow
        C,D,E,F,10 | white
      


    Global warming count

    (back to table)
    Data range/length: [35490:35491] / 2 bytes - (hex: [0x8AA2:0x8AA3]/0x2)

    • Global warming count:
    • a short integer counting the number of times that global warming occurred


    Game settings

    (back to table)
    Data range/length: [35492:35493] / 2 bytes - (hex: [0x8AA4:0x8AA5]/0x2)

    • In-game CIV Settings:
    • this is a byte bitflag controlling the enabled/disabled status of CIV settings:
      Code:
      bit | meaning of bit value = 1
        0 | Instant advice
        1 | Auto-save
        2 | End of turn
        3 | Animations
        4 | Sound
        5 | Enemy moves
        6 | Civilopedia text
        7 | Palace
      
    • the high-order byte is unused


    Land pathfinding

    (back to table)
    Data range/length: [35494:35753] / 260 bytes - (hex: [0x8AA6:0x8BA9]/0x104)

    • Land pathfinding helper data:
    • This data is described in full details in this series of posts: http://forums.civfanatics.com/showthread.php?p=12554133&post12554133
    • It is basically a highlevel 'connexity' map between land map 'tiles' (tiles are 4x4-squares areas of the map, there are 20x13 = 260 tiles covering the whole 80x50 map)
    • Investigation revealed that this data is actually wrongly generated by CIV (a patch to fix this is proposed at the link above)
    • Eact usage of this map is still unclear


    Max tech count

    (back to table)
    Data range/length: [35754:35755] / 2 bytes - (hex: [0x8BAA:0x8BAB]/0x2)

    • Max tech count:
    • The maximum value (2-byte word) of Civ tech count among all Civs


    Player future tech.

    (back to table)
    Data range/length: [35756:35757] / 2 bytes - (hex: [0x8BAC:0x8BAD]/0x2)

    • Player's current level of Future Tech research (see post by Dack)


    Debug switches

    (back to table)
    Data range/length: [35758:35759] / 2 bytes - (hex: [0x8BAE:0x8BAF]/0x2)

    • Debug switches:
    • A 2-byte word value whose first 4 bits only are used as function switches, controlling whether certain game features are enabled/disabled:
      • bit 0: controls an AI/player diplomacy function, which is not yet fully understood; seems to be related to assessment of diplomatic relationships with others Civs...
      • bit 1: may be related to possibility of civil disorder/unhappy citizens, and also the possibility of improving terrains, but still unclear...
      • bit 2: controls the possibility of building City improvements
      • bit 3: seems to control scientific research function; if 0, no research progress occurs at all


    Science rates

    (back to table)
    Data range/length: [35760:35775] / 16 bytes - (hex: [0x8BB0:0x8BBF]/0x10)

    • Science rate:
    • determines the level of science for a Civ; 0 means 0% while 10 means 100%
    • combined with Tax rate (see above), this also determines the Luxury rate for a Civ
    • To be noted that it is possible to set both 10 for Science and Tax, in which case Luxury rate becomes... -100% !!
    • This value ocurs 8 times, once for each Civ


    Next anthology turn

    (back to table)
    Data range/length: [35776:35777] / 2 bytes - (hex: [0x8BC0:0x8BC1]/0x2)

    • Next anthology turn:
    • A 2-byte short value representing the next turn when a 'historian' or philosopher will publish a 'world anthology' with the rankings of all Civs
    • At the start of the game, it is a random value between 0 and 50 (exc.)
    • Whenever the turn is reached, the next turn is computed as: current turn + 20 + a random value between 0 and 40 (exc.)


    Cumulative Epic rankings

    (back to table)
    Data range/length: [35778:35793] / 16 bytes - (hex: [0x8BC2:0x8BD1]/0x10)

    • Cumulative Epic rankings
    • A series of 8 values (2-byte words), 1 for each Civ
    • The first value (=Barbarians) is the number of times a scribe/writer/philosophist/anthologist has published an Epic - i.e. the number of times a gobal Civ rankings occured
    • The other values for each non-Barbarian Civ is the addition of all Epic ranking scores so far
    • The ranking score for each Epic is 7 for the first one, 6 for the second one, etc.


    Space ships

    (back to table)
    Data range/length: [35794:37255] / 1462 bytes - (hex: [0x8BD2:0x9187]/0x5B6)

    • Spaceships
    • The following data blocks define how much the Spaceship is built for each Civ
    • Those data blocks give a great insight in how *unfinished* this feature was meant to be, compared to what was finally implemented in CIV:
      • the total spaceship data can be considered as 8 blocks (one for each Civ), of 15 x 12 bytes (totally 180 bytes per Civ)
      • those 15 x 12 presumably represented the total spaceship 'grid area' where spaceship components could be placed, the grid being 15 columns wide and 12 rows high
      • when analyzing the *actual* data in a SVE file, one realizes that the grid was trimmed down to a 12 x 12 area, removing the 3 first columns
      • the data size was not reduced accordingly, and the space reserved for those columns is now unused
    • Each spaceship grid *cell* is represented by a single *byte*; the value of the byte determines what component is located on this cell (for components that span multiple cells, this placement cell matches the top-left cell of the component):
      • 0 = horizontal structure
      • 1 = vertical structure
      • 2 = intersection structure
      • 3 = propulsion
      • 4 = fuel
      • 5 = cockpit
      • 6 = habitation
      • 7 = life support
      • 8 = solar panel
    • In addition, the scale-down of spaceship feature limits the cells that *can* actually host a spaceship part, to only the cells that are populated by default; that said, it is still possible to place a solar panel on cell here a structural part would be...

      Column 1 Column 2 Column 3 Column 4
      Offset/start Size
      dec hex
      0 0 36 unknown (unused first 3 columns of cells)
      12 C 144 Spaceship grid cells (12 x 12) (see description above for details about its contents)

    • The remaining 24 bytes are used as follows, for storing what Civs have a spaceship, and the ETA (estimated time of arrival) for all Civ's spaceships:

      Column 1 Column 2 Column 3 Column 4
      Offset/start Size
      dec hex
      37234 9172 1 Space ship launched flag
      37235 9173 1 Space ship under construction flag
      37236 9174 2 Human spaceship success rate
      37238 9176 2 AI spaceship success rate
      37240 9178 16 ETA year


      Spaceship launched flag

      • Spaceship launched byte bitflag: each bit indicates whether a Civ has launched their spaceship already (1 if true, 0 if not)

      Spaceship under construction flag

      • Space-enabled Civs byte bitflag: each bit of this byte indicates whether a Civ has started to build a spaceship (1 if true, 0 if not)

      Human spaceship success rate

      • A 2-short integer coding for the chance of the human player's spaceship to reach its destination

      unknown

      • A 2-short integer coding for the chance of the AI player's spaceship to reach its destination (share by all AI Civs; to be confirmed)

      ETA year

      • Estimated Year of Arrival for spaceship:
        • this value is actually a *year*, rather than a turn number;
        • this design is known to create bugs when the ETA year does not match a valid CIV turn number (e.g. very early spaceship sent, before 0 AD), in which case the Spaceship is lost and never arrives
        • this value occurs 8 times, once for each Civ


    Palace

    (back to table)
    Data range/length: [37256:37303] / 48 bytes - (hex: [0x9188:0x91B7]/0x30)

    • Palace
    • the next data section contains all information related to the human player's Palace
    • it basically contains information about the *level of construction* and the *style* of each Palace's parts, intertweened with some apparently padding bytes with an unknown usage
    • the Palace has 10 parts:
      • 7 buiding parts: leftmost(0) left(1) centerleft(2) center(3) centerright(4) right(5) rightmost(6)
      • 3 garden parts: left hedge(A) central alley(B) right hedge(C)
    • the *level* valid values are:
      • 0xFFFF: cannot be built (initialy value for parts (0) and (6), when adjacent part have not been built yet)
      • 0x0: empy but can be built (for centerpiece, this is the starting 'hut' castle)
      • 0x1: level 1
      • 0x2: level 2
      • 0x3: level 3 (highest possible level for garden parts)
      • 0x4: level 4 (highest possible level for castle parts)
    • the *style* valid values are:
      • 0x0: Medieval Europe (gray-brick style castle)
      • 0x1: Ancient Rome (greek-style colonade)
      • 0x2: Arabian (arabesques)

      Column 1 Column 2 Column 3 Column 4
      Offset/start Size
      dec hex
      0 0 2 Leftmost(0) level
      2 2 2 Left(1) level
      4 4 2 Centerleft(2) level
      6 6 2 Center(3) level
      8 8 2 Centerright(4) level
      10 A 2 Right(5) level
      12 C 2 Rightmost(6) level
      14 E 2 unknown
      16 10 2 Left hedge(A) level
      18 12 2 Central alley(B) level
      20 14 2 Right hedge(C) level
      22 16 2 unknown
      24 18 2 Leftmost(0) style
      26 1A 2 Left(1) style
      28 1C 2 Centerleft(2) style
      30 1E 2 Center(3) style
      32 20 2 Centerright(4) style
      34 22 2 Right(5) style
      36 24 2 Rightmost(6) style
      38 26 8 unknown




    Cities X coordinates

    (back to table)
    Data range/length: [37304:37559] / 256 bytes - (hex: [0x91B8:0x92B7]/0x100)

    • Cities X coordinate
    • List of X coordinates for all cities, ordered by City Name ID (256 possible cities), 1 byte per value
    • If value is 0xFF, this means the city does not exist


    Cities Y coordinates

    (back to table)
    Data range/length: [37560:37815] / 256 bytes - (hex: [0x92B8:0x93B7]/0x100)

    • Cities Y coordinate
    • List of Y coordinates for all cities, ordered by City Name ID (256 possible cities), 1 byte per value


    Palace level

    (back to table)
    Data range/length: [37816:37817] / 2 bytes - (hex: [0x93B8:0x93B9]/0x2)

    • Palace level
    • Number of total palace upgrades for the player; Gowron suggests it helps CIV to determine whether the player's Palace is maxed out or not


    Peace turn count

    (back to table)
    Data range/length: [37818:37819] / 2 bytes - (hex: [0x93BA:0x93BB]/0x2)

    • Peace turn count
    • Number of consecutive turns without any battle (incl. between AI players); CIV ignores this before 0 AD


    AI opponents

    (back to table)
    Data range/length: [37820:37821] / 2 bytes - (hex: [0x93BC:0x93BD]/0x2)

    • AI opponents
    • Total number of Civs in this game, minus 1; possibly used by Civ to determine whether a Civ should be ressucitated when its counterpart is destroyed


    Spaceship population

    (back to table)
    Data range/length: [37822:37837] / 16 bytes - (hex: [0x93BE:0x93CD]/0x10)

    • Spaceship population
    • Population aboard the spaceship (x10,000)
    • Occurs 8 times, once for each Civ


    Spaceship launch year

    (back to table)
    Data range/length: [37838:37853] / 16 bytes - (hex: [0x93CE:0x93DD]/0x10)

    • Spaceship launch year
    • Actual year at which the Spaceship is launched
    • Occurs 8 times, once for each Civ


    Civ identify flag

    (back to table)
    Data range/length: [37854:37855] / 2 bytes - (hex: [0x93DE:0x93DF]/0x2)

    • Civs identifiy flag
    • Similar to 'Civ identity/leader graphics' but represented as a bitflag
    • The position of each bit determines which Civ 'flavour' it codes for: bit 0 is for Barbarians, bit 1 is for Romans/Russians, bit 2 is for Babylonians/Zulu, etc.
    • The value of each bit determines which of the 2 Civ is active: bit1=0 -> Romans, bit1=1 -> Russians, etc.
     
  6. darkpanda

    darkpanda Dark Prince

    Joined:
    Oct 28, 2007
    Messages:
    603
    I realize that the cross anchor links between the posts do not work... I will investigate how to fix them properly...

    Same goes for all links to references marked as 'TODO' :p


    Cross-post links are now working properly
     
  7. Gowron

    Gowron Chieftain

    Joined:
    May 21, 2007
    Messages:
    62
    This is a flag indicating the player's civ color.
    0x01 = Barbarians
    0x02 = Romans/Russians
    etc.


    Another flag that indicates which civilizations are currently "alive".
    0x01 = Barbarians (they are always marked as "alive")
    0x02 = Romans/Russians
    etc.


    This area contains 3 tables.

    First table: Unit Counts by Unit Types (how many units of which unit type each civ currently controls)
    2 bytes per unit type
    28 unit types per civ
    8 civs
    ==> table size: 448 bytes

    Second table: Unit-in-Production Counts by Unit Types
    same structure and size as the first table, but this time it counts units in production instead of active units
    ==> table size: 448 bytes

    Third table: Technology Counts (how many technologies each civ has researched)
    2 bytes per civ
    ==> table size: 16 bytes


    This area contains 7 tables.

    First table: City Counts by Civ
    2 bytes per civ
    ==> table size: 16 bytes

    Second table: Unit Counts by Civ (total number of units for each civ)
    2 bytes per civ
    ==> table size: 16 bytes

    Third table: Unknown "Land" Variable (when displaying the stats of a civ using the F7 menu with cheat/debug mode activated, it displays "/Units/Cities/Settlers/Land", and this is the "Land" number)
    2 bytes per civ
    ==> table size: 16 bytes

    Fourth table: Settlers Count by Civ (how many Settlers units each civ controls)
    2 bytes per civ
    ==> table size: 16 bytes

    Fifth table: Total Civ Size (for each civ: combined size of all cities which this civ controls)
    2 bytes per civ
    ==> table size: 16 bytes

    Sixth Table: Military Power (sum of nominal attack and defense strengths of all units which this civ controls)
    2 bytes per civ
    ==> table size: 16 bytes

    Seventh Table: Unknown Variable by Civ (maybe related to the strength or size of a civ)
    2 bytes per civ
    ==> table size: 16 bytes



    to be continued...



    Edit:
    You should update the memory maps in the opening posting. They seem to be outdated now that I see your recent postings.
    If you don't have time to update them, you should delete them, or at least make it evident that they should not be used.
     
  8. darkpanda

    darkpanda Dark Prince

    Joined:
    Oct 28, 2007
    Messages:
    603
    Wow, seems you've switched to brute force mode ! :)

    All those values (number of units being built, total civ size, etc.) can actually be recalculated based on other data (cities, city production, etc.)... Do you know if changing them will affect CIV in any way ? I'll try that when I have time...

    You're right... So much to do, so little time, I am being a little sloppy! Anyway, I did update it just now, thanks for the heads-up. I will also update the SVE table later on.
     
  9. Gowron

    Gowron Chieftain

    Joined:
    May 21, 2007
    Messages:
    62
    Even better - I found the subroutine which writes the save game file. It gives exact sizes and addresses of the data to be written. And some of the addresses contained variables that I had already identified :)

    I don't know for certain, but yes, I am pretty sure that could you could cause some funny glitches if you changed the file in an inconsistent way.

    No problem :) It's just not so good if the important postings are hard to find (i.e. on the 2nd page) and the opening posting is out of date.


    But I wrote "to be continued", so here's some more input:


    Civilization Score (as displayed on the F9 screen and at the end of the game)
    2 bytes per civ

    a turn number that seems to determine when the leader of that civ is willing to contact the human player again
    2 bytes per civ

    horizontal coordinate of the start position of the civ (yes, only the horizontal coordinate)
    2 bytes per civ

    This area contains 5 tables.

    First table: Military Defense Strength on Continent (for each civ: sum of nominal defense strengths of all units of this civ on this continent)
    2 bytes per continent
    16 continents per civ
    8 civs
    ==> table size: 256 bytes

    Second table: Military Attack Strength on Continent (for each civ: sum of nominal attack strengths of all units of this civ on this continent)
    2 bytes per continent
    16 continents per civ
    8 civs
    ==> table size: 256 bytes

    Third table: City Count on Continent (for each civ: number of their cities on this continent)
    2 bytes per continent
    16 continents per civ
    8 civs
    ==> table size: 256 bytes

    Fourth Table: This table contains the continent sizes (number of map square), but it also contains some other unknown continent-related data.
    table size: 256 bytes

    Fifth table: unknown continent-related data
    2 bytes per continent
    ==> table size: 32 bytes

    These are actually 2 tables, each with a size of 0x4B0 bytes. I don't know (yet) what the second table does.


    This area contains two tables.

    First table: Source Civs for Technologies:
    For each civ and each technology, the game stores where the technology came from. This only applies to technologies what were acquired via espionage, conquest or diplomatic exchange. For all other techs, the "source civ" value is 0xFFFF (= -1, default value) or zero (I think it's zero if the tech was found in a hut, but that needs confirmation).
    1 byte per technology
    72 technologies per civ
    8 civs
    ==> table size: 576 bytes

    Second table: Pollution Count (number of map squares which currently contain pollution)
    Not much of a table, actually ^^
    size: 2 bytes

    This is actually 2 bytes in size.
    It is the current Pollution Effect level. It is invoked by the Pollution Count and will cause Global Warming if it reaches a value of 16.
    This is NOT pollution and NOT global warming, although it is related to both of these.

    The first byte of this area belongs to the Pollution Effect level (see above).
    The other 2 bytes are occupied by the Global Warming Count (number of Global Warming instances which happened so far).

    Although this value is only 1 byte in size, it's stored as a 2-byte value in the .SVE file.

    This value is 2 bytes in size.

    Please double-check this. The correct data range should be 0x8BD2:0x9171 (still 0x5A0 bytes).

    That's actually not part of the "Space Ship Grid" data field.
    I'm giving you the sizes of all data parts from address 0x9172 (right after the space ship grid field) till the end of the file, so that you can already arrange your posting accordingly. I will then list whatever I have identified already.
    Sizes (in bytes):
    2
    2
    2
    16 (space ship arrival years)
    24
    24
    256
    256
    2
    2
    2
    16
    16
    2
    ---
    ---
    total: 622 bytes
     
  10. darkpanda

    darkpanda Dark Prince

    Joined:
    Oct 28, 2007
    Messages:
    603
    Wow, this is really impressive... It'll take me some time to process it all (I'm currently stuck in some annoying -but necessary- technical issue in JCivED), but I hope to confirm double-check the values and confirm ASAP.
     
  11. darkpanda

    darkpanda Dark Prince

    Joined:
    Oct 28, 2007
    Messages:
    603
    Looking at my reference gamesave, where I dominate as Babylonians in 1700 AD, and Americans (3 cities) and English (1 city) are still surviving, the values for each of us are:
    - me: 7
    - Americans: 6
    - English: 5

    The remaining (dead) Civs have the 5 remaining values: 4, 3, 2, 1 and 0

    So I believe this value is some kind of ranking, or maybe the order in which Civ play the turn...
     
  12. darkpanda

    darkpanda Dark Prince

    Joined:
    Oct 28, 2007
    Messages:
    603
    Actually, this data seems to be split a little differently:
    - 4th table: continent sizes, 2 bytes per continent, 32 bytes (for some reason, continent '15', which doesn't exist, has size 1...)
    - Next 96 bytes: unknown (all 0x00)
    - 5th table: oceans' sizes, 2 bytes per ocean, 32 bytes (same as above, ocean '15' has size 1...)
    - Next 96 bytes: unknown (all 0x00)
    - 6th table: number of city build sites per continent, 2 bytes per continent, 32 bytes; a city build site is a map square whose initial land value is not 0 (by "initial", I mean the land value assigned at map creation time; those values are stored inside the .MAP file, alongside map geography, continent/ocean segmentation, terrain improvements, etc... ; for some reason, CIV doesn't seem to update land values when the player modifies terrain with settlers...)

    For the two 96-byte blocks of 0x00's, I have no idea what their usage is, I renamed them unknown2a and unknown2b in JCivED...
     
  13. Gowron

    Gowron Chieftain

    Joined:
    May 21, 2007
    Messages:
    62
    No, I just double-checked. The data is split exactly as I wrote above. The game writes this first 256-byte table at once, and then the 32-byte table.

    What you're looking at as "4th and 5th table" are actually just two parts of one big table, at least from the game's point of view.

    While it does not really matter in this case if it's 1 table or 2 or 4, I decided to designate the parts in the same way as they are separated by the game itself when writing to the .SVE file, since that's probably reasonable way.

    Long short story: You don't need to wait for confirmation if you want to re-arrange the tables in a different way that makes them more clear :)


    Btw, if you split up the end of SVE data reference table in the way I posted above, then I can quote that posting and insert the corresponding explanations.
     
  14. darkpanda

    darkpanda Dark Prince

    Joined:
    Oct 28, 2007
    Messages:
    603
    Fine :) Most likely this data is stored in a single block of 256 bytes in memory, which I fully understand, but I prefer to split data according to "game logic", which is more "human-readable".

    Ok, will do it asap.

    I confirmed the actual score graph length is 1200 bytes (0x4B0), which makes up for scores up to turn 600 (equ. to year 2050 AD)...

    The second block of data has the same structure as the score graph (1200 bytes, 8 bytes for every 4 turns, ...), and is populated at the same rate, so I believe it is another type of graph data, but yet to be deciphered. Looking at it, it seems each byte is actually a set of flags...

    On a side note: in order to confirm the above, I ran a game of Civ from start, in Civ EN 475.01, level Emperor, and pressed Enter up to the end of the game (tweaking it inbetween to avoid the opponents sending spaceships out there)...
    While doing this, I realized something happened with turn counts: CIV did an auto-save on year 1831 AD, which was really unexpected. While editing the SVE, the turn count for year 1831 was 400... I realized that opponents had started building spaceships not very long ago, and so my guess is that to avoid the "lost spaceship" bug, this version of Civ actually switches to "1 turn = 1 year" as soon as someone starts building a spaceship.

    Does anyone know about this ?
     
  15. darkpanda

    darkpanda Dark Prince

    Joined:
    Oct 28, 2007
    Messages:
    603
    Just a heads-up to notify that the SVE data reference table and detailed sections have been updated to latest findings by Gowron.

    Keep up the good work ! :)
     
  16. Gowron

    Gowron Chieftain

    Joined:
    May 21, 2007
    Messages:
    62
    After 1750 AD, turns will switch from 2-year to 1-year increments as soon as someone starts building a space ship.

    More precisely, the game starts checking the spaceship status flags at 1750 AD. If one of the flags is set for any civ (except Barbarians, but that does not really matter), the year number is increased by 1 instead of 2. The flags are checked each turn (but not before 1750 AD).

    Thank you :)

    But the data fields at the end of your reference table are incomplete. Here are the field sizes again:

    2 [start addess: 0x9172 = 37234(dec)]
    2
    2
    16 (space ship arrival years)
    24
    24
    256
    256
    2
    2
    2
    16
    16
    2
    ---
    ---
    total: 622 bytes
     
  17. darkpanda

    darkpanda Dark Prince

    Joined:
    Oct 28, 2007
    Messages:
    603
    Actually, those 4 data blocks are included at the end of the Spaceships description... But if you prefer, I can make them separate.
    The first 2 bytes are the "space-enabled Civs" flag, by the way.

    Those 2 data fields actually contains Palace data, which is already described as such in reference data above.

    Those are already separated, starting at unknown #27.
     
  18. kirkham7

    kirkham7 Warlord

    Joined:
    Dec 22, 2012
    Messages:
    288
    Location:
    Hayward, CA
    So question, is the 1750 AD set in stone, or is there a way to change it? For example, if it were changed to say, I don't know, 1 AD, would it continue at the interval of 1 or 2 or 5 years all the way until the year the game normally ends? I ask because if you add food and shields to every square (as I have done), you can make the game go considerably faster. I'm usually done by 1 AD, and it would be interesting to see if the spaceship can be launched and arrived in the BC years or very early AD years...

    Edit: Forgot about turn counts, but my first question is still valid.
     
  19. Gowron

    Gowron Chieftain

    Joined:
    May 21, 2007
    Messages:
    62
    Ah, ok, thank you :)
    No need, this will do :)

    These is the SpaceShip status flags. Although the 2 bytes have different meanings, the game will usually use them as one 2-byte variable.
    One bit per civ, Barbarians are included (and irrelevant) as usually.
    Low byte: space ship launched
    High byte: space ship construction started

    This area contains 2 variables.

    1st variable (2 bytes): space ship success chance for the human player

    2nd variable (2 bytes): another space ship success chance, but this one seems to be used (shared?) by the AI civs (not 100% sure)

    horizontal coordinates of cities, sorted by their city name ID

    vertical coordinates of cities, sorted by their city name ID

    Palace Level
    (total number of palace improvements acquired by the human player)
    This gives the game a quick way to determine if the palace is already maxed out.

    Peace Turn Count
    (note that this is not used at all in the BC years)

    Level Of Competition

    This is stored a bit awkwardly, it's actually the number of civs minus 1:
    2 = (3 civilizations)
    ...
    6 = (7 civilizations)

    Space Ship Population Counts (as multiples of 10,000)
    2 bytes per value
    8 valus (one for each civ)

    Space Ship Launch Year (actual year number, not turn count)
    2 bytes per value
    8 valus (one for each civ)

    Civ Identity Flags
    0x02: Russians
    0x04: Zulus
    etc.
    (basically it's the same as the "Civ identity / Leader graphics" variables, but as flags)



    It can be changed with a hex editor. Takes less than a minute :)

    This is how the game determines the year increment:

    1. If (Year < 1000), increase (Year) by 20. Else, go to step 2.
    2. If (Year < 1500), increase (Year) by 10. Else, go to step 3.
    3. If (Year < 1750), increase (Year) by 5. Else, go to step 4.
    4. If (Year < 1850) and none of the SpaceShip status flags are set, increase (Year) by 2. Else, go to step 5.
    5. Increase (Year) by 1.

    So if you change "1750" to "1", then that would still not be effective until 1500 AD. You would have to change all 3 of the critical year numbers (1000, 1500 and 1750).

    If you are interested in this, you can try to find this code sequence in civ.exe:

    E8 03 7D 07 83 06 40 C1 14 EB 38 81 3E 40 C1 DC 05 7D 07 83 06 40 C1 0A EB 29 81 3E 40 C1 D6 06

    The bold numbers are the critical year numbers ("E803" = 1000, "DC05" = 1500, "D606" = 1750). Changing the above code to

    00 00 7D 07 83 06 40 C1 14 EB 38 81 3E 40 C1 00 00 7D 07 83 06 40 C1 0A EB 29 81 3E 40 C1 00 00

    will enable the SpaceShip check from 0 AD (effectively from 1 AD, since 0 AD does not exist in Civilization), but as a side effect, years will only be incremented by 2 years per turn, even if no space ship has been launched yet.

    To avoid the side effect, you could make 2 versions of civ.exe. Start the game with the original version. Immediately after launching your space ship, save your game, switch to the modified version and load your game again :)

    IIRC, the game does not check for space ship arrivals until 1 AD.
    Unless you are going to change that as well ^^
     
  20. Dack

    Dack Terra Form Moderator

    Joined:
    Nov 26, 2003
    Messages:
    532
    Location:
    civ dos 474.05
    In the attached images I have overlaid a hex editor over a test tab of TerraForm in order to indicate my findings.
    In TerraForm when a save as is preformed the program labels each island with a unique indicator A thru Whatever then sorts the list by the number of squares it contains. The largest is labeled 1 and so on until 0xE all others are labeled 0xF. The same algorithm is used for the seas.

    Observations:
    1. I found the first island value at 0x0A8A, the first sea at 0x0B0A. I assume the word (16 bits) before the first island or sea must be a space filler word for programming convenience.
    2. I wonder how these values work? When TerraForm was new we had a series of Game of the month. As TerraForm does not update these values they remained the values of the SVE file that was edited. No one ever noticed strange game play.
    3. The data depicted is from an actual game (unmodified). Everything was as expected except the largest sea (1) had a value of 2889 but TerraForm’s count was 2692 (far left text box). Then I noticed the largest island didn’t include the squares in the Arctic & Antarctic, which are always marked as island 1. But the two values for the Arctic & Antarctic plus the largest sea value equal the value stored in the SVE file. (98 + 99 + 2692 = 2889). So the area covered by the Arctic & Antarctic are included in the count of squares in the largest sea 1. (A side note the sea side bit in the city data is not set for non human countries cities that are built next to seas that are not the sea labeled 1. {City status flag bit 1 | Costal city (used by AI to build ships)})

    In the lower left corner of the image the box with the line Number of Islands =11 this includes the Arctic & Antarctic which are not islands in and of them selves but are always marked 1. The total number of islands is 2 less or 9.


    My memory of the development of TerraForm made me question the above.

    One after another I started new games on the 12th try CIV produced a game with 18 seas the smallest 4 are labeled F in the island/sea value.
    The coordinates of these seas are the following: XY 16,20 – 44,20 – 39,24 – 59,42

    On the 19th try I came up with a world with 16 islands.

    The two smallest with a size of 8 and 5 are both marked with a value of F. The Island F data with a value of 1.


    The attached zip file contains the two examples, produced by CIV 474.05 and unaltered.
     

    Attached Files:

Share This Page