Doom Juan wrote:Is anyone able to break this down for me so I can get my head around it?
I really want to know the process first before I even attempt to tinker with anything... how does everything work?
Thanks!
Hello,
It's often easier to learn by trial-and-error.
To my knowledge, there is no up-to-date documentation available. The general idea is the following:
- Freeciv looks at .tileset files in the tileset directory.
- Each .tileset file contains the tileset name, some general information about it and a list of .spec files. These files are typically located in a subdirectory and contain information about the graphics.
- When the tileset is changed, Freeciv reads each of the .spec files and applies the required changes.
Each .spec file tells Freeciv how to use an image file. Each image is a grid of so-called
tiles laid out in a grid. Tiles have a transparent background. Each tile in the grid gets a
tag, which tells Freeciv how it should be used.
The best way to understand a .spec file is to look side by side at it and the corresponding image. Let me, however, describe amplio2/hills.spec:
This gives the Freeciv version the spec file is supposed to work with:
Code: Select all
[spec]
options = "+Freeciv-2.5-spec"
This is the artist:
Code: Select all
[info]
artists = "
Peter Arbor <an email>
"
Here begin the interesting stuff. This tells Freeciv this file describe an image named amplio2/hills.png, or amplio2/hills.bmp, or whatever is present and supported by the client:
The following lines describe the grid. The first two lines tell Freeciv it begins at 1px from the top and 1px from the left. The next two lines give the width and height of a tile. The last line says there is a 1px border between the tiles. If you look at amplio2/hills.png, you'll see that's how the file is organized.
Code: Select all
[grid_main]
x_top_left = 1
y_top_left = 1
dx = 96
dy = 48
pixel_border = 1
The last lines describe how to use the tiles. These are all terrain tiles ("t"), used on layer 1 ("l1"), for hills ("hills"). The remaining characters in the "tag" column are a bit special. The easiest way to understand them is to guess their meaning by looking at amplio2/hills.spec and amplio2/hills.png side by side.
Code: Select all
tiles = { "row", "column", "tag"
0, 0, "t.l1.hills_n0e0s0w0"
0, 1, "t.l1.hills_n0e0s0w1"
0, 2, "t.l1.hills_n1e0s0w0"
0, 3, "t.l1.hills_n1e0s0w1"
...
Louis