Jump to content

[WIP] Loading textures only as required


Faark

Recommended Posts

Thanks for the quick answers!

I've removed ATM and installed LOD. After a very long "frozen" state of the loading screen while processing MM patches (which usually occurs, but is shorter), I got something like "Load on demand encountered a problem and was disabled. The requested feature is not implemented." No log file in GameData\Loadondemand, but this in KSP.log:

[LOG 21:50:00.666] LoadOnDemand:

[EXC 21:50:00.669] ArgumentException: Getting control 6's position in a group with only 6 controls when doing Repaint

Aborting

[LOG 21:50:01.265] LoadOnDemand:

[EXC 21:50:01.265] ArgumentException: Getting control 6's position in a group with only 6 controls when doing Repaint

Aborting

[Edit] OK, seems I had only vcredist_x64 installed, installing x86 seems to have fixed that issue.

Edited by Korb Biakustra
Link to comment
Share on other sites

@Korb Biakustra

Keep ATM. Its great for textures LOD can't handle. But make sure it is ATM version 3 or above. "The requested feature is not implemented." usually means one of the requirements listed in the first post is missing (a bad message, will be improved with the next version). But the current log would interest me as well. KSP.log isn't very informative, please have a look at or upload KSP_Data\output_log.txt.

Link to comment
Share on other sites

I edited my post the minute you replied. :)

I've installed ATM back, up to date. The game is still loading. It's not frozen, but the loading is VERY long now. I think I launched it like 25 min ago (usually it takes about 2 min to load).

First time loading with ATM takes a long time. Next time will be faster than original was.

Link to comment
Share on other sites

Ok had a problem that I thought was LOD, but turned out to be a botched module manager config file that got saved instead of reverted for some reason. I was going to delete this, but it occurred to me that similar reports have been put here about how LOD just isn't working for them, so maybe if this pops up again, a suggestion could be to review any recent module manage config changes to make sure they work correctly.

Ok, so I have a really strange issue that suddenly cropped up... LOD has just stopped working altogether. I've not changed anything since my last successful run of the game, and my computer has just sat at home turned off while I was at work. Now when I try to launch the game, the loading screen happily cruises up to an OOM error without even slowing down and when I check the LOD log, I'm greeted with a single line reading:

Logging Started at 5/24/2014 3:04:37 AM (Async)

And absolutely nothing else. I've tried deleting the LOD folder to have it recreated, reinstalling the DLL, and even rebooting the computer, but all to no avail. Any thoughts?

EDIT: Ok, so searching through the output_log.txt, I found this series of errors in relation to LOD which are followed almost immediately by a similar one related to ATM:



(Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 53)

NullReferenceException: Object reference not set to an instance of an object
at UrlDir+.MoveNext () [0x00000] in <filename unknown>:0

at UrlDir+
.MoveNext () [0x00000] in <filename unknown>:0

at System.Collections.Generic.List`1[UrlDir+UrlConfig].AddEnumerable (IEnumerable`1 enumerable) [0x00000] in <filename unknown>:0

at System.Collections.Generic.List`1[UrlDir+UrlConfig]..ctor (IEnumerable`1 collection) [0x00000] in <filename unknown>:0

at GameDatabase.GetConfigs (System.String typeName) [0x00000] in <filename unknown>:0

at LoadOnDemand.Logic.Startup+<processAndGetInternals>d__a.MoveNext () [0x00000] in <filename unknown>:0

at LoadOnDemand.Managers.InternalManager.Setup (IEnumerable`1 data) [0x00000] in <filename unknown>:0

at LoadOnDemand.Logic.Startup.Awake () [0x00000] in <filename unknown>:0
UnityEngine.GameObject:Internal_AddComponentWithType(Type)
UnityEngine.GameObject:AddComponent(Type)
AddonLoader:StartAddon(LoadedAssembly, Type, KSPAddon, Startup)
AddonLoader:StartAddons(Startup)
:MoveNext()

(Filename: Line: -1)

AddonLoader: Instantiating addon 'WorkQueue' from assembly 'LoadOnDemand'

(Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 53)

AddonLoader: Instantiating addon 'ConfigManager' from assembly 'ModuleManager.2.1.5'

(Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 53)

NullReferenceException: Object reference not set to an instance of an object
at UrlDir+.MoveNext () [0x00000] in <filename unknown>:0

at ModuleManager.ConfigManager.Update () [0x00000] in <filename unknown>:0

at ModuleManager.ConfigManager.Awake () [0x00000] in <filename unknown>:0
UnityEngine.GameObject:Internal_AddComponentWithType(Type)
UnityEngine.GameObject:AddComponent(Type)
AddonLoader:StartAddon(LoadedAssembly, Type, KSPAddon, Startup)
AddonLoader:StartAddons(Startup)
:MoveNext()

(Filename: Line: -1)

AddonLoader: Instantiating addon 'ToolbarManager' from assembly 'Toolbar'

(Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 53)

AddonLoader: Instantiating addon 'ActiveTextureManagement' from assembly 'ActiveTextureManagement'

(Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 53)

NullReferenceException: Object reference not set to an instance of an object
at UrlDir+.MoveNext () [0x00000] in <filename unknown>:0

at UrlDir+
.MoveNext () [0x00000] in <filename unknown>:0

at GameDatabase.GetConfigNodes (System.String typeName) [0x00000] in <filename unknown>:0

at ActiveTextureManagement.ActiveTextureManagement.PopulateConfig () [0x00000] in <filename unknown>:0

at ActiveTextureManagement.ActiveTextureManagement.Awake () [0x00000] in <filename unknown>:0
UnityEngine.GameObject:Internal_AddComponentWithType(Type)
UnityEngine.GameObject:AddComponent(Type)
AddonLoader:StartAddon(LoadedAssembly, Type, KSPAddon, Startup)
AddonLoader:StartAddons(Startup)
:MoveNext()

(Filename: Line: -1)
LoadOnDemand: Device: Direct3D 9.0c [nvd3dum.dll 9.18.13.3221]

Is it possible I have a corrupt install?

EDIT: So I redownloaded and reinstalled with no improvement. I've run dxdiag, which reports there are no issues, so I'm getting a little concerned something worse is going on here. Any thoughts?

EDIT2: Just realized what's concerning me most isn't showing up here, so here's a screenie:

i9zOXDM.jpg

I've never seen characters like those show up in a KSP error log, so I'm not sure what they could be.

Edited by SpacedInvader
Link to comment
Share on other sites

First time loading with ATM takes a long time. Next time will be faster than original was.

That's right, I forgot about that!

What do "Ref all" and "GC" stand for, in the interface? The GUI is not very clear to me to be honest, it would perhaps deserve a little legend in the first post! :P

[Edit] Just tried to go in the VAB, several parts were showing these purple buggy textures, and others were missing details even after waiting a few seconds. I tried "ref all", assuming it would perhaps try to refresh all textures, but it crashed the game.

output_log.txt file is here. It is really huge; I'm using a lot of mods so I guess it's related.

Edited by Korb Biakustra
Link to comment
Share on other sites

That's right, I forgot about that! However, even subsequent loadings have been extremely long, way longer than before installing LOD.

What do "Ref all" and "GC" stand for, in the interface? The GUI is not very clear to me to be honest, it would perhaps deserve a little legend in the first post! :P

[Edit] Just tried to go in the VAB, several parts were showing these purple buggy textures, and others were missing details even after waiting a few seconds. I tried "ref all", assuming it would perhaps try to refresh all textures, but it crashed the game.

output_log.txt file is here. It is huge, but I'm using a lot of mods.

"Ref All" fetches all the textures you have, so yeah it's gonna crash the game for you if you're running close to the memory limit.

I'm not quite sure what "GC" means but it seems to clear the loaded/prepared textures every time I press it...

As for the purple/missing textures- It takes time for the mod to load up and prepare all the required textures.There's a little thing in the middle o your screen that tells you how many textures are getting loaded. If that amount gets quite large it can take a significant amount of time, or crash the game...

Link to comment
Share on other sites

"Ref All" fetches all the textures you have, so yeah it's gonna crash the game for you if you're running close to the memory limit.

I'm not quite sure what "GC" means but it seems to clear the loaded/prepared textures every time I press it...

As for the purple/missing textures- It takes time for the mod to load up and prepare all the required textures.There's a little thing in the middle o your screen that tells you how many textures are getting loaded. If that amount gets quite large it can take a significant amount of time, or crash the game...

GC stands for Garbage Collector that is the code cleaner that shall free some memory for new access, but the unity GC is well, call it dump it only gives you a very limited part back of the used memory.

Link to comment
Share on other sites

Also, the purple textures should eventually be replaced by the correct ones. Seeing these usually means that you've jumped into the game before LOD has finished prepping all of the textures its going to control (that window at the main menu that says its prepping textures). A best practice I've found is to let it fully prep everything before even trying to enter into your game.

Link to comment
Share on other sites

Thanks for your answers. However I don't understand why I get these textures errors, because I did wait for the textures to be loaded. When reaching the main menu, I wait for LOD to load 342/342, then load my save, wait a bit at the Space center, enter the VAB, wait for the central window to state that all textures have been loaded (34/34), and then I still get parts like this:

1Cgy1uhl.jpg

[Edit] Tried to launch that "ship" in the screenshot, but it crashed the game before I reached the launchpad.

Link to comment
Share on other sites

Faark, ist me again, with another question that came up yesterday. One of my colleges is working in Java with an OpenGL Engine ist called GDX or so, but the point is there is the ability to stream textures into the VRAM of the graphicscard.

Do you know anything about that with Unity and C#? I was never so deep into coding for Memory saving and this stuff like you, but I can't remember anything like that.

Link to comment
Share on other sites

Thanks for your answers. However I don't understand why I get these textures errors, because I did wait for the textures to be loaded. When reaching the main menu, I wait for LOD to load 342/342, then load my save, wait a bit at the Space center, enter the VAB, wait for the central window to state that all textures have been loaded (34/34), and then I still get parts like this:

http://i.imgur.com/1Cgy1uhl.jpg

[Edit] Tried to launch that "ship" in the screenshot, but it crashed the game before I reached the launchpad.

Again, pink textures means the mod is still fetching them. There should be a little info box in the centre of your screen, around the vessel name, that tells you how many textures are getting loaded. That and the p (prepared textures) and l (loaded textrues) values on the LoD display should represent that as well.

Since both are at 0, I'm guessing something might be wrong with the LoD cache. Delete the folder called "Load on Demand" in your GameData (keep the .dll with the same name though) to clear it and see what happens.

Link to comment
Share on other sites

Again, pink textures means the mod is still fetching them. There should be a little info box in the centre of your screen, around the vessel name, that tells you how many textures are getting loaded.

Absolutely, but as I said, this info box did load all textures and did report loading was successful (34/34), and then it disappeared! So I guess it got its job done here.

That and the p (prepared textures) and l (loaded textrues) values on the LoD display should represent that as well.

Since both are at 0, I'm guessing something might be wrong with the LoD cache. Delete the folder called "Load on Demand" in your GameData (keep the .dll with the same name though) to clear it and see what happens.

Thanks, I'll try that. :)

[Edit] Same behaviour. What happens is that LOAD prepares 344 on 344 total textures on the main menu, then the count drops to 0/0. Then I load my save game, wait a bit at the Space Center but nothing happens, so enter the VAB, and there "p" will stay at 0/0 while "l" will load textures, as reported by the central infobox below the ship name. It will successfully load 34/34 textures (I'm still on the "Pods" page at this pint), then drop to 0/0 too. I don't see any change in the "Pods" page textures during the process. Then when I change pages, LOD will not do anything anymore; no loaded or prepared textures, no central infobox.

Edited by Korb Biakustra
Link to comment
Share on other sites

Absolutely, but as I said, this info box did load all textures and did report loading was successful (34/34), and then it disappeared! So I guess it got its job done here.

The fact that the "loaded" value is 0 and you have a craft loaded means the mod isn't functioning properly as it will not unload textures of parts that are placed.

Link to comment
Share on other sites

I've never seen characters like those show up in a KSP error log, so I'm not sure what they could be.

Those characters are fine. They are a part of what is supposed to make KSP harder to decompile.

I don't think the actual cause of your issue can be fixed, since its withing KSP code. But LOD will now try to give a warning if there are any exceptions thrown during its startup.

Seeing these usually means that you've jumped into the game before LOD has finished prepping all of the textures its going to control (that window at the main menu that says its prepping textures). A best practice I've found is to let it fully prep everything before even trying to enter into your game.

I hope to improve this with one of the next updates to finally allow playing even though some textures are still in prep. There are still some issues to work around, but it was never intended to make you wait.

[...]

I don't see any better solution available for KSP than what LOD does.

The GUI is not very clear to me to be honest, it would perhaps deserve a little legend in the first post! :P

This UI was where i dumped infos or test features for development and never intended to be seen by users. It will be gone with v3 (unless you mess with the config) and instead there is just some activity info (if there is activity for more than e.g. 3 sec).

About the issue: There was some mod messing around (maybe unloading) a texture thumbnail created by LOD. Not sure what mod, though. The log at least doesn't mention TR doing it. Oh and please disable TR's mipmap generation as well, though it unlikely to cause this particular issue.

Edited by Faark
Link to comment
Share on other sites

This is working like a charm for me:

Mine is a heavily modded game, which reaches 3.1 GB memory at the main menu with ATM Agrressive set up, but with this plug-in I only get 2.3 GB. :sticktongue:

I dont care much about the VAB crashes since one could simply delete the .dll in his building sessions and restore it for flights and missions; I'm actually thinking to keep an alternative KSP game folder just for building, and the standerd one for playing.

Overall performance is noticeable better too!

The only issue I've encountered so far is the loss of transparencies in some textures as this:

4CfuE0A.jpg

If someone could figure out why is this problem appearing this mod would be complete, for me at least.

Edited by PaganoCristo
Link to comment
Share on other sites

This is working like a charm for me:

Mine is a heavyly modded game, which reaches 3.1 GB memory at the main menu with ATM Agrressive set up, but with this plug-in I only get 2.2 GB. :sticktongue:

I dont care much about the VAB crashes since one could simply delete de .dll in hiss building sessions and restore it for flights and mission; I'm actually thinking to keep an alternative KSP game folder just for building, and the actual one for playing.

Overall performance is noticeable bbetter too!

The only issue I've encountered so far is the lost of transparencies in some textures as this:

http://i.imgur.com/4CfuE0A.jpg

If someone could figure out why is this problem appearing this mod would e complete, for me at least.

I concur with the above post. A lot of the cockpits/capsules have lost the transparency of their windows, even when all the required textures are loaded...

I'm talking about cockpit view during flight.

Link to comment
Share on other sites

About the issue: There was some mod messing around (maybe unloading) a texture thumbnail created by LOD. Not sure what mod, though. The log at least doesn't mention TR doing it. Oh and please disable TR's mipmap generation as well, though it unlikely to cause this particular issue.

Can you point me to the exact error in the log file? Perhaps I could see the name of the messed up texture and try to track down which mod may be involved. I'll need that to get a working LOD.

TR's mipmap is now disabled. :)

Link to comment
Share on other sites

This is working like a charm for me:

I'm actually thinking to keep an alternative KSP game folder just for building, and the standerd one for playing.

I tried that; didn't work out too well. At face value, it is simple enough, just copy gamedata folder to a separate install. But, I ended up with some mods crashing LOD entirely, so had to go and find which specific ones were doing so, because it won't do to have any missing parts, as KSP will flummox the ENTIRE craft if just one little part is missing.

It turned out to be a horrible headache, and even drove me away from KSP for a couple of months (spending 90% of your time trying to keep the game from crashing, rather than playing the game does that)

What we REALLY need, is some sort of external VAB program. Some little Java type applet that would use very simple representations of the parts, and would allow you to construct an entire craft outside of ksp. Then load up KSP, load the craft in the VAB, fine tune the part placement and be done with it. Though, admittedly, that would likely be very difficult to program

Edited by Bloodbunny
Link to comment
Share on other sites

Those characters are fine. They are a part of what is supposed to make KSP harder to decompile.

I don't think the actual cause of your issue can be fixed, since its withing KSP code. But LOD will now try to give a warning if there are any exceptions thrown during its startup.

As I mentioned, it seems that LOD was affected by a module manager failure of epic proportions. A single typo in a module manager config actually caused the whole of MM to fail to load properly, which also caused LOD to fail to load properly for some reason. After deleting the offending config, everything went right back to working properly. The reason I kept the post in this thread was mostly just to provide it as a reference in case someone else has a similar problem.

Link to comment
Share on other sites

As I mentioned, it seems that LOD was affected by a module manager failure of epic proportions. A single typo in a module manager config actually caused the whole of MM to fail to load properly, which also caused LOD to fail to load properly for some reason. After deleting the offending config, everything went right back to working properly. The reason I kept the post in this thread was mostly just to provide it as a reference in case someone else has a similar problem.

It would be nice of you to report the problem you found in MM thread, instead of speaking of it in a totaly unrelated thread and hoping it will get solved by magic.

Link to comment
Share on other sites

It would be nice of you to report the problem you found in MM thread, instead of speaking of it in a totaly unrelated thread and hoping it will get solved by magic.

a: I solved the problem on my own, and b: the problem manifested itself in a way that made LOD fail to load, which is something that people often come here to report. As I mentioned in my original post, I had planned on deleting the post because it was related to MM rather than LOD, but because it affected LOD in a way that is often reported here, I kept it for reference.

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