Accounts e-mail HP

Implementing new unit graphics

Contribute, display and discuss art and tilesets for use in Freeciv here.

Implementing new unit graphics

Postby pioja » Sat Feb 09, 2008 1:13 am

Hi,

could anyone point me to a tutorial on how to implement new unit graphics into freeciv? I have found the graphical file in the amplio unit set, but it seems to me that there are not many 'free spots' left in the file.

Do I have to resize the unit image data file, if I want to add more units to freeciv? Also, what kind of licence does the graphic have to come along.

Thanks,

Piotr
pioja
 

Implementing new unit graphics

Postby MichaelLeoM » Tue Aug 19, 2008 7:52 am

[quote="pioja"]Hi,

could anyone point me to a tutorial on how to implement new unit graphics into freeciv? I have found the graphical file in the amplio unit set, but it seems to me that there are not many 'free spots' left in the file.

Do I have to resize the unit image data file, if I want to add more units to freeciv? Also, what kind of licence does the graphic have to come along.

Thanks,

Piotr[/quote]

Use blender.
MichaelLeoM
 

Implementing new unit graphics

Postby ngunjaca » Wed Aug 20, 2008 12:12 am

[quote="pioja"]Hi,

could anyone point me to a tutorial on how to implement new unit graphics into freeciv? I have found the graphical file in the amplio unit set, but it seems to me that there are not many 'free spots' left in the file.

Do I have to resize the unit image data file, if I want to add more units to freeciv? Also, what kind of licence does the graphic have to come along.

Thanks,

Piotr[/quote]

For implementing new graphics here is a short guide:
In amplio/units.spec file a "grid" for units is defined:
"[grid_main]

x_top_left = 0
y_top_left = 0
dx = 64
dy = 48"

and a graphics file where the actual graphics are stored
"[file]
gfx = "amplio/units"" (this can be any other file)

which means that a single unit graphic in the image file units.png has 64x48 pixels. The size of the units.png image file can be expanded as you like. Its original size is 1280x192; if you want to add new units in new columns add to x axis 64 pixels (change the image canvas size for x axis from 1280 to 1344). Now you have 4 new empty unit graphics slots. The same way you can add new rows. In this way you can expand the unit.png file as you like. My biggest unit.png file is 1600x624 pixels, and i have no problems with FreeCiv loading the units.

Next step is to define in the units.spec file where your new unit graphic in the units.png image file is ("row", "column" numbers, are actually x and y axis), and give the unit a tag (for example for the original armor unit it is "u.armor"). For your new unit, lets say in the new column we added in the first row the coordintes would be 0, 20, and a tag "u.newunit". The new tag i.e. "u.newunit" is then used in the units.ruleset file under "graphic = "u.newunit"" for each separate unit. Take note that you can have up to 200 units defined in the units.ruleset file (this actually should be enough for everyone).

You can read more about it in the README.graphics file in /doc folder.
ngunjaca
 

Implementing new unit graphics

Postby HanduMan » Wed Aug 20, 2008 1:02 am

[quote="ngunjaca"]
For implementing new graphics here is a short guide:
[/quote]
Well put! [img]images/smiles/armata_PDT_34.gif[/img]

An alternative to expanding the units.png file would be to create a new one. An easy way to do this is to copy the units.png to for example moreunits.png and units.spec to moreunits.spec. Then change moreunits.spec:
[b]Code:[/b]
[file]
gfx = "amplio/units"[/quote]

to
[b]Code:[/b]

[file]
gfx = "amplio/moreunits"[/quote]

and remove or comment out the tag specifications (eventually to be replaced by your new specs according to ngunjaca's directions).

In amplio.tilespec just add
[b]Code:[/b]
  "amplio/moreunits.spec",[/quote]
in the list of files.

Make sure you don't leave any duplicate tags in units and moreunits.
HanduMan
 

Implementing new unit graphics

Postby ranko » Tue Jan 11, 2011 7:02 pm

I want to add more units but it wont let me add more graphics , i can change graphics but i just cant add new ones. its the amplio/units tile spec that is a problem every time i try to add a new unit the game wont start.

p.s its windows xp
ranko
 

Re: Implementing new unit graphics

Postby Tooktazoom » Wed Oct 19, 2016 12:41 pm

It is the knowledge that a lot. It makes the reader learn something useful.
Tooktazoom
 
Posts: 2
Joined: Wed Oct 19, 2016 12:35 pm


Return to Art and tilesets

Who is online

Users browsing this forum: No registered users and 2 guests

cron