narzoul / DDrawCompat

DirectDraw and Direct3D 1-7 compatibility, performance and visual enhancements for Windows Vista, 7, 8, 10 and 11

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

0.5.2 DDrawCompat breaks windowed mode for The Sims 1 + stuttering in fullscreen

mrpenguinb opened this issue · comments

Not sure what change affected windowed mode and created stuttering in the game. 0.5.1 has none of these issues.

Can you provide more information on these issues? I haven't encountered any stuttering, and windowed mode works mostly fine, except the screen freezes on the loading screen initially, but it's fixable by moving the window or clicking outside of it. That's an odd issue, I'll look at it later.

What OS? GPU? DDrawCompat settings? In-game settings? 3rd party mods/patches? Do these issues happen without them?

Windows 10 22H2, RTX 3060 Ti
No settings specified for DDrawCompat. The neighborhood screen in windowed mode is just black, and I have to Alt+Tab for each time I exit to the neighborhood screen from a lot/house, but otherwise everything else "works".
No third party mods or modification to the .exe, only DDrawCompat is installed.

Also, the stuttering only occurs when DisplayResolution = app is set. DDrawCompat 0.5.1 doesn't stutter when this is set for The Sims 1.

Windows 11 23H2, RTX 3060 Ti also here, but no stuttering even with DisplayResolution=app setting. Is there a particular area or action in the game that stutters? What does the stats overlay show? Does it also stutter with the default DisplayResolution=desktop setting? Have you tried setting CpuAffinity=all?

Windows 11 23H2, RTX 3060 Ti also here, but no stuttering even with DisplayResolution=app setting. Is there a particular area or action in the game that stutters? What does the stats overlay show? Does it also stutter with the default DisplayResolution=desktop setting? Have you tried setting CpuAffinity=all?

How do I get the stats overlay window to show? What am I meant to be looking for in the stats overlay, performance statistics?

Looking closer, with DDrawCompat, DisplayResolution=app set on v0.5.1, the stuttering is reduced compared to when it's set to DisplayResolution=desktop, with v0.5.1. Wonder why.... 0.5.2 changed something and stutters with DisplayResolution=app (all of this testing is in fullscreen of course since windowed mode with the game is glitched like stated before).
Sorry if this is confusing and hard to follow, and nitpicky.

How do I get the stats overlay window to show?

https://github.com/narzoul/DDrawCompat/wiki/Configuration#statshotkey

What am I meant to be looking for in the stats overlay, performance statistics?

Yes, mostly the current and average present and flip rates. I think the min/max values are not very reliable, but I never had time to look into it. Note that the stats overlay is not yet optimized so displaying it may itself decrease frame rate a bit. But you can compare the results against v0.5.1.

I added a build of all commits between v0.5.1 and v0.5.2 here:
https://github.com/narzoul/DDrawCompat/releases/download/v0.5.2/DDrawCompat-v0.5.2-debug-previous-builds.7z

Could you please figure out which was the first one that introduced the stuttering?

With Shift + F12 (performance stats) showing, the stutter goes away. As soon as it's disabled it's back to stuttering (microstutter more specifically I think).

Also the commit that last works is 15-gc344ec34, 16-gd5a89cad and above exhibit stuttering (with windowed mode breaking at the same commit).

This should fix windowed mode: ddraw.zip (diff.txt compared to v0.5.2)

I still don't understand the fullscreen stuttering issue, nor can I reproduce it. Could you record a video showing the issue, and how enabling the stats overlay fixes it?

Windowed mode is fixed now, but it's still not as performant as it could be (been an issue before 0.5.1).

Here's a video showcasing the stutter: TS1 stutter in DDrawCompat unless overlay is used
The stuttering is visible when right-click dragging the mouse slowly (moving the camera) across a Sims house/lot.

Both issues should be fixed in v0.5.3 now.

0.5.1 is still smoother overall when right-click dragging to move the camera.
Moving too fast in 0.5.3 causes one or two momentary hitches/stutters. Once again, having the overlay showing resolves the stutter. Shrug
(moving slow is fine in 0.5.3 and windowed works as expected)

I'm not sure what you mean by "moving too fast", but if I scroll as fast as possible, there is so much motion blur on my monitor I can't really notice any stutters.

Anyway, once again I approached the problem through measurements instead, and I did find some odd behavior in the scan line reporting on my NVIDIA GPU, where the reported scan line would appear to "jump back" to a smaller value after exiting the vertical blank interval. This could cause DDrawCompat to report spurious vertical blank events, and while this doesn't seem to affect the number of presented frames, I'm not sure if it could cause any visible stutters or not. This glitch happens a lot more frequently at low display resolutions, such as with DisplayResolution=app.

This patch seems to eliminate this issue for me:
ddraw.zip (diff.txt compared to v0.5.3)

Unfortunately, even without this correction, I found absolutely no measurable difference between having the stats overlay on or off. I'm not sure how it could still cause any difference anyway. There was a bug before, where having the overlay off would cause approximately 5 dropped frames per second, at even intervals, but this was definitely fixed in v0.5.3. With the current implementation, having the overlay on should theoretically never improve anything, but it might slightly make things worse in some cases. I have no idea how the opposite could happen.

I've been using DisplayResolution=app the entire time, so I encountered it a lot if what you're describing is what I experienced. It seems to be all good now with your latest patch!

Sorry for nitpicking so much. I'm glad you've fixed the overlay issues in 0.5.3 already and that you took a measurements-based approach to see if there were any issues.

May I ask why do you use DisplayResolution=app? That options mainly exists as a fallback in case there are still bugs with the mouse cursor emulation or other aspects that display scaling has to deal with. Are there still such issues with this game? Or what other use cases are there for it?

I prefer it as it filters the game instead of being overly pixelated.
Blurring with DDrawCompat's bilinear filter looks odd, so I prefer the game running with the desktop resolution being the same as the game, I think it's because of how the filter gets applied to a larger image and doesn't scale based on the base resolution (just a guess).

Is GPU scaling enabled or disabled in NVIDIA Control Panel? If it's enabled, I thought it would use a simple bilinear filter too, but that doesn't seem to be the case. I don't know how to compare it to any of the filters in DDrawCompat, because I don't know of a way to take a screenshot of the GPU-upscaled image.

If GPU scaling is off, then scaling is done by your monitor, and I think it's impossible to know what it does anyway.

The only "official" source of information I found for the NVIDIA GPU scaling algorithm is this:
https://forums.developer.nvidia.com/t/nvidia-scaling-algorithms/254672

If you use the GPU, then NVIDIA will use the best algorithm for the job. It depends on upscale ratio, content, monitor specs, etc. So in short, how NVIDIA is doing the upscaling here is part of the driver implementation which I cannot share in detail.

Which is about as vague as it could be, so I guess there is no simple way of replicating their result. The closest one seems to be bicubic(0), but it's not quite the same either.

I've got aspect ratio scaling set in NVIDIA control panel, set to do scaling on the GPU:
image

I haven't touched the Image Scaling option in "Manage 3D settings" FYI.