 |
|  |
 |
|
Allard HS
|
Everything that is commonly knowledge about hex-editing and a lot of new stuff.
Updated 26th May, 15th May and 20th June.
See later posts for details on what's updated when.
If you wish to save this on disk, and do not wish some formatting to be lost, it is best to edit this post and copy-paste it.
code: HEX-EDITING SAVED GAMES:
By various authors, mentioned where appropriate.
This text may be copied freely without permission.
LAYOUT OF A SAVED GAME:
=======================
Hex offsets are given, until map information, from where
the values are no longer fixed.
00 - 2F = toggled options, various player settings
30 - 109 = unidentified or empty
10A - 141 = Wonders location (with city ID)
142 - 247 = unidentified or empty
248 - 8E5 = 7 blocks of each F2 bytes long with city style
information, leader and tribe names for all 7 civs
8E6 - 3585 = 8 blocks of each 593 (in hex) bytes long with
various information, like money and techs (a lot
still unidentified) for all 8 civs (incl. barbarians)
3586 - 3594 = map header information
... = map data block 1 (continues a very long time)
... = map data block 2 (quite long too)
... = map data block 3 <a few pages>
... = unit information
... = city information
... = unidentified, and other info such as where the
screen is centred or the cursor is located
... = a bit of text on how the scenario is called, and
probably a bit of history (who's wiped out, etc.)
... = event stuff (starts with EVNT, easy to find)
START OF SAVED GAME FILE:
=========================
(source Allard Höfelt)
(Xin Yu found out about byte 2F toggling civ to be played)
(Captain Nemo found out the civs that are in play in byte 2E)
A : 27 : Conflicts in Civilization or lower
28 : Fantastic Worlds (2.7.81)
2C : Multiplayer Gold
31 : Test of Time
C : 1... .... = bloodlust on/off
.1.. ....
..1. ....
...1 .... = simplified combat on/off
.... 1...
.... .1..
.... ..1.
.... ...1
D : 1... .... = flat/round world
.1.. ....
..1. ....
...1 ....
.... 1...
.... .1..
.... ..1.
.... ...1 = don't restart if eliminated on/off
E : 1... .... = move units without mouse on/off
.1.. .... = enter closes city screen on/off
..1. .... = grid on/off
...1 .... = sound effects on/off
.... 1... = music on/off
.... .1..
.... ..1.
.... ...1
F : 1... .... = cheat menu on/off
.1.. .... = always wait at end of turn on/off
..1. .... = autosave each turn on/off
...1 .... = show enemy moves on/off
.... 1... = no pause after enemy moves on/off
.... .1.. = fast piece slide on/off
.... ..1. = instant advice on/off
.... ...1 = tutorial help on/off
10 : 1... ....
.1.. ....
..1. .... = animated heralds on/off
...1 .... = High Council on/off
.... 1... = civilopedia for advances on/off
.... .1.. = throne room graphics on/off
.... ..1. = diplomacy screen graphics on/off
.... ...1 = wonder movies on/off
14 : ...1 .... = cheat penalty/warning on/off
.1.. .... = scenario file yes/no (no effect really)
16 : 1... .... = announce "we love the king day" on/off
.1.. .... = warn when food dangerously low on/off
..1. .... = announce cities in disorder on/off
...1 .... = announce order restored in city on/off
.... 1... = show non-combat units built on/off
.... .1.. = show invalid build instructions on/off
.... ..1. = warn when city growth halted on/off
.... ...1 = show city improvements built on/off
17 : .... ....
.... .1.. = zoom to city not default action on/off
.... ..1. = warn when new pollution occurs on/off
.... ...1 = warn when changing production will cost shields on/off
1C-1D = number of turns passed
1E-1F = number of turns passed to calculate game year in pop-ups, status bar, etc.
22-23 = specifies which unit is selected at start of the game
(you can find the unit id number by playing another civ, revealing
the map and right clicking on the unit. On the right, the id is
shown between parentheses)
27 = changes which human player is used
28 = player's map which is used
29 = player's civilization number used
2A = changes with map used. Sometimes FF
2B = map revealed or not
2C = difficulty level [deity=5, emperor=4, etc.]
2D = barbarian activity
2E = number of civs still in play [binary]
2F = human player played (can be more than one) [binary]
toggling this byte is great and allows Hotseat mode in FW!!!
32 = amount of polution. 7F is maximum, and will certainly cause global
temperature rising at the end of the turn. A value of 80 till FF
is a negative amount (still shows the icon for global rising),
but it will be reset to 00 at the end of the turn.
33 = amount of times that a global temperature rising has been
happening this far in the game. 7F is maximum and will make the
whole world a big swamp when the next global temperature rising
occurs. 80 or higher will prevent any global rising from happening.
At the moment when terrain should be changed, nothing happens, and
byte 32 is restored to 00, though a message still pops up. Byte 33
will remain at what it was, so it is not reset.
38 = number of turns of peace (counts only after 200th turn)
WONDERS:
========
(source Allard Höfelt)
Near the start of the saved game, on offset 10A until 141 are given the
locations of all wonders. All 28 wonders have 2 bytes, so in total the
block for all wonders is 56 bytes long.
If the 2 bytes for a wonder are
- FF FF : the wonder has not yet been built.
- EF FF : the wonder is destroyed (original city is not stored).
- otherwise the number is the city ID number. 00 00 the first city, etc.
TRIBES:
=======
(source unknown)
The information is stored in 7 blocks (not for barbarians) of F2 length.
The blocks start and end at:
248-339 - 1st block
33A-42B - 2nd "
42C-51D - 3rd "
51E-60F - 4th "
610-701 - 5th "
702-7F3 - 6th "
7F4-8E5 - 7th "
These 7 blocks are all filled with 00's except for a few names and numbers.
These are:
City Style - directly at start of block, one byte long
Leader Name - 3rd byte from start (eg. 250, 341..), 23 bytes long
Tribe Name - 1Ath (26th in decimals) byte from start, 23 bytes long
Adjective - 32th (50th in decimals) byte from start, 23 bytes long
note: City Styles can be any city style, including industrial and modern,
even though without the required advances.
You can even fill in higher numbers here, which however produce
strange effect (as it does everywhere) and may cause the game to
crash.
TECHNOLOGIES & MONEY:
=====================
(source Allard Höfelt)
Byte 8EF until 3585 is devided in 8 blocks of each 593 bytes. Each of
these blocks contain information specific for each civ, such as techs
and money. A lot more in these blocks has as yet not been idendified.
The blocks all start at these offset bytes:
Block of 0th civ: 8E6 - E79 (barbarians)
" 1st civ: E7A - 140D
" 2nd civ: 140E - 19A1
" 3rd civ: 19A2 - 1F35
" 4th civ: 1F36 - 24C9
" 5th civ: 24CA - 2A5D
" 6th civ: 2A5E - 2FF1
" 7th civ: 2FF2 - 3585
Counted from the start of each block:
note: the number given here are all hexadecimals, so the
16th byte in hexadecimal is the 22nd in decimal.
byte 2 - Gender. Male=00 Female=02
byte 3 - Money. The barbarians' money is also changeable.
byte 9 - Research progress. Also updates the colour of research
indicator in status bar on the right.
byte B - Tech which is being researched. FF if cleared or no goal.
byte 15 - Percentages to tax, science and luxuries.
byte 16 - Government. Valid values are 00-07 (though 07 does
not normally exist). A value of 08 or higher causes
the game to crash. 00 is of course Anarchy, 01 is
Despotism, etc.
You can give the barbarians Democracy (06) to prevent
their cities being subverted.
byte 1F - Reputation
byte 25-40 - Treaties. 4 bytes for the treaties with all 7
civs (including their own civ).
1st byte: .... ...1 - contact
.... ..1. - cease fire
.... .1.. - peace
.... 1... - alliance (with peace always)
...1 .... - vendetta
1... .... - embassy
2nd byte: ..1. .... - war
.... .1.. - ???? used by game
3rd byte: ..1. .... - ???? used by game
4th byte: ????
then the 1st byte for the next civ, for all 7 civs.
note: you can also combine them, eg. war and alliance
at the same time. They will repair your units,
but talk with you as if in war. Some more strange
effects.
byte 42-48 - Attitudes. Byte 42 is attitude to 1st player,
43 is to 2nd player, etc.
byte 59-64 - Technologies. B (11) bytes long.
To explain how the bytes work, an example of the first
technology byte:
.... ...1 : 1st technology
.... ..1. : 2nd "
.... .1.. : 3rd "
.... 1... : 4th "
...1 .... : 5th "
..1. .... : 6th "
1... .... : 7th "
In the next byte are the 8th-14th technolgy. Note that for
some reason the .1.. .... is left out. This is not the case
in each of these bytes, though. I don't know why.
Though it's fun to know how it works, it is much much easier
to set techs using the cheat menu.
byte 67-68 - military demographics value.
byte 3E5-3F2 - last contact with civs. First two to 1st civ,
3rd and 4th for 2nd civ, etc.
FF FF if not available, 01 00 for 1, etc.
note: It may be that the FF FF in byte 3E3 and 3E4
are for last contact with barbarians, but that
is not verifiable.
MAPS:
=====
(see Jorrit Vermeiren's Maps explanation)
UNITS INFORMATION:
==================
(source Allard Höfelt)
Located right before the city information. It may be handy to set you hex editor
to show 13/26 bytes per row, so that a unit is exactly 2/1 rows under the one
before him. The units are numbered (right click on a unit and you'll see its id
number) according to the way they're ordered in here.
Find specific unit by toggling eg. veteran status. Alternatively, search for
the location of the unit by searching the x and y coordinates. If your unit is
located at (88,46) look for the hex value 58 00 2E 00.
01-02 = horizontal coordinates of unit
(NOTE: the unit is invisible if moved, unless the terrain it now
occupies has the "contains unit" flag toggled on. See terrains)
03-04 = vertical coordinates of unit (same NOTE as with horizontal)
06 : 1... .... = adds a grey star to the shield, no apparent function
..1. .... = toggles veteran
07 = unit type (counted in rules.txt, 00=settler, 01=engineer, etc.)
08 = owning civilization
11 = number of hitpoints lost
12 = ?? does change
14 = caravan commodity
(00 hides, 01 wool, ..., 0A uranium, F0 food supply, rest makes no sense)
16 = orders:
01 : fortify (not yet fortified, but ordered to do so)
02 : fortified
03 : sentry
04 : build fortress
05 : builds road/railroad
06 : builds irrigation
07 : builds mine
08 : transform terrain
09 : cleans up pollution
0A : builds airbase
0B : go to (see number 19-20 and 21-22)
FF : no orders (can also fill in any other number for no orders, but computer uses FF)
17 = home city with number is city number (FF is none)
(You can find out the city number with for example "find city". If all cities
that are on the map are listed, you can simply count them to find the number)
19-20 = horizontal coordinate of "go-to" command
21-22 = vertical coordinate of "go-to" command
23-24 = link to ?id?'s of other units to be drawn in the same square on top of the unit
(works very strange)
25-26 = link to ?id?'s of other units to be drawn in the same square under the unit
(works very strange)
at location 27, the next unit starts
CITIES:
=======
(source Andrew Livings and Xin Yu)
Search for the city names located near the end of the save game.
The city name itself starts on the 33th hex numbers pair.
01-02 = vertical coordinates of city
03-04 = horizontal coordinates of city
05 : 1... .... can build coastal improvements
...1 .... denotes auto-build under military rule
.... 1... denotes stolen tech
.... .1.. denotes improvement sold
.... ..1. denotes "we love the king day"
.... ...1 denotes civil disorder
07 : ..1. .... can build ships (only if coastal flag is checked)
08 : ...1 .... denotes objective x3
.... .1.. denotes objective x1 (if used both it will be x2)
09 = city owner [00-07 (don't use >7)]
10 = city size (negative sizes cultivate no squares but produce food)
11 = who originally built the city [00-07]
15-21 = working city production squares??
23-26 = specialists, 4 hex positions representing 16 base 4 numbers representing specialists
0=none, 1=elvis, 2=tax, 3=sci.
example: 06000000, first hex 06=1*4+2: 1 taxman and 1 elvis
27-28 = food in food box (FF=famine)
29-30 = shields in shield box
31-32 = net trade (not including those from trade routes)
33-47 = city name buffer [15 characters, end with a 00]
48 = 00, city name cannot exceed 15 characters
49 = workers in inner circle (8 squares next to city square) [ff=all worked]
50 = workers on 8 of the outer circle
51 = workers on 4 of the outer circle
[first digit is always 1, the second digit represents the 4 working positions]
52 = number of specialists times 4 [eg. 08=2 specialists]
53-57 = city improvements:
1... .... is 7th improvement
.1.. .... is 6th improvement
..1. .... is 5th improvement
...1 .... is 4th improvement
.... 1... is 3rd improvement
.... .1.. is 2nd improvement
.... ..1. is 1st improvement
58 = item in production (can be used to force production)
[units 00-3f]
(improvements are inversed [FF=1st FE=2nd etc])
59 = number of active trade routes [decimal, can also be >03]
60-62 = 1st, 2nd and 3rd trade commodities available
- [00-0F (are 1st-15th in rules.txt)]
- supplied trade goods, eg (Coal), are inverse values.
eg., commodity 13 is already supplied, the value is F3 (-13)
- if in paranthesis use FF compliment (can force trade commodity
eg., 0F=Uranium, F0 = (Uranium), which is ff-0f
63-65 = 1st, 2nd and 3rd trade commodities demanded
66-68 = 1st, 2nd and 3rd trade commodities in route
69-74 = 1st, 2nd and 3rd trade route partner city number (city number is 85th-86th position)
75-76 = science
77-78 = tax
79-80 = number of trade icons (including trade routes)
81 = total food production
82 = total shield production
83 = number of happy citizen
84 = number of unhappy citizen (double unhappy count twice??)
85-86 = sequence number of this city, used to idendify the city. Very useful!
87-88 = ?? always 0000 ??
OTHER
=====
(source Allard Höfelt)
- 3C-3F bytes after the last city has been finished are the coordinates of the cursor.
- 3B1-3B2 bytes after the last city has been finished are the zoom factors. For zooming
in, change byte 3B1 only. For zooming out, change byte 3B2 to FF and lower
the value of byte 3B1 beginning with FF.
note: F9 FF is the lowest zoom you can get. Lowering it further causes
the game to crash. There is no limitation when zooming in.
- 583-58A control the size of the city screen.
<font size=1 face=Arial color=444444>[This message has been edited by Allard HS (edited June 20, 2000).]</font>
|
|
|  |
 |
Panda
|
Europe
Jan 1970 time: 05:37
|
|
<center><table width=80%><tr><td><font color=000080 face="Verdana" size=2><font size="1">quote:
<img src="/images/blue1.gif" width=100% height=1>
</font>TRIBES:=======
(source is from common knowledge)
2 before tribename = city style can be any city style, including industrial and modern without the required advances.
<img src="/images/blue1.gif" width=100% height=1></font></td></tr></table></center>
That will be very useful.
But I'm a bit confused by this:
<center><table width=80%><tr><td><font color=000080 face="Verdana" size=2><font size="1">quote:
<img src="/images/blue1.gif" width=100% height=1>
</font>C : 1... .... = bloodlust on/off .1.. .... ..1. .... ...1 .... = simplified combat on/off .... 1... .... .1.. .... ..1. .... ...1
<img src="/images/blue1.gif" width=100% height=1></font></td></tr></table></center>
How does that translate into the hex value we use, please?
|
|
|  |
 |
|
Allard HS
|
Please note that these values are not all my work. Only there where my name stands on top has been found by me. The rest I simply assembled from all other information available. Therefore I also do not understand all of it, especially the city sequence numbers. Ask that Xin or Andrew.
<center><table width=80%><tr><td><font color=000080 face="Verdana" size=2><font size="1">quote:
<img src="/images/blue1.gif" width=100% height=1>
</font>On the city architecture byte, is that permanent even if techs leading to industrial or modern style are discovered later
<img src="/images/blue1.gif" width=100% height=1></font></td></tr></table></center>
Then it changes, if you have any of the old styles. Which is logical, because the game will automatically save the style there. And the style later upgrades. That in itself is no great innovation, but the trick is that you can set the civ to have modern cities without the required techs. Or industrial, which will (not tested that one though) upgrade to modern with the required techs.
This trick can allow good savings on the length of tech trees. Instead of giving one civ annoying techs, you can just set it here.
<center><table width=80%><tr><td><font color=000080 face="Verdana" size=2><font size="1">quote:
<img src="/images/blue1.gif" width=100% height=1>
</font>How does that translate into the hex value we use, please?
<img src="/images/blue1.gif" width=100% height=1></font></td></tr></table></center>
it's an unprofessional way of talking. What I mean with .... ...1 is in hexadecimal 01 and .... ..1. is 02. So adding both of them would give .... ..11 which is 03. The . basically means that it can be any value but has no importance for this.
I have no experience with hex-editing before, so it's probably not the best way of making it clear, but I thought it worked pretty ok like this.
<center><table width=80%><tr><td><font color=000080 face="Verdana" size=2><font size="1">quote:
<img src="/images/blue1.gif" width=100% height=1>
</font>Allard, hey some really GREAT work here! This should definitely be made a scenario league tip before it gets lost as an old forum post
<img src="/images/blue1.gif" width=100% height=1></font></td></tr></table></center>
I thought it handier to post it here. Reaches more people 
<center><table width=80%><tr><td><font color=000080 face="Verdana" size=2><font size="1">quote:
<img src="/images/blue1.gif" width=100% height=1>
</font>Allard: Great job! If you attach an example it would be even better
<img src="/images/blue1.gif" width=100% height=1></font></td></tr></table></center>
I'll leave that too others
|
|
|  |
 |
Panda
|
Europe
Jan 1970 time: 05:37
|
|
Well, good news.
Now that I finally figured out that it was a reference to binary values I've realised that both the civ's technologies and city improvements are both stored as binary numbers. Thanks, Allard.
Good news: found the starting locations for each civs technologies and gold:
<TABLE BORDER=0><TR><TD>CIV</TD><TD>MONEY</TD><td>TECHNOLOGY</TD></tr><TR>
<TR><TD>BARBARIAN</TD><TD>2280+2281 ( 8E8)</TD><td>2366 ( 93E)</TD></tr><TR>
<TR><TD>1</TD><TD> 3708 ( E7C)</TD><td> 3794 ( ED2)</TD></tr>
<TR><TD>2</TD><TD> 5136 (1410)</TD><td> 5222 (1466)</TD></tr>
<TR><TD>3</TD><TD> 6564 (19A4)</TD><td> 6650 (19FA)</TD></tr>
<TR><TD>4</TD><TD> 7992 (1F38)</TD><td> 8078 (1F8E)</TD></tr>
<TR><TD>5</TD><TD> 9420 (24CC)</TD><td> 9506 (2522)</TD></tr>
<TR><TD>6</TD><TD>10848 (2A60)</TD><td>10934 (2AB6)</TD></tr>
<TR><TD>7</TD><TD>12276 (2FFA)</TD><td>12362 (304A)</TD></tr></table>
Bad news: editing the barbarian's technology is not so straight-foward, which was the whole point of the investigation.
Bad news: the city information (in FW at least) only contains 84 bytes, not 88, so there is no index number for the city included within this space. Byte 86 in the above list is simply the vertical coordinates of the next city.
------------------
"The man who can smile when things go wrong has thought of someone he can blame it on"
|
|
|  |
 |
|
Allard HS
|
Damn! I just found out exactly the same about techs and money today! Well, also some more things fortunately. I'll post it tomorrow if i got any time left.
|
|
|  |
 |
|
Allard HS
|
I updated the list today, in the first post on the topic. To make it more clear what has been added, here are the new things I found out.
code: LAYOUT OF A SAVED GAME:
=======================
Hex offsets are given, until map information, from where
the values are no longer fixed.
00 - 2F = toggled options, various player settings
30 - 247 = unidentified or empty
248 - 8E5 = 7 blocks of each F2 bytes long with city style
information, leader and tribe names for all 7 civs
8E6 - 3585 = 8 blocks of each 593 (in hex) bytes long with
various information, like money and techs (a lot
still unidentified) for all 8 civs (incl. barbarians)
3586 - 3594 = map header information
... = map data block 1 (continues a very long time)
... = map data block 2 (quite long too)
... = map data block 3 <a few pages>
... = unit information
... = city information
... = unidentified, and other info such as where the
screen is centred or the cursor is located
... = a bit of text on how the scenario is called, and
probably a bit of history (who's wiped out, etc.)
... = event stuff (starts with EVNT, easy to find)
code: START OF SAVED GAME FILE:
=========================
A : ---27 : Conflicts in Civilization or lower
---28 : Fantastic Worlds (2.7.81)
---2C : Multiplayer Gold
22-23 = specifies which unit is selected at start of the game
(you can find the unit id number by playing another civ, revealing
the map and right clicking on the unit. On the right, the id is
shown between parentheses)
code: TRIBES:
=======
(source unknown)
The information is stored in 7 blocks (not for barbarians) of F2 length.
The blocks start and end at:
248-339 - 1st block
33A-42B - 2nd "
42C-51D - 3rd "
51E-60F - 4th "
610-701 - 5th "
702-7F3 - 6th "
7F4-8E5 - 7th "
These 7 blocks are all filled with 00's except for a few names and numbers.
These are:
City Style - directly at start of block, one byte long
Leader Name - 3rd byte from start (eg. 250, 341..), 23 bytes long
Tribe Name - 1Ath (26th in decimals) byte from start, 23 bytes long
Adjective - 32th (50th in decimals) byte from start, 23 bytes long
note: City Styles can be any city style, including industrial and modern,
even though without the required advances.
You can even fill in higher numbers here, which however produce
strange effect (as it does everywhere) and may cause the game to
crash.
TECHNOLOGIES & MONEY:
=====================
Byte 8EF until 3585 is devided in 8 blocks of each 593 bytes. Each of
these blocks contain information specific for each civ, such as techs
and money. A lot more in these blocks has as yet not been idendified.
The blocks all start at these offset bytes:
Block of 0th civ: 8E6 - E79 (barbarians)
" 1st civ: E7A - 140D
" 2nd civ: 140E - 19A1
" 3rd civ: 19A2 - 1F35
" 4th civ: 1F36 - 24C9
" 5th civ: 24CA - 2A5D
" 6th civ: 2A5E - 2FF1
" 7th civ: 2FF2 - 3585
Counted from the start of each block:
note: the number given here are all hexadecimals, so the
16th byte in hexadecimal is the 22nd in decimal.
byte 2 - Gender. Male=00 Female=02
byte 3 - Money. The barbarians' money is also changeable.
byte B - Tech which is being researched. FF if cleared or no goal.
byte 16 - Government. Valid values are 00-07 (though 07 does
not normally exist). A value of 08 or higher causes
the game to crash. 00 is of course Anarchy, 01 is
Despotism, etc.
byte 1F - Reputation
byte 25-40 - Treaties. 4 bytes for the treaties with all 7
civs (including their own civ).
1st byte: .... ...1 - contact
.... ..1. - cease fire
.... .1.. - peace
.... 1... - alliance (with peace always)
...1 .... - vendetta
1... .... - embassy
2nd byte: ..1. .... - war
.... .1.. - ???? used by game
3rd byte: ..1. .... - ???? used by game
4th byte: ????
then the 1st byte for the next civ, for all 7 civs.
note: you can also combine them, eg. war and alliance
at the same time. They will repair your units,
but talk with you as if in war. Some more strange
effects.
byte 42-48 - Attitudes. Byte 42 is attitude to 1st player,
43 is to 2nd player, etc.
byte 59-64 - Technologies. B (11) bytes long.
To explain how the bytes work, an example of the first
technology byte:
.... ...1 : 1st technology
.... ..1. : 2nd "
.... .1.. : 3rd "
.... 1... : 4th "
...1 .... : 5th "
..1. .... : 6th "
1... .... : 7th "
In the next byte are the 8th-14th technolgy. Note that for
some reason the .1.. .... is left out. This is not the case
in each of these bytes, though. I don't know why.
Though it's fun to know how it works, it is much much easier
to set techs using the cheat menu.
byte 3E5-3F2 - last contact with civs. First two to 1st civ,
3rd and 4th for 2nd civ, etc.
FF FF if not available, 01 00 for 1, etc.
note: It may be that the FF FF in byte 3E3 and 3E4
are for last contact with barbarians, but that
is not verifiable.
code: OTHER
=====
- 3c-3f bytes after the last city has been finished are the coordinates of the cursor
|
|
|  |
 |
|
blackclove
|
Two things occur to me as I review this:
1) You could periodically reset the tech level to zero and build an entirely new rules.txt file with a new tech tree. Simply read off, say, the twenty most advanced technologies on your "ancient tech tree" and make them the FIRST twenty technologies of your "industrial tech tree". Then for each tribe set the appropriate starting techs. Anyone who was more techs behind than that gets an instant "tech leap".
2) You could also simultaneously scan for ALL outdated units (e.g., militiamen) and replace them with an equivalent modern unit. For example, when the late modern age starts, you might turn all ancient units in every civilization to riflemen. After all, nowadays even the most pathetic nation has riflemen of some sort. This would let you start the units file over again with an entirely new set of units.
Does anyone know the formula for the number of lightbulbs required for a tech advance? If one were to create such a modpack then this would become important. Because the cost of discovering a new tech seems to depend on the number of techs you already have, you'd need to either set the changeover to occur at times of "rapid innovation" like the Renaissance and the Modern Age, or else strategically change the tech paradigm for the scenario at the same time.
I think I'm starting to drool....
|
|
|  |
 |
|
Archangel
|
Does anyone know if you can hex edit a save file to change the number of units allowed in the game at once?
|
|
|  |
 |
|
blackclove
|
<center><table width=80%><tr><td><font color=000080 face="Verdana" size=2><font size="1">quote:
<img src="/images/blue1.gif" width=100% height=1>
</font><font size=1>Originally posted by Archangel on 05-26-2000 01:04 AM</font>
Does anyone know if you can hex edit a save file to change the number of units allowed in the game at once?
<img src="/images/blue1.gif" width=100% height=1></font></td></tr></table></center>
I don't think this is possible, but using the technique I described above we might, with a simple program and a new rules.txt and units.gif, be able to have an INFINITE number of units by "rolling over" the tech tree periodically.
|
|
|  |
 |
Captain Nemo
|
Red Front
Jan 1970 time: 05:37
|
|
Even without the Hex-edit you can accomplish this to a certain extent by relying on the AI's eagerness to disband obsolete units and using Leonardo's for the Human player.
Here is an example I am using in RedFront 1.941:
There are 3 slots for Soviet fighters. At any time the Soviets have 2 active fighters, A & B and are researching C. A is already obsolete and will be upgraded to B by Leonardo's next time a tech is discovered. When C is discovered, all As become Bs. On the next rules/units load slot A is used for new fighter D and B is made obsolete by the tech required for C... and so on. 3 slots, infinite units.
|
|
|  |
 |
Captain Nemo
|
Red Front
Jan 1970 time: 05:37
|
|
Working on Second Front I made some interesting discoveries for scenario builders:
-Ship units can paradrop unto landsquares and become immobile...Old news...well not really: If they are transport ships they carry their cargo with them! Now you have air transport!
-If you build airbases "on" water the ships can start their paradrop from there...This can really made some very interesting scenarios, whether space travel (Star gates?) or Assault Gliders (Second Front)...I can't even list all the ideas I have had about this.
-Domain 3 units are like helicopters but they act like ships if their trireme bit is set (They sink!) They can't capture cities unlike helicopters, they travel on water and land, they are vulnerable to regular ground fire.
-The trireme check looks at all surrounding squares to see if there is land but not at the square itself... That means that a land unit with the trireme bit set landing on an size 1 island will SINK! Weird...
-If you hex edit a city location to be on water, the city continues to exist under water...But becomes invisible except for the name...I haven't fully investigated all it's effects (Like can it be attacked? Can it build land units which appear in the middle of the ocean? Can enemy ships "sail" over it when it has no units in it?)
And there are many more...
|
|
|  |
 |
|
Allard HS
|
Nemo, you're not entirely right on your last point:
<center><table width=80%><tr><td><font color=000080 face="Verdana" size=2><font size="1">quote:
<img src="/images/blue1.gif" width=100% height=1>
</font>If you hex edit a city location to be on water, the city continues to exist under water...But becomes invisible except for the name...I haven't fully investigated all it's effects (Like can it be attacked? Can it build land units which appear in the middle of the ocean? Can enemy ships "sail" over it when it has no units in it?)
<img src="/images/blue1.gif" width=100% height=1></font></td></tr></table></center>
What you saw is the same that happens to a city if you change its coordinates to anything else than it was, also on land squares. What you need to do is change the flag of the terrain on the square you're moving the city to to properly show the city. This is explained by Jorrit Vermeiren (Mercator) in his guide on how to hex-edit the terrains, which I did not include in my hex-editing text because it is so long.
What you need to do is change one byte on the hex of the terrain where the city is moving to and one on the hex of the square where is stood before to make it complete. Units, obviously, will not move with the city.
This works well, and a city will be located in the middle of the ocean. It can even grow food, build units (both land and sea and air). However, no land unit will be able to occupy the place, as it cannot "land". Also ships will simply appear to sail "through" it, with no special effect, though located in an enemy city. Only Helicopters are able to conquer the city.
All in all, your discovery, Nemo, seems to have quite some possibilities. Especially the fact that only heli's can capture it, calls for a special "aquanauts" unit or something to be used to conquer Atlantis. Or of course a Nautilus .
|
|
|  |
 |
|
Allard HS
|
Some updates on what I found this week:
code: START OF SAVED GAME FILE:
=========================
A : 31 : Test of Time
32 = amount of polution. 7F is maximum, and will certainly cause global
temperature rising at the end of the turn. A value of 80 till FF
is a negative amount (still shows the icon for global rising),
but it will be reset to 00 at the end of the turn.
33 = amount of times that a global temperature rising has been
happening this far in the game. 7F is maximum and will make the
whole world a big swamp when the next global temperature rising
occurs. 80 or higher will prevent any global rising from happening.
At the moment when terrain should be changed, nothing happens, and
byte 32 is restored to 00, though a message still pops up.
38 = number of turns of peace (counts only after 200th turn)
These last three (32, 33, 38) were found on Harlan's request a while ago. Lightbulbs are determined by the amount of research already found rather than that the current colour of the bulb is stored in the saved game. Same for nuclear activity icon.
code: TECHNOLOGIES & MONEY:
=====================
byte 9 - Research progress. Also updates the colour of research
indicator in status bar on the right.
byte 15 - Percentages to tax, science and luxuries.
byte 16 - Government. Valid values are 00-07 (though 07 does
not normally exist). A value of 08 or higher causes
the game to crash. 00 is of course Anarchy, 01 is
Despotism, etc.
You can give the barbarians Democracy (06) to prevent
their cities being subverted.
byte 67-68 - military demographics value.
code: OTHER
=====
- 3B1-3B2 bytes after the last city has been finished are the zoom factors. For zooming
in, change byte 3B1 only. For zooming out, change byte 3B2 to FF and lower
the value of byte 3B1 beginning with FF.
note: F9 FF is the lowest zoom you can get. Lowering it further causes
the game to crash. There is no limitation when zooming in.
- 583-58A control the size of the city screen.
Not so many useful new stuff, but I wanted to keep you informed of what news I found.
I'll also update the first post of the thread now.
|
|
|  |
 |
Captain Nemo
|
Red Front
Jan 1970 time: 05:37
|
|
I was mainly trying to find a way to build a bunch of cities (Up to 255) and place them on water to make them unusable...That didn't work. What seems to work is to place a whole bunch of cities at the same coordinates! They all continue to exist in the game file and use up the extra city spaces, to preventing the building of new cities without taking up a bunch of map space.
Another very interesting one: Edit city locations to be adjacent...That way you can build mega-cities covering 2, 3 or 4 squares. This would be useful in scenarios where 2 opponents hold adjacent parts of the same city (East-West Berlin, Stalingrad...)
|
|
|  |
 |
Harlan
|
Berkeley, CA, USA
Aug 2005 time: 21:37
|
|
Allard,
Does your latest research on pollution mean that in effect, one can turn off the global warming effect? Edit byte 33 to be 80 or greater, or does that byte reset to 0 somehow?
If so, Capt. Nemo, you could have the Allied bombing of Germany actually be nukes that create rubble (in fact, pollution) that would cut the productivity of squares around the cities, and soften up defenses, allowing Allies to conquer places when you want them to. Better than rubble as units.
|
|
|  |
 |
|
Archangel
|
Nemo, I wasn't talking about changing the amount of units in the units.bmp file, but the actual amount the map will hold. Like in Red Front, how sometimes you get the "too many units" message and new units won't be created. I want to know if you can hex edit that problem.
|
|
|  |
 |
|
Allard HS
|
sorry, haven't been online too often lately, so I couldn't update this thread.
Gothmog, very interesting!!! I think we now understand the building of the saved game pretty well. And what's funny is that the saved games of Colonization and even civ1 are pretty similar.
<center><table width=80%><tr><td><font color=000080 face="Verdana" size=2><font size="1">quote:
<img src="/images/blue1.gif" width=100% height=1>
</font>Another very interesting one: Edit city locations to be adjacent...That way you can build mega-cities covering 2, 3 or 4 squares. This would be useful in scenarios where 2 opponents hold adjacent parts of the same city (East-West Berlin, Stalingrad...)
<img src="/images/blue1.gif" width=100% height=1></font></td></tr></table></center>
Always trying to make things practical... Serious, this is very cool! Wow! And if you change the background terrain too a bit you can even make it look like one big city.
<center><table width=80%><tr><td><font color=000080 face="Verdana" size=2><font size="1">quote:
<img src="/images/blue1.gif" width=100% height=1>
</font>I must seem out of it, but how do you know which lines to edit? And which is the write set of numbers? I have a hexeditor and I opened up a scenario file, but what do you do exactly?
<img src="/images/blue1.gif" width=100% height=1></font></td></tr></table></center>
it's really very easy. before I started I almost knew nothing about hex-editing myself. It's all pretty obvious. If you have a good editor it will tell you (usually somewhere at the bottom of the screen) what the offset is of the currently selected hex. The layout of the saved game is explained at the start of my first post. And you see that using FW until the map info everything is always at the same offset. After that it starts to be variable, but mostly it is pretty clearly visible when going from one area to the next. Watching the LAYOUT chapter should explain it mostly to you.
<center><table width=80%><tr><td><font color=000080 face="Verdana" size=2><font size="1">quote:
<img src="/images/blue1.gif" width=100% height=1>
</font>Does your latest research on pollution mean that in effect, one can turn off the global warming effect? Edit byte 33 to be 80 or greater, or does that byte reset to 0 somehow
<img src="/images/blue1.gif" width=100% height=1></font></td></tr></table></center>
Yes. If you turn byte 33 to be 80 you can switch off global warming completely. I'll try to explain it in some more details so that everybody understands it, even without knowledge of hex-editing.
The thing is, normally byte 32 and 33 both stand at 0. If there is pollution, byte 32 gets higher and higher, and at a certain amount global warming will happen. Maybe there is a x% chance of this happening determined by this byte. If global warming happens, byte 32 is reset to 00, and byte 33 is set to 01, which is logical, cause if byte 32 would not be reset to 0, there would be again a chance of global warming. This goes on and on, and byte 33 gets higher after every global warming.
However if you set byte 33 higher than 7F, the max, byte 32 will still get higher, of course still causing global warming still to occur, which causes the pop-up. Normally, it will cause a 1st, a 2nd, a 3rd.. to a 7Fth rate global warming, determined by byte 33, but since that is turned to a strange rate, nothing happens at all, and byte 32 is reset without anything happening.
Byte 33 remains at 80, and appears to remain so every time again.
This makes a foolproof anti-global warming tool that allows pollution. Two things still have to be taken care of, which could if used right give some extra fun. The icon for pollution itself, and the pop-up message (with a nice little logo of the game).
<center><table width=80%><tr><td><font color=000080 face="Verdana" size=2><font size="1">quote:
<img src="/images/blue1.gif" width=100% height=1>
</font>Nemo, I wasn't talking about changing the amount of units in the units.bmp file, but the actual amount the map will hold. Like in Red Front, how sometimes you get the "too many units" message and new units won't be created. I want to know if you can hex edit that problem
<img src="/images/blue1.gif" width=100% height=1></font></td></tr></table></center>
The amoung of units in the units.gif/bmp file SHOULD be changeable. After all, that's what they did changing from CiC to FW, and that change was so minor, you might be able to track it down. In the file civ2.exe of course, not in a saved game.
The too many units/cities will be probably trickier to change. It still could, but you'd have to insert a byte, I guess, screwing the whole file up. To fix that you'd need a lot of expertise. Maybe some expert at programming or hacking might explain how to do this. I mean, it should be possible. You could change anything if you wanted.
Both problems anyway could only be changed by editing the civ2.exe file, which I haven't done yet, so I know nothing about it (except changing the font the game uses). And both are pretty tricky.
|
|
|  |
 |
|
SCDARS
|
I'm sorry if it's already mentioned here, but does anyone know which hex value specifies which wonders are already build/ destroyed?
Could you even create multiple wonders?
|
|
|  |
 |
|
Allard HS
|
<center><table width=80%><tr><td><font color=000080 face="Verdana" size=2><font size="1">quote:
<img src="/images/blue1.gif" width=100% height=1>
</font>I'm sorry if it's already mentioned here, but does anyone know which hex value specifies which wonders are already build/ destroyed?
Could you even create multiple wonders
<img src="/images/blue1.gif" width=100% height=1></font></td></tr></table></center>
That's a great question!! Thanks to you I uncovered 3 more lines of the file. Here comes the new stuff, it's also updated in the main story.
As you see, it's unfortunately not possible to create the same wonders multiple times. If it would have been listed as one of the city improvements with the city information stuff, it would have, but this makes it strictly buildable only at one place.
Here comes the info:
code: WONDERS:
========
Near the start of the saved game, on offset 10A until 141 are given the
locations of all wonders. All 28 wonders have 2 bytes, so in total the
block for all wonders is 56 bytes long.
If the 2 bytes for a wonder are
- FF FF : the wonder has not yet been built.
- EF FF : the wonder is destroyed (original city is not stored).
- otherwise the number is the city ID number. 00 00 the first city, etc.
If you come up with more interesting questions...
|
|
|  |
All times are GMT. The time now is 05:37. Apolyton Time is 00:37. |
top of page
|
| |
|
|
|
|