VOGONS


dgVoodoo 2.7.x and related WIP versions

Topic actions

  • This topic is locked. You cannot reply or edit posts.

Reply 240 of 474, by FulValBot

User metadata
Rank Member
Rank
Member
FulValBot wrote on 2020-10-07, 16:21:

Midtown Madness 1 has serious glitches with and without dgvoodoo2 (i'm unable to select options because these are unreadable)

also direct3d (if supported) is not available (and that option is unreadable...), only software rendering

Yes, as far as I remember D3D is not available, but I cannot remember why. Maybe I only managed to get the sw renderer of the game to work because the other crashed, as I recall.

Ok if i rename midtown.exe to MidtownMadness.exe it works properly (with direct3d also, that is renamed dxvoodoo2 wrapper) but with a very, very, veeery slow frame rate and stuttering, also with 640x480

forcing resolution it doesn't work (tested 2x mode without success)

Reply 243 of 474, by Dege

User metadata
Rank l33t
Rank
l33t
lowenz wrote on 2020-10-11, 12:28:
Dege wrote on 2020-10-11, 10:38:

I encountered this phenomenon in some other apps (like a scene demo, its internal fps meter + MSI Afterburner), but I don't know what the reason can be.

And what's the real framerate? 😐

I can reproduce the unmatching (halved) framerate with this demo:
http://www.pouet.net/prod.php?which=4321
(you have to enable its own fps meter in the startup dialog, but not all parts are affected).
Both MSI and FRAPS shows the same values (D3D11/12) so I think the error is in the demo itself in this case.

The Master wrote on 2020-10-11, 15:24:
Dege wrote on 2020-10-11, 10:38:

Thanks. It's a known problem with The Longest Journey. Forced res or MSAA causes this.

Too Bad... is there nothing we can do to fix this? No Forced Res or AA does the Game not good 😒

It can't be solved on the wrapper side. Maybe by patching the game.

Reply 244 of 474, by Dege

User metadata
Rank l33t
Rank
l33t
FulValBot wrote on 2020-10-11, 18:18:
Ok if i rename midtown.exe to MidtownMadness.exe it works properly (with direct3d also, that is renamed dxvoodoo2 wrapper) but w […]
Show full quote
FulValBot wrote on 2020-10-07, 16:21:

Midtown Madness 1 has serious glitches with and without dgvoodoo2 (i'm unable to select options because these are unreadable)

also direct3d (if supported) is not available (and that option is unreadable...), only software rendering

Yes, as far as I remember D3D is not available, but I cannot remember why. Maybe I only managed to get the sw renderer of the game to work because the other crashed, as I recall.

Ok if i rename midtown.exe to MidtownMadness.exe it works properly (with direct3d also, that is renamed dxvoodoo2 wrapper) but with a very, very, veeery slow frame rate and stuttering, also with 640x480

forcing resolution it doesn't work (tested 2x mode without success)

Ok, I'll open an issue for this on github because I don't know when I'll have time to check it out.

Reply 245 of 474, by ZellSF

User metadata
Rank l33t
Rank
l33t
FulValBot wrote on 2020-10-11, 18:18:
Ok if i rename midtown.exe to MidtownMadness.exe it works properly (with direct3d also, that is renamed dxvoodoo2 wrapper) but w […]
Show full quote
FulValBot wrote on 2020-10-07, 16:21:

Midtown Madness 1 has serious glitches with and without dgvoodoo2 (i'm unable to select options because these are unreadable)

also direct3d (if supported) is not available (and that option is unreadable...), only software rendering

Yes, as far as I remember D3D is not available, but I cannot remember why. Maybe I only managed to get the sw renderer of the game to work because the other crashed, as I recall.

Ok if i rename midtown.exe to MidtownMadness.exe it works properly (with direct3d also, that is renamed dxvoodoo2 wrapper) but with a very, very, veeery slow frame rate and stuttering, also with 640x480

forcing resolution it doesn't work (tested 2x mode without success)

Forcing resolution works fine for gameplay here (menu resolution is stuck at 640x480). Check that you haven't accidentally enabled 640x480 compatibility mode.

To fix the framerate, create a Nvidia profile for the game. Maybe interesting for you Dege? Not sure why dgVoodoo makes this a problem for just this game.

Game still freezes pretty often with dgVoodoo though, so not very playable. I haven't had any freezes when testing with ddrawcompat, but I haven't done that extensive testing.

Reply 246 of 474, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie
FulValBot wrote on 2020-10-11, 18:18:

Ok if i rename midtown.exe to MidtownMadness.exe it works properly (with direct3d also, that is renamed dxvoodoo2 wrapper) but with a very, very, veeery slow frame rate and stuttering, also with 640x480

The game supports all native resolutions from Direct3D HAL including widescreen. Just install the last official patch known as XP compatibility pack, no EXE renaming. Here's the VIDEO.CFG produced from video detection in QEMU with WineD3D. Use "ResChoice=" to select the resolution. The list starts at 0 and the default 1 selects 640x480. For eg. "ResChoice=8" selects 1280x960.

[NVIDIA GeForce GT 730]
Type=2
InterfaceGuid=aeb2cdd4-6e41-43ea-94-1c-83-61-cc-76-07-81
DriverGuid=aeb2cdd4-6e41-43ea-94-1c-83-61-cc-76-07-81
bSmoothAlpha=1
bAdditiveBlending=1
bVertexFog=1
bMultiTexture=1
bTexturePalette=0
bHaveMipmaps=1
uSpecialFlags=0
Resolutions=14
320 200 266208256
640 480 264749056
800 600 263712256
1024 768 261873664
1280 1024 258727936
1600 1200 255072256
1152 864 260620288
1280 800 260448256
1280 960 259219456
1440 900 258816256
1400 1050 257772256
1680 1050 256008256
1920 1200 252768256
2560 1600 242016256
ResChoice=1

Reply 247 of 474, by ZellSF

User metadata
Rank l33t
Rank
l33t

Unfortunately, higher resolutions aren't supported. The game just crashes at 4K (yes even with this: https://github.com/UCyborg/LegacyD3DResolutionHack). Plus performance is terrible if you force higher antialiasing levels in Nvidia Inspector.

I did some more testing. Still haven't had any freezes when not using dgVoodoo. dgVoodoo debug log outputs absolutely nothing when the game is freezing.

If anyone's curious why the exe renaming works, Windows has a built in compatibility database with a lot of fixes it bases just on filename. MIDTOWN.EXE applies a compatibility fix, DirectPlayEnumOrder that breaks dgVoodoo. Renaming exe also something helps with getting away from bad GPU driver profiles.

I assume anyone who wants to play Midtown Madness is aware of OpenMM1?:
https://github.com/0x1F9F1/OpenMM1
That solves all problems, but being very untested software might introduce new ones.

Reply 248 of 474, by Dege

User metadata
Rank l33t
Rank
l33t

Ok, I tested MM1 myself and now I know why I thought that only the sw renderer worked with dgVoodoo: because DDraw.dll is loaded from the system folder for some reason. So, I hexedited the executable and applied the 'bdraw.dll' trick.

The hw renderer worked with dgVoodoo without any problem, out of the box. However, with D3D11 I experienced very heavy performance stuttering and intermittent freezes, as reported.
With D3D12 on the other hand, it just worked perfectly smooth. I was curious so profiled both D3D11 and 12, see the attached images.

In case of D3D11 a background thread, on which nVidia's driver thread is running, consumes 72%(!) of the total time, leaving only the rest for the game itself. I don't know what it's doing, even the call tree doesn't really reveal it, but my guess is that it's crawling in a monitoring loop (or sg like that) with high priority.
This explains the stuttering because the game runs with single processor affinity. So, the game thread is choking on the background thread.

With D3D12, everything is executed on the main thread. This is because dgVoodoo D3D12 detects the processor affinity and switches to single threaded executing if only one processor is enabled (it works even dynamically).
Doing background threading on one processor just causes unnecessary overhead, I remember experiencing this same bad stuttering with Baldur's Gate, that's why I implemented it all that way.

Attachments

  • mmd3d12.png
    Filename
    mmd3d12.png
    File size
    11.19 KiB
    Views
    1953 views
    File license
    Public domain
  • mmd3d11.png
    Filename
    mmd3d11.png
    File size
    11.05 KiB
    Views
    1953 views
    File license
    Public domain

Reply 249 of 474, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie
ZellSF wrote on 2020-10-14, 16:13:

If anyone's curious why the exe renaming works, Windows has a built in compatibility database with a lot of fixes it bases just on filename. MIDTOWN.EXE applies a compatibility fix, DirectPlayEnumOrder that breaks dgVoodoo. Renaming exe also something helps with getting away from bad GPU driver profiles.

I see, so that gets out of the way when I was using WinXP or older Windows version on VM to play the game.

Dege wrote on 2020-10-14, 19:50:

Ok, I tested MM1 myself and now I know why I thought that only the sw renderer worked with dgVoodoo: because DDraw.dll is loaded from the system folder for some reason. So, I hexedited the executable and applied the 'bdraw.dll' trick.

If you happened to have the CD auto-play, the the launcher from the CD would load the OS's ddraw.dll instead of dgVoodoo2 since it was run from the CD. It seems that once the OS's ddraw.dll was loaded, it could pinned itself in the memory and any further DLL request of the same name will use the copy in the memory. It is also possible that some games installation from CD will also use and load ddraw.dll. So that requires a reboot before the game will be able to load dgVoodoo2 ddraw.dll from the game folder.

Do you have any idea how to kick out the ddraw.dll copy in the memory and force the OS to reload from disk?

Was the GDI text elements from pull-down menu legible in the "Option" with dgVoodoo2?

Reply 250 of 474, by Delfino Furioso

User metadata
Rank Newbie
Rank
Newbie

there is this documented (!) trick that works for executables which would otherwise always load the system-provided ddraw.dll
https://docs.microsoft.com/en-us/windows/win3 … ary-redirection

I guess that enabling it for exes running from the CD would require customizing the optical media (or the ripped image)

Reply 251 of 474, by Dege

User metadata
Rank l33t
Rank
l33t
kjliew wrote on 2020-10-14, 22:18:

Was the GDI text elements from pull-down menu legible in the "Option" with dgVoodoo2?

Hardly... see the attached image.

Btw, I didn't run it from the CD. For some unknown reason, the executable always loads ddraw.dll from the system folder. 😕

Attachments

  • mmgditext.png
    Filename
    mmgditext.png
    File size
    64.01 KiB
    Views
    1879 views
    File license
    Public domain

Reply 252 of 474, by Dege

User metadata
Rank l33t
Rank
l33t

Btw, I released a minor update to 2.71.1:

v2.71.2:

  • Fixing blurry output of upscaled DDraw rendering
  • Restoring old window handling behavior for D3D11 (Age Of Wonders, but affects other games too)
  • Minor Glide debug layer improvement for nonstandard resolution/refresh rate parameters

http://dege.fw.hu/dgVoodoo2/dgVoodoo2_71_2.zip
http://dege.fw.hu/dgVoodoo2/dgVoodoo2_71_2_dbg.zip

Edit: files are submitted to MS for malware analysis, removing detection is pending.

Reply 253 of 474, by djc5166

User metadata
Rank Newbie
Rank
Newbie
Dege wrote on 2020-10-07, 19:57: That's weird, I have both game (not the gog version though) and they work as expected. […]
Show full quote

Dege wrote on 2020-10-07, 19:57:
That's weird, I have both game (not the gog version though) and they work as expected.

Yea I can't get it to work, unless I am doing something wrong. I just removed the GOG wrapper and added DGVD. It never renders any textures.

Or maybe the GOG release actually is different?

Something you can take a look at?

Reply 254 of 474, by ZellSF

User metadata
Rank l33t
Rank
l33t
Dege wrote on 2020-10-14, 19:50:

In case of D3D11 a background thread, on which nVidia's driver thread is running, consumes 72%(!) of the total time, leaving only the rest for the game itself. I don't know what it's doing, even the call tree doesn't really reveal it, but my guess is that it's crawling in a monitoring loop (or sg like that) with high priority.
This explains the stuttering because the game runs with single processor affinity. So, the game thread is choking on the background thread.

Did you try what I wrote? Creating an Nvidia profile (don't have to set any settings, just create a profile for the game)?

Not that it's necessarily a good use of your time, you just might find it interesting.

Dege wrote on 2020-10-15, 15:02:
kjliew wrote on 2020-10-14, 22:18:

Was the GDI text elements from pull-down menu legible in the "Option" with dgVoodoo2?

Hardly... see the attached image

You know that the text just looks bad because font smoothing is on in Windows right?

This is actually one of the things that are fixed by the compatibility database that breaks when you rename the exe. Which I found a bit weird, since there are other games with the same issue, that are in the Windows compatibility base without this fix. It's almost like it's an unmaintained mess that shouldn't be included in Windows. Well for retro PC games anyway, maybe the professional applications are given more attention.

Reply 256 of 474, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie
ZellSF wrote on 2020-10-15, 15:25:

You know that the text just looks bad because font smoothing is on in Windows right?

This is actually one of the things that are fixed by the compatibility database that breaks when you rename the exe. Which I found a bit weird, since there are other games with the same issue, that are in the Windows compatibility base without this fix. It's almost like it's an unmaintained mess that shouldn't be included in Windows. Well for retro PC games anyway, maybe the professional applications are given more attention.

I think it is probably the problem with Wine. It was the same on Win98 VM with font smoothing disabled. All the texts are readable in Software Renderer mode regardless of font smoothing with the OS's copy of DDRAW. Software Renderer mode with WineD3D's copy of DDRAW also suffers that same problem. Anyway, having surface resources move back and forth between GDI context and OpenGL context is always troublesome.

Reply 257 of 474, by ZellSF

User metadata
Rank l33t
Rank
l33t

I was just talking about dgVoodoo, where it should look like this:

OpenMM1_2020_10_15_21_33_37_476.png
Filename
OpenMM1_2020_10_15_21_33_37_476.png
File size
300.02 KiB
Views
1874 views
File license
Fair use/fair dealing exception

(That screenshot is OpenMM1, but the unmodified executable looks exactly the same).