Jump to content

[WIN] KSP to DDS texture converter


Recommended Posts

Hi,

I've just updated to your latest, plus the last post's additions, and checked my exceptions file vs. yours. If your interested, I also have :-

//ContractsWindow - toolbar icon doesn't look right converted

Contracts Window\Textures\ContractsIcon.png

//Scansat - toolbar icons

SCANsat\Icons

//ShipManifest

ShipManifest\Plugins

//MapResourceOverlay

MapResourceOverlay\Assets -nm -nr

//CommunityResourcePack - don't mess with its maps

CommunityResourcePack

// Infernal robotics reworks

MagicSmokeIndustries\Parts\Rework -nm

// ATM cache - we don't want to mess, i think

ActiveTextureManagement

//FinePrint - doesn't like its icons ddsified

FinePrint

// RealChutes - loads its icon manually or by extension

RealChute\Plugins\PluginData\RC_Icon.png

// RCSBuildAid too

RCSBuildAid\Textures

Thanks again for this (and of course sarbian for the DDSLoader) - it speeds up my boot for my main career install hugely, and also got my test install load time down to a manageable level so I'm back doing my mod again - woot.

Timmers

Link to post
Share on other sites

Also, when converting or restoring backups, could you check for the existence of the target file for the output file/rename please? I've had a few times when dealing with updates to mods today where I've re-run the install and got stuck because I've overwritten a folder which has been 'ddsified' and then had to go on a hunt as the converter tool throws a .net framework unhandled exception which (as per usual with dotnet) unhelpfully doesn't actually say what file caused the exception - if the export/revert fails that's fine, but it would be great if your tool let me know where I'd interacted with Mr Cockup.

Thanks,

Timmmers

Link to post
Share on other sites

Action Groups Extended has some hard-coded png files and spams the log file with NullReferenceException.

AGXEd EditorLoadFromNode Fail 10b System.NullReferenceException: Object reference not set to an instance of an object
at ActionGroupsExtended.AGXEditor.EditorLoadFromNode () [0x00000] in <filename unknown>:0

for ModsExceptions.txt:

//Action Groups Extended, looks for a png file (hard-coded)
Diazo\AGExt

Link to post
Share on other sites

Sorry I didn't had time yesterday. I'll do all this today.

@NathanKell: For now, I've only encountered textures in a PluginData folder with NavUtilities, so it's the only mod so far to have an exception for this. I'll add a generic exception to the list to avoid them, just in case.

Thanks everyone!

Link to post
Share on other sites

Tried this a while ago and got a CTD during load. Tried again just now and booted fine.

Both times just ran the program on my gamedata folder.

This a good improvement ;)

After a little testing my ship turns purple when I go fast enough for atmospheric effects.

Is there something in gamedata which is not in the exceptions list that I should not have compressed?

EDIT : I use FAR and DRE, I suspect something there myself as they are the mods that change default atmo behaviour on my install.

Edited by John FX
Link to post
Share on other sites

I have a large problem. I started to get this in my crash log after started to use DDS texture.

Shader 'AtmosphereFromGround': fallback shader 'None' not found

(0x01C8D738) (KSP): (filename not available): AgPmEventLoggingEnabled + 0x16a0b8

The problem is when I am landing on mun. I have trade landing manual or whit hyperedit. When I get close to the planet “mun†ksp crashes and I get the error message in the crash log.

Link to post
Share on other sites
I was bored today, so I converted the converter to C# and uploaded it to github: https://github.com/Telanor/DDS4KSP. Release is here. I did some light testing of it and it seems to work properly, but there might be some issues I missed, VB is a strange language...

I'm getting an exception when I start the C# port of this app. I tried building locally and I get the same in the debugger. See below for the exception detail :-

************** Exception Text **************

System.TypeInitializationException: The type initializer for 'DDS4KSPcs.ImageManager' threw an exception. ---> System.BadImageFormatException: is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)

at DDS4KSPcs.ImageManager..cctor()

--- End of inner exception stack trace ---

at DDS4KSPcs.ImageManager.Init()

at System.Windows.Forms.Form.OnLoad(EventArgs e)

at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

at System.Windows.Forms.Control.CreateControl()

at System.Windows.Forms.Control.WmShowWindow(Message& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************

mscorlib

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.5477 (Win7SP1GDR.050727-5400)

CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll

----------------------------------------

DDS4KSPcs

Assembly Version: 1.0.0.0

Win32 Version: 1.0.0.0

CodeBase: file:///C:/Users/x/Google%20Drive/ksp/DDS4KSP/DDS4KSPcs.exe

----------------------------------------

System.Windows.Forms

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.5468 (Win7SP1GDR.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

----------------------------------------

System

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.5467 (Win7SP1GDR.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

----------------------------------------

System.Drawing

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.5467 (Win7SP1GDR.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

----------------------------------------

************** JIT Debugging **************

To enable just-in-time (JIT) debugging, the .config file for this

application or computer (machine.config) must have the

jitDebugging value set in the system.windows.forms section.

The application must also be compiled with debugging

enabled.

For example:

<configuration>

<system.windows.forms jitDebugging="true" />

</configuration>

When JIT debugging is enabled, any unhandled exception

will be sent to the JIT debugger registered on the computer

rather than be handled by this dialog box.

Link to post
Share on other sites
I'm getting an exception when I start the C# port of this app. I tried building locally and I get the same in the debugger. See below for the exception detail :-

************** Exception Text **************

System.TypeInitializationException: The type initializer for 'DDS4KSPcs.ImageManager' threw an exception. ---> System.BadImageFormatException: is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)

at DDS4KSPcs.ImageManager..cctor()

--- End of inner exception stack trace ---

at DDS4KSPcs.ImageManager.Init()

at System.Windows.Forms.Form.OnLoad(EventArgs e)

at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

at System.Windows.Forms.Control.CreateControl()

at System.Windows.Forms.Control.WmShowWindow(Message& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************

mscorlib

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.5477 (Win7SP1GDR.050727-5400)

CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll

----------------------------------------

DDS4KSPcs

Assembly Version: 1.0.0.0

Win32 Version: 1.0.0.0

CodeBase: file:///C:/Users/x/Google%20Drive/ksp/DDS4KSP/DDS4KSPcs.exe

----------------------------------------

System.Windows.Forms

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.5468 (Win7SP1GDR.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

----------------------------------------

System

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.5467 (Win7SP1GDR.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

----------------------------------------

System.Drawing

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.5467 (Win7SP1GDR.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

----------------------------------------

************** JIT Debugging **************

To enable just-in-time (JIT) debugging, the .config file for this

application or computer (machine.config) must have the

jitDebugging value set in the system.windows.forms section.

The application must also be compiled with debugging

enabled.

For example:

<configuration>

<system.windows.forms jitDebugging="true" />

</configuration>

When JIT debugging is enabled, any unhandled exception

will be sent to the JIT debugger registered on the computer

rather than be handled by this dialog box.

FYI I switched the project in devstudio to build for x86 rather than AnyCPU and the errors cleared and I got this working - not sure if that's of help to anyone, or if it was just me getting this issue.

Link to post
Share on other sites
I'm getting an exception when I start the C# port of this app. I tried building locally and I get the same in the debugger.

Yea the program only works in 32bit mode. Somehow while coding the build mode got flipped back to AnyCPU and I must have uploaded that build. I've updated the release on github so it should work now.

Link to post
Share on other sites

Yep, it's a problem with DX, the executable in OP is compiled for x86 too.

So, the new version is out, I tried to test every mods listed above. Some exceptions has been added, some removed. I still have doubts about some, I'll test those a bit furhter tonight. Let me know if you see anything wrong.

Also a quick bug fix: it should stop throwing exceptions when it tries to replace an existing file: if you're doing a conversion, "ddsified" files are replaced, and if you revert from a backup, it let you decide what to do.

@Telanor: This release is still in VB, but I'll go with your code for the next one (it's WAY cleaner than mine, to say the least). I'll PM you the changes.

@JohnFX: I tested FAR and DRE, but the pink textures sounds like one of DX11's problem. Is this happening with OpenGL or DX9?

@Lennie: Any particular Texture pack? I tested EVE with Better Atmosphere (now the whole "Clouds" folder is skipped during conversion), but it's possible that it comes from a mod I didn't test yet.

Edited by Lilleman
Link to post
Share on other sites

For some strange reason, my C# version crashes when converting some textures, like a 64x64 pure white png file from FTT, saying something about index out of bounds when it calls TextureLoader.FromStream. And yet somehow the VB version converts it just fine... I left in all the dispose calls, I only converted a few of the close/dispose sets into 'using' blocks which should do the same thing. It's really weird...

Link to post
Share on other sites

Regarding the “Shader 'AtmosphereFromGround': fallback shader 'None' not foundâ€Â

I don’t know what plugin that is doing this right now. But I will find out. :)

The new version that you put out. 0.1.7

The is 2 errors in the modsexceptions.txt file.

//CommunityResourcePack
CommunityResourcePack -nn -nm -nr

Its need to be

//CommunityResourcePack
CommunityResourcePack

I don’t know why. But if is not like that you can’t use kerbonite, ore, ,, ,,, ,,,, (or see it in map)

The next problem whit the file is a plugin called. Haystack Continued http://forum.kerbalspaceprogram.com/threads/89920

It´s still works, but all the icons and bottom from it is gone. I have added the folder to the file but it still not works. Have you tested the plugin?

I also think that the plugin ProbeControRoom is not working like it shod. I get some strange reading on the monitors when using the control room. But I will look at it and see how to fix it.

Link to post
Share on other sites

Regarding what I wrote about PobeControlRoom. I don’t think that the problem is in that pluging. I have the some “display†error in IVA. I guess the problem is in RasterPropMonitor. I will look at it later.

Link to post
Share on other sites

Thanks! I've updated the link in OP. If you've got the last version already, you can grab the new exceptions here.

I'll take a look at ProbeControlRoom. I have some exceptions setted for RPM, but maybe I missed one or two... (Also, I need a "Download all mods" button on KerbalStuff...).

Edit: updated to include Haystack.

Edited by Lilleman
Link to post
Share on other sites

I tried this last night, and was very impressed with how quickly KSP now loads. I haven't done any tests to see if I saved memory--since I was using ATM I don't expect a lot of savings--but just from the speed increase alone I call this one a must-have. :)

Link to post
Share on other sites

I don't think these have been added to the list. If they've been mentioned before, oh well....

//MSI Infernal Robotics looks for pngs and complains, but it seems to look in the wrong spot according to the log.
MagicSmokeIndustries\Textures
//NearFutureElectrical looks for hard coded png in Reactor GUI
NearFutureElectrical\Plugins\PluginData\NearFutureElectrical
//RealChute looks for hard coded png
RealChute\Plugins\PluginData

Link to post
Share on other sites

Thanks, I've updated the OP to include some icons I missed with Infernal Robotics. For NearFutureElectrical and RealChute, they should be ignored, since the exceptions list has a generic line for any "PluginData" folder.

The new list can be found here, if you already have the last version.

Link to post
Share on other sites

Does exactly what it says on the box it comes in. Makes the conversion to DDS so easy.

KSP would blow a gasket at 3500MB and 50% loaded using ATM. With TextureReplacer on it's own I'd get to 3200MB-ish and (more or less) stable. This and DDSLoader got me down below 2400MB.

2400MB! And I no longer have to go make a coffee when I start KSP - best guess, loading 50% faster, maybe more.

Link to post
Share on other sites
@JohnFX: I tested FAR and DRE, but the pink textures sounds like one of DX11's problem. Is this happening with OpenGL or DX9?

I`ll give it a go and see. I only tried DX11 to try and get better framerate. I`ll try DX9 and see if that helps.

TYVM

EDIT : Works fine with DX9

Edited by John FX
Link to post
Share on other sites
I`ll give it a go and see. I only tried DX11 to try and get better framerate. I`ll try DX9 and see if that helps.

TYVM

EDIT : Works fine with DX9

FYI I'm also getting the same thing with DX11, however DX11 gives me the lack of crashingness, as all the DDS textures live purely in video memory, so I save over a gig this way - right now seeing as DX9 mode runs out of memory after a while, and OpenGL isn't working reliably for me, so I'm taking the pink ship as a price of entry into the install all the mods business. (though it just got me a funny comment from a co-worker as not only was it shocking pink, but I also had 2 short SRBs attached at the time - shades of

Timmers

Edited by timmers_uk
Link to post
Share on other sites

Someone suggest the argument "-force-d3d11-no-singlethreaded" on DDSLoader's thread, to avoid those glitches (the pink textures during reentry and black textures in SPH are the most noticeable). I gave it a try quickly and it seems to work, but I didn't get these glitches every time, so that need to be confirmed.

Link to post
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...