elishacloud / dxwrapper

Fixes compatibility issues with older games running on Windows 10/11 by wrapping DirectX dlls. Also allows loading custom libraries with the file extension .asi into game processes.
zlib License
1.15k stars 82 forks source link

Project I.G.I crashes when i tried to use `Ddraw7to9` #269

Closed programneer closed 1 month ago

programneer commented 2 months ago

When i use dxwrapper and tried to enable Ddraw7to9, the game crashes after initial window creation with error message that it couldn't set clipping window. I tried enabling every single setting in both Ddraw7to9 and d3d9 section, still no luck.

I was the only person to discover this? We never know.

Here's an log file for technical details.

programneer commented 2 months ago

I tried running both Wine and Proton on Arch Linux with exact same config, same issue.

elishacloud commented 2 months ago

I am not sure it is crashing or just exiting early. It seems like dxwrapper was returning an error message to the game and the game could not handle it. It seems like dxwrapper had a error with a flag.

Try this one: dxwrapper.zip

programneer commented 2 months ago

Your fixed version solves that problem, but this time it crashes after trying to start the mission saying that it couldn't get mipmaps.

elishacloud commented 2 months ago

Yeah, this project does not technically support mipmaps. However, I put a hack in that may allow the game to run thinking that mipmaps will work

Try this update: dxwrapper.zip

programneer commented 2 months ago

Now it freezes the game after, again, trying to start the mission without error messages, i don't know what causes that, not even log file says so.

It seems Project I.G.I's engine is a bit too old to work properly on modern computers using these wrappers like dxwrapper.

elishacloud commented 2 months ago

There are a lot of older games that work with dxwrapper. However, this is a 3D game and I am still working on adding support for those. I think I know why it is freezing. Try this update: dxwrapper.zip

programneer commented 2 months ago

Tested on demo version, works like an charm but with somewhat screwed up textures (excluding UI). igi-demo-dxwrapper-screenshot The game somehow doesn't allow me to use discrete GPU and instead uses integrated one which results in poor performance (i'm using laptop). Also when alt-tabbing out and in the game, it crashes with error that wasn't able to flip the surface.

On the full version, it does allow to use discrete one which i previously saw on your previous versions, but crashes with invaild FPU rounding mode error, yet again, starting the mission, possibly an game issue? I'm using Europe version.

elishacloud commented 2 months ago

The reason the textures are messed up is because this build does not support MIPMAPs and I just put a hack in to allow the game to think I support MIPMAPs. I can see this on other games that use MIPMAPs. This is the first game I have seen that requires MIPMAPs though. Can you try disabling them in the game settings?

As far as using a discrete GPU you can enable the GraphicsHybridAdapter option in the dxwrapper.ini file.

The FPU rounding error is seen on other games, but there should be a fix for that. I guess this game checks it at other times. It might be related to a bug with how the game uses DirectSound.

programneer commented 2 months ago

Unfortunately, there is no option in game settings, not even in demo, and changing Graphics detail (Performance Level in demo) one-by-one, it's forced enabled unless someone have to modify the executable itself or make an new ASI/DLL file.

The game doesn't use DirectSound as far as i know, yet i put IndirectSound on it and somehow detected it, but doesn't mean it can use.

FPU rounding error is NOT caused by the lack of mipmaps, i even tried alt-tabbing out and in the game (only in full version, demo is fine) and yet i still get exact same error.

I even tried to use built-in windowed mode igi.exe window but i got "primary surface couldn't update" error, using dxwrapper's one is fine.

Is there any other solutions for all of that?

elishacloud commented 1 month ago

Unfortunately, there is no option in game settings

Ok, I will need to add full support for MipMaps for this game.

FPU rounding error is NOT caused by the lack of mipmaps

Yes, that is caused by some other error in the game, I assume.

One thing you could try is to just enable DDrawCompat rather than dd7to9.

elishacloud commented 1 month ago

@programneer, I added partial MipMap support into this build. It should fix most or all of the messed up textures. Take a look at let me know how it works.

Here is the build: dxwrapper.zip

programneer commented 1 month ago

Tested on demo, still broken. Disabling dd7to9 and using DDrawCompat only displays gray screen but using DDrawCompat21 or below fixes that, happens on both demo and full version. Tested on full version with dd7to9 instead, still the same error message.

elishacloud commented 1 month ago

I added full support for MipMap. If this does not work, you can play around with the following options: HandleExceptions, SingleProcAffinity and DdrawEmulateLock. One or more of these options may help.

Here is the latest build: dxwrapper.zip

programneer commented 1 month ago

This time, it immediately gives me an FPU error at startup on either of these versions with dedicated GPU, and neither of these options don't work, maybe caused by the latest version of NVIDIA driver?

However, when i swapped back to integrated, both of them have blit surface error at starting the mission. Seems random to me.

programneer commented 1 month ago

You know what? I'm closing as this seems near-impossible to fix anyway.