[APP+CODE] A (less crude) fix to make X4 more playable on 2GB VRAM systems

This forum is the ideal place for all discussion relating to X4. You will also find additional information from developers here.

Moderator: Moderators for English X Forum

User avatar
albanana
Posts: 17
Joined: Fri, 7. Dec 18, 15:16

Re: [APP+CODE] A (crude) fix to make X4 more playable on 2GB VRAM systems

Post by albanana »

jimbob82 wrote: Sun, 23. Dec 18, 00:46
albanana wrote: Sat, 22. Dec 18, 20:15 Thanks for the feedback :)
I uploaded a new version - you might want to try different settings (e.g. lowering the texture resolution while upping the mesh quality for ships).. If you haven't upgraded your hardware, that is ;)
Nice work on the new settings, I had meant to post back to update that I had to disable settings on the old version in particular for ship exterior and station exterior - with the station settings to bad it was impossible to build them as you were placing invisible modules. New settings dont seem to have the same negative effects. I did get an error when applying settings specifically to 01.cat but the error was preceeded by a successfull write to it (I'll try from fresh at some point to see if it was somthing I did)
Thanks :)
Did you revert the game files (e.g. via Steam or from backups) before applying new settings ?
The program currently doesn't know if it already modified X4's .cat and .dat-files, so if you open it two times and click the "Lower game quality" button you will possibly lower the quality much more than the program displays.
shinral
Posts: 24
Joined: Fri, 17. Jul 09, 00:40
x4

Re: [APP+CODE] A (less crude) fix to make X4 more playable on 2GB VRAM systems

Post by shinral »

not working for me (nvidia 850m 2gb). The game is broken in the same amount of time with or without this fix.
User avatar
albanana
Posts: 17
Joined: Fri, 7. Dec 18, 15:16

Re: [APP+CODE] A (less crude) fix to make X4 more playable on 2GB VRAM systems

Post by albanana »

shinral wrote: Sun, 23. Dec 18, 11:15 not working for me (nvidia 850m 2gb). The game is broken in the same amount of time with or without this fix.
I uploaded a new version (0.5.1), with new default settings that work (for me at least).
If you want you can use Steam to revert your files to vanilla and try again with those :)
letwolf
Posts: 137
Joined: Sat, 8. Dec 18, 16:42

Re: [APP+CODE] A (less crude) fix to make X4 more playable on 2GB VRAM systems

Post by letwolf »

super
jimbob82
Posts: 19
Joined: Mon, 10. Dec 18, 11:54

Re: [APP+CODE] A (crude) fix to make X4 more playable on 2GB VRAM systems

Post by jimbob82 »

albanana wrote: Sun, 23. Dec 18, 09:56 Thanks :)
Did you revert the game files (e.g. via Steam or from backups) before applying new settings ?
The program currently doesn't know if it already modified X4's .cat and .dat-files, so if you open it two times and click the "Lower game quality" button you will possibly lower the quality much more than the program displays.
Yeah I had the files backed up to another folder and copied them over. Not sure what I did (somthing silly no doubt xD) but a re-install fixed it.
Mebisis
Posts: 23
Joined: Thu, 22. May 14, 14:53
x4

Re: [APP+CODE] A (less crude) fix to make X4 more playable on 2GB VRAM systems

Post by Mebisis »

I've 2 problems. I know the procedure which can solve this, for an user, but not for a program.

01.cat : Could not open file to write (check write permissions)
05.cat : Could not open file to write (check write permissions)

:D
Windows 10 ; AMD 3700X; RTX 2070; 32 GB RAM
Alexander Sushko
Posts: 2
Joined: Sun, 18. Dec 11, 10:44
x4

Re: [APP+CODE] A (less crude) fix to make X4 more playable on 2GB VRAM systems

Post by Alexander Sushko »

HELP !!! :evil:

01.cat : Could not open file to write (check write permissions)
05.cat : Could not open file to write (check write permissions)
User avatar
albanana
Posts: 17
Joined: Fri, 7. Dec 18, 15:16

Re: [APP+CODE] A (less crude) fix to make X4 more playable on 2GB VRAM systems

Post by albanana »

Mebisis wrote: Mon, 24. Dec 18, 04:28 I've 2 problems. I know the procedure which can solve this, for an user, but not for a program.

01.cat : Could not open file to write (check write permissions)
05.cat : Could not open file to write (check write permissions)

:D
Alexander Sushko wrote: Mon, 24. Dec 18, 07:03 HELP !!! :evil:

01.cat : Could not open file to write (check write permissions)
05.cat : Could not open file to write (check write permissions)
Hey, I uploaded a newer version.
You may have to open the program as administrator (right-click on the .exe),
depending on where your game is located.
Mebisis
Posts: 23
Joined: Thu, 22. May 14, 14:53
x4

Re: [APP+CODE] A (less crude) fix to make X4 more playable on 2GB VRAM systems

Post by Mebisis »

Same problem in admin mode, so i've use an other computer. Great success :lol:

2h of gameplay, it works fine. :mrgreen:
Windows 10 ; AMD 3700X; RTX 2070; 32 GB RAM
KvantSky
Posts: 8
Joined: Sat, 9. Dec 17, 00:30
x4

Re: [APP+CODE] A (less crude) fix to make X4 more playable on 2GB VRAM systems

Post by KvantSky »

albanana wrote: Sun, 23. Dec 18, 09:48
KvantSky wrote: Sun, 23. Dec 18, 07:57 Exactly what 1/3 of players need... Dear Egosoft, please hire this man)
One question. Will the game be changed to *modified* status? And how I have to reset *modified* status if it will be?
Thanks ;)
That's a good question actually.. Since I use a few mods my game already says "modified".
If anybody encounters that problem, let me know and I will look into it.
I checked) Unfortunately, it will set the game into *modified* status. So, you can update first post with this info. But anyway, thanks for the app!)
User avatar
albanana
Posts: 17
Joined: Fri, 7. Dec 18, 15:16

Re: [APP+CODE] A (less crude) fix to make X4 more playable on 2GB VRAM systems

Post by albanana »

KvantSky wrote: Mon, 24. Dec 18, 17:30
albanana wrote: Sun, 23. Dec 18, 09:48
KvantSky wrote: Sun, 23. Dec 18, 07:57 Exactly what 1/3 of players need... Dear Egosoft, please hire this man)
One question. Will the game be changed to *modified* status? And how I have to reset *modified* status if it will be?
Thanks ;)
That's a good question actually.. Since I use a few mods my game already says "modified".
If anybody encounters that problem, let me know and I will look into it.
I checked) Unfortunately, it will set the game into *modified* status. So, you can update first post with this info. But anyway, thanks for the app!)
Yeah, that's unfortunate.. Will do, thanks!
Miravlix
Posts: 246
Joined: Mon, 13. May 13, 01:14
x4

Re: [APP+CODE] A (less crude) fix to make X4 more playable on 2GB VRAM systems

Post by Miravlix »

It seems like EGOSOFT consider this a game modification, my save can't do ventures after trying to make the game playable with this.

So I can either not play the game or not play with ventures... Game Over.
Alexander Sushko
Posts: 2
Joined: Sun, 18. Dec 11, 10:44
x4

Re: [APP+CODE] A (less crude) fix to make X4 more playable on 2GB VRAM systems

Post by Alexander Sushko »

albanana wrote: Mon, 24. Dec 18, 09:09
Mebisis wrote: Mon, 24. Dec 18, 04:28 I've 2 problems. I know the procedure which can solve this, for an user, but not for a program.

01.cat : Could not open file to write (check write permissions)
05.cat : Could not open file to write (check write permissions)

:D
Alexander Sushko wrote: Mon, 24. Dec 18, 07:03 HELP !!! :evil:

01.cat : Could not open file to write (check write permissions)
05.cat : Could not open file to write (check write permissions)
Hey, I uploaded a newer version.
You may have to open the program as administrator (right-click on the .exe),
depending on where your game is located.
Version 0.5.2 is fine, texture processing took a few minutes. Not visible texture in the construction of the station, the modules that are built are visible.
Thanks for good job :D !!!
NovemberG
Posts: 3
Joined: Wed, 5. Dec 18, 19:45
x4

Re: [APP+CODE] A (less crude) fix to make X4 more playable on 2GB VRAM systems

Post by NovemberG »

Alexander Sushko wrote: Tue, 25. Dec 18, 17:21
albanana wrote: Mon, 24. Dec 18, 09:09
Mebisis wrote: Mon, 24. Dec 18, 04:28 I've 2 problems. I know the procedure which can solve this, for an user, but not for a program.

01.cat : Could not open file to write (check write permissions)
05.cat : Could not open file to write (check write permissions)

:D
Alexander Sushko wrote: Mon, 24. Dec 18, 07:03 HELP !!! :evil:

01.cat : Could not open file to write (check write permissions)
05.cat : Could not open file to write (check write permissions)
Hey, I uploaded a newer version.
You may have to open the program as administrator (right-click on the .exe),
depending on where your game is located.
Version 0.5.2 is fine, texture processing took a few minutes. Not visible texture in the construction of the station, the modules that are built are visible.
Thanks for good job :D !!!

Hello, great idea you had there.

I had the same issue with the write permission, whatever I did (changed folder, changed permissions, admin rights, nothing solved the problem)
So I checked in your code and the raised exception is in fact a file not found exception.

It happens in the DoReduceDDS function, when you assign the img variable.
The function LoadFromDDSMemory returns a system.io.filenotfoundexception for some (all?) textures.

I then unpacked the concerned cat, and the textures were present, so it seems to be an addressing problem rather than a corrupted file.

Unfortunately, my abilities do not allow me to go much further...
Thanks a lot for the work, anyway.
User avatar
albanana
Posts: 17
Joined: Fri, 7. Dec 18, 15:16

Re: [APP+CODE] A (less crude) fix to make X4 more playable on 2GB VRAM systems

Post by albanana »

NovemberG wrote: Fri, 28. Dec 18, 00:39 [...]

Hello, great idea you had there.

I had the same issue with the write permission, whatever I did (changed folder, changed permissions, admin rights, nothing solved the problem)
So I checked in your code and the raised exception is in fact a file not found exception.

It happens in the DoReduceDDS function, when you assign the img variable.
The function LoadFromDDSMemory returns a system.io.filenotfoundexception for some (all?) textures.

I then unpacked the concerned cat, and the textures were present, so it seems to be an addressing problem rather than a corrupted file.

Unfortunately, my abilities do not allow me to go much further...
Thanks a lot for the work, anyway.
Thanks :)
I just uploaded the next version (0.6), which should, amongst other things, fix some (all?) issues where objects were invisible,
as well as provide a more verbose logging output if an exception occured.

I couldn't reproduce the errors you got -
so if you (or anybody who got an error using the program) wants to try again could you copy the log output and send it to me here (or via github if you have an account there)?
NovemberG
Posts: 3
Joined: Wed, 5. Dec 18, 19:45
x4

Re: [APP+CODE] A (less crude) fix to make X4 more playable on 2GB VRAM systems

Post by NovemberG »

Hello,
Just tried the 0.6 and here's the log :

Code: Select all

01.dat:
	Exception occured: System.IO.IOException: Category: NPCs, Path: assets/characters/argon/textures/ar_f_battlesuit_bump-small.gz ---> System.TypeInitializationException: The type initializer for 'DirectXTexNet.TexHelper' threw an exception. ---> System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
   at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
   at System.Reflection.Assembly.LoadFile(String path)
   at DirectXTexNet.TexHelper..cctor()
   --- End of inner exception stack trace ---
   at LOWRES_X4.CatIndex.DoReduceDDS(CatEntry e, TECategory cat, Int64 pos, Int32 levels, Res res) in C:\Data\Projects\2018\LOWRES_X4-master (1)\LOWRES_X4-master\src\CatIndex.cs:line 196
   --- End of inner exception stack trace ---
   at LOWRES_X4.CatIndex.DoReduceDDS(CatEntry e, TECategory cat, Int64 pos, Int32 levels, Res res) in C:\Data\Projects\2018\LOWRES_X4-master (1)\LOWRES_X4-master\src\CatIndex.cs:line 220
   at LOWRES_X4.CatIndex.ProcessTextures(TextureLevels levels) in C:\Data\Projects\2018\LOWRES_X4-master (1)\LOWRES_X4-master\src\CatIndex.cs:line 167
   at LOWRES_X4.MainForm.<>c__DisplayClass4_0.<BtnLowerQuality_Click>b__0() in C:\Data\Projects\2018\LOWRES_X4-master (1)\LOWRES_X4-master\src\MainForm.cs:line 161

Canceled further processing (contact developer ?)
hope it helps.
User avatar
albanana
Posts: 17
Joined: Fri, 7. Dec 18, 15:16

Re: [APP+CODE] A (less crude) fix to make X4 more playable on 2GB VRAM systems

Post by albanana »

NovemberG wrote: Fri, 28. Dec 18, 19:41 Hello,
Just tried the 0.6 and here's the log :

Code: Select all

01.dat:
	Exception occured: System.IO.IOException: Category: NPCs, Path: assets/characters/argon/textures/ar_f_battlesuit_bump-small.gz ---> System.TypeInitializationException: The type initializer for 'DirectXTexNet.TexHelper' threw an exception. ---> System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
   at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
   at System.Reflection.Assembly.LoadFile(String path)
   at DirectXTexNet.TexHelper..cctor()
   --- End of inner exception stack trace ---
   at LOWRES_X4.CatIndex.DoReduceDDS(CatEntry e, TECategory cat, Int64 pos, Int32 levels, Res res) in C:\Data\Projects\2018\LOWRES_X4-master (1)\LOWRES_X4-master\src\CatIndex.cs:line 196
   --- End of inner exception stack trace ---
   at LOWRES_X4.CatIndex.DoReduceDDS(CatEntry e, TECategory cat, Int64 pos, Int32 levels, Res res) in C:\Data\Projects\2018\LOWRES_X4-master (1)\LOWRES_X4-master\src\CatIndex.cs:line 220
   at LOWRES_X4.CatIndex.ProcessTextures(TextureLevels levels) in C:\Data\Projects\2018\LOWRES_X4-master (1)\LOWRES_X4-master\src\CatIndex.cs:line 167
   at LOWRES_X4.MainForm.<>c__DisplayClass4_0.<BtnLowerQuality_Click>b__0() in C:\Data\Projects\2018\LOWRES_X4-master (1)\LOWRES_X4-master\src\MainForm.cs:line 161

Canceled further processing (contact developer ?)
hope it helps.
Looks like you compiled the program yourself ?
The error most likely indicates that DirectXTexNetImpl.dll was not found.

The folder structure containing the .exe of the program has to look like this:

Code: Select all

- LOWRES_X4.exe
- DirectXTexNet.dll
- x64
   |- DirectXTexNetImpl.dll
Both .dll's can be found in the repository as well as the release archives (e.g. LOWRES_X4_0.6.0.zip)
NovemberG
Posts: 3
Joined: Wed, 5. Dec 18, 19:45
x4

Re: [APP+CODE] A (less crude) fix to make X4 more playable on 2GB VRAM systems

Post by NovemberG »

Hello,

You were right, VS did not put the dlls in the x64 folder.

the error was thus different and is likely a conflict between the .net frameworks.
Here's what it shows now:

Code: Select all

Worsening X4's graphics ...
>> Modifying textures is enabled, this can take a couple of minutes.

01.cat:
	Meshes: Modified 5164 entries / removed 404.645 MB / added 41.591 MB

01.dat:
	Exception occured: System.IO.IOException: Category: NPCs, Path: assets/characters/argon/textures/ar_f_battlesuit_bump-small.gz ---> System.TypeInitializationException: The type initializer for 'DirectXTexNet.TexHelper' threw an 
	exception. ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the 
	.NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. 
	See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
   at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
   at System.Reflection.Assembly.LoadFile(String path)
   at DirectXTexNet.TexHelper..cctor()
   --- End of inner exception stack trace ---
   at LOWRES_X4.CatIndex.DoReduceDDS(CatEntry e, TECategory cat, Int64 pos, Int32 levels, Res res)
   --- End of inner exception stack trace ---
   at LOWRES_X4.CatIndex.DoReduceDDS(CatEntry e, TECategory cat, Int64 pos, Int32 levels, Res res)
   at LOWRES_X4.CatIndex.ProcessTextures(TextureLevels levels)
   at LOWRES_X4.MainForm.<>c__DisplayClass4_0.<BtnLowerQuality_Click>b__0()

Canceled further processing (contact developer ?)

 ***************************************************************************** 
                                       DONE.                                   
 ***************************************************************************** 
 
I'll check the microsoft site to see how it's supposed to be solved.
mati140
Posts: 46
Joined: Thu, 15. Jan 09, 20:15
x4

Re: [APP+CODE] A (less crude) fix to make X4 more playable on 2GB VRAM systems

Post by mati140 »

I just logged in to tell OP he's a god and I shall worship him
Miravlix wrote: Tue, 25. Dec 18, 00:00 It seems like EGOSOFT consider this a game modification, my save can't do ventures after trying to make the game playable with this.

So I can either not play the game or not play with ventures... Game Over.
Forget about ventures, in a game as reliant on mods as the X games that feature is DOA anyway. This is far from the only essential mod in this game.

Cheers
mati140
Posts: 46
Joined: Thu, 15. Jan 09, 20:15
x4

Re: [APP+CODE] A (less crude) fix to make X4 more playable on 2GB VRAM systems

Post by mati140 »

NovemberG wrote: Sat, 29. Dec 18, 17:13 Hello,

You were right, VS did not put the dlls in the x64 folder.

the error was thus different and is likely a conflict between the .net frameworks.
Here's what it shows now:

Code: Select all

Worsening X4's graphics ...
>> Modifying textures is enabled, this can take a couple of minutes.

01.cat:
	Meshes: Modified 5164 entries / removed 404.645 MB / added 41.591 MB

01.dat:
	Exception occured: System.IO.IOException: Category: NPCs, Path: assets/characters/argon/textures/ar_f_battlesuit_bump-small.gz ---> System.TypeInitializationException: The type initializer for 'DirectXTexNet.TexHelper' threw an 
	exception. ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the 
	.NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. 
	See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
   at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
   at System.Reflection.Assembly.LoadFile(String path)
   at DirectXTexNet.TexHelper..cctor()
   --- End of inner exception stack trace ---
   at LOWRES_X4.CatIndex.DoReduceDDS(CatEntry e, TECategory cat, Int64 pos, Int32 levels, Res res)
   --- End of inner exception stack trace ---
   at LOWRES_X4.CatIndex.DoReduceDDS(CatEntry e, TECategory cat, Int64 pos, Int32 levels, Res res)
   at LOWRES_X4.CatIndex.ProcessTextures(TextureLevels levels)
   at LOWRES_X4.MainForm.<>c__DisplayClass4_0.<BtnLowerQuality_Click>b__0()

Canceled further processing (contact developer ?)

 ***************************************************************************** 
                                       DONE.                                   
 ***************************************************************************** 
 
I'll check the microsoft site to see how it's supposed to be solved.
OK, I'm having the exact same problem even though I used the binary version.

EDIT: Found a solution, in case anyone else using Win 10 has this problem: right click on each exe/dll file in the program's directory, open properties and check "unblock".

EDIT2: Found another issue, likely an easy fix (will try to fork the code tomorrow) - the program stops upon encountering archive number 10, due to it being empty (likely a dummy for a future dlc). Can be worked around by simply changing their extension, running the program and changing it back. Not sure if it matters though, I don't think the tool touches anything but 01 and 05.

EDIT3: Putting texture settings lower than default causes the app to glitch out with some categories, FX and station exteriors at the least, will investigate further.

Return to “X4: Foundations”