Jump to content

[WIP] Loading textures only as required


Faark

Recommended Posts

K, will test around a bit and see what i can improve. Even fast VAB browsing could use some improvements... i have to admit :(

I have noticed memory use spikes at each page turn within the VAB, almost as if LOD is allowing the game to load all of the textures for items on that page before purging them down to the placeholder textures.

I'm also curious if there has been any more confirmations that the new version of ATM coexists well with LOD? I may have been a little too quick to report that 400mb savings in my earlier post because it didn't even occur to me that this was in a new save without any debris or ongoing flights, which is probably the source of much of that extra memory. There is still an improvement in the amount of memory used and in the way it handles it.

I would also like to point out that even small savings can add up quite quickly. If a planet texture takes up 40mb, but then you're able to get rid of 10 of them until they are actually seen, you're saving 400mb. Also, wouldn't intercepting planet textures work in the same way as part textures?

Edited by SpacedInvader
Link to comment
Share on other sites

I've tried this twice with no success. I have all the required elements but the game refuses to load. Are there any mods known that this isn't compatible with?

Are you running Texture Replacer? Or any other mod that might mess with the way textures are handled?

Link to comment
Share on other sites

I did both and it still didn't work. I'm going to try with the texturereplacer 1.2.2 see if its the new version or not

My suggestion would be to try is without Texture Replacer at all to see if that does the trick. So far, my experience is that this doesn't love anything that alters textures at all.

Link to comment
Share on other sites

I have 73 itens on my GameData folder. Your mod can be SERIOUSLY useful to me. Still, what dos it do with the textures when they're not immediately needed anymore? Doest it unload it, freeing memory for other things, or does the texture keeps loaded? I'm asking because lately I started to monitor my memory use while playing KSP and I see that memory doesn't seem to get cleaned. I have 6gb Ram, the game loads itself and properly start at 3 or 3.5 gb use and this always get bigger and bigger, until I either close it or it crashes. So, if there's a way to keep memory from getting "flooded", so to speak, I ask: where do I send the check? (AAND I use that lil Large Adress Aware thingy. Without it, KSP doesnt even load with that many mods...)

Edit: Always a bad idea to post the first thing to come to your mind before browsing through the thread. Odds are that someone said exactly the same thing way before you. On the first page. Forth post.

Edited by BadLeo
Link to comment
Share on other sites

BTW Faark, I was thinking if you want to make this thing ready for release before starting further improvements, I'd suggest the following, which I'm hoping are easy modifications:

1: Give it toolbar integration so we can close the window and reopen it on demand

2: Get the info window to stay open beyond when you release the mouse

3: Have better item names than "p:", "l:", etc.

Those are the most basic changes I would think you would need before you could readily move this to the release thread. It's already quite stable (I haven't had a crash since 2.2) and really just set for more improvement in memory handling and maybe compressed textures.

Link to comment
Share on other sites

Hmm... Try loading KSP without RSS.

Is it crashing during loading, or just not wanting to start?

I get all the way to the loading screen, then crash. Logs say its some texture in unrecognised format. No offence to anyone but if it isn't compatible with my own spacesuits or RSS then sadly this isn't for me :( I blame 32 bit unity... *shakes fist @ unity*

Link to comment
Share on other sites

I get all the way to the loading screen, then crash. Logs say its some texture in unrecognised format. No offence to anyone but if it isn't compatible with my own spacesuits or RSS then sadly this isn't for me :( I blame 32 bit unity... *shakes fist @ unity*

Do you get a LOD menu screen during KSP load-up?

Edited by BananaDealer
Link to comment
Share on other sites

I get all the way to the loading screen, then crash. Logs say its some texture in unrecognised format. No offence to anyone but if it isn't compatible with my own spacesuits or RSS then sadly this isn't for me :( I blame 32 bit unity... *shakes fist @ unity*

What mod folder does the log say it's attempting to load at the time of the crash? The LOD log usually says what file it's having a fit with.

Link to comment
Share on other sites

So I worked out from the log that the numbers generated refer to some textures I have that aren't compressed by ATM. Write a couple of configs game loads.

Window now says 0/0 active. Is this right and do I need the window open?

Link to comment
Share on other sites

So I worked out from the log that the numbers generated refer to some textures I have that aren't compressed by ATM. Write a couple of configs game loads.

Window now says 0/0 active. Is this right and do I need the window open?

This is wrong... on loading it should say 0/X loaded, where X = total number of part textures you have in your gamedata folder. It should also run through all of them on the "p:" line once on loading.

As far as the window being necessary, I'm not sure, Faark hasn't really commented about it needing to be open or not for the mod to work.

Link to comment
Share on other sites

So I worked out from the log that the numbers generated refer to some textures I have that aren't compressed by ATM. Write a couple of configs game loads.

Window now says 0/0 active. Is this right and do I need the window open?

Yeah getting 0/0 "alive textures" on your load is wrong...

The p: x/Y and l: x/Y stands for "prepared" and "loaded" textures respectively.

The mod should go through all your textures at the main menu after the game is loaded (I suggest to everyone to wait until that finishes before loading up a game).

It would then go on to prepare and load textures as needed.

But yeah, the mod reading no textures present is strange...

Are you sure you've updated all the prerequisite drivers to their proper, latest versions?

I vaguely remember getting something similar when I mistakenly installed the wrong C++ redistributable...

Link to comment
Share on other sites

I've got all the prerequisite stuff. I got it loading properly but still doesn't work :P LOD doesn't like the v3.1 aggressive ATM, at least not on standard settings anyway. Can load game without it but crashes out of memory while LOD is prepearing textures. Adjusted settings in the ATM config to just compress and still won't load. Tried normal ATM the other day by accident and that didn't work. I did have it working briefly on ATM v2.15 the other day but I had a krakken (turned out to be OLDD conflicting with KSO) got annoyed and fresh installed. Can't remember exactly what I did now :P Like I said earlier its no big deal just hope this is useful de-bug info.

Link to comment
Share on other sites

I've got all the prerequisite stuff. I got it loading properly but still doesn't work :P LOD doesn't like the v3.1 aggressive ATM, at least not on standard settings anyway. Can load game without it but crashes out of memory while LOD is prepearing textures. Adjusted settings in the ATM config to just compress and still won't load. Tried normal ATM the other day by accident and that didn't work. I did have it working briefly on ATM v2.15 the other day but I had a krakken (turned out to be OLDD conflicting with KSO) got annoyed and fresh installed. Can't remember exactly what I did now :P Like I said earlier its no big deal just hope this is useful de-bug info.

Are you sure you're using - Visual C++ Redistributable Packages for Visual Studio 2013 X86 and not X64? Because i had the same problem and i only had the 64bit version installed.

Link to comment
Share on other sites

Hey Green Skull,

if i followed you correctly is the current state that LOD seems properly installed & starts to do some stuff but does crash e.g. on the main menu while preparing textures? There are 3 common causes for such crashes:

- Invalid images or image formats LOD cannot handle

- Other mods messing around with textures LOD wants to "manage"

- KSP actually runs out of memory. LOD isn't really perfect yet in that regard, especially when preparing the individual textures for the first time. My large test install also usually needs one "restart" before it can finish first time preparation.

I would like to have a look at your log files (KSP.log, KSP_data\output_log.txt, GameData\LoadOnDemand\LoadOnDemand.log) to verify what is going on. Also, does this KSP installation load without LOD? Does it load when you temporarily remove the other mentioned mods? (ATM & texture replacer).

Btw, ATM 3.1 aggressive does work nice with LOD on my mostly stock test install, but you have to make sure that LoadOnDemand.dll is placed directly within GameData, since otherwise ATM would start first and would take sole control over textures.

[LOD window]

This is supposed to be a debug only UI an user doesn't have to see in the first place. Sure i can make it possible to show it via LOD's config and slap in the toolbar to re-show the closed window, but there isn't that much info a common player usually would care about, i think. Same for those info button... its main purpose was to write that text you also see on screen into the log file. Do you have an actual usage to know what textures are currently loaded or just find it interesting in general?

Lemme know when you get the DXT compression worked out, because this is freaking amazing.

It wouldn't be very hard, i had sth like that set up while doing early feasibility tests months ago. But i don't see an actual benefit from doing so. The only crash reports i know of are during first time prep and fast VAB browsing. It shouldn't matter at all for both of them (first doesn't have anything to do with compression, second should work on fast browsing as well). Thus i would keep that feature as sth to add once this mod was actually released. Partly because there is enough to smooth/polish anyway.

Link to comment
Share on other sites

Hey Green Skull,

if i followed you correctly is the current state that LOD seems properly installed & starts to do some stuff but does crash e.g. on the main menu while preparing textures? There are 3 common causes for such crashes:

- Invalid images or image formats LOD cannot handle

- Other mods messing around with textures LOD wants to "manage"

- KSP actually runs out of memory. LOD isn't really perfect yet in that regard, especially when preparing the individual textures for the first time. My large test install also usually needs one "restart" before it can finish first time preparation.

I would like to have a look at your log files (KSP.log, KSP_data\output_log.txt, GameData\LoadOnDemand\LoadOnDemand.log) to verify what is going on. Also, does this KSP installation load without LOD? Does it load when you temporarily remove the other mentioned mods? (ATM & texture replacer).

Btw, ATM 3.1 aggressive does work nice with LOD on my mostly stock test install, but you have to make sure that LoadOnDemand.dll is placed directly within GameData, since otherwise ATM would start first and would take sole control over textures.

This is supposed to be a debug only UI an user doesn't have to see in the first place. Sure i can make it possible to show it via LOD's config and slap in the toolbar to re-show the closed window, but there isn't that much info a common player usually would care about, i think. Same for those info button... its main purpose was to write that text you also see on screen into the log file. Do you have an actual usage to know what textures are currently loaded or just find it interesting in general?

It wouldn't be very hard, i had sth like that set up while doing early feasibility tests months ago. But i don't see an actual benefit from doing so. The only crash reports i know of are during first time prep and fast VAB browsing. It shouldn't matter at all for both of them (first doesn't have anything to do with compression, second should work on fast browsing as well). Thus i would keep that feature as sth to add once this mod was actually released. Partly because there is enough to smooth/polish anyway.

DXT is faster in terms of graphics performance (less color data to move around, sample, etc.), so I would seriously consider getting it implemented.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...