Jump to content

[1.0][Release-5-0][April 28, 2015] Active Texture Management - Save RAM!


rbray89

Recommended Posts

Oh, thank god, I had been beating my head against it for like an hour trying to figure out my error. Thanks for letting me know. I am actually happy to have the vast majority of the buttons clear again. And now that I know how to form these I can go in and exclude some of the textures that are so badly distorted that they are almost unidentifiable.

Link to comment
Share on other sites

Hah, I cant figure out how to post images, so here they are on
dropbox :(

You can use the 4th icon from the right between unlink and insert video and type in the https://www.dropbox.com/sh/91rsfxnka2ds6qx/AADCWyQMEVtR7R7Xip1qNZeFa?dl=0 for the url on the upcoming window.

By the way This was my problem too, with the .25 version of the game. after using ATM. Without astronomers pack. I do had that cloud and citylights mod I can't remember it's name sorry.

At the main screen I had little triangles they was green even after I get rid of ATM directory.

So this error should be something leftover from the old days.

Link to comment
Share on other sites

You can use the 4th icon from the right between unlink and insert video and type in the https://www.dropbox.com/sh/91rsfxnka2ds6qx/AADCWyQMEVtR7R7Xip1qNZeFa?dl=0 for the url on the upcoming window.

By the way This was my problem too, with the .25 version of the game. after using ATM. Without astronomers pack. I do had that cloud and citylights mod I can't remember it's name sorry.

At the main screen I had little triangles they was green even after I get rid of ATM directory.

So this error should be something leftover from the old days.

it is environmental visual enhancements

Link to comment
Share on other sites

Every time I launch kerbal, it goes through the loading of files and it hangs and locks up at Squad/Strategies/Icons/UnpaidResearchprogram. if I delete that icon, it hangs on the next one in that folder.

has anyone found a fix for this?

Found the problem. The folder after that is TextureReplacer, and I'm rocking EvE. It locks up while converting those textures and just does it very, very slowly. Way slower than it should if I'm honest. I've used the same textures before and used ATM on them in the past and they flew by, maybe 2 to 5 seconds were spent on them each, even the big 6k ones, now it's taking 3-5 minutes a texture, what's the deal

Edited by Sabor
Link to comment
Share on other sites

Hi.

There's this option in the config file:

### Generate mipmaps. Mipmaps add smaller, filtered versions### of the texture for use at a distance. Adds ~30% more

### memory. Well worth it on visual textures.

mipmaps = true

With the mipmaps on 'true', do I use LESS or MORE memory? If I set this option to 'false', what effects will it have on the game and my RAM usage?

Link to comment
Share on other sites

Hi,

I''ve created a new mod for the Contractconfigurator, and created my own agency with a flag & thumbnail. How can I prevent this from compressing them, the compression looks awful and they aren't that big to begin with.

They are both PNG files if that helps.

Thanks

Link to comment
Share on other sites

I having a new issue with FASA that just popped up in the last day. My loading screen get stuck on the same gemini part.

alEJgSA.png

Its an easy fix I just have to delete the the gemini folder from the ATM texture cache and the game loads works perfectly fine with no issue. However if I try to load it again the game will hang on that same piece. So the last 3 or four times I have loaded ksp I just delete the gemini folder from the ATM texture cache and it loads fine. I figure this is an ATM issue but I have never had this problem before it just started happening. Also here is my log if it helps.

https://www.dropbox.com/s/j9pm1i59c04ycoi/Player.log?dl=0

Link to comment
Share on other sites

Am I missing something or is this mod increasing the size of the files not reducing them? All the files are coming out the same size.

edit: I deleted everything and started again to check. It's doing the exact same thing again. All the files the same size as this picture shows.

S7PFTJB.jpg

Edited by uglyduckling81
Link to comment
Share on other sites

The size of a png has nothing do do with the size in memory. Unity converts the png in the same way when KSP loads the files but since it is done in memory you don't see it.

Link to comment
Share on other sites

I finally got this mod working by combining it with the OpenGL mode.

currently, all is well, except the fact that Astronomers Visual Pack is having errors with it (I think)

The current error is that there are pink splotches on all the atmospheric planets, there are also noticeable question marks on Eve, and a weird field around Moho (as you can see in the images)

Here are the pictures: Hah, I cant figure out how to post images, so here they are on dropbox :(

My output_log is right here, also Dropbox

My KSP version is 0.90

Windows 8.1, using 32x KSP

(the first half of this is specific to Astronomer's "Interstellar" Visual Pack but at the bottom of this long post I get to some juicy ATM stuff... sorry for the long pre-amble)

I have been using Astronomer's "Interstellar" Visual Pack for awhile - but lots of things have eluded me:

  1. The clouds load as red blotches? Or only sometimes they do? Only when images are scaled?
  2. It uses SOOO much memory - and doesn't respond well to ATM - does it really have to? Why does ATM hate it?
  3. The most effective advice is to use the supplied ATM config which is set to not scale any of the 8k images - Why are they un-scalable?

I dug into this and learned a few things worth sharing:

  1. Astronomer - in what I believe was an effort to save in game memory use - noted this in the Interstellar forum post: "Reformatted all B/W textures from RGB to Greyscale"

    1. I'm not sure this actually saved any memory in the game - or perhaps it increased quality?
    2. This definitely doesn't play nice with ATM - I'm far from an expert in this area but I believe the Greyscale with Alpha channel png (16 bit per pixel) is being treated by ATM as a lower bit rate png without an alpha channel - or something like that - the result is it loads these bits into a different format that expected causing a bit-shift in the colors. This results in red?
    3. What I can say for sure is that re-encoding these greyscale w/ alpha .pngs to color w/ alpha at 8 bits / channel causes them to load without this red-ness

    4. There was a belief posted somewhere about the Interstellar images not using image sizes that were nicely divisible by 2 (or 4 as sarbian notes in post above) - and that by re-encoding them to more standard sizes could improve performance or compatibility.
      1. I tried this and all I can say for sure is that the format change was more critical than moving to a more divisible size.
      2. At some point in the testing of all this I was able to improve the game from experiencing 6 frames per second to 15 frames per second. That was using 8k clouds textures prior to any memory management (but nothing but a few test parts and Astronomer's clouds running with OpenGL).
      3. This could've been from format changes OR from moving to standard texture sizes as during that test both were enabled. I may get a chance to retest this.

[*]Bug #1 in ATM - 16 bit, B/W with Alpha Chanel PNGs don't load into ATM the same way the game loads them - the colors shift

  1. Not sure this is a big deal - doesn't seem like 16 bit, B/W with Alpha, PNGs should be used with the game as I doubt there are benefits other than disk space utilized? But it's there and it is impacting people who try to use ATM with Astronomer's Pack

[*]Bug #2 in ATM - 2048x512 textures, downscaled with ATM while using a minimum of 512 for example, results in a 512x512 sized image.

  1. This is smaller and uses less memory...but it's also distorted. I know square textures are recommended for KSP (much like image sizes which are divisible by 4 are recommended) so maybe this isn't ATM's fault.
  2. But from my perspective, ATM should respect the original textures aspect ration when scaling the image

[*]Bug #3 in ATM - As sarbian notes in a previous recent post, when ATM rescales images it doesn't ensure that the resulting image is divisible by 4 which may have negative impacts on the game's ability to load/use the image.

  1. Not even sure ATM should worry about this case but if it doesn't then ... bad things for difficult to explain reasons?
  2. It's unfortunate, as I think it's of no fault of rbray's work, but ATM has already prove itself difficult for the masses to adopt. The forum seems filled with people who have barely read much about how to make it work much less the attention to detail required to make it work well for your needs/mods.
  3. Is this bug another case of that? Is there a reasonable way to protect against it?

So after finding the texture loading I started by just re-encoding Astronomer's black & white cloud images and then using ATM to scale them to more reasonable sizes based on the load out of mods I wanted to use on that game. Nice! Huge win! In fact, with my test setup I dropped from 2.9 GB of memory to 1.3 GBs. This enabled me to consider using DirectX again which improved my frame rate to 55 FPS with amazing clouds for the first time ever!

But then I saw how the textures were becoming squares as Astronomer uses a lot of 2:1 and 16:9 sized images. I had a few drinks and next thing I knew I was looking at ATM's source code and the resize function. Yup...that's the trouble right there I thought...

To my surprise I rewrote the resize code to some success - enough so that it certainly preserves aspect ratios now.

But then I got fancy and thought to address the textures should be "divisible by 4" issue that sarbian mentioned (as it seemed plausible to handle it in the same spot). I was able to solve that but it *sometimes* (for some of the weird sized textures used by Astronomer's for example) it comes at the cost of *slightly* modifying the aspect ratio - not sure if this will result in bad things. Seems to work in my testing thus far...more to come I suppose (maybe I'll even play the game!).

So that's my super long story - here's my inebriated chicken scratch - anyone want to code review? - is this worth proposing to the repository?


public void SetScalingParams(int scale, int maxSize, int minSize)
{
this.scale = scale;
this.maxSize = maxSize;
this.minSize = minSize; // The Max and Min size might as well be divisible by 4 as the game (due to unity bug) won't reliably load the texture
if (maxSize % 4 != 0)
{
this.maxSize = 4 * (int)Math.Round((double)maxSize / 4);
}
if (minSize % 4 != 0)
{
this.minSize = 4 * (int)Math.Round((double)minSize / 4);
}
}
..... .....
public void Resize()
{
double newScale = scale;
int largestSideDimention = Math.Max(width, height);
int resizedMax = largestSideDimention / scale;
// Does the new size exceed the maximum size - adjust scale to compensate - scale both dimentions equally
if ((maxSize != 0) && (resizedMax > maxSize))
{
newScale = (double)largestSideDimention / maxSize;
}
int smallestSideDimention = Math.Min(width, height);
int resizedMin = smallestSideDimention / scale;
// Does the new size exceed the minimum size - adjust scale to compensate - scale both dimentions equally
if ((minSize != 0) && (smallestSideDimention > minSize) && (resizedMin < minSize))
{
newScale = (double)smallestSideDimention / minSize;
}
needsResize = ( (1 != (int)newScale) && (smallestSideDimention > minSize) );
// If the image is going to be resized, it mights as well be resized to have dimentions that are divisible by 4
// the game (due to unity bug) won't reliablely load textures that are not divisible by 4
// [URL]http://forum.kerbalspaceprogram.com/threads/59005-0-90-Release-4-3-Dec-16-2014-Active-Texture-Management-Save-RAM%21?p=1779257&viewfull=1#post1779257[/URL]
if (needsResize)
{
resizeWidth = 4 * (int)Math.Round((width / newScale) / 4.0);
resizeHeight = 4 * (int)Math.Round((height / newScale) / 4.0);
}
else
{
resizeWidth = width;
resizeHeight = height;
}
}

Link to comment
Share on other sites

Hello,

So I am on my next to last to-do list...ATM.

So I thught I would load up my MODS and get them done; so far so good and I have 2.4 Gigs...

As a side note before I continue...I DO NOT USE OpenGL; I know it reduces memory but in my opinion this is what would cause issues with ATM not the other way around, and I wouldnt think you could do anything to make OGL happy anyways; except maybe for the few tricks mentioned above.

ATM has to do it's thing and can only do so much; just my thinking...Now I am adding AVP and the Atmosphere Enhancements (E.V.E.); this has also been tested on my game loads and works fine; it does have a MEMORY OVERHEAD; I plan on 1 Gig of MEMORY OVERHEAD for AVP to load; it is taking about 800-900megs (then it drops by almost 500 MEGS after the game loads; this seems to work fine.

My problem is this: I want certain folders NOT TO HAVE TEXTURES MESSED WITH:

ACTIVE_TEXTURE_MANAGER_CONFIG

{

folder = OPM

enabled = true

OVERRIDES

{

OPM/.*

{

compress = false //<<<<<<<<<<??

mipmaps = false

scale = 1

max_size = 0

}

}

}

Either way I am getting BIOMES compressed; maybe thats not a problem.

Mechjeb2 Icons are still being processed? I have 2 or 3 cfgs to not have this happen and even changed the main ATM cfg...:

ACTIVE_TEXTURE_MANAGER_CONFIG

}

OVERRIDES

{

.*/.*[i|i]con.*/.*

{

compress = false <<<??

mipmaps = false

scale = 1

max_size = 0

}

OVERRIDES

{

.*/Icons/.*

{

compress = false <<<??

mipmaps = false

scale = 1

max_size = 0

}

}

}

Can I use the above CFG for all Icons folders?

No matter what I use for 'compress' the imagecache files still show up in the folder...please explain if this is actually happning in game/or memory whether or not the files are created.

I am checking things out in game right now...and will edit this post...I am also trying to add AVP/E.V.E. and I may have issues here as well with ATM and am hoping the correct cfg is needed NOT to allow AVP files to be processed; thank you !

(EDIT:GADS this is not good....Outer Planets and ATM dont seem to like each other......any thoughts while I start to cry (!) and work on this??? Right now I only have ATM and OPM with all the goodies; I will drop the goodies and just leave OPM and see what transpires; it could be Kittopia but I am using that for rings on my planets so I hope not.)

(EIDT2: I might as well ask: If I cant get this to work with OPM, does "Texture Replacer" do what ATM does? I have use BOTH before but not with OPM; I think ATM is a better program as it is more configurable; I havent a clue what TR does as far as reducing game memory on MODS; I guess I am back and forth on this all day today...I use TR to PIMP (!) my Kerbals and their SUITS (that file is 200 Megs and takes years to load) ! I looked over there so it does reduce some 'VRAM'...guess I have to try it because as it stands OPM is dead with ATM...not good for me).

(EDIT3: I think Kerbin is gone in OPM...I am going over to their thread and hash some stuff out; maybe in the Kopernicus CFG...I understand and have used ATM and TR together before but not with OPM.)

(Edit4: Both ATM and TR make Kerbin dissappear and no sunlight etc...NO OPM with either ATM or TR; I know Kopernicus takes a copy of the Kerbol System and in the TR thread the author said some portions of ATM were used in his MOD; just thought I would pass this on that there is a common issue (with OPM working). TR was supposed to have worked with OPM so I am goin over there...).

Edit5: Minmus was on top of my ship (reason for no Kerbin)...WARP Timer is broke...yes these problems are part of OPM...I probly go over there and talk about this as well...)

EDIT6: Found the problem with TR/OPM etc...I used my own cfg files so OPM would not load; using ORIGINAL OPM files (and Trans-Kept) all is good; tried to re-add ATM - still a NO-GO. Hyperedit may have something to do with it; I am trying another combination with OPM etc and not having Hyperedit installed...back in a few and I will read the posts...

Edit-Final: So looks like ATM breaks Outer Planets 'however' it is possible that Outer Planets MOD may have an easier fix to get ATM to work; this is only a guess; I will hop on over there and tell 'em the good news. Sorry about ATM here and I dont even know if Texture Replacer is gonna save me memory we shall see. ATM saves me 800 Megs of RAM right off the top; but I want Outer Planets so I may have to pull off some other MODS...sorry to be a bother...

Cmdr Zeta

Edited by Cdr_Zeta
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...