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.17k stars 83 forks source link

[Silent Hill 2] Checklist of Remaining/Wishlist Fixes #9

Closed Polymega closed 6 years ago

Polymega commented 6 years ago

(Note: This thread was made a few days before the creation of the SH2 Enhancements Repository)

I'm doing a play through of Silent Hill 2 again for the Enhanced Audio project and I was making mental notes of the remaining "wishlist" fixes and wanted to post them for posterity purposes.

Noted areas for improvement:

Discussion thread

Fixed!:

Polymega commented 6 years ago

@Bigmanjapan whenever the hanging meat does disappear are there any values that change during these moments when viewing it through a hex editor?

AeroWidescreen commented 6 years ago

@Polymega Thanks for the link, some of the comments were interesting to read. Here's a recent one that stood out:

I last tried this several years ago, and had no luck getting any of it to work with my US PC copy of the game. Now, it's working great, and playing great! I'm shocked at how good it can really look.

It seems some people didn't know about the recent improvements being made until now, and your guide really helps a lot.

@Bigmanjapan whenever the hanging meat does disappear are there any values that change during these moments when viewing it through a hex editor?

I haven't forgotten about this, by the way. Been busy is all. I haven't forgotten about the language selection stuff either.

Polymega commented 6 years ago

It seems some people didn't know about the recent improvements being made until now, and your guide really helps a lot.

I'm very happy to hear that. The guide has succeeded with its purpose then. :)

I haven't forgotten about this, by the way. Been busy is all. I haven't forgotten about the language selection stuff either.

Hey, no worries there, friend. I actually brought this up again because I found this just now while fiddling with the chainsaw SFX a little more:

https://youtu.be/EKwde4nTVqs

Do note I am not asking for this to be fixed or anything. No one would ever notice this thing disappearing that close to the camera's edge (especially as James has free movement here) unlike the hanging meat which is happening in a fixed-camera environment.

Bigmanjapan commented 6 years ago

whenever the hanging meat does disappear are there any values that change during these moments when viewing it through a hex editor?

There are thousands of values being changed at that moment due to all the processes in the game engine. IMO meat is always loaded in from the very beginning of the cutscene. What we see is a camera culling issue which is present due to unnatural FOV.

Hey, no worries there, friend. I actually brought this up again because I found this just now while fiddling with the chainsaw SFX a little more:

https://youtu.be/zY3m9EsQvj4

As you can see, I change camera projection while James stays still and the logs textures load/unload based on the projection value alone. Then I zoom out debug's camera and logs stay loaded all the time, because they probably are fully within camera's culling spread this way.

I also tried increasing back side draw distance with no positive results.

Edit: I remember finding something like camera culling adjustment in Bayonetta https://youtu.be/_0tNde7Ixyw?t=62 but never found something similar in SH2. Maybe the two cameras of those games are too different.

lakeviewhotel commented 6 years ago

I need images of all 3 CDs made via Alcohol120% with "Securom NEW 4/5/7" Datatype option selected.

@Bigmanjapan Just got this "made via Alcohol120%" 3CD images from a friend, I can provide if you still need it.

Bigmanjapan commented 6 years ago

@lakeviewhotel what version? I'm looking for big yellow box NTSC version: http://crimson-ceremony.net/lostreleases/item.php?id=shgame_sh2dc-pc-usa2

And any PAL version excluding UK and French.

Nisto commented 6 years ago

@lakeviewhotel I would also love to have those images, if you don't mind. When reverse engineering, I don't like the idea of looking at a modified executable, because, in the case of No-CD patches, I don't know what may have been stripped away.

Bigmanjapan commented 6 years ago

@Nisto I can share small yellow box NTSC and UK/FRA PAL builds' images if you want them.

lakeviewhotel commented 6 years ago

@Bigmanjapan Think what I've got was the small one, cause the discs were wrapped in black paper sleeves. Didn't know that you've already got this version, すみません!

@Nisto Sure thing! Here is the link: https://mega.nz/#!6WJDwaRR!wfZvmUathLdzW51pVTSQ2vdmpTOxLmBT2GM2gkBpgfQ

AeroWidescreen commented 6 years ago

@lakeviewhotel Thanks for this!

@Polymega It seems with this version of the game some of the image IDs are off by 4. For example, instead of Diary on Roof being 7C, it's 78 (0x7C - 0x4 = 0x78), but then something like the Pyramid Head painting is exactly the same. This causes some of the letterboxed images not to scale to fullscreen.

Do you think there's an image or file missing? Because different exes have no effect.

Edit: Overwriting the entire data folder with the other version of the game fixed it, so something is going on there. Just another thing I need to look into this weekend I guess.

Polymega commented 6 years ago

Hi @AeroWidescreen ,

Do you think there's an image or file missing? Because different exes have no effect.

Are you asking if there's an image/file missing in that particular .exe or overall in the game?

I know for a fact the game has in its files/memory but doesn't use a version of Angela's photograph: https://github.com/ThirteenAG/WidescreenFixesPack/issues/337#issuecomment-332630169

However, it may be worth bringing up again how I found two different versions of the notepad on the table for the clock puzzle from the PS2 disc rip: https://github.com/ThirteenAG/WidescreenFixesPack/issues/375#issuecomment-379924659

I think this is worth mentioning again. I don't know if the PC version has these two different versions because you mentioned how, while there is two versions of A notepad image, it's of the same one but one's slightly less saturated and used in the "memos" section: https://github.com/ThirteenAG/WidescreenFixesPack/issues/337#issuecomment-333335576

I'm not sure what else it could be? If you can give me some more details I'd be happy to help you further!

Also, please check your email, Aero.

Polymega commented 6 years ago

@Aerowidescreen oh, I understand now. You were talking about this in relation to @lakeviewhotel 's rip.

Do you think it was a fluke during Installation?

I emailed you a link to my PC small box Alcohol rip. I can also install my copy on another PC if you'd like? I can then send you my game's "data" folder for comparison or you can tell me what to look out for.

Just let me know how I can help.

AeroWidescreen commented 6 years ago

@Polymega Yeah, sorry if I wasn't clear enough. Maybe it was a fluke. I merged them all into image before installing, so maybe something went wrong there. Again, I'll take a look this weekend. I thought maybe you knew more about this version of the game than I did. Thanks for the email though!

Polymega commented 6 years ago

I was always under the completely non-scientifical impression that the NA and EU copies were the same except for the main menu BG image and font.

AeroWidescreen commented 6 years ago

@Polymega I think you're right, but some of the textures have a small difference in their header. See: https://i.imgur.com/KXimTqr.png <- that's the "Opened Car with Map" for reference.

That's from the SH2 I got from lakeviewhotel, I will try the others later.

Polymega commented 6 years ago

@AeroWidescreen @Bigmanjapan @Nisto @elishacloud Check your emails when you have a moment. I've sent files that may help with any future testing/modding you may do for the game.

AeroWidescreen commented 6 years ago

@Polymega Many thanks. Both EUs have the same image IDs, while both NAs have the same images that are off. I don't think it's a big deal yet. There's a good possibility I can add the other hexadecimals to the existing list and it might not interfere with anything in the EU version. Testing, testing, testing.

Nisto commented 6 years ago

@Bigmanjapan I've got a rip from @Polymega now. Thanks anyway!

@lakeviewhotel Thanks for the upload!

Bigmanjapan commented 6 years ago

@Polymega @lakeviewhotel Thanks for the uploads.

Basically, all PAL builds (UK / FRA / Polish checked) are identical down to a single byte, NTSC big box and small box builds are indentical as well. One can use CD1 from any build (both PAL and NTSC) to emulate protection.

Also, what's an overall stance on James' walking bug on the stair before the final bossfight? If you walk forward, he will stutter at each 2nd-3rd step. Strafing works normally.

Edit: Maria does it too in Born from a Wish on the basement stairs prior to bug hallway.

Polymega commented 6 years ago

Basically, all PAL builds (UK / FRA / Polish checked) are identical down to a single byte, NTSC big box and small box builds are indentical as well.

Nice! This is good to know, especially for @AeroWidescreen 's current research into full screen image addresses.

Also, what's an overall stance on James' walking bug on the stair before the final bossfight? If you walk forward, he will stutter at each 2nd-3rd step. Strafing works normally.

I don't believe that's a bug. I'd need to check the PS2 version but I believe it also does that there.

I think this was the developer's way of simulating stair movement (because you move slower going up stairs in real life and other games do this too) without having to make a new set of animations for the stair climb.

Polymega commented 6 years ago

Also, what's an overall stance on James' walking bug on the stair before the final bossfight?

Yeah, the PS2 version also does this. I always assumed this was intentional by the devs to either simulate walking up stairs or to add a little more suspense before finally meeting Mary/Maria.

But you're right: There's no other staircases in the game that I can think of that also do this...

Maybe it is a bug after all?

lakeviewhotel commented 6 years ago

@AeroWidescreen @Bigmanjapan @Nisto No problem! I've been reading all the threads to catch up with you, you guys are truly amazing! Sadly I know nothing about ASM or the other programming skills, so just hope I can contribute something at least...

Hi @Polymega , I saw your comment here and yesterday I've discovered something new in the HD Collection (XBOX 360), like the high res menu background and savebg pictures (all 1152* 720 px), I'd like to test them or modify but I don't know how to put the them back correctly. I'm using the sh texture explorer 2.1, but I have to resize them before the replacement, the high res texture will be compressed :(

Here's the link of all high res backgrounds: https://drive.google.com/drive/folders/1DYRKCcEPAOWMXQw02cKlL8VJpeyKO9uj?usp=sharing

There's a edited version of savebg2.raw in the PNG folder, I added a background and few filters just to keep the consistency...though I'm not sure.

compare

@Nisto For the audio porting, for example, when I'm extracting bgm_001.xma (bgm_001.adx in PC version) by using xmash 0.8, it gives a .pos file for every riff wave header which is for looping. Is that means something? The sound quality of PS2 version is still better than HD Collection though.

pos


Besides I'm working on a chinese localization for SH2, although there is one now (use d3dhook to insert a new font). But I wanna do it in another way, which means only to add font textures so the other language options can be saved. Thanks to my friend and finally now we can change the japanese .mes files properly.

Sorry for offtopic again. I was almost give up until I found this thread, just want to say thank you for all your hard works and giving me hope.

Polymega commented 6 years ago

Hi @Polymega , I saw your comment here and yesterday I've discovered something new in the HD Collection (XBOX 360), like the high res menu background and savebg pictures (all 1152* 720 px)

This is great! @elishacloud and @AeroWidescreen have discovered breakthroughs in hopefully being able to implement HD static images in the game so these save screens should come in handy!

I'd like to test them or modify but I don't know how to put the them back correctly. I'm using the sh texture explorer 2.1, but I have to resize them before the replacement, the high res texture will be compressed :(

Yes, unfortunately, when using SH Texture Explorer, you have to resize the images. Not only that, but I believe that software also degrades the image's quality even further (beyond just the resizing). If positive results come from Elisha and Aero's research with the HD image mod, we should be able to skip using SH Texture Explorer altogether.

@brunibunny has a way of saving the high res images as DDS format so we won't have to use SH Texture Explorer, either. But, I just check your Google Drive images, and it looks like you already have these particular images saved in DDS format!

In summary: Hopefully in the future we'll be able to use high res images without having to reduce their size/resolution and without having to use SH Texture Explorer. :)

Nisto commented 6 years ago

@lakeviewhotel The PC version already does contain loop information in the BGM .adx/.aix files. The thing is, we wanted to convert the PS2 renditions to uncompressed WAV files, because ADX compression introduces various defects. But it doesn't natively support looped WAV files (except for complete looping, from start to end, which is controlled by the last byte), and I don't think it supports .pos files either (even if it did, all WAV "files" in the game are either concatenated together into one file, or they're part of a virtual filesystem, without companion files and whatnot).

AeroWidescreen commented 6 years ago

@lakeviewhotel Using higher res images requires memory modifications that elishacloud is working on in conjunction with sound improvements. It's been proven possible with only one issue that needs be ironed out. But these images you've extracted are really helpful, especially the save backgrounds!

Bigmanjapan commented 6 years ago

Just curious, in which case that Maria's save background with watery overlay is displayed in HD Collection?

I always thought that watery overlay comes from the well with the first red tablet in the main scenario. And that a player looks at James from the back side of the tablet, just like in SH3 player looks at Heather from the back side of the halo sign. Does it make sense to use background with watery overlay in Born from a Wish if it's the main scenario thing?

Maybe it is a bug after all?

Strangly enough, if you push against the wall, James will run at full speed which is 4 (float). https://youtu.be/bOFoZhcsmus Used in speedrunning: https://youtu.be/qD2s0s7h1QQ?t=404

James/Maria acceleration sh2pc.exe+1BB10A8 (01FB10A8) float

Polymega commented 6 years ago

Strangly enough, if you push against the wall, James will run at full speed which is 4 (float).

Haha, yeah, I used this tactic back when I speed ran the game. If James' body is 45 degrees to the stair/railing he won't slow down.

Although, seeing it again in action, it really does look like it was intentionally programmed this way. Only because he slows down in perfect sync with his own footsteps.

lakeviewhotel commented 6 years ago

@Polymega @AeroWidescreen @Nisto Thanks for replying, I'll stop messing around with the files for now and leave it to you professionals!

I always thought that watery overlay comes from the well with the first red tablet in the main scenario.

@Bigmanjapan Wow I've never thought of this.. now I can't agree with you more. I'll think twice if I do modding again, thank you :)

Polymega commented 6 years ago

@Bigmanjapan

screenshot_20180529-222126

AeroWidescreen commented 6 years ago

Well that's one less thing to worry about, confirmed by Masahiro Ito himself

Bigmanjapan commented 6 years ago

https://youtu.be/tsFSUmSzGiQ

New issue to add?

Polymega commented 6 years ago

https://youtu.be/tsFSUmSzGiQ

New issue to add?

Nice catch on the animation glitch. I guess it happens so quick I've never noticed before. It looks like the monster's model just needs to be rotated 180 degrees while it's dormant on the ground? Maybe a value that has a negative in it instead of a positive? Or vice versa?

But, I did always notice how a pool of blood forms on the Mannequin before it awakens in the PC build. I always thought that was odd...

In fact, I had to Photoshop/edit out the blood for my next, upcoming demonstration trailer:

0001

Also, the specularity of the Mannequin on the PC build is much more pronounced:

sh2pc 2018-05-31 17-48-33

I always wished the specularity could be removed from the monster before obtaining the light. (Basically, tricking the game into thinking the flashlight on the mannequin dress is "off" but this trick only affects the Mannequin monster because when the light is off all monsters have their specularity removed.) I know in the PS2 build the Mannequin has specularity like this while it lays dormant but it doesn't seem near as much. I actually removed it on the upcoming video as well just for nicer presentation purposes:

0002

Would you like to make a ticket and add it to this repository? We have a lot of conversations/testing for all sorts of different things throughout the same thread(s) so it may be better to make more individual tickets to keep track of them all.

Bigmanjapan commented 6 years ago

Would you like to make a ticket and add it to this repository?

Sure. I might try to remove the flicker on the mannequin and the blood stain while I search for animation fix.

Polymega commented 6 years ago

I don't know if it'd help you guys but I extracted my PS2 save files of SH2 to use with PCSX2. You can download them here:

SH2 PCSX2 Save Files.zip

Do note these save files are from the original NTSC release of the game; I don't know if these save files are compatible with later released versions.

image

Bigmanjapan commented 6 years ago

a pool of blood forms on the Mannequin before it awakens in the PC build. I always thought that was odd...

This blood stain is formed via three layers. Change their Y coordinates to shift them underneath the floor. I don't know if something else accesses the addresses, so a single change of value to 128 upon entering the room should be fine. Better to leave the addresses unfrozen to make sure it doesn't break anything else in the game later on.

sh2pc.exe+556364 (00956364) float sh2pc.exe+5563BC (009563BC) float sh2pc.exe+556414 (00956414) float

Change them to 128.

https://youtu.be/0Brt9z60Rew

Interestin fact: blood stain Y position is calculated from mannequin Y position. If you change mannequin Y position via address in the next message, freeze the value and re-enter the room — blood stain will also be shifted on Y axis following the mannquin.

Bigmanjapan commented 6 years ago

It looks like the monster's model just needs to be rotated 180 degrees while it's dormant on the ground?

I'm afraid it's not that simple. I found all the addresses that control it's position and it seems that the way his legs positioned are entirely different to consoles' versions. Simply rotating it won't do.

sh2pc.exe+1BB15B4 (01FB15B4) float - Mannequin position X sh2pc.exe+1BB15BC (01FB15BC) float - Mannequin position Z sh2pc.exe+1BB15B8 (01FB15B8) float - Mannequin position Y sh2pc.exe+1BB15C8 (01FB15C8) float - Mannequin horizontal rotation sh2pc.exe+1BB15CC (01FB15CC) float - Mannequin vertical roll (need to NOP an instruction that writes to this address to be able to change the value)

Not sure what to do about it yet.

Bigmanjapan commented 6 years ago

These three addresses control flickering on the mannequin. NOPing functions that write to them and setting the value, for example, to 1 — removes flickering but also breaks the flashlight.

Maybe some manipulation with the addresses upon entering the room but before the flashlight pick up and reverting it to default after the pickup?

sh2pc.exe+4A0020 (008A0020) float sh2pc.exe+4A0028 (008A0028) float sh2pc.exe+4A002C (008A002C) float

https://youtu.be/HHz0iCFWqpA

Polymega commented 6 years ago

I'm afraid it's not that simple. I found all the addresses that control it's position and it seems that the way his legs positioned are entirely different to consoles' versions. Simply rotating it won't do.

I think the largest issue with this is that the Mannequin does a complete 180 flip. Because of how drastically the creature must move to be back in the right position it's noticeable even at just one frame long.

If you can get the creature rotated to the correct angle so it doesn't "flip" over upon activation I seriously think that would suffice. Because, even if the Mannequin's legs are slightly different I would bet no one would notice when it comes to life. It's the entire body flipping that is large enough on-screen to become noticeable, if that makes sense.

Bigmanjapan commented 6 years ago

If you can get the creature rotated to the correct angle so it doesn't "flip" over upon activation

The issue is that 180 flip is scripted, no matter what it's initial position is, the flip will occur.

https://youtu.be/DvD4NsmjmM0

Polymega commented 6 years ago

Well that's just both silly and frustrating... And is a downside of the Quick Save feature then. On PS2 the devs would never need to worry about that.

AeroWidescreen commented 6 years ago

I don't know if it'd help you guys but I extracted my PS2 save files of SH2 to use with PCSX2. You can download them here:

It definitely helped me. I've had the game running without a hitch in PCSX2 for awhile now, but I've never got around to doing a full playthrough. I don't have to rely on YouTube videos for comparisons anymore. Thanks for this.

AeroWidescreen commented 6 years ago

@Polymega Thought you might find this interesting. With a little bit of trial and error I was able to create a custom zoom and movement for the map like I was trying to do before. I don't have any plans on implementing it, but it's cool to see that it's possible to fix the pillarboxing without having to replace the textures.

Ignore the markings not being synced when zooming; I didn't feel like going through the trouble of fixing that for this video.

https://youtu.be/KpK7YC84qmc

Polymega commented 6 years ago

:open_mouth: I don't find that interesting; I find that sexy.

As you said: I know with the hopeful advent of implementing widescreen 2D images we probably won't need to completely fix the full screen map images but it's super nice knowing you found a solution as a back up.

Plus, I know this is both something that's been requested of you for a long time and something you've wanted to properly fix for quite some time. So I'm sure it's a wonderful relief just for yourself to have this egg finally cracked. Your talents always amaze!

Polymega commented 6 years ago

@AeroWidescreen @Bigmanjapan I did a speed run of SH2 Greatest Hits PS2 and am attaching my PCSX2 memory card for you guys to use if you'd like. This has every save point saved at within the game. This memory card now holds saves for both the original NTSC release and GH NTSC release.

PCSX2_Silent_Hill_2_Save_Files.zip

image image

Also, Aero, a neat fun fact: The "Maria" ending is also glitched when playing on PCSX2:

image

elishacloud commented 6 years ago

Moving This Issue to Silent-Hill-2-Enhancements

Everyone, I am moving this issue to the Silent-Hill-2-Enhancements project. Some comments were not able to be moved, but they can still be referenced here.

Please put all comments in the New Issue. Thanks!