VFansss / mgs2-v-s-fix

Unofficial fix for PC version of Metal Gear Solid 2
Other
562 stars 23 forks source link

Green screen on the projector in Tanker Chapter #26

Closed Lion4K closed 5 years ago

Lion4K commented 6 years ago

Hi, i'm running into some graphical issues, and I wish to know if they are already known or if I'm doing something wrong. I have set the graphics to max settings. If you could some time take a look, I've posted some images on imgur. https://imgur.com/gallery/hmRVj Thanks in advance.

MrMirvC commented 6 years ago

Same issue as everyone :D

VFansss commented 6 years ago

Hi!

Before starting: thanks for reporting me the issues!

Unfortunately is a bug that affects everyone, and is unrelated to the fix: it happen even on the unpatched version. The only way to "fix" it is to play on a machine with Windows XP SP1 (On SP2 is has the bug).

Is even listed on the "Known Bugs" page on the manual.

Unfortunately, fixing that is FAR beyond my abilities: I've contacted a lot of skilled people in that field (Like Durante) but I've not received any reply.

So until I found a way to fix it or I find someone that know how to fix it, is an unfixable bugs :(

Lion4K commented 6 years ago

I see, Thanks for the fast reply. I'm sorry for posting a known bug, I should had read before.

Thanks again!

VFansss commented 6 years ago

Don't worry: the only bad question is the one you didn’t ask!

Have fun :)

Keith94 commented 6 years ago

@Elishacloud Hey, you may be interested in tackling these issues; it seems like your area of expertise. :)

elishacloud commented 6 years ago

It says in the Known Bugs section that this is caused because "some Dx8 api that don't work good on recent OS".

Have you tried using d3d8to9?

I put a number of fixes in there for things like this. Based on my testing it should do everything as good or better than ENB dx8 to dx9 by Boris Vorontsov.

VFansss commented 6 years ago

It says in the Known Bugs section that this is caused because "some Dx8 api that don't work good on recent OS".

I came to that conclusion based on some info find on the web, but honestly I don't 100% sure of what is causing it. The only sure things is that that damned projector is displaying correctly on Windows XP SP2, but not on Windows XP SP3 (and above, off course).

Also, I've tried the d3d8to9 today and unfortunately the issues is still there :(

Lion4K commented 6 years ago

I wonder if the windows xp mode would have this issue. gonna try seeing if it runs under windows 10 pro.

CookiePLMonster commented 6 years ago

Wouldn't this be maybe a missing or a broken codec? Videos displaying full green when they don't decode properly is not uncommon.

VFansss commented 6 years ago

Wouldn't this be maybe a missing or a broken codec? Videos displaying full green when they don't decode properly is not uncommon.

I'm pretty sure is that the case, but I didn't yet found the solution of the riddle.

Sometimes the screen goes black, other times it goes fully green.

I've installed all common codecs, but nothing worked. I've used a DX Wrapper (the game originally work under DX8) and didn't work either.

The only things that I know is that on Windows XP SP2 its working good, but on XP3 and higher it doesn't work anymore. At least is what I've read on several online sources.

I didn't found yet anything that could guide me to the solution. The facts that I'm not good enough to reverse the game engine to understand what could be the culprit is not helping at all! (My field of ability is much further that that!)

CookiePLMonster commented 6 years ago

I'll be starting MGS2HD on PS3 soon, I could also take a look at this issue after I'm done with the game (as I absolutely do not want any spoilers)!

I've been receiving requests to look into this in the past already, so seeing how you didn't come up with a solution yet I may as well take a look. With d3d8to9 it should be fairly easily debuggable, however the fact it doesn't work on XP SP3 either doesn't help - as I only have a XP SP3 virtual machine :(

VFansss commented 6 years ago

Sorry for the late reply!

(as I absolutely do not want any spoilers)!

Is the first time you play the game?

Oh, it will be a wild ride 😄

With d3d8to9 it should be fairly easily debuggable, however the fact it doesn't work on XP SP3 either doesn't help - as I only have a XP SP3 virtual machine :(

I'm not sure on that. I never actually tried on a SP2 machine, but worth a try, honestly. I will do that if I can!

I've been receiving requests to look into this in the past already, so seeing how you didn't come up with a solution yet I may as well take a look.

I would be very pleased 😄

CookiePLMonster commented 5 years ago

I have access to XP SP2 but not XP SP1 - is it confirmed that it works fine on SP2?

VFansss commented 5 years ago

is it confirmed that it works fine on SP2?

I think I've done a mistake!

The only guy that talk about something that resemble a solution is one of the commenter of this video

The guy talk about that the game doesn't have that bug on SP1, but on SP2 it does.

Also, it mention some other little minor bugs (like the sudden black screen on some cutscenes).

The interesting things is that no operative system (windows 7 neither w10) has a compatibility flag for running the game under "Windows XP SP1": they jump from running the game under Win 98/ME to Windows XP SP2.

If I select Windows ME or older the game doesn't even start.

So I don't actually sure that the guy was telling the truth, and the only way is actually trying WinXP SP1 inside a virtual machine.

CookiePLMonster commented 5 years ago

I am obtaining Win2000 SP4, maybe it's going to be fine there!

VFansss commented 5 years ago

Just for curiosity: what virtual machine software are you using?

CookiePLMonster commented 5 years ago

VMWare Player - works great for things like this.

DittoLink commented 5 years ago

is it confirmed that it works fine on SP2?

I think I've done a mistake!

The only guy that talk about something that resemble a solution is one of the commenter of this video

The guy talk about that the game doesn't have that bug on SP1, but on SP2 it does.

Also, it mention some other little minor bugs (like the sudden black screen on some cutscenes).

The interesting things is that no operative system (windows 7 neither w10) has a compatibility flag for running the game under "Windows XP SP1": they jump from running the game under Win 98/ME to Windows XP SP2.

If I select Windows ME or older the game doesn't even start.

So I don't actually sure that the guy was telling the truth, and the only way is actually trying WinXP SP1 inside a virtual machine.

I find out a new way to see Projector screen without installing old version windows. Downgrading the new version quartz.dll to old one(I use this version 6.05.01.0902),and then the Projector screen wii be shown correctly.

Keith94 commented 5 years ago

Can you post a link to that file? Where is it located on file systems?

elishacloud commented 5 years ago

Here is a copy of the dll: quartz.zip

Try putting it in the game folder. Windows normally loads the dlls in the local folder before loading the ones from the System32 folder.

VFansss commented 5 years ago

I find out a new way to see Projector screen without installing old version windows. Downgrading the new version quartz.dll to old one(I use this version 6.05.01.0902),and then the Projector screen wii be shown correctly.

Yesterday I've tried it and...it's WORKING!

You should have a golden statue inside the Konami building...

I have to ask: how you discovered that? I have to know...

What I've done to make it working: I've downloaded the downgraded version ( I use this version 6.05.01.0902 ) of quartz.dll (that, for what I've understand, was a library to render through DirectShow in OLD version of DirectX SDK) and replaced the existing one inside Windows\SysWOW64.

I had to work a little with system permissions on the SysWOW64 folder because is heavy secured ( Is a very good move, however ) and cannot be written even by an Administrator Account ( I had to manually change ownership to Admin account and then set Write permission), but then it worked flawlessly.

I've also tried to replace the quartz.dll inside System32, but it didn't changed nothing: the one inside SysWOW64 is the right one.

Try putting it in the game folder. Windows normally loads the dlls in the local folder before loading the ones from the System32 folder.

Unfortunately I've done several tests but it doesn't working: the game doesn't load the "local" one instead the one inside SysWOW64.

This make a potential fix a serious problem: replacing .dll(s) inside 'Windows' folder isn't a very good behaviour, for the system stability (it could make some other software unstable or even broke it) and also because the fix should change several security permission and isn't...a very cool things to do.

Not to mention that, in that case, it would be 100% flagged as a malware by any serious ( and not serious ) antivirus.

Ok: quartz.dll is a VERY legacy .dll, but...

Also, I don't know who is calling the quartz.dll: the game itself, or the DX8-9 library, so make the caller use a local one could be even infeasible, for what I know about .dll(s)...

But now I have a road to follow, and I will try to make a better solution that doesn't require to do such a mess with the system folder.

I honestly don't have the words to thanks DittoLink: no one in 15 years has ever found a solution to that. Or at least he did, but hasn't posted it online.

Can you add me on Steam? I want to ask you something...

CookiePLMonster commented 5 years ago

Oh God, replacing DLL files inside your system32 might be the single worst idea, you're lucky things didn't crash and burn.

VFansss commented 5 years ago

Oh God, replacing DLL files inside your system32 might be the single worst idea, you're lucky things didn't crash and burn.

And THAT'S why I like to live dangerously!

Jokes aside: I know. Don't try this at home, kids :stuck_out_tongue:

elishacloud commented 5 years ago

I have to agree with @CookiePLMonster on this one. Replacing System32 or SysWow64 dlls is not a good idea. It may work for this game but cause Windows to become unstable.

I will create a wrapper later that will force loading the local quartz.dll file. This way you can copy the quartz file to the local game folder and you will not need to replace system files.

DittoLink commented 5 years ago

I find out a new way to see Projector screen without installing old version windows. Downgrading the new version quartz.dll to old one(I use this version 6.05.01.0902),and then the Projector screen wii be shown correctly.

Yesterday I've tried it and...it's WORKING!

You should have a golden statue inside the Konami building...

No,I just be a normal player. I have to ask: how you discovered that? I have to know...

I try to use Directx Happy Uninstaller to backup DX9.0c on VirtualBox XP SP1 and SP3, and then comparing the difference of DX9.0c between SP1 and SP3. What I've done to make it working: I've downloaded the downgraded version ( I use this version 6.05.01.0902 ) of quartz.dll (that, for what I've understand, was a library to render through DirectShow in OLD version of DirectX SDK) and replaced the existing one inside Windows\SysWOW64.

I had to work a little with system permissions on the SysWOW64 folder because is heavy secured ( Is a very good move, however ) and cannot be written even by an Administrator Account ( I had to manually change ownership to Admin account and then set Write permission), but then it worked flawlessly.

I've also tried to replace the quartz.dll inside System32, but it didn't changed nothing: the one inside SysWOW64 is the right one.

Try putting it in the game folder. Windows normally loads the dlls in the local folder before loading the ones from the System32 folder.

Unfortunately I've done several tests but it doesn't working: the game doesn't load the "local" one instead the one inside SysWOW64.

This make a potential fix a serious problem: replacing .dll(s) inside 'Windows' folder isn't a very good behaviour, for the system stability (it could make some other software unstable or even broke it) and also because the fix should change several security permission and isn't...a very cool things to do.

Not to mention that, in that case, it would be 100% flagged as a malware by any serious ( and not serious ) antivirus.

Ok: quartz.dll is a VERY legacy .dll, but...

Also, I don't know who is calling the quartz.dll: the game itself, or the DX8-9 library, so make the caller use a local one could be even infeasible, for what I know about .dll(s)...

But now I have a road to follow, and I will try to make a better solution that doesn't require to do such a mess with the system folder.

I honestly don't have the words to thanks DittoLink: no one in 15 years has ever found a solution to that. Or at least he did, but hasn't posted it online.

Can you add me on Steam? I want to ask you something...

Sorry,I don't have account on Stream.

CookiePLMonster commented 5 years ago

@elishacloud How do you plan to wrap it? Pre-load quartz.dll on your own so then whatever other DLL depends on it pick the already loaded one instead of loading it by itself?

elishacloud commented 5 years ago

How do you plan to wrap it? Pre-load quartz.dll on your own so then whatever other DLL depends on it pick the already loaded one instead of loading it by itself?

No. Preloading is not a good idea for several reasons. First of all it is not good to depend on load order, as this is not guaranteed by the OS. Also load order is different on different OSes. But more importantly it appears that this dll is loaded via COM which means it will still load the system version even if you preload it.

For my solution I did the following:

  1. Load the system version.
  2. Load the local version.
  3. Hook each of the exported functions in the system version and redirect them (using ASM JMP commands) to the exported functions of the local dll.

Solution listed below: This should allow you to store the quartz.dll file locally rather than overwriting the system one.

Here are the steps:

  1. Download the stub.zip file and unzip one of the DLLs into the game folder, the same folder where the game EXE file is located. I don't have this game so I could not test which DLL is the right one. I suspect it should be one of the following: d3d8.dll, d3d9.dll, dsound.dll, dinput8.dll or winmm.dll. Try each of these one-by-one until you get one that works.
  2. Download the quartz.zip file and unzip this into the game folder, the same folder as step 1 above.
  3. Start the game and enjoy!

Note: This stub creates a stub.log file. If no log file is created it means that you are using the wrong dll in step 1. You can also take a look at the log file to see if the dlls are loaded correctly.

BTW: if you are interested you can see my code check-in for this here: 43b8a7e

VFansss commented 5 years ago

Yesterday I've tried it, and I'm truly happy to say that is working perfectly :)

What I've done: I've used the winmm.dll wrapper because I liked the name, copied the quartz.dll locally and it worked perfectly.

The most important things is that is working perfectly aside:

So I can't truly say that isn't a fantastic solution.

I've tested it only on my Win10 laptop, but the winmm.dll is present also on Win7 so the wrapper should work even on it.

Honestly I can't say that this isn't fantastic: no one in 15 years has posted online a solution for this issues, thanks to you all this big issues has been brilliant solved from one day to another.

I'm slowly working on another version of the Fix so, if Elisha allow me to, I would love to include this inside the fix itself, so we could solve what I think is the last big issue with the PC Version.

Thanks to you, guys 😄

Sorry,I don't have account on Stream.

Can I pay you a beer somehow?

elishacloud commented 5 years ago

Yesterday I've tried it, and I'm truly happy to say that is working perfectly :)

Glad that worked! Since I don't own the game I was not able to test it.

if Elisha allow me to, I would love to include this inside the fix itself, so we could solve what I think is the last big issue with the PC Version.

Yes. All my work is open source. You are welcome to add this solution as is or use my code in your project, whatever you like. You can see my license agreement here.

VFansss commented 5 years ago

I'm proud to say that thanks to DittoLink, Elishacloud and Silent and everyone else, the issue is finally SOLVED.

From the 1.7 version of the fix, the issue should be solved with a dedicated fix, deployed by V's at startup.

If this isn't a success made by the community, frankly I don't understand what it's supposed to be.

A special praise to @DittoLink , that has solved an issue that anyone in 15 years has solved by its own, but thanks to everyone else, that had the patience to find out a solution.

Honestly, I never thought we'd figure out how to solve this problem. But I'm glad I was wrong.

Thanks, guys.

nobleflame commented 2 years ago

Just wondering - on the second area with projectors (the switching projectors) I still get a black screen with no image. This is with the latest V’a fix.

Any idea how I can resolve this?

mirh commented 2 years ago

But more importantly it appears that this dll is loaded via COM which means it will still load the system version even if you preload it.

Changing the registry key with the COM guid could work as well.. But it supposedly didn't use to be like that before windows 8. Do you know what may have changed?

CookiePLMonster commented 2 years ago

Do you know what may have changed?

Paths started being registered as absolute in Win8 AFAIK, on Win7 and before they were relative - hence the current "fix" to update their registration to use a relative path (aka DLL name) again.

mirh commented 2 years ago

At least the string values in the registry were also absolute before (I mentioned the W7 iso in that thread).