Silent-Hill-2-Enhancements: Otherworld Brookhaven staircase map inconsistency

In Brookhaven hospital you have access to four maps:

  1. A plant of the 2nd and 3rd floors as well as the rooftop
  2. A plant of the 1st floor and the basement
  3. A plant of the 2nd and 3rd floors as well as the rooftop (Otherworld)
  4. A plant of the 1st floor and the basement (Otherworld)

When you enter the staircase that leads to the Pyramid Head chase in the alternate version of the hospital, the map correctly shows your position in the Otherworld version of the map, 3rd or 2nd floor depending on where you are standing (map no. 3 in the list I made above).

Captura de tela de 2023-11-25 00-25-04

Logically, when you get to the first floor the map should show your position in the Otherworld 1st floor (map no. 4). I marked in green where you should appear. Notice there’s a broken door mark there in the map, next to the elevator, and a save point.

Captura de tela de 2023-11-25 00-25-15

When you open the map in that spot though, you appear in the “fog world” version of the 1st floor.

Captura de tela de 2023-11-25 00-26-21

Also, even if you interact with that door right there, it will not get marked on the map, because James isn’t in the fog world version of the hospital anymore.

As an addendum, imagine if the developers had made it so that door was locked from the side of the staircase, allowing you to the 1st floor patient wing hall and save in that corridor that leads to the garden before you go to the basement? Oh it would’ve made the chase on hard action so much more tolerable…


By the way, please forgive me for being a nosy sonuva but I was checking out the code for the project and here’s a little something I noticed. This code is from the file Patches/LightingPatch.cpp (line 121, as marked in the URL):

if (CurrentRoomID == 0x08 /*Town West*/ || CurrentRoomID == 0xD3 /*Mansion outside main entrance*/)

I see two ways that the readability here could be improved and possibly even the maintainability of the codebase as a whole. The first is simpler but less flexible and involves attributing these conditional statements to #defines, thus allowing you to assign names to these conditions and avoiding having to comment the name of the maps the IDs correspond to or keeping an external spreadsheet of IDs. This line, for example, could become:

if (MAP_TOWN_WEST || MAP_MANSION_OUTSIDE_MAIN_ENTRANCE)

Of course this would scale very poorly as more and more “RoomId ==” conditionals are created and it’s a very hacky thing to do. The second would be to create an enumeration of room IDs in Patches/Common.cpp and alter the return type of the GetRoomID function to be of that enum, then perform a cast before returning. Let’s say this is the enum we created:

enum RoomIDs {
FOO = 0x00,
BAR = 0x01,
BAZ = 0x02,
BIZ = 0x03,
TOWN_WEST = 0x08,
MANSION_OUTSIDE_MAIN_ENTRANCE = 0xD3
};

After altering GetRoomID to be of type enum RoomIDs and performing a cast to that type in line 160, you could then do so in LightingPatch.cpp:

if (CurrentRoomID == TOWN_WEST|| CurrentRoomID == MANSION_OUTSIDE_MAIN_ENTRANCE)

It becomes much easier to maintain an enum of all room IDs in the game and use their names in the code rather than their IDs. From a quick glance it appears there are a few other function that could similarly be altered, for example GetCutsceneID (would require an enum of all cutscenes in the game) and GetChapterID (a simple two-entry enum for LFSH and BFAW). However, I’m not really sure if that cast would be possible to perform, though I imagine so since *pRoomID is a pointer (void*). I’d love to see your thoughts on this.

About this issue

  • Original URL
  • State: open
  • Created 7 months ago
  • Comments: 19 (6 by maintainers)

Commits related to this issue

Most upvoted comments

@elishacloud Murugo found a Room ID we missed (0xBC). I also renamed the name for 0xBF as a result. Thanks, Murugo!

What do you say we do items as well?

I’m personally in no rush/need to do the items. The room and cutscene IDs have made up 99% of what we’d need for certain features. FrozenFish did start something like this a few years back (needed for soft shadow work) that you can find here: https://github.com/elishacloud/Silent-Hill-2-Enhancements/blob/bd3ec05d72cb79b7af8daf3160d8f577b04fcc91/Patches/ModelID.h

Hi Elisha,

Matheus and I have compiled hex numbers for all cutscene and room IDs throughout the game:

https://docs.google.com/spreadsheets/d/1dIbtpJ9hkuO5fSv4mgz4guHHbwoxXyujGIAmCMG_oZg/edit?usp=drivesdk

We figured we might as well catalog them all for posterity, and in case it might be of any help in the future.

Thanks!

Done! I just finished the hospital and am calling it a night there. Within the document there’s two tabs for Room and Cutscene IDs. Feel free to add on and thanks!

@Polymega, by any chance, do you have a spreadsheet of IDs for things like rooms, cutscenes, items etc? I imagine there must be one otherwise it’d be nearly impossible to maintain the codebase up to this point without memorizing the IDs.

One hasn’t been made but it’s something I can do in the future.

Just a suggestion, you can probably omit the what type of item you’re referring to in the names of the enum constants because it can be inferred from variable being checked.

Yeah, I was just trying to prevent overlapping names and try for some level of consistency. Anyways, I changed it to “SC_”, which is smaller but still allows for consistency.

You can also safely set the constants to hexadecimal values (it will behave exactly like decimal numbers), which is smart to do in big lists like for cutscenes and rooms.

Yes, I knew that. But I could not decide whether to use decimal or hexadecimal numbers. I changed it to hexadecimal since I think that is used exclusively for cutscene IDs and it can eliminate the remarks I had.

create an enumeration of room IDs in Patches/Common.cpp and alter the return type of the GetRoomID function to be of that enum

Yes, I already started doing this for some items. It’s definitely a good idea to do for Room IDs, Event IDs, and a few other items.

Oh wow! That’s interesting about the map. I probably would’ve never noticed that before. I’ll jot that down but I’m not sure if/when it’d be looked into.

Thanks, matheusvb3!