Silent-hill-2-enhancements: Launcher

Created on 2 Jul 2019  路  13Comments  路  Source: elishacloud/Silent-Hill-2-Enhancements

I'm not exactly an expert in programming, but I was thinking.
Would it be complicated to develop a launcher for all the options rather than using the .ini file? Would be smoother for potential players who are not very technical.

All 13 comments

A launcher is certainly not a bad idea! Such decision would ultimately be up to Elisha, our lead programmer for the project.

However, I was planning on sending him a revised structure format for the INI file, to make it more intuitive for the common user. Basically categorizing fixes into more sensible groups and putting the more used/important fixes up top.

Here was my proposed format:

;; Config file for Silent Hill 2 Enhancements

[RESOLUTION & DISPLAY MODE]
ResX = 0 // Game resolution width, set to 0 to inherently size to your display width.
ResY = 0 // Game resolution height, set to 0 to inherently size to your display height.
EnableWndMode = 1 // Enables forced windowed mode.
FullscreenWndMode = 1 // Enables fullscreen windowed mode. Requires EnableWndMode = 1.
WndModeBorder = 0 // Enables window border when WndMode is enabled.

[PERFORMANCE SETTINGS]
SingleCoreAffinity = 1 // Limits game to one CPU core to prevent sound loop and other bugs. Set value to 1 or higher to change core used. (i.e. 1 = CPU 0, 2 = CPU 1, etc).
FPSLimit = 30 // Controls the game's overall framerate limit. *It is recommended to keep the FPS at 30.* There are noted audio/visual issues if this value is changed.
ImproveStorageSupport = 1 // Allows you to save the game when you have more than 2 TB of free memory space.
CreateLocalFix = 1 // Creates a "local.fix" file for GPU-based anti-aliasing support.
DisableSafeMode = 1 // Prevents the game from using the lowest visual settings upon relaunch if the game crashes.

[ADVACNED OPTIONS]
d3d8to9 = 1 // Causes Silent Hill 2 to use DirectX 9, allowing for additional features and fixes to be used.
AutoUpdateModule = 1 // Checks for updated versions of the SH2 Enhancement module.
EnableSFXAddrHack = 1 // Allows custom SFX files to be used. Required if using the Audio Enhancement Pack.
NoCDPatch = 1 // Removes the CD checks on some versions of SH2. Not guaranteed to work on all executables.
UseCustomModFolder = 1 // Uses custom files in the 'sh2e' folder rather than the 'data' folder.

[HUD & VISUAL SETTINGS]
Fix2D = 1 // Enable (1) to display fullscreen 2D images at their original aspect ratio. Disable (0) to stretch the images to fill the screen. Affects all fullscreen 2D images, along with subtitles.
FullscreenImages = 1 // Crops (hides) the letterboxing on fullscreen 2D images to fill the screen.
DisableRedCross = 0 // Disables the low health indicator completely. This option is recommended only if you are using a controller with vibration enabled.
DisableRedCrossInCutScenes = 1 // Hides the low health indicator during in-game cutscenes. Use with FastTransitions = 1 for best results.
DisableCutsceneBorders = 1 // Removes cutscene letterboxing.
FastTransitions = 1 // Increases the speed of all transitions, such as when opening your inventory or going through doors.
FMVWidescreenMode = 1 // Cutscenes and movies will display better in widescreen.
FMVWidescreenEnhancementPackCompatibility = 1 // Adds compatibility when using the FMV Enhancement Pack.
IncreaseNoiseEffectRes = 512 // Use 128 and above to increase noise effect resolution. Default value 512.
PS2CameraSpeed = 1 // Changes camera speed to match PS2 version. Use with FPSLimit = 30.
ReduceCutsceneFOV = 1 // Cutscenes will use vert- scaling to match the horizontal composition of the original 4:3 cutscenes, which hides off-screen characters and other visual anomalies.

[CONTROLLER]
XInputVibration = 1 // Replaces DirectInput based vibration with XInput based vibration. Restores vibration for both DirectInput and XInput gamepads.
PadNumber = 0 // XInput pad ID to vibrate. Default value 0.
DPadMovementFix = 1 // Allows movement with D-pad on DirectInput and XInput gamepads.
GamepadControlsFix = 1 // Allows the same button to be assigned to multiple actions.
SteamCrashFix = 1 // Prevents a crash when Steam controller configuration is used.

[NAVIGATION & LANGUAGE]
LockResolution = 1 // Shows the true resolution being used and disables changing the resolution in the game's options menu, which can crash the game while using enhancement packages.
MainMenuFix = 1 // Fixes mouse hitboxes on the game's main menu (for North American EXE 1.1).
MainMenuTitlePerLang = 1 // Loads 'start01x.tex' (graphic Main Menu, 'x' is the first letter of language) according to the selected language (for 1.0 and 1.1 versions only).
UseCustomExeStr = 1 // Restores the language selection in the Options menu (for North American EXE 1.0 and 1.1). 'exe_str.txt' must be present in 'sh2e\text\' for this fix to work. 
UnlockJapLang = 0 // Unlocks Japanese language in the Options menu. It is recommended to keep this disabled for now, as not all Japanese characters are currently supported.

[GAME FIXES]
CatacombsMeatRoomFix = 1 // Updates the color and lighting of the catacomb meat cold rooms to be more like the PS2.  This update also requires updated 'ps189.map' and 'ps193.map' files.
CemeteryLightingFix = 1 // Prevents saving wrong lighting values in the cemetery, which can corrupt the fog.
ClosetCutsceneFix = 1 // Adjusts visuals during the apartment closet cutscene to resemble the PS2 version.
FixHangOnEsc = 1 // Fixes an issue where the game will hang when Esc is pressed while transition is active.
FixMissingWallChunks = 1 // Fixes an issue on Nvidia graphics cards where wall chunks are missing in some locations.
Fog2DFix = 1 // Fixes an issue on Nvidia graphics cards where the 2D fog is missing.
FogParameterFix = 1 // Adjusts the fog-of-war boundaries for specific areas to fix visual errors.
HalogenLightFix = 1 // Fixes the prison hallway halogen lights.
HospitalChaseFix = 1 // Correctly syncs an attack animation to the rest of the cutscene that plays out during the Hospital chase.
HotelWaterFix = 1 // Restores lighting values for the hotel water.
IncreaseDrawDistance = 1 // Increases the front draw distance in certain areas to hide the environment loading in.
LightingFix = 1 // Fixes a flashlight bug, and restores the fog and lighting conditions for one of the ending cutscenes.
LightingTransitionFix = 1 // Makes lighting transition smooth from one light source to another for a few particular areas.
PistonRoomFix = 1 // Hides a piston behind a door that should not be seen during a cutscene.
PS2FlashlightBrightness = 1 // Adjusts flashlight brightness to resemble the PS2 version. Reduces flashlight intensity for environments, but keeps enemies and NPCs bright.
PS2StyleNoiseFilter = 1 // Adjusts noise filter to resemble the PS2 version. Use with IncreaseNoiseEffectRes = 512 for best results.
Room312ShadowFix = 1 // Prevents distracting shadow flickering while in Room 312 of the Hotel.
RowboatAnimationFix = 1 // Fixes an issue with rowboat animation if you exit to the menu and reload the game.
WhiteShaderFix = 1 // Fixes an issue on Nvidia graphics cards where certain textures would appear as white when they should be black.

[PLUGINS]
LoadPlugins = 0 // Loads ASI plugins
LoadFromScriptsOnly = 0 // Loads ASI plugins only from the 'scripts' and 'plugins' folders.
LoadD3d8FromScriptsFolder = 0 // Loads d3d8.dll from the 'scripts' and 'plugins' folders. Requires d3d8to9 = 0.

[INTEGRATED PACKAGES]
WidescreenFix = 1 // Enables SH2 WidescreenFixesPack and sh2proxy module.
Nemesis2000FogFix = 1 // Enables the Nemesis2000 Fog Fix module. See settings below.

[FONT]
UseCustomFonts = 1 // Loads 'font000.tga' file located in 'sh2e\font' folder as font texture and "fontwdata.bin" as width data for the first 224 chars.
DisableEnlargedText = 1 // Disables enlarged, floating save/load menu text.
CustomFontCol = 100 // Number of chars in column on font texture. Default custom value 100.
CustomFontRow = 14 // Number of chars in row on font texture. Default custom value 14.
CustomFontCharWidth = 20 // Width of single char on font texture. Default custom value 20.
CustomFontCharHeight = 32 // Height of single char on font texture. Default custom value 32.
NormalFontWidth = 20 // Width of single char in game. Default custom value 20.
NormalFontHeight = 30 // Height of single char in game. Default custom value 30.
SmallFontWidth = 16 // Width of single char in game. Default custom value 16.
SmallFontHeight = 24 // Height of single char in game. Default custom value 24.

[FOG]
fog_custom_on = 1 // 0 - Off, 1 - On.
fog_transparency_layer1 = 128 // Original value 128. Default custom value 128.
fog_transparency_layer2 = 138 // Original value 128. Default custom value 138.
fog_layer1_x1 = 0.250 // Original value 0.125. Default custom value 0.250.
fog_layer1_x2 = 0.250 // Original value 0.125. Default custom value 0.250.
fog_layer1_y1 = 0.250 // Original value 0.125. Default custom value 0.250.
fog_layer1_y2 = 0.250 // Original value 0.125. Default custom value 0.250.
fog_layer2_density_mult = 1.4 // Original value 1.0. Default custom value 1.4.
fog_layer2_density_add = 100.0 // Original value 0.0. Default custom value 100.0.
fog_layer2_complexity = 0.066406 // Original value 0.048828. Default custom value 0.066406.

[MISC]
SelfUpdate = 0

[MODS]
d3d8.dll = https://github.com/elishacloud/Silent-Hill-2-Enhancements

[d3d8.dll]
PlaceToRoot
  • The list above includes LockResolution, MainMenuFix, MainMenuTitlePerLang which are not yet added to the project but will be upon Belek666's pull request.

The fixes are in alphabetical order within each category, except for those that are the most important. For those ones, they're at the very top of each category.

While not a launcher, I do feel that a reorganization would definitely help the common user.

That format seems perfect. Those explanations are very helpful!

Also, if you end up making a launcher, please make it optional. I start Silent Hill 2 through Steam Big Picture and I want it to go directly into the game and not having to go to my PC first to start the game via the launcher.

Yes, I have considered adding a launcher. I will put this on my feature list.

@Polymega, I like the new organization of settings. However a couple of comments:

  1. For some of the settings the header makes a difference. Changing the header may break some settings. You might want to test this to make sure that it works with the new headers.
  2. Adding the remark on the same line as the setting causes the remarks to get lost after an update with modupdater. What if we move the remarks to be on the line above the setting like some other ini files are?

Sure thing, I'll test this out soon and report back.

What if we move the remarks to be on the line above the setting like some other ini files are?

That would be an awesome idea. I always wondered why the INI file was stripped down after updating through modupdater. I'm glad to know this.

I should make one more note. This might be a bit picky, but the symbol for a remark in an ini file is supposed to be a semicolon ;.

So the file should look like this:

;; Config file for Silent Hill 2 Enhancements

[RESOLUTION & DISPLAY MODE]
; Game resolution width, set to 0 to inherently size to your display width.
ResX = 0
; Game resolution height, set to 0 to inherently size to your display height.
ResY = 0
; Enables forced windowed mode.
EnableWndMode = 1
; Enables fullscreen windowed mode. Requires EnableWndMode = 1.
FullscreenWndMode = 1
; Enables window border when WndMode is enabled.
WndModeBorder = 0

Rather than like this:

;; Config file for Silent Hill 2 Enhancements

[RESOLUTION & DISPLAY MODE]
// Game resolution width, set to 0 to inherently size to your display width.
ResX = 0
// Game resolution height, set to 0 to inherently size to your display height.
ResY = 0
// Enables forced windowed mode.
EnableWndMode = 1
// Enables fullscreen windowed mode. Requires EnableWndMode = 1.
FullscreenWndMode = 1
// Enables window border when WndMode is enabled.
WndModeBorder = 0

// is the remark character for C++ and JavaScript, but not ini files.

This might be a bit picky, but the symbol for a remark in an ini file is supposed to be a semicolon ;.

Not picky at all. A coding standard is a standard for a reason. :)

Changing the header may break some settings. You might want to test this to make sure that it works with the new headers.

Good catch. That seems to be the case for all the WSF fixes and the Fog Fix (although that header is perfectly fine as "FOG").

Silent's and Belek's pull request work seems to be fine with changed headers, along with the work implemented directly from this repository.

Disclaimer: I didn't extensively check _every_ fix done/implemented by you, Elisha, as the handful of ones I checked were fine and assume you kept that coding standard up for all the other fixes you implemented throughout.

The flow is a bit broken up now, but what do you think of this?

;; Config file for Silent Hill 2 Enhancements

[MAIN]
; Game resolution width, set to 0 to inherently size to your display width.
ResX = 0
; Game resolution height, set to 0 to inherently size to your display height.
ResY = 0
; Enables forced windowed mode.
EnableWndMode = 1
; Enables fullscreen windowed mode. Requires EnableWndMode = 1.
FullscreenWndMode = 1
; Enables window border when WndMode is enabled.
WndModeBorder = 0
; Enable (1) to display fullscreen 2D images at their original aspect ratio. Disable (0) to stretch the images to fill the screen. Affects all fullscreen 2D images, along with subtitles.
Fix2D = 1
; Cutscenes and movies will display better in widescreen.
FMVWidescreenMode = 1
; Adds compatibility when using the FMV Enhancement Pack.
FMVWidescreenEnhancementPackCompatibility = 1

[ADVANCED OPTIONS]
; Causes Silent Hill 2 to use DirectX 9, allowing for additional features and fixes to be used.
d3d8to9 = 1
; Checks for updated versions of the SH2 Enhancement module.
AutoUpdateModule = 1
; Allows custom SFX files to be used. Required if using the Audio Enhancement Pack.
EnableSFXAddrHack = 1
; Removes the CD checks on some versions of SH2. Not guaranteed to work on all executables.
NoCDPatch = 1
; Uses custom files in the 'sh2e' folder rather than the 'data' folder.
UseCustomModFolder = 1

[PERFORMANCE SETTINGS]
; Limits game to one CPU core to prevent sound loop and other bugs. Set value to 1 or higher to change core used. (i.e. 1 = CPU 0, 2 = CPU 1, etc).
SingleCoreAffinity = 1
; Disables the Microsoft Game Explorer (GameUX) to prevent rundll32.exe high CPU usage, along with other performance issues.
DisableGameUX = 1
; Allows you to save the game when you have more than 2 TB of free memory space.
ImproveStorageSupport = 1

[MISC]
; Removes cutscene letterboxing.
DisableCutsceneBorders = 1
; Prevents the game from using the lowest visual settings upon relaunch if the game crashes.
DisableSafeMode = 1
; Creates a "local.fix" file for GPU-based anti-aliasing support.
CreateLocalFix = 1
; Increases the speed of all transitions, such as when opening your inventory or going through doors.
FastTransitions = 1
; Controls the game's overall framerate limit. *It is recommended to keep the FPS at 30.* There are noted audio/visual issues if this value is changed.
FPSLimit = 30
; Crops (hides) the letterboxing on fullscreen 2D images to fill the screen.
FullscreenImages = 1
; Allows the same button to be assigned to multiple actions.
GamepadControlsFix = 1
; Use 128 and above to increase noise effect resolution. Default value 512.
IncreaseNoiseEffectRes = 512
; Fixes a flashlight bug, and restores the fog and lighting conditions for one of the ending cutscenes.
LightingFix = 1
; Changes camera speed to match PS2 version. Use with FPSLimit = 30.
PS2CameraSpeed = 1
; Cutscenes will use vert- scaling to match the horizontal composition of the original 4:3 cutscenes, which hides off-screen characters and other visual anomalies.
ReduceCutsceneFOV = 1
; Prevents a crash when Steam controller configuration is used.
SteamCrashFix = 1

[HUD & VISUAL SETTINGS]
; Disables the low health indicator completely. This option is recommended only if you are using a controller with vibration enabled.
DisableRedCross = 0
; Hides the low health indicator during in-game cutscenes. Use with FastTransitions = 1 for best results.
DisableRedCrossInCutScenes = 1

[CONTROLLER]
; Replaces DirectInput based vibration with XInput based vibration. Restores vibration for both DirectInput and XInput gamepads.
XInputVibration = 1
; XInput pad ID to vibrate. Default value 0.
PadNumber = 0
; Allows movement with D-pad on DirectInput and XInput gamepads.
DPadMovementFix = 1

[NAVIGATION & LANGUAGE]
; Shows the true resolution being used and disables changing the resolution in the game's options menu, which can crash the game while using enhancement packages.
LockResolution = 1
; Fixes the mouse hitboxes for the game's main menu selections (for North American EXE 1.1).
MainMenuFix = 1
; Loads translated main menu text selections for North American EXE 1.0 and 1.1. 'start01*.tex' files must be present in 'sh2e\pic\etc\' for this fix to work. 
MainMenuTitlePerLang = 1
; Restores the language selection in the Options menu for North American EXE 1.0 and 1.1. 'exe_str.txt' must be present in 'sh2e\text\' for this fix to work. 
UseCustomExeStr = 1
; Unlocks Japanese language in the Options menu. It is recommended to keep this disabled for now, as not all Japanese characters are currently supported.
UnlockJapLang = 0

[GAME FIXES]
; Updates the color and lighting of the catacomb meat cold rooms to be more like the PS2.  This update also requires updated 'ps189.map' and 'ps193.map' files.
CatacombsMeatRoomFix = 1
; Prevents saving wrong lighting values in the cemetery, which can corrupt the fog.
CemeteryLightingFix = 1
; Adjusts visuals during the apartment closet cutscene to resemble the PS2 version.
ClosetCutsceneFix = 1
; Fixes an issue where the game will hang when Esc is pressed while transition is active.
FixHangOnEsc = 1
; Fixes an issue on Nvidia graphics cards where wall chunks are missing in some locations.
FixMissingWallChunks = 1
; Fixes an issue on Nvidia graphics cards where the 2D fog is missing and restores James' flashlight lens glow.
Fog2DFix = 1
; Adjusts the fog-of-war boundaries for specific areas to fix visual errors.
FogParameterFix = 1
; Fixes the prison hallway halogen lights.
HalogenLightFix = 1
; Correctly syncs an attack animation to the rest of the cutscene that plays out during the Hospital chase.
HospitalChaseFix = 1
; Restores lighting values for the hotel water.
HotelWaterFix = 1
; Increases the front draw distance in certain areas to hide the environment loading in.
IncreaseDrawDistance = 1
; Makes lighting transition smooth from one light source to another for a few particular areas.
LightingTransitionFix = 1
; Hides a piston behind a door that should not be seen during a cutscene.
PistonRoomFix = 1
; Adjusts flashlight brightness to resemble the PS2 version. Reduces flashlight intensity for environments, but keeps enemies and NPCs bright.
PS2FlashlightBrightness = 1
; Adjusts noise filter to resemble the PS2 version. Use with IncreaseNoiseEffectRes = 512 for best results.
PS2StyleNoiseFilter = 1
; Prevents distracting shadow flickering while in Room 312 of the Hotel.
Room312ShadowFix = 1
; Fixes an issue with rowboat animation if you exit to the menu and reload the game.
RowboatAnimationFix = 1
; Fixes an issue on Nvidia graphics cards where certain textures would appear as white when they should be black.
WhiteShaderFix = 1

[PLUGINS]
; Loads ASI plugins.
LoadPlugins = 0
; Loads ASI plugins only from the 'scripts' and 'plugins' folders.
LoadFromScriptsOnly = 0
; Loads d3d8.dll from the 'scripts' and 'plugins' folders. Requires d3d8to9 = 0.
LoadD3d8FromScriptsFolder = 0

[INTEGRATED PACKAGES]
; Enables SH2 WidescreenFixesPack and sh2proxy module. If disabled, various fixes within this INI file will also be disabled.
WidescreenFix = 1
; Enables the Nemesis2000 Fog Fix module. See settings below.
Nemesis2000FogFix = 1

[FOG]
; Enable (1)/Disable (0) the custom fog fix.
fog_custom_on = 1
; Original value 128. Default custom value 128.
fog_transparency_layer1 = 128
; Original value 128. Default custom value 138.
fog_transparency_layer2 = 138
; Original value 0.125. Default custom value 0.250.
fog_layer1_x1 = 0.250
; Original value 0.125. Default custom value 0.250.
fog_layer1_x2 = 0.250
; Original value 0.125. Default custom value 0.250.
fog_layer1_y1 = 0.250
; Original value 0.125. Default custom value 0.250.
fog_layer1_y2 = 0.250
; Original value 1.0. Default custom value 1.4.
fog_layer2_density_mult = 1.4
; Original value 0.0. Default custom value 100.0.
fog_layer2_density_add = 100.0
; Original value 0.048828. Default custom value 0.066406.
fog_layer2_complexity = 0.066406

[FONT]
; Loads 'font000.tga' file located in 'sh2e\font' folder as font texture and "fontwdata.bin" as width data for the first 224 chars.
UseCustomFonts = 1
; Disables enlarged, floating save/load menu text.
DisableEnlargedText = 1
; Number of chars in column on font texture. Default custom value 100.
CustomFontCol = 100
; Number of chars in row on font texture. Default custom value 14.
CustomFontRow = 14
; Width of single char on font texture. Default custom value 20.
CustomFontCharWidth = 20
; Height of single char on font texture. Default custom value 32.
CustomFontCharHeight = 32
; Width of single char in game. Default custom value 20.
NormalFontWidth = 20
; Height of single char in game. Default custom value 30.
NormalFontHeight = 30
; Width of single char in game. Default custom value 16.
SmallFontWidth = 16
; Height of single char in game. Default custom value 24.
SmallFontHeight = 24

[MISC]
SelfUpdate = 0

[MODS]
d3d8.dll = https://github.com/elishacloud/Silent-Hill-2-Enhancements

[d3d8.dll]
PlaceToRoot

Good catch. That seems to be the case for all the WSF fixes and the Fog Fix (although that header is perfectly fine as "FOG").

Yes, I was pretty sure that WSF required special headers. I also know that modupdater requires special headers, but you did not change those so we are ok there.

Disclaimer: I didn't extensively check every fix done/implemented by you

Not to worry. All the fixes in this module can be under any heading.

The flow is a bit broken up now, but what do you think of this?

Yes, the flow looks much better. Just a couple of comments:

  1. SingleCoreAffinity is now handled by my code, so you could move this one somewhere else if desired.
  2. I added a new option yesterday called DisableGameUX. This will disable the Microsoft Game Explorer (GameUX) to prevent rundll32.exe high CPU. You may want to add this somewhere appropriate.

Perfect. I updated my post right above your's then. :)

Also included in this list is the upcoming pull request fixes by Belek666. (LockResolution, MainMenuFix, and MainMenuTitlePerLang).

I also know that modupdater requires special headers, but you did not change those so we are ok there.

lol I just got lucky then. I assume the modupdater is the SelfUpdate under [MISC] near the bottom?

I assume the modupdater is the SelfUpdate under [MISC] near the bottom?

Correct. The three bottom most options are all for the modupdater. Here are the options:

[MISC]
SelfUpdate = 0

[MODS]
d3d8.dll = https://github.com/elishacloud/Silent-Hill-2-Enhancements

[d3d8.dll]
PlaceToRoot

I updated my post right above your's then.

Ok, I will update this on my next check-in after I merge belek666's pull request.

Updated the project with the new ini layout. I made one change under ImproveStorageSupport. I changed the word "memory" to "disk". While disk space can be referred to as memory, it is more common for RAM to be referred to as memory.

I'll keep this issue open until the Launcher is created, since that was the original request here.

Slightly off-topic, but the default value for fog_transparency_layer2 is set to 138, yet the comment mentions that the default should be 128. I searched the github for the variable and this ticket came up and I'm none-the-wiser with regards to what the "true" default value is. I'm guessing it is actually supposed to be 128, right?

Original value 128. Default custom value 138.
fog_transparency_layer2 = 138

That means the vanilla PC version used 128, but our custom default is using 138 for a better appearance with the fog.

Launcher would be much appreciated and hopefully spread the user base due to the added ease of use.

Ideally the launcher could also do the install procedure on its own if pointed to the source files of the game, and then fetch necessary installers, run through them, do config, etc etc.

Further feature would then be to also set desired versions and jump between them. Likely it'll happen that an update doesn't work for someone, so he could then easily just fall back on a previous version he was using.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gregitol picture gregitol  路  5Comments

Psycho-A picture Psycho-A  路  16Comments

yukinsaknos picture yukinsaknos  路  14Comments

OregonPacifist picture OregonPacifist  路  15Comments

silentdream21 picture silentdream21  路  8Comments