Editing Terrain .pcx files

onedreamer

Dragon
Joined
Oct 21, 2004
Messages
6,580
Location
Torino - Italia
Hello everyone,

what tool/program/procedure can I use to edit these files (I looked around but can't seem to find the right one, from the descriptions) ? And how can I recognize the content of these files... most of the names don't seem to mean anything (eg. LWOO ... o_O)
 
Gimp is free, Paint Shop Pro is trial, Photoshop

Look at the files, you'll see. "L" I think denotes "landmark" terrain. W=water and 00 = Ocean.
 
Start with the basic terrain tiles. The graphics of the basic tiles are actually centered on the corner of each in-game terain tile. In other words, the .pcx tiles are really transitions between the terrain types. More in a bit.

The basic tiles are in the form zABC where:

z=w or x, a w indicating that all terrain types in the file are water, x indicating that all types are land and/or coast. An L prefix indicates landmark terrain.

ABC are the three types of terrain in the file. For example, xdgp would mean that the four terrain types surrounding the corner are either desert, grassland, or plains. Note that this restricts the number of terrain types in any four-tile diamond to three, and if there are only one or two terrain types in a diamond, there may be multiple files the map generator can choose from (I don't know the underlying algorithm).

The values for ABC are as follows:
d=desert
g=grassland
p=plains
t=tundra
c=coast
s=sea
o=ocean

Note that some .pcx files have the same type more than once, such as xggc or wooo. This means that the computer recognizes several different subtypes and allows for a greater variety of some basic terrain. This is why a single tile grass island comes in two different sizes with the basic graphics.

How does the ABC come into play? Since there are 3 different types in each file, and four positions, the total number of possibilities is 3^4=81. The .pcx file is a 9x9 grid. Use the following to determine what terrain types should be bordering for a particular corner:

1
3 9
27​

where the number indicates how frequently the type cycles through each position, counting from left to right. In other words, the graphic located in the 3rd column, 4th row would be of the following format:

C
A A
B​

If the file were xdgc, the terrain to the north would be coast, desert to the east and west, and grassland to the south.

That covers the basic tiles.

What happened to hills, mountains, forests, jungles, and marshes? These are all overlays. They are centered on the tile, rather than on the corner. I am not entirely sure yet on how map generator picks which forest or jungle graphic, aside from generally that the larger graphics are reserved for the middle of a forest; obviously, I need to investigate further. There are different files for the forest based on underlying terrain, but they are rather explicit.

Okay, but why are hills and mountains overlays? They actually use a grassland tile as their base terrain, and then overlay with the appropriate graphic, which is dependent upon if there is another elevated terrain tile in the diagonal directions. In other words, it forms a chain if there is another hill or mountain to the NE, NW, SE, or SW. Use the following to figure out what is where (similar to the zABC, except turned 45 degrees and only two choices per direction):

2 1
4 8
In other words, if a hill had elevated terrain to the NE, SE, and SW, the graphic for that hill would be found in the 3rd column, 4th row. The top left spot is for when the hill is isolated, the bottom left for when it is surrounded. Terrain to the N, S, E, and W is ignored.

Rivers and floodplains are done similiarly, except located at the corners of terrain tiles. River is drawn on top of floodplain. mtnRivers is for when a river starts in elevated terrain, delta for when it ends on coast.

That's most of what you need to know.
 
Can you explain how to add new terrain files to a scenario?
 
DANGERBOY said:
Edit the old. You can't add new ones, the program won't acknowledge them.

Yes, I know that, but when you put a new scenario in your C3C scenario folder, you put your terrain files into a folder. It´s just that, put it into the scenario folder? How would the map I use recognize the terrain files in that specific folder?
 
Hamah said:
Yes, I know that, but when you put a new scenario in your C3C scenario folder, you put your terrain files into a folder. It´s just that, put it into the scenario folder? How would the map I use recognize the terrain files in that specific folder?


Magic. Try it out. ;)

Heres what I do when modifying hardcoded files like these.

Make the scenario folder. In the editor, type in the name of that folder in the appropriate window, (under scenario properties)

I believe for this particular example, you need to put in a folder titled "art", and then in that folder one called "terrain"

GO to your civ III files, in art--->terrain, and copy them all to the new terrain folder.

Back them up in a back up folder, and go to town.
 
Back
Top Bottom