crosire / d3d8to9

A D3D8 pseudo-driver which converts API calls and bytecode shaders to equivalent D3D9 ones.
BSD 2-Clause "Simplified" License
881 stars 78 forks source link

[Silent Hill 2] Red-tinted FMVs w/ IGPU & Shader Oddity #24

Closed Polymega closed 6 years ago

Polymega commented 7 years ago

Hello,

With using ThirteenAG/Aero52's Silent Hill 2 Widescreen Fix and activating the d3d8to9 feature I've noticed two visual oddities that come up:

If using integrated graphics all of the FMV cutscenes will be tinted completely red:

untitled

And in one of the in-game cutscenes the lighting/shaders on James' body is cranked up too much (this happens using Nvidia, AMD, or integrated graphics):

f3435fe0-400a-11e7-8ecd-a5f1f81abda1 f3458950-400a-11e7-9726-44546687e718

I intend to do a speedrun playthrough soon of the game to see if there are any other spots that have been affected by the lighting issue when d3d8to9 is enabled.

I'm not sure if this is within the ballpark of fixes for ReShade but would like to address them for posterity.

Thank you

CookiePLMonster commented 7 years ago

According to this post, these issues may be fixed now (with a new widescreen fix): http://gtaforums.com/topic/547841-gtanfsmpother-widescreen-fixes-pack/?p=1069610259

AeroWidescreen commented 7 years ago

The issue we fixed was something else that was causing people to crash and other defects.

There's some odd lighting problems that occur, and I guess the severity of them depends on the type of GPU you're using. I only have a weird issue where all of the NPCs illuminate for a few seconds after turning on the flashlight.

All that's necessary to reproduce this is Ultimate ASI Loader renamed to d3d8.dll, and global.ini in the scripts folder with the below settings:

[GlobalSets] LoadPlugins=1 LoadFromScriptsOnly=1 ForceEntryPointHook=1 UseD3D8to9=1

elishacloud commented 7 years ago

I am not sure if this is related to the issue reported about incorrect lighting and a red tint in the movies but I am getting a "Failed to reassemble shader" error from CreateVertexShader.

Here is the shader after immediately after disassembly:

22964 15:04:48.512 > Dumping translated shader assembly:
    vs_1_1
    dp4 oPos.x, v0, c0
    dp4 oPos.y, v0, c1
    dp4 oPos.z, v0, c2
    dp4 oPos.w, v0, c3
    mov oD0, c14.w
    mov oFog.x, c14.x
    mov oT0, c14.x
    mov oT1, c14.x
    mov oT2, c14.x
    mov oT3, c14.x

// approximately 10 instruction slots used

And here is the shader right before reassembly:

22964 15:04:48.512 > Dumping translated shader assembly:
    vs_1_1
    dcl_position v0
    mov oT3, c0 /* initialize output register oT3 */
    mov oT2, c0 /* initialize output register oT2 */
    mov oT1, c0 /* initialize output register oT1 */
    mov oT0, c0 /* initialize output register oT0 */
    mov oD0, c0 /* initialize output register oD0 */
    dp4 oPos.x, v0, c0
    dp4 oPos.y, v0, c1
    dp4 oPos.z, v0, c2
    dp4 oPos.w, v0, c3
    mov oD0, c14.w
    mov oFog /* removed swizzle */, c1.x /* select single component */4.x
    mov oT0, c14.x
    mov oT1, c14.x
    mov oT2, c14.x
    mov oT3, c14.x

// approximately 10 instruction slots used

22964 15:04:48.512 > CreateVertexShader: Failed to reassemble shader:
D:\Games\Silent Hill 2\memory(13,71): error X2000: syntax error : unexpected float '4'

Notice the line:

    mov oFog /* removed swizzle */, c1.x /* select single component */4.x

It seems to have incorrectly changed c14.x to c1.x /* select single component */4.x. This issue also appears to be in this line of code and looks like the same issue reported in issue #28.

elishacloud commented 7 years ago

I cannot seem to reproduce the lighting and red tint issue. The video and lighting seem ok for me. Maybe it is because I am using an nVidia GTX 790 video card.

However, after looking at the source code for the WidescreenFixes it looks like the lighting problem may be related to the LightingFix setting in the "SilentHill2.WidescreenFix.ini" file.

It appears that the LightingFix modifies the memory of the process, which seem risky to me and may work differently on Direct3D8 vs Direct3D9. I recommend disabling the LightingFix feature and see of the problem goes away.

In the "scripts\SilentHill2.WidescreenFix.ini" file change:

LightingFix = 1

To:

LightingFix = 0
Polymega commented 7 years ago

Hi Elisha,

Thanks for responding. Did you test that same particular cutscene for the lighting bug? I ask because, as far as I can tell so far, that's the only cutscene/area that is affected by this. But this is also one of the most pivotal cutscenes in the game so having that bug there is especially no fun.

I've disabled the "LightingFix" within the SH2 Widescreen Fix and the bug still happens.

It seems to be something within ReShade as I tried an older version of ReShade (from 1+ years ago) and the bug does not happen. My guess is as the code for ReShade evolved it changed something enough to affect this game.

I can't say for certain if this only affects certain video cards but am leaning towards not because it affected Nvidia, AMD, and integrated graphics cards in my tests.

The red-tinted FMVs will only be visible on integrated graphics; Nvidia and AMD cards seem to be fine with that particular bug.

elishacloud commented 7 years ago

I am wondering if the lighting issue is the same one mentioned in #31. Can you check this file and let me know if this solves the lighting issue.

Note: the red tint issue is something else. That needs to be looked at separately.

Polymega commented 7 years ago

Hi Elisha,

I'm sorry for the delay but I'm very happy to say that fixed the problem! Thank you for your time and ingeniousness!

May I ask one last request? I don't know if this should be asked at all; asked here; or made into a new ticket; but WineD3D For Windows (using its D3D9 version/files) seems to be incompatible with ReShade's D3D8to9 and Silent Hill 2.

Could this possibly be looked in to? WineD3D For Windows is crucial to use for this game as it fixes many visual eye sores that Nvidia cards produce for the title. A video example of some of these issues in action (there are some other Nvidia bugs I didn't bother recording for the video):

https://www.youtube.com/watch?v=878F2cbLAXo

When used with ReShade's converter the game simply hangs on launch. So for now, I've been using/telling others to use the ENB Converter in an installation guide I've made. Although I'd love to consolidate these steps by using Widescreen Fix's built-in ReShade D3D8to9 converter instead of the ENB Converter for WineD3D For Windows, if that's possible.

elishacloud commented 7 years ago

Thanks for the follow up. I am glad that this fixed the lighting issue. Basically there were three issues I found:

  1. Dangling Swizzles.

For this I added [\\.wxyz]*(?![\\.wxyz]) in the regex to ensure that it always matched on all swizzles. This line here was change to this:

SourceCode = std::regex_replace(SourceCode, std::regex("(1?-)(c[0-9][\\.wxyz]*(?![\\.wxyz]))"), "$2 /* removed modifier $1 */");
  1. d3d8to9 removed the - modifier on an add arithmetic function.

I fixed this by changing the add to a sub by adding this line here:

SourceCode = std::regex_replace(SourceCode, std::regex("(add)([_satxd24]*) (r[0-9][\\.wxyz]*), ((1-|)[crtv][0-9][\\.wxyz_abdis2]*), (-)(c[0-9][\\.wxyz]*)(_bx2|_bias|_x2|_d[zbwa]|)(?![_\\.wxyz])"), "sub$2 $3, $4, $7$8 /* changed 'add' to 'sub' removed modifier $6 */");
  1. d3d8to9 removed the _bx2 modifier.

This was a harder fix and there is no perfect solution. For Silent Hill 2 the _bx2 modifier was used on all source registers. So after doing some math I believe that removing both _bx2 source registers and adding the _x2 modifier to the arithmetic function would get a closer result to what was intended.

I made this change by adding this line:

SourceCode = std::regex_replace(SourceCode, std::regex("((?![ ])...)(_sat|) (r[0-9][\\.wxyz]*), ([crtv][0-9][\\.wxyz]*)_bx2, (c[0-9][\\.wxyz]*)_bx2(?!,)"), "$1_x2$2 $3, $4, $5 /* removed modifiers _bx2 added modifier _x2 */");

The patch above only has the first two fixes in it. The third fix also seems to improve the lighting (at least I noticed it looked better). Here is an updated file with all three fixes.

As far as the red tint issue and the WineD3D issues they will need to be looked at separately. This fix so far only fixes the lighting issue.

Polymega commented 7 years ago

So, um, won't lie; what you just said is 100% Greek to me. Nonetheless I'm amazed and astounded you could problem solve this issue with the coding language you shared above.

Would you imagine ReShade's D3D8to9 would be compatible to work with WineD3D For Windows' D3D9 file(s) in the future as well?

The third fix also seems to improve the lighting (at least I noticed it looked better). Here is an updated file with all three fixes.

Thank you for this. I ran it and didn't notice any lighting improvements that immediately jumped out to me. Are there particular areas where this would be more evident? I don't doubt it improved lighting aspects as you've said and I'd be tickled pink to see them for myself.

elishacloud commented 7 years ago

Well, I am not the owner of this project and cannot make any promises. But I will take a look at the WineD3D issue when I have time and see if I can figure out what the issue is.

elishacloud commented 7 years ago

I did some testing on the WineD3D issue. Checkout this update here and let me know how this works.

Polymega commented 7 years ago

Unfortunately it still hangs the game on launch (requiring a force quit) when used with WineD3D For Windows. I tested this on a Win7 64 bit machine, if that matters/helps.

elishacloud commented 7 years ago

I have seen this before. but I am not sure it is actually freezing. It just takes several minutes to start up. Have you tried waiting longer? I have seen it take as long as 4 minutes. This happened once on my computer but now it no longer happens. It took about 1 minute the first time. Let me see if I can reproduce this on Windows 7.

Polymega commented 7 years ago

You totally hit the nail on the head: Letting it sit for about 1-2 minutes launched the game afterwards. The only thing is the "loading" time stayed the same upon me launching the game four different times. Not the most ideal scenario. Any hunch as to why it hangs up for so long?

elishacloud commented 7 years ago

I still cannot really reproduce this issue on either of my computers. But on one system it took around 20 seconds to load the game.

Also, I found an issue with the way d3d8to9 handles GetAdapterModeCount and EnumAdapterModes. Each time the game calls these APIs d3d8to9 calls thousands of Direct3D9 APIs. This happens several times at the beginning of Silent Hill 2.

The ENB Converter handles this by caching the results of the API on the first run and then using that cache the rest of the time. I tried the same thing with d3d8to9 and it decrease the loading time on my system down to around 2 seconds. Let me know how this one works for you.

HerMajestyDrMona commented 7 years ago

Slow loading time might be caused by a running Antivirus. I had a similar problems when I was testing Indiana Jones game. Bitdefender Total Security Active Threat Control was causing those issues, and sometimes was even crashing game on start. It usually isn't d3d8to9 nor WineD3D problem, but third party software that is running on system. I would recommend to test how it behaves with all programs disabled / some services stopped.

Polymega commented 7 years ago

That's the ticket Elisha!!!

Loads within a small handful of seconds now! Damn you guys are so damn smart/impressive with all of this!

@elishacloud do you have a PayPal/donation address I can send a small thank you tip to?

Should there be no issues/concerns with caching the API results for ReShade as a broad update for the project? GitHub's site/interfaces are still fairly foreign to me but if/when @crosire implements these changes how would one know/be notified of the newest, public release for this?

elishacloud commented 7 years ago

Great! I am glad this worked for you. I have created an updated pull request here. When this pull request has been merged into the project I will make sure this thread is updated.

BTW: I don't need any donations. One of my hobbies is getting older games to work on newer OS's. Checkout my project here. Also, I am using this project to learn Direct3D and C++. I am learning a lot by all these issues. :)

elishacloud commented 7 years ago

jdkubiak, the WineD3D code fix has just been merged in the project. The only item left on this thread is the rd tint issue with the video. I did notice that there is no red tint when using the WineD3D dll's.

Polymega commented 6 years ago

Sorry again for the delay; busy, busy week at work.

So you're the creator of DxWrapper! Cool!! Thank you for everything you've done both here and for your own project. :)

And thank you more so for helping the Silent Hill community as you've done. I love the fact you love doing this to better your skill set; your ambition is equal parts admirable and awesome!

@ThirteenAG 's Ultimate ASI Loader (UAL) uses a built-in version of ReShade's D3D8to9 converter that can be switched on and off. So continuing on with my ignorance of how GitHub works: Can I direct ThirteenAG's attention to the merger you specified as the updated source code for him to use in his UAL?

Edit: Oh, and asking out of general curiosity: Are these pull requests/mergers reflective on the .dll download page as the project is updated? Or is that download manually updated during each significant update?

crosire commented 6 years ago

@jdkubiak No, I have to update that download manually, which hasn't happened yet. I guess it would make sense to make use of https://github.com/crosire/d3d8to9/releases instead though and use a build server to automatically compile the DLL on every source code modification.

elishacloud commented 6 years ago

You can have @ThirteenAG just pick up the latest code from this repository and add it to his Ultimate ASI Loader project. Then once he makes a new release it will have all the changes needed for Silent Hill 2.

ThirteenAG commented 6 years ago

I'll update submodule a bit later, no need to worry about that.

Polymega commented 6 years ago

@elishacloud May I ask for your expertise once more?

There's a flashlight bug that has popped up in the game now when using ReShade in conjunction with WineD3D For Windows' D3D9 files. Please see the video below:

https://youtu.be/6fGhMyrs5mY (Sorry for the typo in the video's caption.)

WineD3D For Windows is a crucial package for fixing visual bugs for Nvidia users in the game and practically must be used as a result. As mentioned in the video, this issue doesn't occur when using ENB Converter + WineD3D For Windows so I'm thinking (hoping) an adjustment in ReShade would fix it the same?

Some possibly important back story about the flashlight and this game: The flashlight in the vanilla version of this game was inherently bugged. When on, it would ALWAYS illuminate NPCs/items behind James. The only way to fix this back-in-the-day was to disable vertex shaders but doing so compromised the flashlight's visual quality drastically in the process.

Aero_ from the Widescreen Fix projects made a fix to this bug that also retains vertex shading (thus preserving the flashlight's beautiful per pixel lighting).

Any thoughts on the matter?

This bug has also been reported by another user: https://github.com/ThirteenAG/WidescreenFixesPack/issues/254

elishacloud commented 6 years ago

@jdkubiak, Ok, I will look into this. Though it may be a little while before I will have a chance to work on this.

It would be great if you could get a link to change that Aero_ made that fixed this.

Also can you could tell me exactly how to get to that location in the game?

AeroWidescreen commented 6 years ago

@elishacloud All we did was add 00000010 to a few pointers. I don't think this is the same problem, but I'm no expert on any of this. Use LightingFix = 0 to disable it if you're using the widescreen fix.

https://github.com/ThirteenAG/WidescreenFixesPack/blob/master/source/SilentHill2.WidescreenFix/dllmain.cpp#L453-L456

The two memory addresses in the comments are for the no-cd v1.1 "gimpsRus" exe.

Polymega commented 6 years ago

Thank you for looking into this once more @elishacloud !

Also can you could tell me exactly how to get to that location in the game?

Absolutely! Download this save folder for the game:

http://www.igotaletter.com/temp/sh2pc/Maria_Ending.zip

Copy "Folder 1" from the archive to the "\data\save" folder in your game's directory. Load up the game and choose the first save labeled "Hospital" from the list.

elishacloud commented 6 years ago

Thanks! I was able to reproduce the problem.

elishacloud commented 6 years ago

Ok, I think I figured out the issue. This looks like it might be a bug in Silent Hill 2 and not in d3d8to9. Try this one and let me know how it works.

This is a pretty bad hack. I literally hard coded the pixel shaders in this one. I will see if I can find a better fix for this later.

Polymega commented 6 years ago

I loaded up several random save points/locations and didn't see any issues! You are bloody brilliant, Elisha. Wow...

Very excited to see it cleaned up/optimized to your standards. With this and @AeroWidescreen working on a better noise filter for the game SH2 PC is now 99% perfect.

Question: Do you think implementing soft shadows would ever be feasible for this game and something within your skill set to do? If you think it is, let me know and if you'd be interested in looking into this as I would spread the word around about what you'd be trying to do and get other fans to donate to your cause. This would probably be one of, if not the, hardest mods to do for the game so compensation is absolutely a requirement for such a major task/time commitment.

Oh, PS @AeroWidescreen : Check your email when you have a moment, please.

elishacloud commented 6 years ago

Well, it looks like I spoke too soon. I found the issue with d3d8to9. It was a pixel shader change I made #32 to fix lighting issues. I guess I was a bit over zealous in that change.

This updated d3d8to9 file here should fix the issue properly. I will add a pull request for this.

As far as the soft shadows I think that is a bit beyond what I could do. I was primarily able to fix this since there was a working version and I could reverse it to figure out what was wrong. Building something new like that is still a bit beyond me. I might look into it when I have some free time. But don't expect anything soon.

crosire commented 6 years ago

Closing this issue since the original bug was fixed a while ago.

Polymega commented 6 years ago

Thank you all for your wonderful support.

Polymega commented 6 years ago

Oh, and sorry for the delay on this @elishacloud --just got back home--but your second-revised .dll from last night also worked like a charm. :)

AeroWidescreen commented 6 years ago

Very excited to see it cleaned up/optimized to your standards. With this and @AeroWidescreen working on a better noise filter for the game SH2 PC is now 99% perfect.

Yup, we're almost there. We just need to replace the audio and fix that annoying map problem. Thanks for the email by the way, always appreciated.

As far as the soft shadows I think that is a bit beyond what I could do. I was primarily able to fix this since there was a working version and I could reverse it to figure out what was wrong. Building something new like that is still a bit beyond me. I might look into it when I have some free time. But don't expect anything soon.

Maybe looking at SH3 could help? It has soft shadows, and I believe it uses the same engine. Strangely I couldn't figure out how to change the shadow resolution in SH2, despite being able to do so in SH3.

Polymega commented 6 years ago

I feel confident some confidante will come out of the shadows with an audio fix for the game in time. That certainly seems doable if we can just get started in the right direction.

While no one prefers stretched images I personally am not all that bothered by them in order to fix the map issue. Although just like you I'd love and hope a solution shows it's head for it one day.

Does SH3 PC run on DirectX 8 like SH2 PC or is it on DirectX 9? If 9 that could explain how they got soft shadows. I also know SH3 is very clever in that it uses cel shaders to make its shadow effects with very impressive results (for its time).

AeroWidescreen commented 6 years ago

Does SH3 PC run on DirectX 8 like SH2 PC or is it on DirectX 9? If 9 that could explain how they got soft shadows. I also know SH3 is very clever in that it uses cel shaders to make its shadow effects with very impressive results (for its time).

It uses d3d8.dll just like SH2, that's as much as I know.

Polymega commented 6 years ago

It uses d3d8.dll just like SH2, that's as much as I know.

That's good to hear! (Haven't been home to check myself.) There's always that small sliver of hope for the future, then. :)

Oh, and @AeroWidescreen , before you edited the post something to consider using that method for zoom scaling: Would it affect ALL overlaid 2D images or could you tell it which ones to zoom in on?

For example: Only zoom for the map and Eddie bowling scene fade-to-black? But if it would affect all overlaid images then it would definitely crop the buttons while in the inventory screen or options menu, for example.

elishacloud commented 6 years ago

@jdkubiak, what is the audio issue with Silent Hill 2? Also can you explain the soft shadows request in bit more detail?

@AeroWidescreen, How did you create soft shadows in Silent Hill 3?

AeroWidescreen commented 6 years ago

@elishacloud I didn't create soft shadows in SH3. It already exists in the vanilla game. I was suggesting that maybe you could learn how that works and apply the same method to SH2. Sorry, I must've confused you with the shadow resolution stuff. I'm just saying my own shadow related research hasn't led me to anything in SH2.

@jdkubiak You're too quick. It would only apply to the map when you pressed a button to zoom in, just like it normally does, but the way the zoom is achieved would be different to avoid the pillarboxing. I edited my post so we can keep the discussion focused on soft shadows.

Polymega commented 6 years ago

what is the audio issue with Silent Hill 2? Also can you explain the soft shadows request in bit more detail?

I'd be happy to! First, if/when you have a spare 25 minutes I'd strongly recommend watching this video that breaks down the differences between the main releases of SH2 for various platforms: https://www.youtube.com/watch?v=nna2yt1c9gI

In regards to the audio: All versions of SH2 except for the PS2 version have compressed the audio files into a lossy format. This is further explained here: https://www.youtube.com/watch?v=nna2yt1c9gI&t=403

And while this situation is less than ideal the tone and pitches for the audio files have also changed during the conversion. You can hear this in action here: https://www.youtube.com/watch?v=8E5Nt8ahZRk

So while typically only audiophiles will be able to hear the reduced bitrate of the compressed audio files everyone can pick up on these tone/pitch differences. It's equal parts strange and silly this happened.

The solution-in-theory then is to somehow extract the sound libraries from the PS2 disc and convert/transpose those files to the PC version. In a perfect world the libraries would have the same naming/file structure conventions so it would hopefully be a straight-foward process of replacing the files. But I don't know if that's the case as I have yet to find a definitive piece of software to extract content like this from a PS2 disc.

But ultimately the end goal here would be to find a way to transplant the PS2 game's sound files into the PC game's folder.

In regards to the shadows: Both the PS2 and Xbox versions of the game utilize soft shadows in the game's world whereas the PC version uses simple, hard edge volumes which results in razor-sharp shadow lines. This reduction in shadow quality not only looks less than desirable but also hurts the game's atmosphere.

You can learn more about the PC's shadows vs. consoles here: https://www.youtube.com/watch?v=nna2yt1c9gI&t=836

And in the same video they discuss more about the soft shadows being used in the PS2/Xbox versions here: https://www.youtube.com/watch?v=nna2yt1c9gI&t=353

And here: https://www.youtube.com/watch?v=nna2yt1c9gI&t=701

Polymega commented 6 years ago

@elishacloud this post is just backstory/context to give a better understanding of why so many fans are passionate in seeing SH2 PC fixed as a whole. Not required reading by any means:

Konami (the game's publisher) has become infamous for grossly mistreating its IP and Silent Hill is no exception. SH2 has never (and probably will never) receive a proper HD remaster/remake. You may have heard of the "Silent Hill HD Collection" for PS3/Xbox 360 which contains SH2 and SH3 being "remastered" but it's anything but...

Keeping in tradition with mishandling their IP Konami's first mistake was giving the task of remastering two of their most beloved titles to Hijinx Studios. Hijinx's previous work includes Karaoke Revolution, TouchMaster, and Frogger Returns. So not only have they only developed shovelware style games but they have never remastered a game before (as opposed to a studio such as BluePoint Games who is known for their masterful work at reverse engineering old games to remaster them).

Konami's second mistake--and boy this one is a doozy--is that they lost the master source code for SH2 so Hijinx Studios received beta code of SH2 to work with.

Needless to say, when the "Silent Hill HD Collection" shipped it was riddled with bugs, glitches, errors, and so, so much more. They inexplicably changed the voice actors for SH2 (with the majority agreeing for the worse) and their attempt at remaking the textures range from a muddied mess to THE cardinal sin of graphic design.

So "Silent Hill HD Collection" is out of the question then to experience SH2 in HD. That leaves us with emulating the PS2 game or enhancing the PC version of the game.

Emulating is certainly a viable option but it is also a very extensive and involved process. From having to extract your own PS2 BIOS to modifying settings to get the game to run properly (and even then there have been reported issues) to having a powerful, stout PC to run PCSX2/SH2 without lag this option leaves the Average Joe out of luck to play this game in HD.

That leaves us with the most logical option: Fixing and modifying SH2 PC to get the game up to modern standards.

Unfortunately, the vanilla PC version of the game is inferior to its console brethren (especially to the PS2 version which I've mentioned some in the post above this one) in numerous ways. But we can consolidate the main issues as such:

But @ThirteenAG and @AeroWidescreen , with the help of other brilliant minds (including you!), have been doing a fantastic, wonderful job addressing many of these issues. Let's go back to the list of issues:

With the insurmountable work and progress done by these fine people the PC version is this close to becoming not only up to standards to its PS2 counterpart, but also surpassing it in many ways with the HD/widescreen enhancements to go along with it.

After being mistreated and figuratively abused by its owner (Konami) for 1.5 decades Silent Hill 2 fans--including myself--have become starry-eyed over the thought of seeing this masterpiece brought up to modern gaming standards. Most households no longer have CRT TVs so playing the game on a PS2 or original Xbox will look awful on these newfangled boob-tubes. Many households don't have high end PCs so emulating the game is out of the question (plus the immense legwork that the average person would have to do to get it running). And the Silent Hill HD Collection... well... we don't talk about that.

mirh commented 6 years ago

Dumping PS2 bios is rock easy once you have an hacked memory card (even better if it's one of those USB-compatible) Also dumping PS2 assets isn't all that sci-fi in many games afaik. Sometimes you don't even need coding at all because the video/sound format is the "standardized" one. And AFAIR, even an intel igp should be enough to get it to run at least in HD.

Anyway, this was all but what I'd be expecting labeled as "audio issue". This is a hellish incubus. You'd need to analyze which audio format games is able to read, then hope somebody already made an encoder for it. (or I guess just straightway adding PS2 coded support to the game? U.u) Kinda pretty bad that sh2fix was merged into WSF, when the widescreen part is just 10% by the end.

Polymega commented 6 years ago

Many people have a personal computer whereas many don't have hacked memory cards, held onto their old PS2 consoles, or have PCs that will run SH2 emulated with 0 frame rate issues. And, if you put yourself in the mindset of more casual gamers, comparing installation steps of SH2 PC vs. SH2 emulation there is a noticeable learning curve between the two. Plus, in my mind, I'm thinking broader accessibility for more people.

You'd need to analyze which audio format games is able to read, then hope somebody already made an encoder for it.

Definitely. The long-step solution would be to extract the audio files from the PS2 disc, convert them to a universal, loseless format such as .wav, then encode/convert them to the format the PC version uses. And, along the way, re-package the audio files in the structure the PC version expects. However...

(or I guess just straightway adding PS2 coded support to the game? U.u)

My hope is the package/file structure is identical between the PS2/PC versions so the matter of replacing the audio files for the PC version would be much more straightforward.

Kinda pretty bad that sh2fix was merged into WSF, when the widescreen part is just 10% by the end.

WSF is just a name. ;) It's what it does that matters the most and I <3 what all these wonderful people are doing for the WSF!

AeroWidescreen commented 6 years ago

Kinda pretty bad that sh2fix was merged into WSF, when the widescreen part is just 10% by the end.

If you're talking about the widescreen fix then I'm not sure what you mean. A typical widescreen fix is made up of resolution, field of view, cutscene, full motion video, and menu modifications. It has all of the above, which makes up the majority of the code. The few non-widescreen related features that have been added were either requested bug fixes (LightingFix), compatibility fixes (SteamCrashFix), or enhancements (PS2CameraSpeed). I'm not sure why that's considered bad, or how any of this relates to the audio problems we're discussing.

mirh commented 6 years ago

I'm talking about this going "inside" WSF rather than the other way around.

elishacloud commented 6 years ago

In Silent Hill 2 most of the audio files are stored in adx or afs. This may also be the same format stored on the PS2 ISO (as this is a common PS2 format I believe). As @mirh says it may be fairly easy to extract from the ISO. I can look at this when I get some time in the next week or so.

However I recommend we take these final issues off this forum as these are not related to d3d8to9. Can you repost them on DxWrapper?

You'd need to analyze which audio format games is able to read, then hope somebody already made an encoder for it.

Not necessarily. Many games use winmm for audio playback. If this game does that you can wrap winmm and use it to play just about any format you want. Check out this ogg-winmm project for an example.

AeroWidescreen commented 6 years ago

@mirh I understand what you're saying. In hindsight I don't think it was the best choice either, but I'm not the one who ultimately makes those decisions. When it comes to adding other features, it's difficult because I want to please people with their requests, but I don't want to anger other people in the process. In the ideal world we could these mods together, like the fog fix or extra options, but that's not always possible. 😞

@elishacloud Thanks for helping with this. I'll join you guys in the other forum and assist how ever I can.