elishacloud / dxwrapper

Fixes compatibility issues with older games running on Windows 10/11 by wrapping DirectX dlls. Also allows loading custom libraries with the file extension .asi into game processes.
zlib License
1.16k stars 83 forks source link

Videos Not Playing In Septerra Core #120

Closed Zombeaver closed 1 year ago

Zombeaver commented 3 years ago

I've been trying to get dxwrapper to play nicely with Septerra Core because I'd like to incorporate Reshade. The game itself seems to work but none of the cutscenes play. The GOG version comes with its own ddraw wrapper and I'm not sure if this is something that they put together in-house or what but none of the other wrappers I've tried (DDrawCompat, dgvoodoo 2, or dxwrapper) seem to work with the cutscenes but that one does. It doesn't seem to be converting to D3D9 though because Reshade isn't hooking with it (but does with dxwrapper).

Any ideas?

Zombeaver commented 3 years ago

Did some digging and I tried out the method mentioned in the bottom of this post and everything's working (including videos along with Reshade), so it would seem there's several factors involved here. I think the issue may be with the way the game is patched on GOG.

elishacloud commented 3 years ago

This is kind of a mess. The GOG version includes 32bit color videos and stretches the game to fullscreen. This requires multiple extra copying around of the surface data each frame. So it may not be as good as using the videos you found in the post you linked to.

However, I was able to put a fix into dxwrapper for this issue. Basically you must use the GOG ddraw.dll file if you want to use the GOG videos. There is game specific code in there for those videos. So to get dxwrapper to work we need to use a different wrapper and then hook ddraw. To do this I am using the dsound.dll wrapper.

Here is the update: dxwrapper.zip

Note: using the GOG ddraw.dll will cause the game to run slower and may not be as stable. You can run the game in Windows 7 compatibility mode and run the program with administrator rights to improve the stability. Using the GOG ddraw.dll will also give you pixelization, if you like that look. You can also use the DdrawUseNativeResolution and DdrawMaintainAspectRatio options in dxwrapper to get pixelization even without the GOG ddraw.

Zombeaver commented 3 years ago

Hmm, yeah that does indeed seem to work, including with Reshade. Thanks for that!

I really dislike how their included ddraw wrapper apparently forces native resolution though, it looks kindof awful to me (on a 1080p screen). With the static recompiled version it runs at original resolution which looks a lot better.

I happen to have the Steam version as well and it doesn't use the 32bit color videos or use any kind of ddraw wrapper. The videos don't seem to work at all in that version, with or without the addition of a ddraw wrapper, so I guess that one's even worse off. The movie files (M1.db, M2.db, etc.) are different sizes from the downloaded ones in the GOG thread as well. The static recompiled version + downloaded videos seem to work with the Steam version though.

I make easy to install one-and-done patches that aim to fix weirdness like this in various old games, and add in additional features like Reshade support + custom bezels and shaders, controller support via Antimicro, etc. and am working on one for Septerra Core is the reason I was asking about all this.

Thank you for taking the time to take a look at this and for all the work you do! I guess this can probably be closed out although I don't know whether or not you want to look at the Steam version first so I've left it open.

elishacloud commented 3 years ago

I really dislike how their included ddraw wrapper apparently forces native resolution though

Agreed. There is not much I can do about that. They look at the resolution size at the start of the game and tell ddraw to stretch the image to fill the screen. ddraw (and dxwrapper) use nearest-neighbor filtering. I could add some kind of bilinear interpolation filtering, but I am currently not planning to do that anytime soon.

I don't know whether or not you want to look at the Steam version first so I've left it open.

I don't have the Steam version and I don't really want to purchase it again. However, as long as the new version I gave you works as good as the old version then there is nothing for me to look at here. It sounds like there is something else going on with the Steam version that is unrelated to ddraw. Maybe the included videos in Steam use some kind of codec that is no longer supported by Windows?

make easy to install one-and-done patches that aim to fix weirdness like this in various old games

That's great. Do you have a website for these patches? Would you be interested in helping me out with another project I am working on? I am one of the developers on the Silent Hill 2 Enhanced Edition project and we are hoping to be able to put together a simple install like the ones you mention. But we don't have anyone with this expertise.

mirh commented 3 years ago

The nicest (although it's borderline overly ridden of options) installer I know is this. Otherwise I'd look at the usual "plain" suspects: NSIS, Inno or WiX.

Maybe the included videos in Steam use some kind of codec that is no longer supported by Windows?

Re-encoding videos of old games seems very dumb. Perhaps GOG is automatically installing that codec?

Zombeaver commented 3 years ago

I could add some kind of bilinear interpolation filtering, but I am currently not planning to do that anytime soon.

Understood, no worries. I do think a bilinear filtering option is a neat idea though.

Maybe the included videos in Steam use some kind of codec that is no longer supported by Windows?

They're actually not included as .avis at all in the Steam version. It's just the .db files. I assumed this is just the way the game contained them originally. I actually have the original physical disc version as well so I guess I could compare.

That's great. Do you have a website for these patches?

I do, you can find it here: https://www.zombs-lair.com/

Largely the work I do is full installers with PCem, DOSBox, etc. (or in some cases just with a video wrapper) for various abandonware titles with everything setup beforehand so you just install like any other modern piece of software, start the game and go. I use either InstallForge or in some cases Inno for this. I only do this for games that aren't commercially available on modern storefronts like Steam or GOG though, for legal reasons. For the games that are on such storefronts that I have enough interest that I want to give them the same sort of treatment as my normal packages, I make simple patchers to pipe in the necessary files from the GOG or Steam versions. This is done with relatively simple batch scripting. I've only done this for a couple games but you can find them here: https://www.zombs-lair.com/blog/categories/definitive-editions Septerra Core is the next one on the agenda.

You can see what those look like in practice here.

The normal installers look similar to downloading a standalone installer .exe from GOG.

Would you be interested in helping me out with another project I am working on? I am one of the developers on the Silent Hill 2 Enhanced Edition project and we are hoping to be able to put together a simple install like the ones you mention. But we don't have anyone with this expertise.

Sure! Happy to help. I'd just need the files you want to pack and if you there's any artwork that you want to incorporate into the installer. If not, I can make some (I make custom cover art and other media for all my normal installers).

Zombeaver commented 3 years ago

So I took a look at the site and videos for SH2 Enhanced Edition and I'm really impressed! I'd definitely be interested in putting together something for that. I don't think that would be too difficult either. I'll take a look.

Polymega commented 3 years ago

Hi @Zombeaver!

I'm part of the SH2:EE project (credited as Ratiocinator on the project) and Elisha pinged me on your interest in helping us make an installer.

To start: Thank you! I've read over this thread and am both excited and impressed with installers you've made for so many other games. I don't know if you know, but SH2 PC perfectly fits your criteria for making an installer: It has long since been considered abandonware (only having a short physical release back in 2003) and there's no signs at this time of it ever returning digitally to storefronts.

An installer has been a very requested feature for our project for quite some time. While the overall installation process is relatively simple (it's mostly unzipping and moving files to the game's directory) it is still a lot of packages a user most download and extract/move. I'm sure you know how it goes: The less a user has to worry about, the better (and it also reduces user installation error which helps us... so win-win!).

Feel free to ping both me and Elisha and we'll be happy to work with you to make sure the installer has all the requirements we'd need, along with helping to make it look pretty (supplying artwork, etc).

Again, thank you for your consideration in helping us!

Zombeaver commented 3 years ago

This is pretty great guys; great work you've done. Even have it playing nicely with Reshade.

sh2pc 2021-04-16 19-56-20 sh2pc 2021-04-16 19-56-23 I made some scripts to instantly swap between Xinput and Dinput/DS4 modes as well. I have a couple things on the agenda currently but I'm excited to work on this some more!

elishacloud commented 3 years ago

@Zombeaver, Thanks for the willingness to help out here!

Even have it playing nicely with Reshade.

I actually include ReShade inside the build. The shader files and the config files are stored as resources in the d3d8.dll patch module. We can add or remove shaders pretty easily there.

Zombeaver commented 3 years ago

How does one access that then? I didn't see anything in the .ini for enabling or disabling it.

I use quite a few custom shaders and have a system of scripts for quickly swapping/combining these beforehand, so I'll have to see how easily I can incorporate these with the built-in version.

image

Is there any disadvantage to just combining what's there with the standard d3d9 version of Reshade? It seems like it's working okay.

Polymega commented 3 years ago

I made some scripts to instantly swap between Xinput and Dinput/DS4 modes as well. I have a couple things on the agenda currently but I'm excited to work on this some more!

Nice! I'm excited to see what comes of this down the line! Thank you so much for helping us. I should mention that hopefully we'll have controller support revamped to make more controllers compatible "out of the box." I'm not sure how it would change things if/when this feature gets implemented, but hopefully it'll make things overall easier.

elishacloud commented 3 years ago

How does one access that then? I didn't see anything in the .ini for enabling or disabling it.

One of the shaders (the brightness shader) is configured via in the game menu. This shader replaces the built-in gamma control. The other two shaders are enabled via the d3d8.ini file:

[SHADERS]
; Adjusts the color temperature of the overall game image to give it a slight cool tint, to match the PS2 version. Requires d3d8to9 = 1 to work. (0|1)
AdjustColorTemp = 0

; Enables SMAA anti-aliasing. Good for anti-aliasing on lower-end computers. It is recommended to disable this if using GPU-based anti-aliasing. Requires d3d8to9 = 1 to work. (0|1)
EnableSMAA = 0

; Restores the ability to adjust the brightness level in the game's options menu. Requires d3d8to9 = 1 to work. (0|1)
RestoreBrightnessSelector = 0

Is there any disadvantage to just combining what's there with the standard d3d9 version of Reshade? It seems like it's working okay.

We had a number of users who had issues with using native version of ReShade, which is one of the reasons we baked it in. But in most cases it should work fine. However, there is a performance overhead to having ReShade loaded twice.

Anyways, if it makes sense to do so, we can add more shaders into the d3d8.dll module and also make them configurable via the d3d8.ini file. I like to keep everything configurable via a single file, if possible. I have to say that your pictures look good to me. Also, one of the items I had on my list was to add some CRT scanlines...

Zombeaver commented 3 years ago

I should mention that hopefully we'll have controller support revamped to make more controllers compatible "out of the box." I'm not sure how it would change things if/when this feature gets implemented, but hopefully it'll make things overall easier.

Yeah that was something that kindof stuck out to me as needing some usability improvements. Starting one shortcut copies over the Xinput files and sets RestoreSearchCamMovement = 1 for Xinput/Xbox controllers and the other deletes them (if present) and sets RestoreSearchCamMovement = 2 for Dinput/DS4 controllers. If there's a way to do a bit of auto-detection to make things more seamless that'd probably be beneficial but in the interim this will at least let you quickly swap from one to the other.

We had a number of users who had issues with using native version of ReShade, which is one of the reasons we baked it in. But in most cases it should work fine. However, there is a performance overhead to having ReShade loaded twice.

Hmm, in that case I don't suppose there's any way to disable the internal one? Like an alternate version of d3d8.dll or possibly disabling it via a field in the .ini (or if all shader values are set to 0)? I did notice that it seemed like it was taking longer to do the initial compile than normal, though seemed to be working okay afterwards.

Anyways, if it makes sense to do so, we can add more shaders into the d3d8.dll module and also make them configurable via the d3d8.ini file. I like to keep everything configurable via a single file, if possible. I have to say that your pictures look good to me. Also, one of the items I had on my list was to add some CRT scanlines...

Honestly you're probably not going to want to build in all the stuff that I'd want to have access to (and boolean pass switches wouldn't cover it even if you did). That second screenshot is 17 shader passes. Reshade and Retroarch shaders are a mild obsession of mine.

None:

sh2pc 2021-04-17 01-47-38

"Cyberpunk" color and bloom adjustments (various LUT, saturation, contrast, chromatic aberration, blur, grain, vignette, bloom, ambient light, etc. passes); I have 6 preset variations on this with different values, but this is the one that I ordinarily use as the default:

sh2pc 2021-04-17 01-47-55

"Cyberpunk" + screen reflection overlay:

sh2pc 2021-04-17 01-48-10

"Cyberpunk" + screen reflection overlay + NTSC color artifacting:

sh2pc 2021-04-17 01-48-31

"Cyberpunk" + screen reflection overlay + CRT Lottes:

sh2pc 2021-04-17 01-49-16

"Cyberpunk" + screen reflection overlay + CRT Mattias:

sh2pc 2021-04-17 01-49-24

"Cyberpunk" + screen reflection overlay + CRT Cathode:

sh2pc 2021-04-17 01-49-49

I've even got stuff that'll make it look like a beatup VHS tape with animated tracking problems if people are so inclined haha

I have some other CRT passes that go for more of a PVM look (like CRT Aperture) but they tend to look odd when combined with high res content. Shadow masks tend to look better for this kind of thing.

Nearly all of this stuff has undergone lots of by-hand adjustment as they often don't look great out of the box. CRT Mattias, for example, looks almost nothing like what you see above by default. Almost none of the color adjustment passes are stock. The scripts I setup are designed to make it modular so people can pick and choose which elements, if any, they want (via the Launcher and Settings UI shown above), without having to fiddle with lots of different passes by hand. This way people can pick and choose a look that suits them from a number of preset options without having to have any familiarity with how to use Reshade.

Sorry, not trying to get too far out into the weeds with this stuff, it's just that this is something that I spend a frankly inordinate amount of time on so it's of particular interest to me.

Tomorrow I'll send you guys a zip of this stuff so you can try it out for yourselves.

Zombeaver commented 3 years ago

Okay so here's a 7z so you see what this stuff looks like in action. You'll need to move your game files into the "Game" folder in this. I'm not really a fan of just dumping everything in one big folder as it looks messy so I organize certain things into different folders. You can change settings, read the manual, or start the game via Launcher.exe. There's also a temp readme in there (from a previous release) to show you how we can do some formatting on the readme to look the way you want (this would also be displayed on one of the pages during the installation process), but I don't know what all you guys will want included in there yet.

Reshade is enabled with Cyberpunk + Screen Reflection here but under normal circumstances it wouldn't by default. You can change stuff around or disable it altogether through the Launcher. There's also a preset comparison gallery to show you what each option looks like, and these can be combined however you want.

elishacloud commented 3 years ago

@Zombeaver, Looks great. Nice to see this running on your launcher. I really like the CRT effects. I am going to have to try these out on some of the older games that I have. I especially want to see them on Wargames.

BTW: I created a new ticket on the Silent Hill 2 project for this. Let's continue the discussion over there!

elishacloud commented 1 year ago

Closing issue as completed.