VOGONS

Common searches


First post, by UCyborg

User metadata
Rank Member
Rank
Member

It recently came to my attention that GOG released both The Suffering: Prison Is Hell and The Suffering: Ties That Bind back in September. I got messaged on the other forum about some of the issues with those two games, it turns out there are more problems with them that I was initially aware of. So I thought I'd see whether I can fix or workaround some of the bugs.

Comparing the games as they were released back in the day with the GOG version, there weren't any changes code-wise, they tweaked two variables; lowered default vertical FOV, which gives the correct FOV only with wide 16:9 resolutions and unlocked the ability to select resolution with aspect ratio higher than 4:3.

Found out ThirteenAG made a widescreen patch that also tackles the 2D elements, but it has a fatal flaw that it just crashes the game on some machines at startup. Might be because he does the memory patching from a separate thread once the game code is already running, which is dangerous. I took care of that problem as well.

Download link: ModDB (updated 26th November 2018)

Here comes the list of fixes.

Common:

  • Fixed the bug with game interpreting available hard disk space value incorrectly, preventing users from saving the game and the config file from being updated if they have more than 2 TB of free space on their hard drive.
  • Widescreen support; all supported resolutions are selectable, FOV is adjusted according to the screen's aspect ratio, HUD and in-game FMVs are adjusted as well so they don't stretch with wide aspect ratios.
  • Resolutions available in fullscreen mode are also available in windowed mode.
  • Game's own threads are bound to run on the CPU's first core, this reduces the probability of 'black texture bug' occurrence.
  • Game will now use the audio device selected in Riot Engine Configuration dialog instead of always using default device.
  • Hardware accelerated DirectSound buffers are no longer explicitly requested and the default limit of sound buffers has been increased to prevent sound dropouts on typical modern PC.
  • EAX option has been disabled in Riot Engine Configuration in Sound tab (EAX effects are not implemented).
  • Added frame rate limiter which defaults to limiting the game to run at 59 FPS to workaround bugs that occur at higher frame-rates and provides better mouse response when monitor runs at 60 Hz and VSync is enabled.
  • Game will set monitor's refresh rate to 60 Hz when in fullscreen mode.
  • Mouse acceleration is disabled by default, but can be restored with a config option.
  • Removed bad DirectX check, game will launch without error or DirectPlay pop-up dialog on Windows 8+ if DirectPlay isn't present (which is the default).
  • Made game's message loop more conventional (PeekMessage called without message filtering) to workaround the bug in Windows' Desktop Window Manager, which causes oddities in windowed mode; window being declared unresponsive and replaced with a ghost window after 5 seconds when it loses focus. It even happens that the DWM tries to replace the game window with a ghost window during normal gameplay.
  • Use GetMessage in the message loop for the Riot Engine Configuration dialog rather than PeekMessage, this normalizes CPU usage of said dialog.
  • Embedded manifest in executables:
    • Marked as compatible with all existing Windows versions.
    • Marked as high-DPI aware.
    • Marked as UAC (User Account Control) aware.
  • Registry settings are written to HKEY_CURRENT_USER instead of HKEY_LOCAL_MACHINE.
  • User files are redirected to Documents folder, in "My Games\The Suffering [TTB]".
  • Removed all calls to RegFlushKey (not needed).
  • Removed the call to OutputDebugString that was needlessly made every frame.
  • Reordered icons in the .exe's resource so the Torque icon is the main one instead of the Riot Engine logo.

Prison Is Hell specific:

  • Selecting anything but the first entry in the Display Driver drop-down list in Riot Engine Configuration dialog will no longer result in the empty Display Mode list, so the game can now be made to run on any monitor, not just the primary one.
  • Fixed the bug with user gamma setting not being applied at game startup.
  • Textures now appear clearer when looked at from the distance.
  • Don't grab keyboard exclusively when in fullscreen; Start key works and Alt-Tab behaves normally on modern Windows versions.
  • Added window caption.
  • Disabled screenshot feature (F10 key) since it crashes.

Ties That Bind specific:

  • Registry settings are stored in a separate value called SettingsDX106 rather than SettingsDX105, which is used by the first game since the binary structures between the games aren't 100% compatible between each other.
  • Fixed the bug with some sounds being delayed when 3D sound buffers are enabled.
  • Added file (Common\System\System.odu) that turns off censorship of Creeper's famous part of dialog (for English version only).
Last edited by UCyborg on 2018-11-26, 22:54. Edited 5 times in total.
Arthur Schopenhauer wrote:

A man can be himself only so long as he is alone; and if he does not love solitude, he will not love freedom; for it is only when he is alone that he is really free.

Reply 1 of 6, by Kerr Avon

User metadata
Rank Oldbie
Rank
Oldbie

These two games are great! I have them on the original XBox (so your patch is unnecessary to me, but thanks anyway) and they are very underrated, I think. The design of the enemies is especially imaginative, compared to many first person shooters.

Reply 3 of 6, by UCyborg

User metadata
Rank Member
Rank
Member
KainXVIII wrote:

Thanks for your work!
PS - also can you shine light to this "problem" Re: The Suffering detail texturing setting is greyed out ?

I'm mostly clueless when it comes to rendering related things, so I can't add much to what was said over GOG forums. Have no old machine around to test neither to see what's up with that checkbox. I'd be interesting though, the game is supposed to run on GeForce4 MX 440 which my previous PC had, DirectX 7 level graphics card, so no shaders.

The first Surreal's game (Drakan: Order of the Flame) based on the older iteration of Riot Engine also has this option, but I don't see anything different visually. From what I see in The Suffering, some surfaces do change appearance when you get close, take for example the door from which the correction officer comes after you leave the cell when the game begins, maybe this has something to do with it. Surreal also left a checkbox for unimplemented feature in that dialog in the past.

One thing I managed to find in Drakan is the value that defines how models get deformed when the camera moves away from them (level of detail). That'd be nice to tweak in The Suffering as well, it looks weird when characters are changing shape as you get close or move away from them. It may have been helpful in the old days for performance.

Speaking of performance, it's possible that this iteration of the engine wasn't designed in a way that would make things the most efficient. At least from little searching, making Direct3D calls from multiple threads is not good for performance, and the game does it. And there are strange bugs that have been observed when allowing the game to run multiple cores that disappear when setting affinity to one core. I wonder if the reason is not using critical sections everywhere it should. Well, it still runs "too fast" on modern machines, that bloody tying of everything in-game to frame rate. Double quotes because there's nothing wrong with pumping out frames at high speed.

Kerr Avon wrote:

These two games are great! I have them on the original XBox (so your patch is unnecessary to me, but thanks anyway) and they are very underrated, I think. The design of the enemies is especially imaginative, compared to many first person shooters.

I also think they're one of those lesser known gems. And don't forget the morality system and how Torque's appearance changes in regards to his actions. Painkiller is also interesting when it comes to enemies' design. So many different monsters.

The sound is pretty messed up out-of-the box on PC, but at least IndirectSound takes care of the dropouts and restores 3D positional audio, there's just no reverb, only Creative ALchemy can give it back. It'd be nice to somehow fix the sound code to at least get rid of the dropouts when you only have the plain DirectSound without wrappers.

Arthur Schopenhauer wrote:

A man can be himself only so long as he is alone; and if he does not love solitude, he will not love freedom; for it is only when he is alone that he is really free.

Reply 4 of 6, by UCyborg

User metadata
Rank Member
Rank
Member

I finally got around revising the patch a little, here are the changes:

Prison Is Hell specific:

  • Fixed the bug with user gamma setting not being applied at game startup.
  • Textures now appear clearer when looked at from the distance.
  • Don't grab keyboard exclusively when in fullscreen; Start key works and Alt-Tab behaves normally on modern Windows versions.

Ties That Bind specific:

  • Added file (Common\System\System.odu) that turns off censorship of Creeper's famous part of dialog (for English version only).

Common:

  • Improved FPS limiter's accuracy, using 59 FPS limit with VSync now makes mouse a bit more responsive than it was with previous implementation.
  • Removed affinity mask setting, only game's own threads are bound to run on the CPU's first core instead of the entire process (which is better for performance), this reduces the probability of 'black texture bug' occurrence in 99% cases, but since it can still happen even if all threads run on single core, I don't think the multi-core CPUs are the factor.

Like the previous implementation of the workaround (run the entire process on single core), it also helps with some delays, eg. when clicking Load Game option for the first time after startup.

  • Games will now use the audio device selected in Riot Engine Configuration dialog instead of always using default device.
  • Hardware accelerated DirectSound buffers are no longer explicitly requested and the default limit of sound buffers has been increased to prevent sound dropouts on typical modern PC. Using IndirectSound, Creative ALchemy or similar DirectSound wrapper is no longer needed.
  • EAX option has been disabled in Riot Engine Configuration in Sound tab (EAX effects are not implemented).
  • Updated manifest in executables:
    • Marked as compatible with all existing Windows versions.
    • Marked as high-DPI aware.
    • Marked as UAC (User Account Control) aware.
  • User files are redirected to Documents folder, in "My Games\The Suffering[ TTB]". (Move your saves and .cfg file there!)

There are two known issues with widescreen code; the aspect ratio correction tends to turn the right side of the screen into garbled mess when viewing Archive pages. And in the first game, vertical field of view value is connected to rendering if inventory icons, so they appear smaller and render in wrong places and often invisible, depending on where the player is looking.

KainXVIII wrote:

PS - also can you shine light to this "problem" viewtopic.php?f=8&t=49226&p=516520&hilit=suffering+detail#p516520 ?

I can confirm the Detail Texturing option is indeed something that simply wasn't implemented. The checkbox is unconditionally disabled and if you enable it, toggling it would just set one bit in a variable that specifies which graphics settings are turned on and the said bit is not inspected anywhere in the engine code.

Last edited by UCyborg on 2018-07-01, 00:00. Edited 2 times in total.
Arthur Schopenhauer wrote:

A man can be himself only so long as he is alone; and if he does not love solitude, he will not love freedom; for it is only when he is alone that he is really free.

Reply 5 of 6, by KainXVIII

User metadata
Rank Member
Rank
Member
UCyborg wrote:

I can confirm the Detail Texturing option is indeed something that simply wasn't implemented. The checkbox is unconditionally disabled and if you enable it, toggling it would just set one bit in a variable that specifies which graphics settings are turned on and the said bit is not inspected anywhere in the engine code.

Ha-ha, thanks! I can sleep in peace now. 😊

Reply 6 of 6, by UCyborg

User metadata
Rank Member
Rank
Member
UCyborg wrote:

Added file (Common\System\System.odu) that turns off censorship of Creeper's famous part of dialog (for English version only).

Forgot to ZIP it...it's included now.

KainXVIII wrote:

Ha-ha, thanks! I can sleep in peace now. 😊

If you open RERES.dll with Resource Hacker, you can also find the unused Developer tab of Riot Engine Configuration dialog that is implemented in Drakan: Order of the Flame and always appears if SHIFT is held when launching it.

There's also Environment FX setting in Audio settings menu in the first game that doesn't appear to do anything.

Another mystery is Anti-aliasing setting. It never changed anything visually on my PC.

Arthur Schopenhauer wrote:

A man can be himself only so long as he is alone; and if he does not love solitude, he will not love freedom; for it is only when he is alone that he is really free.