BraveSirKevin's Graphic Contributions

Development of artwork, requests, suggestions, samples, or if you have artwork to offer. Primarily for the artists.
Message
Author
User avatar
Bigjoe5
Designer and Programmer
Posts: 2058
Joined: Tue Aug 14, 2007 6:33 pm
Location: Orion

Re: Dimensional Rift and Void overlays for planets

#31 Post by Bigjoe5 » Wed Sep 04, 2013 10:18 pm

BraveSirKevin wrote:They don't play as nicely with the atmosphere and shadow shaders as I'd like at the moment, and getting the most out of the overlays would require some animation. Fixing these issues will likely involve messing around with some stuff in the source, but I have no idea where to look if I'm going to effect some changes there. If anyone knows which source files control the revolving planet graphics in the UI, please point me in the right direction.
See RotatingPlanetControl (SidePanel.cpp:583). It uses a surface texture, an overlay texture (which is what you would be dealing with) and an atmosphere texture. All of them are represented with GG::Texture objects. The overlay texture is rendered in RotatingPlanetControl::Render by passing it into the RenderPlanet method (SidePanel.cpp:307). As far as I know, there are no GG objects to represent animations, such as might be stored in a single file as an animation... Instead what you may have to do (as is done with the asteroid animations) is have a sequence of textures that are passed to the RenderPlanet method in turn, to create an animation (see default/data/art/planets/asteroids).

I also want to add that while I'm not terrible familiar with animation stuff, having a huge number of pngs rather than using a file format actually designed for animations seems a bit odd... would it be better to choose a format for animations and use that instead of the gazillion separate little images?
Warning: Antarans in dimensional portal are closer than they appear.

User avatar
BraveSirKevin
Space Squid
Posts: 68
Joined: Wed Aug 14, 2013 1:42 pm
Location: Johannesburg, South Africa

Re: Dimensional Rift and Void overlays for planets

#32 Post by BraveSirKevin » Wed Sep 04, 2013 10:35 pm

Bigjoe5 wrote: See RotatingPlanetControl (SidePanel.cpp:583). It uses a surface texture, an overlay texture (which is what you would be dealing with) and an atmosphere texture. All of them are represented with GG::Texture objects. The overlay texture is rendered in RotatingPlanetControl::Render by passing it into the RenderPlanet method (SidePanel.cpp:307). As far as I know, there are no GG objects to represent animations, such as might be stored in a single file as an animation... Instead what you may have to do (as is done with the asteroid animations) is have a sequence of textures that are passed to the RenderPlanet method in turn, to create an animation (see default/data/art/planets/asteroids).
Thanks a lot... I'll dig through it later this week and see what I can work out. My plan was to create maybe 10 or 15 frames and set up a loop that cycles throgh them over the space of about 3 seconds. Combined with the rotation of the planet, I don't think the repetition would be too obvious on most worlds. It's entirely experimental right now, so I don't know if it'll work out being anything of value, but I'd kinda like to try and get those figured out because those little planets have a whole heap of untapped potential.
I also want to add that while I'm not terrible familiar with animation stuff, having a huge number of pngs rather than using a file format actually designed for animations seems a bit odd... would it be better to choose a format for animations and use that instead of the gazillion separate little images?
It's fairly standard practice to use sequential PNGs, especially for high-resolution rendering were you absolutely do not want the artifacts of a compressed movie file messing things up. You can use pre-rendered animations in a movie format if you have the video codec available, but to my knowledge FO does not have one in its libraries at the moment. Even then, you'd not use the movie as an overlay texture if you could help it because of the quality issues...

User avatar
Bigjoe5
Designer and Programmer
Posts: 2058
Joined: Tue Aug 14, 2007 6:33 pm
Location: Orion

Re: Dimensional Rift and Void overlays for planets

#33 Post by Bigjoe5 » Thu Sep 05, 2013 11:50 am

BraveSirKevin wrote:It's fairly standard practice to use sequential PNGs, especially for high-resolution rendering were you absolutely do not want the artifacts of a compressed movie file messing things up. You can use pre-rendered animations in a movie format if you have the video codec available, but to my knowledge FO does not have one in its libraries at the moment. Even then, you'd not use the movie as an overlay texture if you could help it because of the quality issues...
Hmm, OK then.
Warning: Antarans in dimensional portal are closer than they appear.

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

Re: BraveSirKevin's Graphic Contributions

#34 Post by Geoff the Medio » Thu Sep 05, 2013 11:59 am

Looking at the DynamicGraphic header, it suggests that it could be passed a single texture that contains multiple SubTexture frames within it, and would cycle through them. In that case, all the frames for an animation could be in one larger png file, instead of multiple single-frame files. I haven't tried this, though.

User avatar
BraveSirKevin
Space Squid
Posts: 68
Joined: Wed Aug 14, 2013 1:42 pm
Location: Johannesburg, South Africa

Re: BraveSirKevin's Graphic Contributions

#35 Post by BraveSirKevin » Thu Sep 05, 2013 12:32 pm

The most efficient method I can think of would be to set up a single large PNG that contains all of the frames an array, and then control the animation by changing the UV co-ordinates so that it's reading a different frame in the array at every iteration of the loop. The main issue with that is there's already a similar method being used to animate the rotating planets, and because the both methods would need to affect the same data (the UV co-ordinates) I don't think i can get it to run both processes simultaneously.

The much bigger challenge here is that my C++ is so rusty that perusing the code is a little like reading Chaucer... The words are so familiar and I know what they mean mostly, but they're also very strange and confusing because I'm not used to seeing things structured like that. It is coming back to me though and I'm getting the hang of it again slowly. Apart from that, I need to get familiar with the art of compiling this beast so that's the next step on this little sidequest.

My priority is still the art, so that's where I'll be spending most of my time.

User avatar
BraveSirKevin
Space Squid
Posts: 68
Joined: Wed Aug 14, 2013 1:42 pm
Location: Johannesburg, South Africa

Sit-Rep Icon for Unlocked Buildings, Hulls and Parts

#36 Post by BraveSirKevin » Thu Sep 05, 2013 2:43 pm

At r6336 Dilvish added sit-rep entries to let players know that new buildings, hulls and parts had been unlocked and were now buildable. The game currently uses the default X icon for those announcements, so I quickly threw together a lock icon for that.

Image

I looked through the various text files under freeorion/default to try and find where the sit-rep icons get called, but I could not locate it. Never the less, I've put the icon here in case someone who does know how to set that up wants to.

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

Re: Sit-Rep Icon for Unlocked Buildings, Hulls and Parts

#37 Post by Geoff the Medio » Thu Sep 05, 2013 2:50 pm

BraveSirKevin wrote:I looked through the various text files under freeorion/default to try and find where the sit-rep icons get called, but I could not locate it.
Those files don't yet exist, but the code looks for them at the .png file names specified in these functions:

Code: Select all

SitRepEntry CreateTechUnlockedSitRep(const std::string& tech_name) {
    SitRepEntry sitrep(UserStringNop("SITREP_TECH_UNLOCKED"), "icons/sitrep/tech_unlocked.png");
    sitrep.AddVariable(VarText::TECH_TAG,          tech_name);
    return sitrep;
}

SitRepEntry CreateBuildingTypeUnlockedSitRep(const std::string& building_type_name) {
    SitRepEntry sitrep(UserStringNop("SITREP_BUILDING_TYPE_UNLOCKED"), "icons/sitrep/building_type_unlocked.png");
    sitrep.AddVariable(VarText::BUILDING_TYPE_TAG,  building_type_name);
    return sitrep;
}

SitRepEntry CreateShipHullUnlockedSitRep(const std::string& ship_hull_name) {
    SitRepEntry sitrep(UserStringNop("SITREP_SHIP_HULL_UNLOCKED"), "icons/sitrep/ship_hull_unlocked.png");
    sitrep.AddVariable(VarText::SHIP_HULL_TAG,      ship_hull_name);
    return sitrep;
}

SitRepEntry CreateShipPartUnlockedSitRep(const std::string& ship_part_name) {
    SitRepEntry sitrep(UserStringNop("SITREP_SHIP_PART_UNLOCKED"), "icons/sitrep/ship_part_unlocked.png");
    sitrep.AddVariable(VarText::SHIP_PART_TAG,      ship_part_name);
    return sitrep;
}
Note that there can/should be different icons for each of those types of unlocks.

User avatar
BraveSirKevin
Space Squid
Posts: 68
Joined: Wed Aug 14, 2013 1:42 pm
Location: Johannesburg, South Africa

Re: BraveSirKevin's Graphic Contributions

#38 Post by BraveSirKevin » Thu Sep 05, 2013 3:01 pm

Well, that makes things easy. It's just a matter of naming the png appropriately. I'll have a look at how to differentiate them better for the future, but for now I'll just do it with some colour tweaks on this graphic.

Image
ship_part_unlocked.png

Image
building_type_unlocked.png

Image
tech_unlocked.png

Image
ship_hull_unlocked.png

Just a temp fix. I'll try and make something that differentiates things in line with what's already being done with the other sit-rep icons this weekend.

User avatar
Vezzra
Release Manager, Design
Posts: 4666
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: BraveSirKevin's Graphic Contributions

#39 Post by Vezzra » Fri Sep 06, 2013 8:39 am

Committed, rev 6397.

User avatar
MarcThibeault
Space Floater
Posts: 49
Joined: Thu Jul 04, 2013 12:48 am

Re: BraveSirKevin's Graphic Contributions

#40 Post by MarcThibeault » Fri Sep 06, 2013 11:33 pm

Those new icons look great.
If this post contains code, it's released under GPL 2.0 or later.

Post Reply