New handling of graphics starting in 0.3.1-RC5

Development of artwork, requests, suggestions, samples, or if you have artwork to offer. Primarily for the artists.
Post Reply
Message
Author
tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

New handling of graphics starting in 0.3.1-RC5

#1 Post by tzlaine »

All the graphics (e.g. default\art\stars\orange5.png) that start with the same filename prefix (in this case, "orange") are loaded. This means that you can add any file "orange[whatever]", like "orange6.png", and FreeOrion will load and use it along with the existing files. This was done so the artists can just toss any old files in there with the right naming convention and see them in use in-game. Please use this feature to test out new graphics and to submit them to the Graphics forum.

The files in the planets directory, (e.g. default\art\planets\Inferno01.png) also have to have one or more entries in default\data\art\planets\planets.xml that use the file before it is used.

The planets.xml entries look like this:

Code: Select all

    <RotatingPlanetData>
      <planet_type>PT_INFERNO</planet_type>
      <filename>planets/Inferno05.png</filename>
      <RPM>3.0</RPM>
      <axis_angle>19.0</axis_angle>
      <shininess>0.0</shininess>
    </RotatingPlanetData>
These entries aren't new, they've been around a while. But before the code that loaded up the art directory files was more rigid. Now its a lot easier to add stuff on an experimental basis.

The <planet_type> refers to the FreeOrion-type of the planet. Just use one of the ones already in the file -- it should be pretty obvious which one is which.
<filename> is also pretty obvious.
<RPM> is the speed, in revolutions per minute, at which the planet will rotate in the SidePanel.
<axis_angle> is the tilt of the planet in degrees (the earth has a 23-degree tilt).
<shininess> is how much the light that strikes the planet's surface is relfected back as a mirror-like/specular reflection.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: New handling of graphics starting in 0.3.1-RC5

#2 Post by Geoff the Medio »

So if planets.xml has

<filename>planets/Inferno05.png</filename>

then that sidepanel planet definition could use any of the planet textures that start with "Inferno"? I thought that that sort of auto-loading was only set up for the star disc, star halo and nebula textures. The planet definitions were meant to be tied to a particular image, not any of the images named for that planet type.

tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

Re: New handling of graphics starting in 0.3.1-RC5

#3 Post by tzlaine »

Geoff the Medio wrote:So if planets.xml has

<filename>planets/Inferno05.png</filename>

then that sidepanel planet definition could use any of the planet textures that start with "Inferno"? I thought that that sort of auto-loading was only set up for the star disc, star halo and nebula textures. The planet definitions were meant to be tied to a particular image, not any of the images named for that planet type.
Sorry if that wasn't clear, but yes, you're right. A single entry in planets.xml is tied to a single image. But the images that you can use in plantes.xml are not restricted to a hardcoded set any more. You can now throw whatever images you want into the art\planets directory, as long as they are named properly, and then add them to planets.xml.

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: New handling of graphics starting in 0.3.1-RC5

#4 Post by eleazar »

tzlaine wrote:All the graphics (e.g. default\art\stars\orange5.png) that start with the same filename prefix (in this case, "orange") are loaded. This means that you can add any file "orange[whatever]", like "orange6.png", and FreeOrion will load and use it along with the existing files. This was done so the artists can just toss any old files in there with the right naming convention and see them in use in-game.
:D

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: New handling of graphics starting in 0.3.1-RC5

#5 Post by Geoff the Medio »

tzlaine wrote:But the images that you can use in plantes.xml are not restricted to a hardcoded set any more.
Are you sure this change has to do with planets.xml? AFAIK you could always specify any texture file name in the XML.
You can now throw whatever images you want into the art\planets directory, as long as they are named properly, and then add them to planets.xml.
What are the requirements for naming? If I put a file "asdgasdgasd.png" in the art\planets dir, and then specify in planets.xml,

<filename>planets/asdgasdgasd.png</filename>

for a number of planet definitions, it works fine...

tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

Re: New handling of graphics starting in 0.3.1-RC5

#6 Post by tzlaine »

Geoff the Medio wrote:
tzlaine wrote:But the images that you can use in plantes.xml are not restricted to a hardcoded set any more.
Are you sure this change has to do with planets.xml? AFAIK you could always specify any texture file name in the XML.
You can now throw whatever images you want into the art\planets directory, as long as they are named properly, and then add them to planets.xml.
What are the requirements for naming? If I put a file "asdgasdgasd.png" in the art\planets dir, and then specify in planets.xml,

<filename>planets/asdgasdgasd.png</filename>

for a number of planet definitions, it works fine...
Ah, good point. I misremembered how the planets images worked exactly, but the original post still applies to the other kinds of images.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: New handling of graphics starting in 0.3.1-RC5

#7 Post by Geoff the Medio »

tzlaine wrote:...the original post still applies to the other kinds of images.
Not many, really... Anything in XML works like the planet textures, including tech icons.

What is flexible includes:

* map star dics: eg. "blue#.png"
* map star halos: eg. "halo_blue#.png"
* map nebulae: eg. "nebula#.png"
* sidepanel star images: eg. "blackhole##.png" ( I assume; haven't verified myself )

and I think that's it. Still hard-coded includes:

* background starfields: "starfield1.png" thru "starfield3.png"
* tech category icons (Problematic because one can't add extra categories. These should be defined in techs.txt as a property of the category, like tech icon graphics are for techs)
* main title splash icon parts "splash00.png" thru "splash12.png"
* everything else, which is OK in most cases as there's no need for most things to use more than one image

Post Reply