Statistics

Users
3486
Articles
156
Articles View Hits
1528968

Foliage

4 years 2 months ago - 4 years 2 months ago #1 by Jace11

  • Grunt
  • Grunt

  • Posts: 50
  • Thank you received: 51

  • Gender: Male
  • Birthdate: Unknown
  • Foliage was created by Jace11
    I noticed in early development screenshots and some more recent ones posted by people here that the crops and foliage looked a lot more defined than what we have in game now. The game seems to contain two sets of textures for plants and trees etc. One is a packed 2048x2048 texture and the other is the individual textures in the terrain folder for each sprite. These are slightly better in quality but if I set up a mod with a gfx.csv to use those individual textures (or a copy of them) I get a substantial loss in frames in game - even though, in my opinion it looks a lot better. I expect that's why the packed versions are used, but they seem to lose something in the process, either in dds compression of the alpha or something else that makes them hard to see at times (perhaps the alpha threshold used in TexturePacker is slightly high). The alphas of crops seem to accumulate the more there are in the field of view giving rise to this dark effect, even though the texture on the packed.dds is bright.



    This can be completely alleviated by using the unpacked textures, but as I said, you lose frames badly. I did have a go with the latest version of texturepacker tonight which eventually got them to pack with a clearer alpha.



    I'll test it out for a few days and then post it up for people to try once its working alright.
    Last edit: 4 years 2 months ago by Jace11.
    The following user(s) said Thank You: voltigeur, Saddletank

    Please Log in or Create an account to join the conversation.

    4 years 2 months ago - 4 years 2 months ago #2 by Saddletank

  • Division Commander
  • Division Commander

  • Posts: 2171
  • Thank you received: 587

  • Gender: Male
  • Birthdate: 06 Sep 1959
  • Replied by Saddletank on topic Re: Foliage
    Your brighter grass with the edited alpha channel is great in the lower pic.

    Please would you consider adjusting the alpha for the stock textures that come with the game? We play MP almost exclusively with armies of over 50,000 men on the map and we need the framerates to stay as high as practical.

    Thanks.

    HITS & Couriers - a different and realistic way to play SoW MP.
    Last edit: 4 years 2 months ago by Saddletank.

    Please Log in or Create an account to join the conversation.

    4 years 2 months ago - 4 years 2 months ago #3 by Jace11

  • Grunt
  • Grunt

  • Posts: 50
  • Thank you received: 51

  • Gender: Male
  • Birthdate: Unknown
  • Replied by Jace11 on topic Re: Foliage
    All i'm doing really is getting the game to use a different set of default textures (ones already included).

    Unfortunatley I don't think I can do it as I'd hoped. Packed textures seem to have their alphas rendered differently, even if the alpha is "perfect" it still gives rise to the effects seen in the first image. I thought I'd got it working but it turned out the game wasn't using the repacked version I made, when I forced it to, it still gave the same effect as seen in the first screen - so I don't think its possible.

    I'm pretty sure whoever on the team worked on terrain textures encountered the same issues and I'm just running over the same ground. It was probably a design decision to limit the loss of detail as much as possible but still use packed textures for terrain to maximize performance. On the plus side though, when you do use the separate textures, the FPS hit isn't as bad as I first thought - it can be 1 to 3 FPS, which might not seem much but this game can get pretty slow already when alot of sprites are on the field so it will probably be a mod for smaller scale battles or people with powerful rigs that don't care so much. Foliage isn't animated so I suppose that may be why the hit isn't that big.

    BTW texturepacker has a free 7 day trial if anyone is interested in trying anything similar - sprites, units etc.


    Edit:- download added for unpacked terrain mod. extract the zip to your mods folder etc etc, activate and deactivate as required. I'd be interested to see what kind of performance loss other people experience.

    Edit2: download removed - a better version is available below.
    Last edit: 4 years 2 months ago by Jace11.

    Please Log in or Create an account to join the conversation.

    4 years 2 months ago - 3 years 9 months ago #4 by Jace11

  • Grunt
  • Grunt

  • Posts: 50
  • Thank you received: 51

  • Gender: Male
  • Birthdate: Unknown
  • Replied by Jace11 on topic Re: Foliage
    Duh! OK!

    I finally figured it out. The reason the textures for crops etc are dark is the packed textures have been made with black backgrounds. Those in the Terrain folder have full color backgrounds, that's why they look better. The alphas aren't perfect and get compressed a bit *maybe* when making the .dds. Using a black background for the textures on the packed sheet then gives rise to black outlines on the crops etc. I made a new sprite sheet with the full backgrounds so you get the nicer foliage without the performance hit seen in my previous version. I've tested it briefly (loading with and without the mod and checking FPS from certain unit positions) and I can't detect any FPS loss. I was losing 1-2 FPS with my previous version, so this is an improvement I think. It was made using TextureMapper again, but I didn't use a plist as I wanted the whole background for each texture. TM will trim and crop them to fit in the smallest space etc, but I just wanted to make sure each sprite's integrity is maintained so I did it the old fashioned way with a gfx list.

    This file is the original textures fixed up to display correctly.

    File Attachment:

    File Name: PackedTerr...ites.zip
    File Size:1,244 KB






    Edit- a second mod is also available (Terrain Sprites version 3)
    - this is a modded version that includes alot of little tweaks to colors, alphas and a few new sprites. Looks a bit better than the one above, you can't run them together, it is a replacement for the mod above.

    File Attachment:

    File Name: TerrainSprites3.zip
    File Size:1,205 KB
    Attachments:
    Last edit: 3 years 9 months ago by Jace11.
    The following user(s) said Thank You: ADukes, RebBugler, voltigeur, Saddletank

    Please Log in or Create an account to join the conversation.

    4 years 2 months ago #5 by RebBugler

  • NSD Designer
  • NSD Designer

  • Posts: 3899
  • Thank you received: 1983

  • Gender: Male
  • Birthdate: 07 Feb 1948
  • Replied by RebBugler on topic Re: Foliage

    Using a black background for the textures on the packed sheet then gives rise to black outlines on the crops etc.


    I'm left scratching my head about this because I can't find where black backgrounds were used as the alpha, they're all transparent when I open them in Paint.net. I'm pretty familiar with alpha formatting because of my flag work. Furthermore, it's not a packing issue because I tested my flags on 4096x sheets before packing them and saw no degradation or shadowing upon packing.

    You say this sheet is packed, but without a plist and using the GFX file, not the gfxpacked file, then it's just a texture sheet, albeit with very unique coordinate entries.

    FPS is no issue because the number of texture sheets wasn't increased.

    It was made using TextureMapper

    Maybe this is the app that made the difference, tell us more please.

    Regardless, this mod works great at eliminating unwanted dark outlines that seem to be inherent with all the vegetation. Very nice work!

    Permission to use it as an add-on with the next upgrade of the Grog Toolbar?
    If OK'd, what do I call it? The Jace 11 Foliage Fixer? :)

    Expanded Toolbar - Grog Waterloo
    Bugles & Flags Gettysburg - Toolbar, Flags, Scenarios and more...
    __________________________________
    In remembrance:
    Eric Schuttler "louie raider" (1970 - 2018)
    John Bonin "2nd Texas Infantry" (1977 - 2012)

    Please Log in or Create an account to join the conversation.

    4 years 2 months ago - 4 years 2 months ago #6 by Jace11

  • Grunt
  • Grunt

  • Posts: 50
  • Thank you received: 51

  • Gender: Male
  • Birthdate: Unknown
  • Replied by Jace11 on topic Re: Foliage
    I just called called it packed, because the previous version I put up that used individual sprites I called "unpacked" but you're right I guess, it's just a sheet. But then TexturePacker makes exactly the same kind of sheets, its just it's brilliant at making the coordinate file and can pack images closer together.

    It was made using Texture Packer, sorry just a typo... there is no other program, though my trial has just expired, so its a bit trickier to use now. For sheets where all the sprites are the same size I can use Photoshop to make a contact sheet, but where they differ I now have to edit after making the sheet.

    As for why it works?
    I think its mostly to do with converting from .png to .dds and the .png format. Something happens during this process that causes the issue. I've noticed that the .png format has some surprises, for instance, a transparency can still have RGB colour values hidden underneath... and converting png to dds carries these RGB values over. I'll try and make an image to explain.
    Last edit: 4 years 2 months ago by Jace11.
    The following user(s) said Thank You: RebBugler

    Please Log in or Create an account to join the conversation.

    4 years 2 months ago #7 by RebBugler

  • NSD Designer
  • NSD Designer

  • Posts: 3899
  • Thank you received: 1983

  • Gender: Male
  • Birthdate: 07 Feb 1948
  • Replied by RebBugler on topic Re: Foliage

    Jace11 wrote: I just called called it packed, because the previous version I put up that used individual sprites I called "unpacked" but you're right I guess, it's just a sheet. But then TexturePacker makes exactly the same kind of sheets, its just it's brilliant at making the coordinate file and can pack images closer together.

    It was made using Texture Packer, sorry just a typo... there is no other program, though my trial has just expired, so its a bit trickier to use now. For sheets where all the sprites are the same size I can use Photoshop to make a contact sheet, but where they differ I now have to edit after making the sheet.

    As for why it works?
    I think its mostly to do with converting from .png to .dds and the .png format. Something happens during this process that causes the issue. I've noticed that the .png format has some surprises, for instance, a transparency can still have RGB colour values hidden underneath... and converting png to dds carries these RGB values over. I'll try and make an image to explain.


    Much clearer now, thanks. I've also used the packer for making non-packed sheets, not cropping the background, etc., but not with different sizes. I read somewhere that oblong dds conversions have issues so I've avoided anything not squared.

    So, if it's a png to dds format change that's helping out here, how is it that you have the png files to begin with? I know that the dds files can be converted back to png, and then repacked, but wouldn't those former dds graphics still show the degradation that is inherent with dds converts. Hope I'm making sense, still learning, and will be forever, about how graphic conversions work.

    Please continue your explanations, this mod has our attention, or at least mine. :)

    Expanded Toolbar - Grog Waterloo
    Bugles & Flags Gettysburg - Toolbar, Flags, Scenarios and more...
    __________________________________
    In remembrance:
    Eric Schuttler "louie raider" (1970 - 2018)
    John Bonin "2nd Texas Infantry" (1977 - 2012)
    The following user(s) said Thank You: con20or

    Please Log in or Create an account to join the conversation.

    4 years 2 months ago - 4 years 2 months ago #8 by con20or

  • Moderator
  • Moderator

  • Posts: 2540
  • Thank you received: 465

  • Gender: Unknown
  • Birthdate: Unknown
  • Replied by con20or on topic Re: Foliage

    RebBugler wrote: Please continue your explanations, this mod has our attention, or at least mine. :)


    +1
    Last edit: 4 years 2 months ago by con20or.

    Please Log in or Create an account to join the conversation.

    4 years 2 months ago - 4 years 2 months ago #9 by gunship24

  • NSD QA Team
  • NSD QA Team

  • Posts: 693
  • Thank you received: 381

  • Gender: Male
  • Birthdate: Unknown
  • Replied by gunship24 on topic Re: Foliage
    I just loaded up both files and this is what I see. Our one is on the right and Jace's is on the left. Our one has a transparency layer on top (probably not the technical way to describe it) but only for certain colours.

    Attachments:
    Last edit: 4 years 2 months ago by gunship24.

    Please Log in or Create an account to join the conversation.

    4 years 2 months ago - 4 years 2 months ago #10 by Jace11

  • Grunt
  • Grunt

  • Posts: 50
  • Thank you received: 51

  • Gender: Male
  • Birthdate: Unknown
  • Replied by Jace11 on topic Re: Foliage
    Reb: I dont have the original png files. I used the separate textures in the /Terrain folder. I took the colour channel of each (they all have backgrounds) and made a sheet, then did the same with the alphas. These were all in bmp format btw. Then I just combined the two to make the dds.

    P.S feel free to add it to your mod if you want.

    So, I'm not really sure what's happening (I'm no expert either), but the alpha is picking up some of the background surrounding the image.

    Below is an example, it isn't what I did to make the mod, its just to explain why you may have a black (or whatever) background even though you think you don't..

    It starts with the sunflower.dds from the terrain folder, I made a png from it. The transparency looks empty, but its not.!! When you convert it back to dds, you get the background back...

    I wonder if when the sprites sheets are being made this is what happens. The end results (e.g WL_Terrain_Sprites.dds) have black backgrounds and the alphas are picking some of this up. it seems the .png saves every pixel's RGB. If you have an alpha, you won't see them unless the alpha allows, but they are still there... converting to .dds seems to copy all the RGBS too, so that's what you get in color channel of the dds.



    I've attached a png file with the hidden RGB values, if you convert it to dds you should see the difference. If you are making textures from pngs I think you have to be mindful if it contains a hidden RGB, because most editing programs won't display it, but it does appear in the final conversion to .dds!
    Attachments:
    Last edit: 4 years 2 months ago by Jace11.
    The following user(s) said Thank You: RebBugler, Jolly, Saddletank

    Please Log in or Create an account to join the conversation.

    4 years 2 months ago #11 by Jolly

  • NSD Artist
  • NSD Artist

  • Posts: 441
  • Thank you received: 727

  • Gender: Unknown
  • Birthdate: Unknown
  • Replied by Jolly on topic Re: Foliage
    If I remember correctly, I created the original PSD's with alphas, but then had to convert them to PNG, which was not ideal, and made for some unwanted artifacts in the process. I'd have prefered DDS format, but they needed to be converted to PNG format for packing purposes at that time.
    I was'nt involved with the packing, I churned out the textures for the maps, trying to get the best balance for everything - blimey its about two years ago now!

    I've got all the originals still of course, lots of them. :)

    cheers

    David(jolly)

    Please Log in or Create an account to join the conversation.

    4 years 2 months ago #12 by RebBugler

  • NSD Designer
  • NSD Designer

  • Posts: 3899
  • Thank you received: 1983

  • Gender: Male
  • Birthdate: 07 Feb 1948
  • Replied by RebBugler on topic Re: Foliage
    Glad we're able to fix this with a mod, I never knew the flowers were here:

    With this mod



    Without this mod


    Thanks for permission, I'll get this mod integrated into the Grog Toolbar with it's next update.

    Expanded Toolbar - Grog Waterloo
    Bugles & Flags Gettysburg - Toolbar, Flags, Scenarios and more...
    __________________________________
    In remembrance:
    Eric Schuttler "louie raider" (1970 - 2018)
    John Bonin "2nd Texas Infantry" (1977 - 2012)
    Attachments:

    Please Log in or Create an account to join the conversation.

    4 years 2 months ago #13 by Davinci

  • Corps Commander
  • Corps Commander

  • Posts: 3023
  • Thank you received: 757

  • Gender: Male
  • Birthdate: Unknown
  • Replied by Davinci on topic Re: Foliage
    Jace11 - Nice Work!

    Reb - You can reduce the file size slightly without messing up the graphics. The size is 152x200 which is 30kb .

    By slicing off the top which is just empty space you can have a file size of 152x152 which comes out to 23kb in size. That is not a very big savings but every little bit helps.

    davinci

    The only true logic is that, there is no true logic!

    Please Log in or Create an account to join the conversation.

    4 years 2 months ago #14 by RebBugler

  • NSD Designer
  • NSD Designer

  • Posts: 3899
  • Thank you received: 1983

  • Gender: Male
  • Birthdate: 07 Feb 1948
  • Replied by RebBugler on topic Re: Foliage
    Jace11 quote:

    I used the separate textures in the /Terrain folder. I took the colour channel of each (they all have backgrounds) and made a sheet, then did the same with the alphas. These were all in bmp format btw. Then I just combined the two to make the dds.


    The process makes sense, but I still don't understand how to find or use the colour channel. Is this a Photoshop function? I've been working with transparent alpha backgrounds for years with Paint.net modding troop sprites, flags, fire, and terrain, and have never had to deal with cleaning up a colour channel.

    My bottom line question here is: Could this issue have been caused by a Photoshop oversight?





    Hey D, didn't even understand what you're referring to, but thanks anyway. :P

    Expanded Toolbar - Grog Waterloo
    Bugles & Flags Gettysburg - Toolbar, Flags, Scenarios and more...
    __________________________________
    In remembrance:
    Eric Schuttler "louie raider" (1970 - 2018)
    John Bonin "2nd Texas Infantry" (1977 - 2012)

    Please Log in or Create an account to join the conversation.

    4 years 2 months ago - 4 years 2 months ago #15 by Jace11

  • Grunt
  • Grunt

  • Posts: 50
  • Thank you received: 51

  • Gender: Male
  • Birthdate: Unknown
  • Replied by Jace11 on topic Re: Foliage
    Photoshop shows you all the channels in the image, (one exception is in png files - you don't get to see the alpha channel, but you can create it as a separate channel if you want).



    I've never used Paint.net so I can't comment on it. When you open a png with Paint.net, how is the alpha represented? Does it appear as a separate selectable channel or layer, or is it not displayed at all and represented by the chequerboard? - because that's how PS displays it.

    I'm looking at gunships post and compared the alphas of the two.

    On the second image the alpha looks way too weak to be a product of the background selection issue.



    The image on the right isnt ideal for an alpha...especially when there is better one (in the terrain folder). Look at the center of the flower, its contrast suggests its been created using some info from the colour image. It should be solid like the image on the left.

    Don't worry about your sprites/ flags they look completely unaffected to me, the alphas look correct (solid) and they display well in game. It might be just terrain sprites that suffer - I'm thinking people are getting them from images on the net and they don't always come with alphas, so they have to be generated as best possible. It's just in the case of this sheet better alphas were available but not used.
    Last edit: 4 years 2 months ago by Jace11.
    The following user(s) said Thank You: RebBugler

    Please Log in or Create an account to join the conversation.

    4 years 2 months ago #16 by Jolly

  • NSD Artist
  • NSD Artist

  • Posts: 441
  • Thank you received: 727

  • Gender: Unknown
  • Birthdate: Unknown
  • Replied by Jolly on topic Re: Foliage
    Here is a snap of my original psd texture for this. I spent a lot of time getting the alphas looking right - for each and every texture, and there are a lot of them. They then have to have a good balance on the map textures that I also did, taking into account the overall scemantics of the day - large flowers did'nt seem right.



    It looks like for the right image you have just desaturated the colour layer?
    I'm not sure what for, or what it proves.

    If the packing can be improved, then that's great. The packing method we used was to try and reduce the file size as much as possible for these sprites. One idea was to leave the sprites unpacked as seperate dds files, but packing was the correct way to go.

    Cheers
    Attachments:

    Please Log in or Create an account to join the conversation.

    4 years 2 months ago - 4 years 2 months ago #17 by Jace11

  • Grunt
  • Grunt

  • Posts: 50
  • Thank you received: 51

  • Gender: Male
  • Birthdate: Unknown
  • Replied by Jace11 on topic Re: Foliage
    The one on the left is from the alpha layer of GFX_WL_Sunflower.dds that comes with the game (\Scourge of War Waterloo\Base\Graphics\Terrain) this looks like its the same as in your .psd.

    The one is the right is from the alpha layer of WL_Terrain_Sprites.dds (the packed version) that comes with the game (\Scourge of War Waterloo\Base\Graphics\Packed), I haven't edited it.

    They are both in the game.

    The game uses the one on the right, not the one on the left. Have a look at WL_Terrain_Sprites.dds and compare it to your .psd ...

    Somehow, during or prior to packing (converting formats etc), you've gone from one to the other. I don't know how exactly you process them but packing shouldn't result in this change.

    Your textures are great btw, they do fit the game. Just trying to work out why the packed versions aren't appearing as nice as your source images.
    Last edit: 4 years 2 months ago by Jace11.

    Please Log in or Create an account to join the conversation.

    4 years 2 months ago - 4 years 2 months ago #18 by RebBugler

  • NSD Designer
  • NSD Designer

  • Posts: 3899
  • Thank you received: 1983

  • Gender: Male
  • Birthdate: 07 Feb 1948
  • Replied by RebBugler on topic Re: Foliage
    Jace11 quote:

    I've never used Paint.net so I can't comment on it. When you open a png with Paint.net, how is the alpha represented? Does it appear as a separate selectable channel or layer, or is it not displayed at all and represented by the chequerboard? - because that's how PS displays it.


    Paint.net uses layers rather than channels. You can choose either transparent (checkerboard) or solid backgrounds for sprites, building by layers. Once the sprite design is done the layers are flattened (combined), and it's ready for dds, or other conversions.

    Expanded Toolbar - Grog Waterloo
    Bugles & Flags Gettysburg - Toolbar, Flags, Scenarios and more...
    __________________________________
    In remembrance:
    Eric Schuttler "louie raider" (1970 - 2018)
    John Bonin "2nd Texas Infantry" (1977 - 2012)
    Last edit: 4 years 2 months ago by RebBugler.

    Please Log in or Create an account to join the conversation.

    3 years 11 months ago #19 by RebBugler

  • NSD Designer
  • NSD Designer

  • Posts: 3899
  • Thank you received: 1983

  • Gender: Male
  • Birthdate: 07 Feb 1948
  • Replied by RebBugler on topic Re: Foliage
    Now included with the 5.2 release of the Grog Toolbar . Thanks Again! :)

    Expanded Toolbar - Grog Waterloo
    Bugles & Flags Gettysburg - Toolbar, Flags, Scenarios and more...
    __________________________________
    In remembrance:
    Eric Schuttler "louie raider" (1970 - 2018)
    John Bonin "2nd Texas Infantry" (1977 - 2012)

    Please Log in or Create an account to join the conversation.

    Moderators: RebBuglergunship24Leffe7Sargonpaul9038