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
589 stars 41 forks source link

Brightness is set to 0 on first launching game #391

Closed Psycho-A closed 3 years ago

Psycho-A commented 3 years ago

I've noticed that game became start with brightness = 0 on clear profile since of some last EE update. Screen is really dark, and white levels dimmed twice. I've checked EE config and found that "UseBestGraphics" param does this bug. But why? I really don't think we got "Best graphics" with all that darkness...

Polymega commented 3 years ago

UseBestGraphics shouldn't touch/affect the brightness level. We made sure it doesn't set/override this setting. I deleted my settings.ini file and launched the game, and it was set to default brightness (level 3). I then set the level to 0, deleted my settings.ini file again, relaunched the game, and it defaulted back to level 3.

Psycho-A commented 3 years ago

That's strange, because I'm doing the same (remove brightness from settings.ini), but brightness is set to 0 again on next loading for me. Setting RestoreBrightnessSelector to 0 helps get normal brightness level (default), but it causes set zero level in game settings too (although adjusting here does nothing in fact, and always used default level).

Polymega commented 3 years ago

On my Win10 laptop I don't have this issue (as mentioned in my post above). But on my Win7 & Win10 desktops I experience the same behavior as you. If I fully remove the settings.ini file and launch the game, the brightness defaults to 0 on my desktops.

This may be a safety measure by the PC game to boot some options in the "safest" mode if it can't detect a settings.ini file on launch. I'm not sure.

Setting RestoreBrightnessSelector to 0 helps get normal brightness level (default), but it causes set zero level in game settings too (although adjusting here does nothing in fact, and always used default level).

That's correct. This is because the vanilla brightness selector only works if playing in fullscreen mode. Our RestoreBrightnessSelector fixes that, but also requires d3d8to9 for it to work and uses whatever brightness value is set in the settings.ini file.

An easy solution I could do is include a pre-configured settings.ini file (with brightness set to 3) with the "Enhanced Executable" download.

Edit: With all of @elishacloud's work with the brightness selector in the past, maybe there's an instruction we can find that defaults the brightness to 0 if it doesn't detect a settings.ini file on launch and change the default to 3?

Psycho-A commented 3 years ago

This may be a safety measure by the PC game to boot some options in the "safest" mode if it can't detect a settings.ini file on launch. I'm not sure.

Strange, I thought the safe mode is disabled a long times ago... I never encountered it on past year's EE module versions (did no updates since last summer). It's not hard to me to use pre-configured settings, but for clarity of project sake it's still not the best solution...

P.S. In order not to create a new issue, let me ask here too. What made to zip two DirectX dll files inside the EE module that still weren't in version 1.7.1850? The module requires DirectX redists to be installed anyway; also, higher dependencies are always worse for compatibility...

Polymega commented 3 years ago

Strange, I thought the safe mode is disabled a long times ago

Yeah, this is odd. We'll probably need to have Elisha look into this. I re-tested on my laptop and I don't have this issue there. It defaults to brightness 3 if there's no settings.ini file. I'm not sure why this is behaving different/correctly on my laptop.

Maybe it has to do with where the game is installed? (Admin-protected directory vs. user directory?) No clue...

What made to zip two DirectX dll files inside the EE module that still weren't in version 1.7.1850?

This is why:

Polymega commented 3 years ago

I've checked EE config and found that "UseBestGraphics" param does this bug

Duh. My laptop can't support the fog effects so I disable UseBestGraphics on there so the fog won't be re-enabled on each launch. I forgot I did this. That's why the brightness correctly defaults to 3 without the settings.ini file on my laptop.

This is the relevant code for UseBestGraphics.

So here's what I tested next. I disabled UseBestGraphics and found the following:

I then tested the above using the vanilla version of the game and the same results happened. This means:

UseBestGraphics defaults the brightness to 0 if no settings.ini file exists (unlike the vanilla version which defaults to 3), and the vanilla game itself defaults the brightness to 0 if SET DX_CONFIG_BRIGHTNESS is specifically removed from an existing settings.ini file.

I'm thinking if no settings.ini file already exists then UseBestGraphics "spoofs" the game into thinking this ini file does exist (as it needs to enable the best settings) and, since we do not set the brightness level within UseBestGraphics, the brightness defaults to 0 due to the behavior I noted just above.

Psycho-A commented 3 years ago

Hm... well, then I hope we'll can ever get some hack from @elishacloud in EE module that will always return normal default level no matter is settings.ini presented or not, or is UseBestGraphics enabled...

Polymega commented 3 years ago

I think we'll need to fix this before the next update release.

The reason for UseBestGraphics's existence is because I've seen many streamers play SH2 using with the lowest graphical settings and they think that's the way the game is supposed to look. (I assume they launched the game before implementing our project files, the game crashed, and then it booted in safe mode for them.)

A lot of streamers don't check the options menu, for whatever reason, and this seems to also apply to them not checking the brightness level. Because over the past few months I've now seen streamers play the entire game at brightness 0, and they think that's the normal brightness level. Example: Here's a recent tweet by someone, the brightness is set to 0.

I've assumed they were downloading a copy of the game from the internet that had an included, pre-configured file with the brightness set to 0. But it turns out this is due to UseBestGraphics and the non-existence of a settings.ini before launch.

Psycho-A commented 3 years ago

Ah, this is what I told at beginnig... Lots of noobs people don't even touch default settings anywhere at all...

Polymega commented 3 years ago

Indeed. But I'm sure you can understand my confusion as we deliberately made it to where UseBestGraphics doesn't touch/affect the brightness level. So I didn't think UseBestGraphics would cause this issue.

elishacloud commented 3 years ago

This will be fixed in the next update.

elishacloud commented 3 years ago

Here is the fixed build: d3d8.zip

Polymega commented 3 years ago

Looks to be working great--behaves like vanilla PC version in regards to this now. Thank you, Elisha!

elishacloud commented 3 years ago

Basically this change calls the original SH2 function to set defaults for all settings and then calls the function to set "best graphics" after that. This way any option not set by the "best graphics" function will still be set by the original SH2 function. Previously only the options set by the "best graphics" function would get set.