FreeOrion

Forums for the FreeOrion project
It is currently Sun Oct 22, 2017 6:27 am

All times are UTC




Post new topic Reply to topic  [ 40 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Wed Sep 04, 2013 10:18 pm 
Offline
Designer and Programmer
User avatar

Joined: Tue Aug 14, 2007 6:33 pm
Posts: 2058
Location: Orion
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.


Top
 Profile  
 
PostPosted: Wed Sep 04, 2013 10:35 pm 
Offline
Space Squid
User avatar

Joined: Wed Aug 14, 2013 1:42 pm
Posts: 68
Location: Johannesburg, South Africa
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.

Quote:
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...


Top
 Profile  
 
PostPosted: Thu Sep 05, 2013 11:50 am 
Offline
Designer and Programmer
User avatar

Joined: Tue Aug 14, 2007 6:33 pm
Posts: 2058
Location: Orion
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.


Top
 Profile  
 
PostPosted: Thu Sep 05, 2013 11:59 am 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12004
Location: Munich
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.


Top
 Profile  
 
PostPosted: Thu Sep 05, 2013 12:32 pm 
Offline
Space Squid
User avatar

Joined: Wed Aug 14, 2013 1:42 pm
Posts: 68
Location: Johannesburg, South Africa
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.


Top
 Profile  
 
PostPosted: Thu Sep 05, 2013 2:43 pm 
Offline
Space Squid
User avatar

Joined: Wed Aug 14, 2013 1:42 pm
Posts: 68
Location: Johannesburg, South Africa
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.


Top
 Profile  
 
PostPosted: Thu Sep 05, 2013 2:50 pm 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12004
Location: Munich
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:
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.


Top
 Profile  
 
PostPosted: Thu Sep 05, 2013 3:01 pm 
Offline
Space Squid
User avatar

Joined: Wed Aug 14, 2013 1:42 pm
Posts: 68
Location: Johannesburg, South Africa
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.


Top
 Profile  
 
PostPosted: Fri Sep 06, 2013 8:39 am 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4226
Location: Sol III
Committed, rev 6397.


Top
 Profile  
 
PostPosted: Fri Sep 06, 2013 11:33 pm 
Offline
Space Floater
User avatar

Joined: Thu Jul 04, 2013 12:48 am
Posts: 48
Those new icons look great.

_________________
If this post contains code, it's released under GPL 2.0 or later.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 40 posts ]  Go to page Previous  1, 2, 3

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group