-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help Needed: Specialized Room Adjustments #63
Comments
FIXED!
|
The Dormant Mannequin (Woodside Rm 205)This room is a complete mess and the PC version of this game is trying to do everything it can to ruin the surprise. However, thanks to you Bigmanjapan, we now know how to darken the dynamic objects in this room before acquiring the light and we can now also fix the pool of blood when both a) quick loading into the room before getting the flashlight and b) if the Mannequin dies on the carpet afterwards. The last two things to fix? 1) Removing the shine from the mannequin before getting the light (to make the surprise more... surprising) and 2) preventing the mannequin from "flipping" when coming to life if the player quick loads into the room before getting the light. Now, both of these things aren't necessary to have fixed (the most important bug to fix was darkening the dynamic objects) but, between the two remaining fixes, I'd say removing the shine on the mannequin before acquiring the flashlight is more important between the two. Why? Because the chances of someone quick saving then quick loading in this particular room before acquiring the light are probably slim. If someone were to enter this room and see a beacon of light off to the side they're very likely to acquire that before doing anything else in this room ("Ooooh! Shiny!") Because of that, I'd wager many people won't ever experience the mannequin incorrectly flipping from quick loading back into this room. However, removing the shine on the mannequin would be much more beneficial to hide the surprise that awaits them... If I may ask: Between the two remaining fixes for this room, can removing the shine be the priority and its fixed shared even if the other issue can't/hasn't been found yet? |
Probably unhelpful to point out, but the shadows during that cutscene in the PC version also appear to be darker. Is that an extension of it lacking soft shadows? |
I'd say that's correct. If/when we find the right person(s) to implement soft shadows I was planning on asking about if the values of the shadows could also be brightened some; as adjusting that would be the time to do so (with someone editing the shadows). |
This is how that camera angle looks in my build: Are you sure it's not something you've done or some other code of Ehanced Edition interfering? This camera angle is not actually stored in ap18.cam file, it's stored directly in sh2pc.exe. Some addresses that control this camera angle: sh2pc.exe+4E0FA8 (008E0FA8) float — tilt with elliptical trajectory It seems that there is no X / Y / Z coodrinates for this camera angle, it's anchor point is calculated via several addresses that have elliptical trajectories instead of straight X / Y / Z lines. I've seen such design in Fatal Frame games long time ago. The whole store in the sh2pc.exe thing is probably due to the fact that this camera angle needs to be disabled after the key is picked up and once James steps out of the closet after picking up the key. Changes to this camera angle could be made via hex injection directly to sh2pc.exe. The addresses offsets are the same minus 00400000 module: 0x4E0FA8, 0x4E0FAC etc There is always a possibility that some other camera angle polls values from these addresses but I highly doubt that. Interesting that if I save while standing in the closet, then reload, the game will output black screen. One needs to step out of the closet and walk back in to initiate the angle. This suspiciously reminds me of the camera transfer glitch I was getting while running Maria's scenario: https://youtu.be/oZYm5bDslto Doesn't happen on PCSX2 if I try to use debug save function in the closet and then reload it. Once Cxbx-Reloaded is developed more it will be interesting to see if the bug is present in Xbox builds. |
Ignore; this was an issue with Nvidia cards hiding chunks of the wall when the camera is too close.
Oh wow. From 15 years of playing the PC game I've never quick saved in there to have this happen. A possible fix would be IF in room ID AND a certain camera angle is active THEN disable quick save feature. But this is under the presumption that we know how to easily disable quick save for a certain area. However...... I personally think this bug is so circumstantial it wouldn't be worth worrying much about. It could be placed lower on the wishlist of things to fix. |
Better solution would be to figure out why this camera angle only initializes when James steps into the trigger area and not when James is spawned directly on it. At first I thought that on PC version trigger for that angle is made via a line while on PS2 it's an actual rectangular area. Not the case. PC version's trigger area is also a rectangular one but actually needs stepping into to get activated for some reason. |
Ooooh! Actually I bet this is chunks of the wall disappearing due to the already-known Nvidia bug. Okay, yeah, this will eventually be fixed then and the camera angle has been correct the whole time there. |
FIXED!
|
For some reason surface color of that element is controlled via cover-up fog addresses (which is used to create corners shadows indoors): sh2pc.exe+542C20 (00942C20) byte — Cover-up fog R The issue here is that when you bright it up, shadows in the corners becomes brighter too. You can crank shadows down via intensity address but that would mess with the original room design. Also similar thing happens with prison hallway hole lights (ps53.map). When James flashlight is off, black colour on the lights is also rendered by fog addresses for some reason. It only renders proper texture on the lights when James flashlight is on. I think the prison lights and Blue Creek windows issues might have the same root. Xbox builds have these issues too. |
Thanks for looking into this, Bigmanjapan. If the addresses/functions are missing to make these particular materials/shaders fully illuminated perhaps we may ask @FrozenFish24 to see if he could perform magic on the vertex/pixel shader calls for these particular pieces of geometry? Similar to how the WineD3D wall issues became fixed? I have no earthly clue if such a thing is even possible or wise to do so... but: Here's a link to Intel Frame Analyzer screen grabs for both ap88.map and ps53.map: There are two versions of each screen grab: One with the flashlight on, and the other with the flashlight off. For ap88.map here is the geometry in question: For ps53.map here is the geometry in question: As you all know by now, I am no programmer. But I was able to incorrectly brighten these geometry pieces by altering the pixel shader code. For the halogen lights in ps53.map: I changed I know that doesn't help any but it shows that maybe there's something there that can be done? |
Got it working in the Frame Analyzer! Okay, here's what I did: I captured another scene where the halogen lights worked. In this case, the butterfly room in Woodside Apartments: I then copied the vertex shader code from this geometry and pasted it directly as-is to the halogen light geometry in the prison: and the windows for the apartment staircase: This worked--at least through the Intel Graphics Frame Analyzer--for both versions of each scene: When James flashlight was both on and off. Here is the code:
So the final question would be to @FrozenFish24 and @elishacloud : Could anything be done with this information to fix these two spots? |
@Polymega, It is relatively easy to replace one shader with another one. Can you show me what the shader looked like before and after you updated it? |
Yes sir: Quick Save save file for Prison hallway: sh2pcsave1c.zip Halogen lights before (they're pitch black like this when you turn off his light and lambert shaded when his light is on): Halogen lights how they should be after fix: Halogen lights original vertex shader code:
Quick Save save file for Apartment Staircase: Windows before: Windows how they should be after fix: Windows original vertex shader code:
I'm pretty much clueless with Direct3D, shaders, etc. but it's worth noting that we only want to update the shaders for these specific pieces of geometry for these particular rooms only. |
For both of these particular rooms, these geometry pieces seem to be the only ones that use their vertex shader codes within the whole room. So if they're overwritten just for when you're in these rooms, it shouldn't negatively affect anything else within the area. sh2pc.exe+1BB7DAC (01FB7DAC) byte — room index ID Perhaps the shader can be updated for the overall game but I wouldn't know what else that would affect without play testing the whole game. The updated shader code can be found at the bottom of this post: #63 (comment) |
Nice. Also what's up with the dead Lying Figure being rotated 90 degrees after the Blue Creek bossfight? I've seen it being positioned both parallel and perpendicular to the stairs on PC version. |
That's a result of quick loading back into the room, similar to the apartment flashlight room. Although this creature never comes back to life so nothing to really worry over. |
I believe the problem is only with one line in the vertex shader: vs_1_1
dcl_position v0
dcl_color v5
dcl_texcoord v7
mov r11, c0
mov r1, c0
mov oD1, c0
mov oD0, c0
mov oT2, c0
mov oT1, c0
mov oT0, c0
dp4 r1.x, v0, c0
dp4 r1.y, v0, c1
dp4 r1.z, v0, c2
dp4 r1.w, v0, c3
max r11.w, r1.w, c14.w
rcp r11, r11.w
mad oFog, c23.y, r11.x, c23.x
mov oT0.xy, v7
mov oD0, v5 ;<--- This line is bad
mov oD1, c14.x
mov oT1, c14.x
mov oT2, c14.x
mov oPos, r1 Instead of Try with this patch: d3d8.zip |
I'm envious of your know-how. This works great whenever James' flashlight is on. However, it goes back to "blacking" out the geometry whenever you turn off his flashlight ( Any chance to make this override any and all functions/calls to this vertex shader so that the geometry is always fully illuminated, regardless of whether or not James' flashlight is on/off? |
Apparently there is a different vertex shader used when the flashlight is off. I had to make some additional changes to that shader also. Here is the vertex shader used when the flashlight is off: vs_1_1
dcl_position v0
dcl_color v5
dcl_texcoord v7
mov r11, c0
mov r1, c0
mov oD1, c0
mov oD0, c0
mov oT2, c0
mov oT1, c0
mov oT0, c0
dp4 r1.x, v0, c0
dp4 r1.y, v0, c1
dp4 r1.z, v0, c2
dp4 r1.w, v0, c3
max r11.w, r1.w, c14.w
rcp r11, r11.w
mad oFog, c23.y, r11.x, c23.x
mov oFog, c14.x ;<--- This line needs to be removed
mov oPos, r1
mov oT0.xy, v7
mov oD0, v5 ;<--- This line is bad (see above)
mov oD1.xyz, c14.x
mov oT1, c14.x
mov oT2, c14.x Try this one: d3d8.zip Note: I updated the actual vertex shader. This could affect other rooms since I don't know what other rooms use this shader. |
Beautifully done! Just testing the areas in question everything is working and looking great. Thank you very much for looking into this, Elisha!
Okay, let me play test the game soon, playing through both campaigns to completion once with the flashlight always on and another where it's always off. I'll report back with my findings then. |
FIXED!
|
I may have found something about the Hotel chair shadow glitch while I was researching another shadow area. But first: Let's talk about the shadow for the grandfather clock in Woodside Apartment: When your flashlight casts a shadow on the clock it leaves a glitched "outline" of the clock's shadow around it, just like what the Hotel chair seems to be doing: So I took an Intel Frame capture of this room and saw something peculiar: The Frame Capture software unfortunately does not capture real-time shadows. So this shadow isn't a dynamic shadow... But wait! I've seen this before: It's a fake shadow used throughout the game for various assets. It's typically a flat poly plane with a semi-transparent PNG texture that simulates a shadow: So what does this mean? That fake poly shadow plane is a dynamic object. Because when you move the clock, that shadow (that poly plane) moves with it. And what do we know about SH2 PC? Currently, dynamic objects can't have shadows cast upon them. So if/when we can figure out how to have dynamic objects receive shadows cast upon them, the grandfather clock's shadow should at least be fixed. However... I'm not so sure that's the issue with the Hotel chair: I'm not sure how many areas are like this, but for this room it looks like simple geometry is casted out and that is what determines where/how the shadows will be drawn: https://youtu.be/OptmHNdQBFsBe sure to watch the YouTube video above. I'm not sure what this is? There's no shader calls to them? But whatever this is it seems to be what's both casting the current shadow we see and probably also bugging out the chair shadow in the process? But both before and after the cutscene the chair (which has a correct shadow during these points) has a more "clean" piece of geometry to tell it how to cast its shadow: https://youtu.be/xzWlali5qGk You can even see part of these poly planes if you angle James the right way: But during the cutscene I found no instance of such a "clean" piece of geometry to tell the game where/how to cast its shadow. I could just be speaking nonsense right now but I wonder if the disappearance of that one group of "clean" geometry that defines the chair's shadow being missing during the cutscene is what's causing the issue of its shadow not appearing at all? |
I was curious, since the camera adjustment fixes are intended for 16:9 resolutions, I assume they won't be effective for even wider aspect ratios, i.e. 21:9, 32:9, 48:9 etc.? Is there a way to toggle the camera fixes off in those cases? |
That's correct; if you go ultra wide you're still probably going to see clipping through walls even with the 16:9 .cam fixes. To disable them you can remove any/all .cam files from the |
Thanks! |
@Bigmanjapan If I were to guess, I'd say this would be cc11.cam |
@Polymega A semi solution could be changing that camera angle preset which fixes the fog issue. |
Yeah, I see what you're saying. That rough camera shift is probably more of a concern than the fog disappearing. It may be best to not change the preset here then. One thing I did notice is that preset 3 (default) Perhaps there's a certain vertical threshold from James that triggers near-fog in front of the camera to not render. |
@FrozenFish24 When playing in widescreen we now see a much closer look at the bottom of the toilets when the beginning cutscene plays out... and it doesn't look quite right: My suspicions were confirmed the other week when I watched a video (maybe a streamer? I can't remember) play the game in widescreen and commented how there was still camera clipping issues when they noticed that part of the toilet; they mistakenly thought that bad geometry was a camera clip issue. However, that can be addressed! The UV placements remain untouched. There are two separate, adjusted geometry groups for this file: The main group is the toilets, and the other group are plumbing rings that are not grouped with the rest for some odd reason. (When adjusting the toilets I had to make the plumbing pipes taller to compensate the change, hence their adjustments as well.) May I ask you to replace the toilets and their plumbing? Here are the OBJs: The reference wall is the wall that's behind the toilets/plumbing for sizing/placement reference. Thank you very much for your consideration with this! |
What a beautiful, clean job you did swapping out... dirty, nasty toilets. Thank you, FrozenFish24! |
@FrozenFish24 We can't change the fog parameters to fade this out as there are no fixed cameras in this area to only apply adjusted fog values when looking through the jail bars. We also can't duplicate the geometry to extend out the hallway because this area uses dynamic water. (As we don't know how to readily extend out water effects.) But we can create the illusion of the hallway continuing onward by placing some geometry inside this area--slightly smaller than the hallway itself--and adding a black fade alpha to a texture file and apply it on the new geometry: Which gives us this result: FilesHere is an OBJ of the new 'black fade' geometry (green group) and the ceiling (white group) for size/placement reference: OBJ: prisonRoomBlackFade+CEILINGREFERENCE.zip Thank you! |
Phew... this one was an ass-kicker but I love trying to make the most out of UV real estate. Another geometry adjustment if you'd be up for the task, @FrozenFish24 . When playing in widescreen, and without an adjusted .cam file to hide this window, you see a solid white piece of geometry covering the hole of the window you just climbed through: Oringally, we moved the camera to hide this. But what if we revert this camera change, remove that white piece of geometry, and add part of Woodside back? (Yes! I even matched the camera angle/focal lengths and lighting to ensure this would work/look good!) Not only would this look nicer, but it's also user/player friendly: If they can see the window with outside geometry in it, they'll know/remember this is the window they climbed through (if they ever have to go back in case they forgot something). If this is something I could ask your help with, @FrozenFish24 , here is what's changed:
Thank you always for your consideration on this and the prison post above. I'd love to also know your thoughts if "opening up" the window here would help with user experience for first-timers. A heads-up: Currently the lighting transition in this area was previously bugged. If you download the latest version of the SH2 Enhancements module this room/area will have proper, restored lighting transition values. |
@Polymega These two edits may take a little while as geometry using transparent textures is stored differently in the map files and my tools do not currently handle this, so will require additional reversing. I'll be busy for the near future but I'll try and get these done for you as soon as I can. Really nice work on these edits by the way 👍 |
Hi @FrozenFish24 , Using a widescreen camera we can see an empty void on the other side of the wall in the bottom left corner: This would add sidewalk and street geometry for the area: The attached OBJ has the sidewalk + street geometry along with a grass plane for size/placement reference: And this following texture image has been updated to support the new UVs/textures. This texture file and the new geometry do not use any alphas: Thanks for your consideration with this! |
@Polymega Annoyingly, the geometry that uses this texture is also stored in the transparent section for whatever reason. I've still not had a chance to look into further reversing yet, but I should be able to find some time soon. |
No worries, friend. I just happened to discover another void there and thought it good to exercise the 3D muscles once more. Really appreciate your work and contributions with everything. |
Hi @FrozenFish24 , If I may ask, have you had an opportunity to dig into the .map files more? |
Hey @Polymega I'll hopefully be able to get something useful going for you soon. Thanks for your patience 👍 |
No worries FrozenFish24! Take the time you need and, really, this is worth saying again: Thanks for everything you're doing here. You've helped fixed bugs we were completely stumped on which then allowed us to improve many other environments, along with your Direct3D research to fix other avenues. You rock! |
Hi @FrozenFish24, May I ask of you to swap out some UV placements for the Dog Ending room? Nothing has changed geometry-wise, just the UV positions for the computer wall with the four monitors has been adjusted: Edit: Sorry, forgot to mention the map name is qp05.map Thank you for your consideration |
Thank you so much for everything. We have a few more fixes/adjustments we plan to do before this next release. May I also ask for geometry adjustments to some .map files? I know geometry/textures that are linked to transparent images isn't cracked yet, but I believe the following below aren't tied to any transparent textures (I might be wrong): 🔲 Remove duplicate prison bars for ps85.mapA fan of our project noticed the prison bars have a glitchy effect as the cutscene plays of you finding Maria in the prison cell. I looked into it and it turns out Team Silent accidentally duplicated the vertical prison bars, so there's two instances of the geometry which causes the odd rendering effect (this affects all versions of the game): https://www.youtube.com/watch?v=BRL90l2_uiQ Can the duplicate geometry of the vertical prison bars be removed for ps85.map? 🔲 Fix bad edge looping for piece of geometry in forest trailThis is one that's only an issue when played in widescreen. The edge loop/edge flow for a piece of the forest trail hill is broken for ca09.map, which results in a stray vertex that isn't connected to any other vertices: Deleting edges below the offending poly and then connecting that stray vertex to its corresponding neighbor vertex should fix this rendering issue: ☑️ Adjust UVs for DOG ending monitorsSee the post directly above this one for new UV placements. I have a fun idea/plan for this adjustment that will involve the Silent Hill community as a whole. :) Thank you always ❤️ |
Just letting you know I am working on this. Been hitting some road blocks with my scripts though so it might be a little while. I've finally put them up on GitHub by the way, though they're very rough and not much use to anyone but me at the moment: Edit: This also means to modify maps like ps85 seamlessly we need to work out roughly where Team Silent placed their light sources, their intensity and somehow bake off that information to each vertex's color in addition to any edits. |
I'm sorry. I wasn't aware this was something Team Silent done and how this would add an extra wrinkle/headache to the mix. Knowing this now, I would assume then, that, indoor areas with no specialized lighting don't have special vertex coloring. That's why adding geometry for places like the indoor Hospital and Apartment rooms was more straightforward. Whereas the Maria prison cell is "naturally" lit (so vertex colors are used). The same would probably be true for Hotel Room 312, then (using vertex coloring). |
Hi FrozenFish, |
Sorry this is taking a while @Polymega, been a bit busy these last few weeks. Here's the Dog Ending room with the UVs adjusted to tide you over: I've implemented most of the changes I need to support vertex colors and I've got the edited geometry ready to export so I should have the others done for you in the next few days. |
No worries, friend. We're hoping to include up-scaled, properly-fitted main menu, save screens, and maps for this next update as well, so there's no imminent deadline for anything at the moment. Thanks for the adjusted UVs for qp05. With that adjusted, would you mind casting your vote? :) If I may recap the additional earlier requests, plus one for Hotel Room 312, to have everything recollected: 🔲 Add "fade out" geometry to prison sewer room🔲 Add street geometry for outside Baldwin Mansion🔲 Add apartment geometry outside of Blue Creek windowWe can then revert the camera position to default for this area to re-show the window. This'll also help visually guide new players for the game, to let them easily see that's the window they came from and that they can go back through it, if they need to. Also, with the advent of vertex coloring, can all geometry outside the window/window sill have a vertex color of 255 (full brightness)? The idea would be to hopefully prevent James' flashlight from having any influence on this new wall (because his light will shine through the current room's wall due to the general limitation of the game engine). 🔲 Replace low res 2D fence with 3D modelFor Hotel Room 312 (rr91.map), can the flat geometry that makes up the low res 2D fence texture be removed and replaced with a 3D fence model instead? Given the importance of the cutscene that plays out here--and how prominent this fence can be during the cutscene--it'd be ideal to have it look nicer. The heavy pixelation from the flat texture makes it a bit distracting, otherwise. Attached is an OBJ of the 3D fence. I didn't include a "reference" piece for size/scaling as it's probably pretty intuitive how it should fit. The new 3D fence shares/uses the same texture file as the original 2D fence: 🔲 Final requestIt's easier to verbally explain this one so I made a video for you and sent the link to your email. Thank you <3 |
Cast my vote and checked out your email. Nice edits as usual, you're very talented! I've still not RE'd the whole "geometry with transparent textures" thing sufficiently so several of these might take some time. Otherwise I'm on it! In regards to the Blue Creek Window, I don't believe any areas where you can use your flashlight have vertex color-based static lighting. I imagine we could just exclude your wall like we do the TV Static/Heaven's Night Windows (though this may also exclude the window frame and shutters). |
Ah, that makes perfect sense. I think I even hypothesized that previously but forgot (which is why it was possible to edit previous areas as you've already done).
True! Also, another hail Mary idea I had was to set the normal angle for the outside wall to an extreme angle to help make the wall bright. But before worrying about any of that, I'm hoping the light source that's already plugged into this room by the game will brighten that outside wall for us automatically, so we don't even need to worry about it. My only potential fear is, due to game engine limitations, James' light will shine through the wall onto the outside wall, making it look a little odd: My hope is if the outside wall is full brightness, the flashlight's light can't influence that wall's brightness any further. |
That blood pool is the prettiest blood pool I've ever seen because it inspires progress and hope! 😍😍 |
Hi @FrozenFish24 , Exciting times are ahead as we hope to release the next update sometime next month! (Hopefully no later than mid-to-late February.) Have you had any opportunities to experiment more with the .map files? |
@Polymega I'll admit I've been burnt out since my last post from staring at hex dumps and the obtuse layout these files have. But my enthusiasm has recently returned and I was planning to do some more work on it this week. If I'm unable to get my tools working universally, as I'd like, I should at least be able to have your map files done by Feb 👍 |
I'm sorry about the burn out. And it's completely understandable. Virtually no detailed documentation on these formats just leaves you in the dark, and frustrated. And then you got folks like me being starry eyed, just to compound it. Thank you for the update, and your patience with the whole situation. Seriously though, no worries about pushing the work off until an update after this one. I'm more concerned about you and your long term enjoyment working with the project. But hey, I don't know how often you check your email, but I sent you something cool to start off your week. :) |
@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:
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:
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:
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?
The text was updated successfully, but these errors were encountered: