Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restored & Fixed DDrawCompat 0.4.0 + Improvements #65

Merged
merged 39 commits into from
Mar 21, 2023

Conversation

voicemxil
Copy link
Contributor

@voicemxil voicemxil commented Mar 17, 2023

I initially found V3.2.2/DDrawCompat 0.4.0 with my server members while developing The Sims 1 Starter Pack, and we did notice (to a degree) the same major issues mentioned in #61 and #64.

However, a downgrade of DDrawCompat was not necessary - we were able to resolve the issues through simple configuration fixes that brought 0.4.0 in line with the previous versions (mainly a CPU affinity fix), which I implemented into the Web Installer at the time and have been working successfully for 70+ users.

Changes:

  • Upped version number to 3.3.0 & updated DDrawCompat back to 0.4.0
  • Ported my DDrawCompat CPU affinity fixes from the Web Installer into the patcher. This should resolve most or all performance/stability issues with 0.4.0 without having to set "DisplayResolution=app" in the config.
  • Made additional optimizations in the DDrawCompat configuration file.
  • Fixed the borderless prompt not actually setting exclusive fullscreen if you choose "No." This was necessary because borderless is now the default in 0.4.0, so the original code did nothing.
  • Made DDrawCompat the default selection in the list (you may not agree with this one, but all documentation I've seen says it is the recommended option so it made more sense to me)
  • Resolutions below the minimum/default (800x600) no longer appear in the list
  • Disabled resizing the patcher window (was glitchy and allowed it to get too small)
  • Added red/green hover for "Uninstall" and "Patch" respectively.

For testing purposes you can find the built version of my changes here: https://github.com/voicemxil/Sims-1-Complete-Collection-Widescreen-Patcher/actions/runs/4450222392

The latest update to the patcher regressed to no longer include ddrawcompat 0.4.0. However, with a combination of config tweaks it can be made just as stable as 0.3.2 if not better. I also fixed some quirks to make the game more optimized and performant.
- Fixes borderless being enabled no matter what (this broke because borderless is now the default in DDrawCompat)
- Reverted CPU Affinity to all cores, the change to one core occurred after DDrawCompat 0.3.2 and caused massive perf/crashing issues in TS1.
- Added more optimizations for the best gaming experience.
The prior versions showed resolutions that were too low to be compatible with TS1. Now, resolutions must be over 800x600 to be added to the list.
The window is no longer resizable because it was glitchy and you could make it smaller than intended. The Uninstall button will highlight red on hover, and the Patch button will highlight green.
@FaithBeam
Copy link
Owner

FaithBeam commented Mar 17, 2023

@voicemxil Oh wow, this is awesome. I'll review your PR this weekend when I get a chance.

@ghost
Copy link

ghost commented Mar 18, 2023

It remains to turn on the anti-aliasing and that mod on the light from freeso, haha.
Good job, you're doing incredible things

@voicemxil
Copy link
Contributor Author

voicemxil commented Mar 18, 2023

It remains to turn on the anti-aliasing and that mod on the light from freeso, haha. Good job, you're doing incredible things

@PieStars, I actually did test anti-aliasing, and I would have left it enabled if it worked properly.

However, at least in DDrawCompat, it doesn't work on most modern GPUs because of TS1's software rendering. If you desperately need AA, you should use DgVoodoo.

You can technically redirect the software rendering to the GPU via the config to support upping the 3d rendering resolution and AA, but it brings us right back to square one in terms of horrible performance, crashing or inability to open the game, plus very strange glitching if you even can open it. It would have been even worse than without my fixes.

P.S. what lighting mod are you referring to? If you mean the lighting system from SimiTone, this is 100% impossible to add to regular TS1 and you should just play SimiTone instead if you want that.

@ghost
Copy link

ghost commented Mar 18, 2023

As for the fashion about light - it was a joke
Thank you for writing about the anti-aliasing, it's a pity that it does not work. Photos from dgvoodoo look interesting.
I wonder if it is possible to make a mod for light to get at least a little closer to simitone?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about adding DisplayResolution=app in the exclusive fullscreen config? With that, @mrpenguinb and myself have experienced much better performance compared to without. It could be added to the borderless option, but that kind of takes away a reason to use borderless because it changes the desktop resolution to match the game's resolution.

Copy link
Contributor Author

@voicemxil voicemxil Mar 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback @FaithBeam ! I will start working on these in a few hours. I agree that we should include this line only for exclusive mode.

My original reasoning for not including it was: 1) I found that the CPU affinity fix seems to solve the performance woes & lag caused by 0.4.0, and did a better job of it than that line does, so it felt a bit unnecessary. I went from sub-60 to locked 120 with CPUAffinity=all, while display resolution made a much smaller difference. I'm not sure if either of you have tested it this way yet and shared the same results, though.
2) DisplayResolution=app was not a good match for borderless mode (I tested it out, and it will switch your screen resolution any time you alt-tab out of the game and causes a glitched, extremely small windows UI while doing so, especially on high-res screens). It also forces you to use the display's built-in scaling, which is often blurry/low-quality, while DDrawCompat has its own, better & configurable scaling built in. I didn't think about it at the time, but you make a good point that this is kind of the intended behavior for exclusive fullscreen, so I will add it for just that.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I measured average, 1% low, and 0.1% low fps with different ddrawcompat configs using CapFrameX

image

It's tough to get fair benchmarks because the game doesn't have a benchmark mode but I used a new Claire save and measured the first 20 seconds of that save as closely as possible as I could.

Your exclusive config and the modified exclusive config with DisplayResolution=app are pretty close in performance, but DisplayResolution=app does fix the game cursor when you play at a lower resolution than your monitor. The issue being that the cursor is way too large.

Copy link
Contributor Author

@voicemxil voicemxil Mar 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true about the cursor, I noticed it. It didn't seem to bother me too much, but that's just my own opinion so it is definitely something to consider either way.

I will use that tool to perform some similar tests and let you know the results! I'll also see if I can screenshot the weird Windows UI glitches with the lower display resolution enabled.

Copy link
Contributor Author

@voicemxil voicemxil Mar 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
image
Tested with the Hick family. Display resolution seemed to make a bigger difference this time.

Copy link
Owner

@FaithBeam FaithBeam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the great work! I have two things I'd like to discuss further.

  1. Potentially adding DisplayResolution=app to the ddrawcompat settings file
  2. How to handle the default wrapper for Linux and macOS

FaithBeam and others added 2 commits March 19, 2023 11:59
Display correct wrapper selections based on the running OS
@voicemxil
Copy link
Contributor Author

voicemxil commented Mar 19, 2023

@FaithBeam I posted my performance graphs in response to your other comment, and you are right that it seems to perform best with both. I added notes with the cons I found for each setup.

I also did more tests in exclusive mode. I found that without borderless, the game performs much worse overall, and if you're running at a sub-native resolution, the upscaling looks horrendously blurry and a bit temporally unstable with DisplayResolution=app enabled. Despite the scaling, I still think it makes sense to enable it for fullscreen, since overriding the resolution is technically the intended behavior for fullscreen apps. I'll leave it up to you which we should choose for borderless.

Also, we should probably update to the newer dgvoodoo version as well (v2.8).

@mrpenguinb
Copy link

Setting the CPU affinity with DDrawCompat to the second core would improve performance a little bit, but I haven't tested it (as lots of processes run in the background on the first core in Windows).

I personally don't like the pixelated look when DisplayResolution=desktop and prefer it more softer.

@voicemxil
Copy link
Contributor Author

Setting the CPU affinity with DDrawCompat to the second core would improve performance a little bit, but I haven't tested it (as lots of processes run in the background on the first core in Windows).

I personally don't like the pixelated look when DisplayResolution=desktop and prefer it more softer.

Why would just logical core 2 be preferable over allowing all cores? Would it still work if the system is single core?

The scaling is definitely a personal preference thing, I am the opposite way personally. Does adjusting the settings of the bilinear filtering make a difference in softening the image? It should be configurable through the overlay.

@mrpenguinb
Copy link

Not sure if it would work with a single core CPU. Drivers and other system tasks tend to use the first CPU core, so shifting it to logical core 2 (core 1 technically I think), should improve latency/performance slightly.

Adjusting the bilinear filtering (at 100%) softens the image enough for my tastes.

@FaithBeam
Copy link
Owner

FaithBeam commented Mar 20, 2023

@voicemxil Can you show me what ResolutionScale=display(1) does please? I'm changing it in-game but it does nothing.

I like the softer image as well, but I think I'm going to keep the DisplayResolution=app out of the borderless configuration because of the issues you mentioned. Game/system stability is just better without it.

@voicemxil
Copy link
Contributor Author

voicemxil commented Mar 21, 2023

@voicemxil Can you show me what ResolutionScale=display(1) does please? I'm changing it in-game but it does nothing.

@FaithBeam, it shouldn't hurt to remove it. It's supposed to make the 3D rendering/the Sims themselves render at the full display resolution, even if the rest of the game is being upscaled, but it was a similar situation to the anti-aliasing - it doesn't work on all hardware because of software rendering, so it often also requires SoftwareDevice=hal, which causes performance issues, to work.

@FaithBeam FaithBeam merged commit e234055 into FaithBeam:master Mar 21, 2023
@voicemxil
Copy link
Contributor Author

voicemxil commented Mar 21, 2023

There are a few additional changes we made later on, which are not mentioned in the release.

  • Updated DGVoodoo to the new version, 2.8.
  • Rather than "DDrawCompat is now the default," it would be better to put "The default/listed wrappers are detected based on the running OS."

@FaithBeam
Copy link
Owner

Thank you, I updated the release notes with that info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants