Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Restored Forums > [Restored Forum 198] SL: Civ2 Creation Hints, Tips and Guides > Everything about Hex-Editing - UPDATED
Page: Print | Email | Subscribe | Report News       0 votes -  average
18.Sep: `ACSR WEEKLY`: SEPTEMBER 18TH, 2005
16.Sep: `ACSR GDS`: WARDELL INTERVIEW PROMO
15.Sep: `ACSR MAILBAG`: SEPTEMBER 15TH, 2005

bottom of page
  GALACTIC CIVILIZATIONS $19.99 - CIV3 CONQUESTS $29.99 - CIV3 from $9.99 - SMAC+SMAX $19.99
Author
Thread   
Pages (2): [ 1   2   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
Allard HS
Prince
NL
Jan 1970
time: 06:37
22-05-2002 20:36 | www
edit | quote
#1 | report |
Everything about Hex-Editing - UPDATED Support Apolyton or Terrorists Win


My guide with everything about hex-editing from a while ago has just finished a great update. All forum posts about new discoveries since then have been added, the newest version of Jorrit's guide on map-hex-editing has been completely copied, and some very useful info on resource editing (for DLL and EXE files) has been added.

Be sure especially not to miss that last thing. (It's in chapter A, near the end of the document).

It's all written using Word XP, but I think you can also read it in older versions of Word.

Attachment: hex editing.zip
This has been downloaded 171 time(s).

Jacobite1688
Prince
Chicago, IL U.S.A.
Jul 2001
time: 23:37
22-05-2002 22:03
edit | quote
#2 | report |
Support Apolyton, buy Call to Power 2


Very good, Allard! I was just talking about this document in another thread.

Jacobite1688
Prince
Chicago, IL U.S.A.
Jul 2001
time: 23:37
22-05-2002 22:13
edit | quote
#3 | report |
Got spare money?


BOOO! It crashes out Word '98 when I try to read it. Any suggestions.

Mercator
King
Sorekara no Nanimo
Jan 1970
time: 06:37
23-05-2002 02:14 | www
edit | quote
#4 | report |
Support Apolyton buy from Amazon


Brilliant!

Download the Microsoft Word Viewer from microsoft.com. That works fine for me (since I don't have Word at all):

http://support.microsoft.com/defaul...b;en-us;Q165908

SlowThinker
King
homeless, Praha, Czech Republic
Jan 2000
time: 06:37
29-07-2002 06:48 | www
edit | quote
#5 | report |
Got spare money?


The 17th byte of the TECHNOLOGIES & MONEY part of each civ holds NumberOfAcquiredTechs+1 (starting techs are not included).

(works with MGE)

Jacobite1688
Prince
Chicago, IL U.S.A.
Jul 2001
time: 23:37
07-08-2002 23:53
edit | quote
#6 | report |
Support Apolyton, buy Galactic Civilizations


An astute discovery!

yaroslav
Emperor
Madrid, Spain, Europe
Jun 2001
time: 06:37
21-08-2002 02:59
edit | quote
#7 | report |
Browse Apolyton AD-FREE


Hello, great work Allard!

I think that when you wrote:

"byte 89-100 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 technology. 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.
NOTE: This is very useful, however, for giving the Barbarians certain
technologies. You might want to give them Guerrilla Warfare,
for instance.
NOTE: All techs are: FF FF FF FF FF FF FF FF FF FF FF FD. (Excluding
user defined techs. Adding those makes it ...... FF instead of
...... FD)."

It does not apply to MGE. In MGE I believe that bytes reach 102th and that all bits in all bytes have a mean (no .1...... exception)

Xin Yu
King
Emeryville, CA, USA
Jan 1970
time: 21:37
29-08-2002 08:32 | www
edit | quote
#8 | report |
Lose 30 kilos (of popups)


Allard, there is a flag at the 6th byte of city block
.... .1.. can build hydroplant

Also, there should be a block right before wonder info for advances with regard to which civs discovered them. Each byte represents one tech. A 00 means no civ has this tech, a FF means every civ + barbarian have this tech.

SlowThinker
King
homeless, Praha, Czech Republic
Jan 2000
time: 06:37
17-02-2003 02:40 | www
edit | quote
#9 | report |
Got spare money?


quote:
Originally posted in HEX-EDITING (hex-edit.rtf)
byte nr. 20
...1 .... cheat penalty/warning
.1.. .... scenario file (no effect really)

I think there is an effect: techs are open (scenario) or one third is rotately made impossible (standard game).

SCDARS
Warlord

Sep 1999
time: 06:37
23-02-2003 06:15 | www
edit | quote
#10 | report |
Support Apolyton, pre-order Civilization IV


Do you think it would be easy to eliminate all huts by a program? Since all huts are set by the seed, it would seem likely to me that the status of all huts (tipped -or active) is collected in some part of the file and not attached to each of the map tiles' entries, right?...

Henrik
Emperor
The European Union, Sweden, Lund
Dec 2000
time: 06:37
23-02-2003 12:52 | www
edit | quote
#11 | report |
Support Apolyton, buy Civilization III: Complete


I thought you could allready eliminate all huts simply by using the cheat menu?

SCDARS
Warlord

Sep 1999
time: 06:37
23-02-2003 14:18 | www
edit | quote
#12 | report |
Increase Your PM Length


Of course you can, but I was asked by some people if there is an easier way to do this for multiplayer (having the host enabling the cheat menu is not what everybody likes). But the cheatmenu option should make it easy to find the location of those bytes.

SlowThinker
King
homeless, Praha, Czech Republic
Jan 2000
time: 06:37
23-02-2003 14:30 | www
edit | quote
#13 | report |
Support Apolyton buy from Amazon


quote:
Originally posted by Henrik
I thought you could allready eliminate all huts simply by using the cheat menu?

Do you mean to go in the scenario mode, to turn huts off, then save into a .sav file? I tested it (for Early Landing Comparison Game #1 ), but if I remember correctly, I had a problem with that byte 20 (I think the cheat mode was left) and I had to hexedit it manually.

SCDARS
Warlord

Sep 1999
time: 06:37
23-02-2003 15:30 | www
edit | quote
#14 | report |
Support Apolyton, buy GURPS/ Alpha Centauri


If you use "turn huts off", obviously in the 2nd data block of the map 0F is replaced by 00 in one entry each 6 bytes. My first uneducated guess is: All tiles are set to have been owned by the Barbarians and a hut is considered tipped if one civ owns its tile (in the 6th byte).
Moving a roman warrior to one tile changes its respective value to 10, using a Babylonian unit switches it to 20 etc. -- which seems to support this theory.
Can someone more experienced comfirm this?

Last edited by SCDARS on 23-02-2003 at 20:30

Mercator
King
Sorekara no Nanimo
Jan 1970
time: 06:37
23-02-2003 20:53 | www
edit | quote
#15 | report |
Increase the size of your Attachments


You are correct. Setting ownership to barbarian is how the goody huts are cleared.

If you're interested in the details of the map structure, look here or in Allard's hex editing doc.

SCDARS
Warlord

Sep 1999
time: 06:37
23-02-2003 21:17 | www
edit | quote
#16 | report |
Browse Apolyton AD-FREE


Do you see any obvious mistakes in this part of code? (handle is a java RandomAccessFile-object). After some testing, at least it does remove the huts and it doesn't have any side-effects as obvious as turning the whole map into river (which was the result of my first attempt ).
code:
int fertility; final int owner=0;//240 = no owner; 0 = barbarians; for(int i=0; i &lt; SURFACE ; i++){ handle.seek( OFFSET_MAP_BLOCK2+6*i+5 ); fertility = handle.read() % 16; handle.seek( OFFSET_MAP_BLOCK2+6*i+5 ); handle.write( owner + fertility ); }

Field Marshal Klesh
King
Klesh Marshal Field
Jan 2000
time: 00:37
23-02-2003 23:13 | www
edit | quote
#17 | report |
Enter the AD-FREE zone



Yikes, I'm stupid.

yaroslav
Emperor
Madrid, Spain, Europe
Jun 2001
time: 06:37
25-02-2003 02:31
edit | quote
#18 | report |
Support Apolyton, buy Galactic Civilizations: Deluxe Edition


quote:
Originally posted by SCDARS
Do you see any obvious mistakes in this part of code? (handle is a java RandomAccessFile-object). After some testing, at least it does remove the huts and it doesn't have any side-effects as obvious as turning the whole map into river (which was the result of my first attempt ).
code:
int fertility; final int owner=0;//240 = no owner; 0 = barbarians; for(int i=0; i &lt; SURFACE ; i++){ handle.seek( OFFSET_MAP_BLOCK2+6*i+5 ); fertility = handle.read() % 16; handle.seek( OFFSET_MAP_BLOCK2+6*i+5 ); handle.write( owner + fertility ); }


Hi! I'm also using Java for my Civ2 related utility, Civ2PBEM Diplomacy, and in the first version, I also used RandomAccessFile! If you are interested, we can share code or whatever you want ...

(BTW, a good idea would be issue the handle.write when owner<0 && owner>7. This way, you can use this program in any turn of the game, without changing the civ's owner of the tile. For example, if there is a city, I think that your code put the owner city's tile to barbarian, and I'm not sure if that makes sense )

SlowThinker
King
homeless, Praha, Czech Republic
Jan 2000
time: 06:37
10-07-2003 05:47 | www
edit | quote
#19 | report |
Support Apolyton buy from Amazon


SCDARS, did you finish the program that removes huts?

SCDARS
Warlord

Sep 1999
time: 06:37
14-07-2003 02:37 | www
edit | quote
#20 | report |
Browse Apolyton AD-FREE


You can get it here: http://www.civ2.de/pages/liga/misc2...ttachmentid=581 Since I did not expect much interest, I have not written any documentation. It should be fairly easy to use, though. For installation (java required), simply unzip it into some new folder.
For use, put your save into that folder, rename it to "save.net" and run the batch file.

Last edited by SCDARS on 22-11-2003 at 17:47

SlowThinker
King
homeless, Praha, Czech Republic
Jan 2000
time: 06:37
20-07-2003 03:20 | www
edit | quote
#21 | report |
Browsing cities Put an end to popups!


You need to know number of units (to get the size of 'unit information block') and number of cities if you want to be able to browse cities by a program.
I found nothing in the 'Hex-edit.rtf' document...
Yaroslav, Xin Yu, you probably know it?

yaroslav
Emperor
Madrid, Spain, Europe
Jun 2001
time: 06:37
20-07-2003 03:35
edit | quote
#22 | report |
Support Apolyton, buy Civilization: The Boardgame


It is even worse, becuase in order to reach the beginning of the 'city information block' you need not only to know the size of the 'unit information block' but also the size of the 'map information block'!

You can get the number of units from the 58-59th bytes: multiply this number by 26 (or 32 in MGE) and you'll have the size in bytes of the 'unit information block'.

The size (in bytes) of the 'map information block' is

13 * short int starting in 0x0000358A [surface]
+ 2 * short int starting in 0x00003590 * short int starting in 0x00003592
+ 1024
+ 14

starting to count from the map header (byte 0x00003586).

So, you can say that, in MGE the 'city block information' starts in:

0x00003586 + 13 * short int starting in 0x0000358A
+ 2 * short int starting in byte 0x00003590 * short int starting in 0x00003592
+ 1024
+ 14
+ 32 * short int starting in byte 58

SlowThinker
King
homeless, Praha, Czech Republic
Jan 2000
time: 06:37
21-07-2003 02:22 | www
edit | quote
#23 | report |
work of Settlers Support Apolyton, buy Civilization: The Boardgame


Yaroslav, thank you very much.

Another question:
Does anybody know where is agglomerate work of settlers stored? I would like a utility that shows that...

yaroslav
Emperor
Madrid, Spain, Europe
Jun 2001
time: 06:37
22-07-2003 01:24
edit | quote
#24 | report |
Remove this text


I don't know exactly. However, I will do a little research tomorrow/the next day and I will tell you what I founded

yaroslav
Emperor
Madrid, Spain, Europe
Jun 2001
time: 06:37
24-07-2003 01:11
edit | quote
#25 | report |
Increase the size of your Attachments


Research done.

The agglomerate work of settlers is stored in the 15th byte of the unit (starting to count in 1). I believe that a 0 in the 15th stands for 0 turns of agglomerate work, 1 stands for 1 turn of agglomerate work and so on...

With that info, the utility you were speaking about should be easy to programm

I've done two others interesting discoverments that I'm gonna post in the SL-Scenario Creation Forum

SlowThinker
King
homeless, Praha, Czech Republic
Jan 2000
time: 06:37
26-07-2003 02:44 | www
edit | quote
#26 | report |
Enter the AD-FREE zone


Thank you, yaroslav.
I am inclined to believe there are 'units of work' stored in that byte. So Settlers increase the value stored in this byte by 1 every turn of work, but Engineers by 2. Reason: a Leonardo upgrade don't double the aggregate work.
I plan to incorporate aggregate work of settlers in 'Beakers counter'. After that I will confirm or deny my hypothesis.

SlowThinker
King
homeless, Praha, Czech Republic
Jan 2000
time: 06:37
21-09-2003 01:05 | www
edit | quote
#27 | report |
Support Apolyton or Terrorists Win


quote:
Originally posted by Hex-edit.rtf
Enemy ... units that are lost out of sight, will remain marked on their last seen location (?),

Only until they move. The move is seen, but then they are lost of sight completely.

quote:
Originally posted by SCDARS
If you use "turn huts off", obviously in the 2nd data block of the map 0F is replaced by 00 in one entry each 6 bytes. My first uneducated guess is: All tiles are set to have been owned by the Barbarians and a hut is considered tipped if one civ owns its tile (in the 6th byte).
Moving a roman warrior to one tile changes its respective value to 10, using a Babylonian unit switches it to 20 etc. -- which seems to support this theory.
Can someone more experienced comfirm this?

Nooo...
You confuse two different bytes. The sixth byte is the byte that controls huts:

quote:
Originally posted by Originally posted by Hex-edit.rtf
The fifth byte represents "visibility", indicating which of the civilizations have explored
that particular square. 00 means none of the civilizations (including the barbarians,
who are the "0th" (red) civilization) have uncovered that square so far
...
E.g. A square discovered by the Barbarians, Romans, Germans and Sioux will have the
code:
20 + 21 + 23 + 27 = 1 + 2 + 8 + 128 = 139 = 8B

The sixth byte is generally F0, not always though. I strongly believe that this byte has
to do with fertility. Normally all squares end with F0, except Plains and Grassland,
which mostly (if not always) end with something else.


But I don't know which values clear huts and which don't. 00H clears them, F0H don't, but others should be tested.

Mercator
King
Sorekara no Nanimo
Jan 1970
time: 06:37
21-09-2003 01:54 | www
edit | quote
#28 | report |
Support Apolyton, pre-order Civilization IV


I'm sorry, but SCDARS is right, and you're wrong.

The 6th byte controls which civs see the tile, and tile fertility. As SCDARS said, the 5th byte controls ownership, and that's what's used to clear the huts.

SlowThinker
King
homeless, Praha, Czech Republic
Jan 2000
time: 06:37
21-09-2003 03:33 | www
edit | quote
#29 | report |
Avatar Enlargement: We've got the solution


Hm. So how do you set huts ON using the 5th byte?

Mercator
King
Sorekara no Nanimo
Jan 1970
time: 06:37
21-09-2003 04:02 | www
edit | quote
#30 | report |
Increase Your PM Length


You can't just turn them on. The hut pattern is fixed, just like the terrain resources.

Terrain resources can only be hidden by the method Civ2 uses to hide them in mid-Ocean (and MapEdit can do that anywhere).

Similarly, huts can only be hidden, not put in any place you want.

 
Pages (2): [ 1   2   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:37.
Apolyton Time is 00:37.
    top of page
 
Forum Jump:

 



Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0534 seconds (92.46% PHP - 7.54% MySQL) with 30 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net