Hex edit

I sort of understood it despite the fact that i don't know how many bits there are in a byte.
Btw how do you change the resource seed in a saved game? Is it even possible?

"You can still see the rivers beneath the factory icons and if it were my scenario, I'd hex-edit those out. In fact I would've hex-edited the terrain slots to begin with, thus avoiding engineers and rivers - but it can be done without hex-editing."

What do you mean by "hex-edited the terrain slots to begin with"? Hex editing the terrain slots at specific coordinates in-game to be the first resource of terrain slot 15?
 
"If you use something like Mercator's Map Edit utility, you can suppress resources from specific terrain slots. If you use that utility in conjunction with a decent graphics editor (one with the ability to handle palettes), you can suppress resources from specific areas of the map. For placing resources on specific tiles, you'll probably have to use spare terrain slots (if you have them)."

Thats your quote from http://forums.civfanatics.com/showthread.php?t=283827
How do you combine the gfx editor with map edit? In particular i want to suppress resources from the Caspian Sea, but not the mediterranean.
 
Btw how do you change the resource seed in a saved game? Is it even possible?
Yes. There are 2 bytes at the end of each map block in the SAV/SCN file that contain the resource seed. Don't know why they needed 2 bytes; there are only 64 patterns.

What do you mean by "hex-edited the terrain slots to begin with"?
I would've hex edited the map tiles in the SAV file to assign the desired terrain slots. The method I described was a non-hex editing method, but it creates rivers. Since that time, Keu created CivRiver, so you can remove rivers without resorting to hex editing. Hex editing also allows access to terrain slots 12-15 (count starting at 1), not just 16.

Hex editing the terrain slots at specific coordinates in-game to be the first resource of terrain slot 15?
Terrain slot 15 has the same characteristics as resource #1, terrain slot 4. Terrain slot 15 doesn't have any resources as it doesn't really exist.

How do you combine the gfx editor with map edit? In particular i want to suppress resources from the Caspian Sea, but not the mediterranean.
That was advice given to someone at the map-creation stage. Using MapEdit, you can export the MP file as a bitmap and edit it with a graphics editor. There's a palette index for each terrain slot that denotes resource suppression. Paint sections of the map with those colours and then open the BMP in MapEdit. MapEdit can then export the map as an MP file again. If you're already working on a SAV file, then you're looking at hex editing individual terrain tiles.
 
I would've hex edited the map tiles in the SAV file to assign the desired terrain slots. The method I described was a non-hex editing method, but it creates rivers. Since that time, Keu created CivRiver, so you can remove rivers without resorting to hex editing. Hex editing also allows access to terrain slots 12-15 (count starting at 1), not just 16.

Terrain slot 15 has the same characteristics as resource #1, terrain slot 4. Terrain slot 15 doesn't have any resources as it doesn't really exist.

Ok so terrain slot 12 is the desert resource 1, yes? Counting as in the Rules.text file and ignoring the grassland entries, not the bmp file from left to right.
Terrain slot 13 is plains resource 1, 14 is forest resource 1 and 15 hills resource 1. Right?
Was confused at first since i was counting the grassland too. Does that mean you can put resources on grassland? there are 3 grassland entries in the @terrain in the rules.txt.


That was advice given to someone at the map-creation stage. Using MapEdit, you can export the MP file as a bitmap and edit it with a graphics editor. There's a palette index for each terrain slot that denotes resource suppression. Paint sections of the map with those colours and then open the BMP in MapEdit. MapEdit can then export the map as an MP file again. If you're already working on a SAV file, then you're looking at hex editing individual terrain tiles.

You mean there are f.e two shades of blue in the map preview of the mapedit that one denotes ocean tiles with resources(depending on the seed number) and the other resource supressed ocean tiles?
And one can hex-edit individual tiles to hide resources, yes?
 
Ok so terrain slot 12 is the desert resource 1, yes?
Yes, like so:
Code:
@TERRAIN
01 Desert,     1,2,  0,1,0,   yes, 1, 5, 5,   yes, 1, 5,  3,  Pln,  no, ; Drt
02 Plains,     1,2,  1,1,0,   yes, 1, 5, 1,   For, 0,15,  0,  Grs,  no, ; Pln
03 Grassland,  1,2,  2,1,0,   yes, 1, 5, 2,   For, 0,10,  0,  Hil,  no, ; Grs
04 Forest,     2,3,  1,2,0,   Pln, 0, 5, 5,   no,  0, 0,  0,  Grs,  no, ; For
05 Hills,      2,4,  1,0,0,   yes, 1,10, 0,   yes, 3,10,  1,  Pln,  no, ; Hil
06 Mountains,  3,6,  0,1,0,   no,  1,10, 0,   yes, 1,10,  6,  Hil,  no, ; Mou
07 Tundra,     1,2,  1,0,0,   yes, 1,10, 1,   no,  0, 0,  0,  Drt,  no, ; Tun
08 Glacier,    2,2,  0,0,0,   no,  0, 0, 0,   yes, 1,15,  3,  Tun,  no, ; Gla
09 Swamp,      2,3,  1,0,0,   Grs, 0,15, 6,   For, 0,15,  0,  Pln,  no, ; Swa
10 Jungle,     2,3,  1,0,0,   Grs, 0,15, 6,   For, 0,15,  0,  Pln,  no, ; Jun
11 Ocean,      1,2,  1,0,2,   no,  0, 0, 0,   no,  0, 0,  0,  no,   no, ; Oce
12 Oasis,      1,2,  3,1,0,
13 Buffalo,    1,2,  1,3,0,
14 Grassland,  1,2,  2,1,0,
15 Pheasant,   2,3,  3,2,0,
16 Coal,       2,4,  1,2,0,

Does that mean you can put resources on grassland? there are 3 grassland entries in the @terrain in the rules.txt.
The 'placeable resources' don't actually belong to any of the standard terrain slots because they occupy their own terrain slots. They bear the names and stats of the first 5 resources in the terrain list. Since half the fields in the @TERRAIN table are missing for slots 12-16, those fields are given null values. Filling out the table doesn't work. Sixteen is the maximum number of terrain slots because that's the maximum value of 4 bits.

Bear in mind this:
If you transform one of these terrain oddities, the first 4 bits are zeroed, giving you the first terrain slot (terrain number 0)...

Transforming also includes irrigating. I've never tested this fully in a scenario. If AI settlers got hold of it, there's a good chance they'd be stupid enough to change it all to the desert slot. Unless you can control this somehow, I'd probably give it a miss. The good thing is that it's very simple to change it back to regular terrain if it doesn't work out. BTW, terrain number 0 refers to slot 1; in programming, counting starts at 0.

You mean there are f.e two shades of blue in the map preview of the mapedit that one denotes ocean tiles with resources(depending on the seed number) and the other resource supressed ocean tiles?
Yes. The two shades define areas of suppressed and unsuppressed resources (see attached). Any resources which fall over the suppressed regions will not appear in the game.

And one can hex-edit individual tiles to hide resources, yes?
Yep.
 

Attachments

  • MapEdit_PaletteEditor.jpg
    MapEdit_PaletteEditor.jpg
    27.9 KB · Views: 239
Back
Top Bottom