elishacloud / Silent-Hill-2-Enhancements

A project designed to enhance Silent Hill 2 (SH2) graphics and audio for the PC. It also includes scripts to build or modify SH2 audio files (SFX, BGM and Dialog).
http://www.enhanced.townofsilenthill.com/SH2/
zlib License
542 stars 41 forks source link

Help Needed: Specialized Room Adjustments #63

Closed Polymega closed 2 years ago

Polymega commented 5 years ago

@Bigmanjapan

Continuing from email conversation here are details about other rooms/areas that could use some love. Some of these have been discussed in the past but will be posted here just to make them easier to find/discuss, if needed:

Hotel Room 312 Chair Shadow (rr91.map)

The chair James sits on while watching the VHS tape doesn't cast a shadow while the cutscene plays. However, both before and after the cutscene the chair has a shadow once more:

image

Here you can also see a video of the chair regaining its shadow once the cutscene ends: https://youtu.be/JH109aNOpCA

This is a problem because, without the chair's shadow during the cutscene, we see only James' shadow and during certain parts of the cutscene chunks of his shadow are masked out:

image

image

I studied the parts of James' shadow that are bugged/masked out and it seems to actually make an abstract outline of where the chair's shadow should actually be.

And here is a PCSX2 (PS2) screenshot showing that the chair should have its shadow during this part:

image

If you watch the video link from above, we can see that James' can cast his shadow on the chair while the chair itself casts its own shadow (after the cutscene ends).

Since we know it's possible for the chair to cast its own shadow and the chair can also receive James' shadow, is there then anyway to restore the shadow to this chair during the cutscene?

Polymega commented 5 years ago

How cool is this?! For someone who's new to 3D game formats/APIs you are hitting some major home runs here!! Really, really nice work, FrozenFish24!

Sir, if you're feeling up to it there's one more room that I can think of for the remainder of the game that could use some additional geometry, because right now there's a "void" when looking through the hole to the next room. Would you be interested in looking into one more room?

RedPyramidThingy commented 5 years ago

It's super cool. Makes me dream of a fully featured level editor.

FrozenFish24 commented 5 years ago

@Polymega Sure, just get me a save game and your edits and I'll see what I can do :+1:

Polymega commented 5 years ago

@FrozenFish24 Awesome! If you're using an LCD monitor it will make the "void" much easier to see.

Quick Save save file: sh2pc.zip

This is for ap42.map: From the hole that the apartment grandfather clock was covering we see another "void" where the devs didn't think to put a wall. Back in the day they were using CRT computer monitors and, with CRTs naturally having such good black levels, they probably never thought that void would be noticeable on a user's display:

image sh2pc 2018-12-06 20-49-17

Although, strangely, they did put a wall on the other side of this area where you would pretty much never see it:

sh2pc 2018-12-07 19-48-39

Is there a way to either move that wall to the other side or duplicate the wall and place it on the other side? Here's a demo video of me duplicating the wall. It's a bit cumbersome in Maya and my method is very likely not the most practical way of doing things: https://youtu.be/KoqvC_T4wec

I'm more than happy to provide the geometry for this wall similar to the power cord if you'd like (along with a reference-point mesh for sizing/position). Or, if you'd like to take a swing at making the new wall that's cool, too! Just let me know for that!

There are actually two doors on this wall so, we can go the extra mile and include those as well, or just use a "blank" wall similar to the YouTube link above which would also suffice; just so long as there's something there besides a floor that abruptly ends into a black void.

With all that said, I'd love to know your thoughts on the edit.

FrozenFish24 commented 5 years ago

Cool, I should be able to manage the edits on my own. I'll take a crack at it tomorrow and I'll try to make it match the actual room as closely as possible.

FrozenFish24 commented 5 years ago

new-wall

Well that was more involved than I anticipated, but I got there in the end :stuck_out_tongue: I had to fudge the wallpaper and door textures a little, as the one's they use in ap46 don't exist in ap42.

Also, because of the whole "flashlight goes through walls" thing the area is now illuminated when facing the clock, and I wonder if it harms the atmosphere a bit.

Download: ap42.zip

Polymega commented 5 years ago

I don't doubt this was a challenge! But it looks really, really nice! Great job with this. :) Happily, I'd say this is the last "void" issue within the game that I can think of (the other big one we fixed by changing fog parameters). Thank you very much again for stepping up to the task.

I had to fudge the wallpaper and door textures a little, as the one's they use in ap46 don't exist in ap42.

I wouldn't be concerned over that; it's such a small amount you see through the hole that it's mostly there for illustrative purposes (to show continuity on the other side). So long as it approximately represents the other side it'll fool the mind. After all, Team Silent themselves did this exact, same thing: Make an approximation on the other side just so something's there. And I do think it's cool you can see a smidge of the closet door on the other side at the camera angle before you get real close to the hole (image below).

Also, because of the whole "flashlight goes through walls" thing the area is now illuminated when facing the clock, and I wonder if it harms the atmosphere a bit.

That's a valid statement. For someone who'd be using an LED monitor they'd probably never see that void to begin with (due to good black levels). Although I'd think most consumers still have/use LCD displays and the void would be noticeable to some degree. So it would weigh down to what would someone prefer to see: A wall there or darkness but having the floor end into nothingness.

I'll put your mind at ease by stating the following: All other walls for that area beyond the hole actually have, well, walls! Also, if you go through this hole and look through it (back into the grandfather clock room) you'll also see a wall through this angle that's clear-as-day. Lastly, your flashlight casts a shadow through the hole which will darken the wall(s) and I think it looks super nice and much better than a black void:

image

The continuity you've added is great and is exactly what Team Silent has done elsewhere, but we can also instruct users to remove this .map file from the \sh2e\ folder if it concerns them.

Oh, and @FrozenFish24 , I sent you an email the other night as well, sir.

FrozenFish24 commented 5 years ago

Great glad you like it.

Lastly, your flashlight casts a shadow through the hole which will darken the wall(s)

You're right that does look quite nice actually. I guess the real issue is there are some angles where the cast shadows don't align properly with the geometry, leaving a bright seam. But that affects the floor void too now I think about it.

Oh, and @FrozenFish24 , I sent you an email the other night as well, sir.

Oops hadn't checked, I'll get on that for you now

Edit: Here you go @Polymega

dirtycable hp190.zip

Polymega commented 5 years ago

Edit: Here you go @Polymega

Thank you for not taking my head on that. :) The wife says it looks completely perfect now and, you know how it goes: Happy wife, happy life.

Polymega commented 5 years ago

@FrozenFish24 I plan to do a thorough testing of your self-shadow fix in the future, ensuring the effect is used either 100% of the time or if the devs perhaps disabled it during certain cutscenes/rooms (by cross-referencing the PS2 build).

I'm a bit behind on some other things so please be patient with me on this test. I just don't want you to think that your discovery of re-enabling self shadows isn't a big deal 'cause it is!

FrozenFish24 commented 5 years ago

No worries @Polymega. Nobody has a better eye for detail when it comes to SH2 than you do, and I'm sure it's not a quick process, take all the time you need. :+1:

Polymega commented 5 years ago

@FrozenFish24 if I may ask for your assistance with adjusting room geometry again? This one will require a little bit of explaining. (@Bigmanjapan tagging you too because of your interest with this one.)

During this cutscene you'll notice the canvas/plastic around the elevator's entrance has spastic "blotches" phasing in-and-out all over it as James first runs into the elevator (pay attention during the first two camera cuts): https://www.youtube.com/watch?v=MlH49MyOvPA

At first I thought this was a shadow flicker glitch similar to the Hotel Room 312 one (which Bigmanjapan has an address to fix that). But when I disabled shadows in the game's options menu the flicking here still persisted.

I believe (90% sure but not fully certain) this is a clip plane issue (two pieces of geometry that are way too close to each other and the GPU's camera clipping projection isn't strong enough to keep them separated when rendering them).

Take a look at this video: https://youtu.be/C4C5HpC5Sv8 I think perhaps when the cutscene plays the camera's projection (FOV) changes which creates the splotchiness we see? i.e. The new projection is too "extreme" to keep these close-together geometry pieces separated.

Here's the offending piece of geometry:

image

Take a look at how close the edges of this geometry are to the wall--there's practically no gap between them.

image

Proposed solution:

Assuming this is a clipping issue, simply move that geometry away from the wall by a tiny bit. I'm not sure how far out it needs to be moved to alleviate the clipping but I don't think it'd be too much. This is also an acceptable fix to do because, during the (first and) only two camera cuts where we see this geometry we're looking at it almost dead-on, so nobody would ever be able to tell it's sticking out from the wall any due to limited perspective.

The .map file is hp166.map hp230.map.

Thank you for any help with this!

Polymega commented 5 years ago

@FrozenFish24 the correct .map file is hp230.map. My version of the SH Level Viewer is so sensitive with the key presses that if I even barely tap the Shift key (to filter to the next .map) it'll skip like 3-4 of them at a time! I cycled through the whole hp .map files a dozen times over from the other day and apparently consistently skipped over this particular one!

FrozenFish24 commented 5 years ago

It was hp230.map, here's the fix: hp230.zip

Edit: You figured that out yourself :stuck_out_tongue:, I had the page open without refreshing in a while and didn't see

I had to move it further than I'd have expected to get rid of the issue. Very strange. front side

Polymega commented 5 years ago

Impeccable timing, sir! I'm currently play testing for your depth bias fix and was 5 minutes away from this cutscene so I was able to kill two birds with one stone. :) Still wrapping up the play test but your .map file fix worked great! You always see this geometry from a front-on perspective so no one will ever know you moved it. :) Great work as usual, FrozenFish24! Thank you very much once again!

elishacloud commented 5 years ago

I checked in a fix for the prison hallway halogen lights mentioned here. I updated the two vertex shaders as mentioned here and here.

You can see the code check in at b3d14d0.

Here is the latest build, it fixes this halogen light issue and the one mentioned in #74: d3d8.zip

elishacloud commented 5 years ago

@Polymega, is the fix created by FrozenFish24 here a good fix? Should I add this code update to the module?

Polymega commented 5 years ago

@Polymega, is the fix created by FrozenFish24 here a good fix? Should I add this code update to the module?

I'm currently play testing this fix over the course of several days. This is a literal game-changer for the PC version (restoring self shadows) so I'm trying to be as slow, careful, and thorough as possible.

I already have a list of notes made for this fix but still have to test out all the endings. In a nutshell: There will be certain cutscenes/rooms where self shadows (at least for James) will need to be disabled. So this won't be a set-it-and-forget-it fix.

I'd almost possibly suggest adding the fix in, having it deactivated by default, and also not put the fix line in the .ini file for now. That way, others like FrozenFish24, Bigmanjapan, and Aero_ can stealthily add the fix line/activate the fix from the .ini to help with play testing. Then, once everything is good we can simply reveal/include the fix line in the .ini.

This will be a substantial fix akin to the Audio Enhancement project we worked on and I'm anticipating multiple hands will ultimately need to be involved with this one and it'll take some time to perfect.

Polymega commented 5 years ago

Oh, @elishacloud , these fixes are good to go, though: https://github.com/elishacloud/Silent-Hill-2-Enhancements/issues/49#issuecomment-429931243

A concise fix name could be something like FogParameterFix = 1 // Adjusts the fog-of-war boundaries for specific areas to fix visual errors

elishacloud commented 5 years ago

Self Shadows Globally excluding this for certain rooms and certain cutscenes should be very easy. However if it needs to be enabled for some things in a room but not for others in the same room, that can get quite complicated.

I already know how to retrieve the room ID. It should be pretty easy to exclude this for specific rooms if someone can give me a list of room IDs to exclude.

sh2pc.exe+1BB7DAC (01FB7DAC) byte — room index ID

Checking for the cutscene should be similar. Using code from the DisableRedCrossInCutScenes fix I think I can get the cutscene ID. If someone can give me a list of cutscene IDs to exclude I should be able to exclude them as well.

I'll go ahead and add the fix into the code but not the ini file.

Fog Parameter Fix Yes, I can work on this next. This is going to be a bit more involved than any of the other game patches I have done so far.

Polymega commented 5 years ago

I'll have those lists for you in the near future (addresses and values). They will affect either the whole room or cutscenes.

It should be pretty easy to enable/disable; either we FULLY disable self shadows or ONLY James' self shadow (which can be done by setting his stencil back to REPLACE).

For the cutscenes it'll be a little trickier: They will only need to be disabled for particular camera cuts then re-enabled as the cutscene continues. We base these camera cuts on the camera's X coordinate on any given cut. You'll be familiar with this once you dip your toes into the FogParameterFix. I'll also have these values for you as well.

Polymega commented 5 years ago

Hi @Bigmanjapan ,

In reference to this post, can the camera at the bottom floor of the elevator for ps67.cam (there is no ps67.cam, perhaps ps66.cam?) be adjusted to reduce how high up the camera can look while in Search mode? This would be to hide the hole in the ceiling:

sh2pc 2019-01-21 17-25-40 sh2pc 2019-01-21 17-25-46

Bigmanjapan commented 5 years ago

@Polymega

The angle is contained in ps66.cam file. Doesn't seem to be possible to limit the camera tilting up via ps66.cam.

Other way to solve that might be limiting the upper border of dymanic camera tilt value.

sh2pc.exe+1B812E0 (01F812E0) float — dymamic camera tilt sh2pc.exe+1B812E4 (01F812E4) float — dynamic camera pan

When you freeze those in CE the camera movement becomes stutttered etc because it tries to overcome the frozen value. It should be possible to make the value not go beyond a certain point smoothly via smart code alteration but that's the question to other guys.

Polymega commented 5 years ago

FIXED!

:confused: Weird camera script for this area... @Bigmanjapan please ignore the post I just made about this.

@FrozenFish24 May I ask for another geometry adjustment? This is either for ps66.map or ps67.map (I believe it's ps66.map between the two.)

At the bottom of the long labyrinth elevator ride you enter a small room with nothing but a door and save point in it. If you load from this save point you receive greater camera control in the room which allows you to look further up... to see a hole in the ceiling. You can see images of this hole a few posts up.

Quick Save save file of this room

May I ask you to place a simple, flat polygon plane that fills this hole and use this texture file for the UV coordinates? (In the SH Texture Explorer for ps66.map it's tex_007)

image

Bigmanjapan commented 5 years ago

@Polymega

I don't think there is a trigger like that.

If I make one or two steps from the elevator and allow camera to float behind James, then I can make it tilt up enough to see the hole. If James stands right next to the elevator entrance, camera can't float behind James which limits it's ability to tilt up.

Same thing happens for me if I exit the room via the door and re-enter it. When you re-enter the door, camera gets positioned right behind James which doesn't happen when a player walks around the room and allows camera to float freely. That unintended positioning right behind James' back allows it to tilt up enough to see the hole above the elevator.

It should be quite easy to change camera position fast enough upon entering the room, so that the player wouldn't notice.

From this angle:

default

To this angle:

default

This only solves the door camera angle tho, not sure what to do about the elevator one. If I mistake something and there is a trigger area, please make a video of it.

Same things happens on PS2 when yo re-enter the room:

default

Although it does seem that the issue stems from a wrong camera property like it was in one of the hospital patient's room. A camera was set to "outdoors" while it should have been set to "tiny" which makes it more confined / tilt down more.

Polymega commented 5 years ago

If I mistake something and there is a trigger area, please make a video of it.

No, I don't think you are mistaken. Here is what I think happened for me:

After the elevator ride I quick saved in this room. So every time I quick loaded from the quick save it retained the correct camera property values. However, if I loaded the "Elevator" save file the camera properties became wrong. So whenever I quick saved after the elevator ride it also seems to store the correct camera values, even if I exit the game and re-load the quick save.

I believe this is what was confusing me before. But since some people may load from the traditional "Elevator" save point, they'll still receive the wrong camera properties. So to play things safe, we can simply add ceiling geometry for the room.

Although it does seem that the issue stems from a wrong camera property like it was in one of the hospital patient's room. A camera was set to "outdoors" while it should have been set to "tiny" which makes it more confined / tilt down more.

By chance is that the same issue going on for this room?

Bigmanjapan commented 5 years ago

By chance is that the same issue going on for this room?

Yes. Turns out the camera property was not set at all.

ps66.zip

The issue should be completely solved.

Polymega commented 5 years ago

Much love, Bigmanjapan!

@FrozenFish24 please ignore my request. :)

@Storm3000 the issue of a "hole" in the ceiling at the bottom of the Labyrinth elevator is now resolved. You can download Bigmanjapan's fix (one post above) and place it in \sh2e\bg\ps\ . This adjusted .cam file will also be included in the next release of the Enhanced Edition Essential Files.

AeroWidescreen commented 5 years ago

Bigmanjapan is on the case! Good stuff.

Polymega commented 5 years ago

@FrozenFish24 May I ask you to add geometry for the final bedroom cutscenes? This would be for both qp01.map and qt01.map.

In both cutscenes the camera will eventually be higher up, looking down on James and Mary. During this time, we see a magically-floating lampshade:

Leave ending:

sh2pc 2019-01-27 13-52-07

In Water ending:

sh2pc 2019-01-27 13-49-11

Even back in 2001 this has always stood out like a sore thumb and it'd be nice to see geometry properly added inside the lampshade. Thanks to your amazing skills, we could do just that!

image image

This mesh would sit directly on top of where the current inner stem of the lamp stops:

image

Files

Geometry (OBJ):

Texture (DDS):

The UVs have already been created and placed where they should go. They just need to be linked up to the correct texture file in the .map file. I had to create a light bulb texture and add it to the texture file that holds the rest of the lamp/carpet details:

qp01

Note:

You've previously modified qt01.map to restore proper vertex normal data. So if adding geometry to this .map file, be sure to add it to the one you've already fixed up. Here is that file again, just in case: qt01.zip

Thank you very much for your help with this!

FrozenFish24 commented 5 years ago

Here you go

lightbulb lightbulb.zip

I simplified the bulb slightly while I was at it, hope that's okay. ![simpler-bulb](https://user-images.githubusercontent.com/12547453/51927297-410d5880-242e-11e9-9bfd-c719de57cead.png)
Polymega commented 5 years ago

As always, I can't thank you enough, FrozenFish24. Please do consider accepting donations in the future as I'd love to send monetary thanks to you as well. :)

I simplified the bulb slightly while I was at it, hope that's okay.

Absolutely. You did a fantastic job with poly budgeting! Well done!!

May I ask another modification from you? In the PC version, the water effects are noticeably more transparent in their textures compared to the PS2 version. I think I may have a fix solution but it needs testing.

Similar to how you made a test .dll for another shader code, may I ask you to create a new test .dll with the following vertex shader code adjusted? Unlike the other attempt at changing a pixel shader for the Hotel windows, the shader code below should only affect the areas we want it to affect and not the whole screen:

vs_1_1
dcl_position v0
dcl_color v5
dcl_texcoord v7
mov oD0, c0
mov oT0, c0
dp4 oPos.x, v0, c32
dp4 oPos.y, v0, c33
dp4 oPos.z, v0, c34
dp4 oPos.w, v0, c35
mov oT0, v7
mov oD0, v5

Change the last line from mov oD0, v5 to add oD0, v5, c4.y

FrozenFish24 commented 5 years ago

Here you go this should do the job, sorry for not replying to your email by the way I somehow overlooked it.

Release.zip

Polymega commented 5 years ago

Thank you again! May I ask you to confirm the fix is implemented in this test build? Checking in the Intel Frame Analyzer it didn't seem to take effect.

I don't know if spacing matters for the fix to swap out the pre-existing code but here's how the Frame Analyzer feeds out the code (seems to be four spaces before each line):

    vs_1_1
    dcl_position v0
    dcl_color v5
    dcl_texcoord v7
    mov oD0, c0
    mov oT0, c0
    dp4 oPos.x, v0, c32
    dp4 oPos.y, v0, c33
    dp4 oPos.z, v0, c34
    dp4 oPos.w, v0, c35
    mov oT0, v7
    mov oD0, v5
FrozenFish24 commented 5 years ago

I don't know if spacing matters

It does, but I added them in myself. Throw us a save game with some water and I'll try and figure out what's going wrong.

Polymega commented 5 years ago

Sure thing, here you go: sh2pcsave2e.zip

Here's an example of what this changes (screen grabbed from within the Frame Analyzer):

Before:

001

After:

002

This vertex shader affects more than just water; it also affects puddle splash ripples, the fire/smoke in the Angela Hotel stair room, and more. So I'll do a full play test with this to be sure it's not doing any funny business elsewhere.

FrozenFish24 commented 5 years ago

Wow that's really cool!

Here's a working dll: Release.zip

The issue was, d3d8to9 added some comments to the 5th and 6th lines. So the shader ended up looking like this and not what I was searching for:

    vs_1_1
    dcl_position v0
    dcl_color v5
    dcl_texcoord v7
    mov oD0, c0 /* initialize output register oD0 */
    mov oT0, c0 /* initialize output register oT0 *
    dp4 oPos.x, v0, c32
    dp4 oPos.y, v0, c33
    dp4 oPos.z, v0, c34
    dp4 oPos.w, v0, c35
    mov oT0, v7
    mov oD0, v5
Polymega commented 5 years ago

Yikes!!! Maybe not! Yeesh!

https://youtu.be/tR3W3nZ5hPE

Something else strange: Whenever the water effect "goes dark" any shader codes are gone for it. I checked in the Frame Analyzer and the shader code just disappears. Either way, this proposed solution also makes the fire and smoke cartoonishly thick and the "dust" (?) effects under water way too bright.

Thank you for letting us experiment with that though, FrozenFish24! Back to the drawing board with this one.

FrozenFish24 commented 5 years ago

Huh, well that's pretty odd. I'll have a look at this tomorrow too when I get a chance and see if I can come up with anything.

AeroWidescreen commented 5 years ago

Do you guys think the water intensity could be changed through the executable (x86 ASM) or is it only possible through shader code?

Polymega commented 5 years ago

I'm thinking it has to be through the executable?

Because, after testing that .dll, it seems other effects that share this vertex shader code (hotel fire, hotel fire smoke, firearm muzzle smoke, water ripples (on Blue Creek floors), blood pools from enemies, etc) all seem to look correct currently as-is?

I tried reducing the alpha intensity of the actual water texture files but they're saved as .tbn2 format (animated texture files) and my edits aren't reflected in-game for these particular textures.

Bigmanjapan commented 5 years ago

@Polymega @AeroWidescreen @FrozenFish24

For the water effect in this particular room:

9

sh2pc.exe+493F5C (00893F5C) float — red channel on additional bleaks that happen when waves become tall sh2pc.exe+493F60 (00893F60) float — green channel on additional bleaks sh2pc.exe+493F64 (00893F64) float — blue channel on additional bleaks sh2pc.exe+493F64 (00893F68) float — additional bleaks intensity

sh2pc.exe+493F7C (00893F7C) float — red channel on center texture sh2pc.exe+493F80 (00893F80) float — green channel on center texture sh2pc.exe+493F84 (00893F84) float — blue channel on center texture

As always, increasing all three by the same amount increases overall brightness/intensity.

sh2pc.exe+493FC (00893F6C) float — water texture Z stretch/shrink sh2pc.exe+493F78 (00893F70) float — water texture X stretch/shrink sh2pc.exe+493F74 (00893F74) float— additional intensity? sh2pc.exe+493F78 (00893F78) float — additional intensity?

2

sh2pc.exe+494064 (00894064) float — red channel on water texture's outer rim / additional bleaks sh2pc.exe+494068 (00894068) float — green channel on water texture's outer rim / additional bleaks sh2pc.exe+49406C (0089406C) float — blue channel on water texture's outer rim / additional bleaks sh2pc.exe+494070 (00894070) float — water texture's outer rim / additional bleaks intensity

sh2pc.exe+494084 (00894084) float — red channel on center texture (1st set) sh2pc.exe+494088 (00894088) float — green channel on center texture (1st set) sh2pc.exe+49408C (0089408C) float — blue channel on center texture (1st set)

sh2pc.exe+494090 (00894090) float — red channel on center texture (2nd set) sh2pc.exe+494094 (00894094) float — green channel on center texture (2nd set) sh2pc.exe+494098 (00894098) float — blue channel on center texture (2nd set)

sh2pc.exe+494074 (00894074) float — water texture Z stretch/shrink sh2pc.exe+494078 (00894078) float — water texture X stretch/shrink sh2pc.exe+49407C (0089407C) float — additional intensity? sh2pc.exe+494080 (00894080) float — additional intensity?

If you look around in this memory region, you will find addresses that control waves height, regularity of waves etc I guess it's not important for the issue in question.

For these three rooms:

66

55

7

sh2pc.exe+493AB4 (00893AB4) float — red channel on center texture sh2pc.exe+493AB8 (00893AB8) float — green channel on center texture sh2pc.exe+493ABC (00893ABC) float — blue channel on center texture sh2pc.exe+493AC0 (00893AC0) float — center texture intensity

For these three rooms there is no active addresses (in this region) that can control outer rim color setting or texture shrink/stretch. I guess this whole water effect was made in a slipshod manner. If these addresses are needed, then I'll look for them.

Polymega commented 5 years ago

Holy cow, you just hit a home run here, @Bigmanjapan! Excellent work/research!

For these three rooms there is no active addresses (in this region) that can control outer rim color setting or texture shrink/stretch. I guess this whole water effect was made in a slipshod manner. If these addresses would be needed, then I'll look for them.

Possibly the only benefit of finding shrink/stretch values for this area would be to better fix these seams, but it's really not that important to find if it's too hard to locate. Even PS2 version suffers from these seams (and on PS2 version they're much more noticeable):

image

While you're currently researching for this, may I ask you to do the same in the prison, labyrinth, and final boss fight water? These are the other water areas that needs to have their transparency adjusted like what you've done in the alternate hotel.

There's only one area for the prison, but multiple areas throughout the labyrinth. Lastly, the water in the RPT apartment boss fight looks correct as-is so that one doesn't need to be touched. Are there any other water areas I may have forgotten about?

image image image

(The water for the prison and labryinth is easier to notice in motion, if you're able to play both PC and PCSX2 version side-by-side.)

@AeroWidescreen when the time comes I can give recommended value changes to match the PS2 version, if you'd like?

AeroWidescreen commented 5 years ago

@Bigmanjapan

I guess this whole water effect was made in a slipshod manner. If these addresses are needed, then I'll look for them.

And I noticed that some of these areas use completely different functions for their water effects. I don't understand why it was done like that, it seems really inefficient.

@Polymega

When the time comes I can give recommended value changes to match the PS2 version, if you'd like?

I don't think I need to do anything for this one. The addresses that bigmanjapan are posting are all that's needed, unless you happen to find any side-effects.

Polymega commented 5 years ago

I meant what the new values should be for those addresses, to better match the PS2 visuals, once all addresses are accounted for for the areas we need them. I can contrast-and-compare to the PS2 version and write down what their values should be per room/area.

Bigmanjapan commented 5 years ago

Possibly the only benefit of finding shrink/stretch values for this area would be to better fix these seams

sh2pc.exe+E34F1 (004E34F1) float — water texture Z stretch/shrink (hallway after kitchen) sh2pc.exe+E34F9 (004E34F9) float — water texture X stretch/shrink (hallway after kitchen)

sh2pc.exe+E3BE1 (004E3BE1) float — water texture Z stretch/shrink (elevator area prior to Venus Tears bar) sh2pc.exe+E3BE9 (004E3BE9) float — water texture X stretch/shrink (elevator area prior to Venus Tears bar)

sh2pc.exe+E4231 (004E4231) float — water texture Z stretch/shrink (Venus Tears bar) sh2pc.exe+E4239 (004E4239) float — water texture X stretch/shrink (Venus Tears bar)

Bigmanjapan commented 5 years ago

Mary/Maria bossfight area water effect is controlled via the same addresses that control the effect in the three rooms around Venus Tears bar.

sh2pc.exe+493AB4 (00893AB4) float — red channel on center texture sh2pc.exe+493AB8 (00893AB8) float — green channel on center texture sh2pc.exe+493ABC (00893ABC) float — blue channel on center texture sh2pc.exe+493AC0 (00893AC0) float — center texture intensity

There's only one area for the prison, but multiple areas throughout the labyrinth.

Do you mean the difference water particles during each step or an amplitude of the waves?

At least in Strange Area 2 (hallway prior to the bug room) from what I can see waves on PS2 go a little bit higher in comparison to PC.

Strange Area 2 (hallway prior to the bug room) and Labyrinth sections color channels are also controlled via the addresses above.

sh2pc.exe+E7ED1 (004E7ED1) float — water texture Z stretch/shrink (Strange Area 2) sh2pc.exe+E7ED9 (004E7ED9) float — water texture X stretch/shrink (Strange Area 2)

Edit;

In my previous post I provided two sets of addresses for central textures for the kitchen area. It seems that the second set of addresses is a leftover from parts of the game where flashlight is still active.

default

First set of addresses controls visual area outside of the flashlight's spread, second set controls flashlight spread area. The addresses to control colors in Labyrinth sections are the same.

sh2pc.exe+E4D01 (004E4D01) float — water texture Z stretch/shrink (Labyrinth) sh2pc.exe+E4D09 (004E4D09) float — water texture X stretch/shrink (Labyrinth)

Polymega commented 5 years ago

Thanks again for all your hard work with this, Bigmanjapan.

Do you mean the difference water particles during each step or an amplitude of the waves?

I mean in regards to it's visual intensity/transparency. Amplitude may also be different, but 100% there's a difference in visuals.

For the alternate hotel water, you made the water texture more noticeable by increasing the intensity (making it less transparent). The same things also need to be done for the other mentioned areas.

It seems to be an issue for just about all water areas for the PC version. For the PC version, the prison and labyrinth water textures in particular almost look completely invisible.

Polymega commented 5 years ago

Sorry, I should have also mentioned that you have your flashlight for these water areas. Some of your previous addresses can also adjust the prison/labyrinth water intensities when the flashlight is not touching those water areas.

But addresses for when the light is touching the water would be needed here to make the water less transparent when the light is touching. If you can place PC and PCSX2 side-by-side you will notice differences.

So essentially the same process as you've done for the alternate hotel water, but for when the flashlight is touching the water in these areas.

Bigmanjapan commented 5 years ago

But addresses for when the light is touching the water would be needed here to make the water less transparent when the light is touching.

Try these three for the labyrinth area (and it seems to also work for prison area but the effect is very weak):

sh2pc.exe+493AC4 (00893AC4) float — water effect red channel (flashlight spread) sh2pc.exe+493AC8 (00893AC8) float — water effect green channel (flashlight spread) sh2pc.exe+493ACC (00893ACC) float — water effect blue channel (flashlight spread)

This is another second set of addresses for the previous areas which appeared to be inactive due to flashlight not present on James.

Don't forget about using negative values for float types. Usually reasults in darkening instead of brightening.