Trying to customise Unit graphics

Contribute, display and discuss art and tilesets for use in Freeciv here.
Post Reply
ToneTW
Posts: 4
Joined: Fri Sep 06, 2013 11:56 am

Trying to customise Unit graphics

Post by ToneTW »

Fellow Civ fans,

I always come back to playing Civ 2 Test of Time with static graphics and I cut and paste lovely units (eg. below of the sort of units I enjoy using) from the Scenario League Wiki to my Units file and done. However ToT has its limitations and I love the expansion that Freeciv offers. I have been attempting to customise units in a similar fashion.

Now I have downloaded GIMP and can manage to cut and paste units in to the relevant file but the issue I am having is that the units below and the unit file in ToT has a 64 x 64 pixel grid and I am having trouble figuring out what to do to edit the grid size for the units in Freeciv. Ideally I would like to create a custom unit graphics file from the start which I could use for different rules in the future.

I have tried looking on the Freeciv wiki and I just can not figure it out. Any help would be greatly appreciated.

Many thanks and all the best,

Tone

Image
cazfi
Elite
Posts: 3093
Joined: Tue Jan 29, 2013 6:54 pm

Re: Trying to customise Unit graphics

Post by cazfi »

Let's assume that you create completely new units gfx file instead of replacing units inside existing one. You then need actual .png -gfx file, and textual .spec file to describe how units are arranged withing the .png.

See for example data/amplio2/units.spec.

So, if you have your 64 x 64 units in file called tileset/tonetwunits.png separated by single pixel borders, you could have tileset/tonetwunits.spec like this:

Code: Select all

[spec]

; Format and options of this spec file:
options = "+Freeciv-spec-Devel-2013.Feb.13"

[file]
gfx = "tileset/tonetwunits"

[grid_main]

x_top_left = 1
y_top_left = 1
; 64 x 64 grid with one pixel between
dx = 64
dy = 64
pixel_border = 1

tiles = { "row", "column", "tag"
 0, 0, "u.warriors"
 0, 1, "u.phalanx"
 1, 0, "u.musketeer"
 1, 1, "u.legion"
}
Then you need to list "tileset/tonetwunits.spec" in the files list in your toplevel .tilespec -file.

Also note that you need to make real transparency to the sprites. Civ2 makes those pixels with that pink color transparent, but freeciv expects real png alpha channel transparency. Unless it's transparent by alpha channel, pink pixel will appear pink. (And yes, also partial opacity works)
ToneTW
Posts: 4
Joined: Fri Sep 06, 2013 11:56 am

Re: Trying to customise Unit graphics

Post by ToneTW »

Great thank you so much. I'll give it a go and let you know how I get on. I have managed in the past to fuzzy select the pink and deleted it to make the unit have a transparent background. Thanks again and all the best,

Tone
ToneTW
Posts: 4
Joined: Fri Sep 06, 2013 11:56 am

Re: Trying to customise Unit graphics

Post by ToneTW »

Thank you again cazfi I have managed to get the graphics to work and your advice has helped me understand the way the files work. I just need to adjust the art and clean up bits of pink pixel I've missed.

Cheers,

Tone
Post Reply