Sim City 4 Devotion Forums

SimCity 4 General Discussion and Tutorials => Tips, Tricks and Tutorials => Topic started by: Durfsurn on September 27, 2020, 07:23:40 PM

Title: How to run SimCity 4 Natively above 1920x1080 in Hardware Mode!!!
Post by: Durfsurn on September 27, 2020, 07:23:40 PM
So I recently bought a new computer screen with the jaw dropping resolution of 51201440 and was looking into getting SimCity 4 to run at something closer to native resolution.

It has been known to the community for some time that SimCity 4 is locked to resolutions under 2048ish pixels either wide or high in hardware mode, the source of this limit is DirectX 7 which cannot handle resolutions any higher. This could be circumnavigated by running SC4 in software rendering mode (CPU only) but this caused other issues and notably reduced the graphics.

However I have found a fantastic repository which can breathe new life into many games that use DirectX 9 or earlier called dxWrapper (https://github.com/elishacloud/dxwrapper) which includes a Legacy Hack for removing the resolution restriction, among other tricks.

Anyway, with the help of one of the fantastic developers (elishacloud), a configuration was found that enables resolutions such as 4k (https://user-images.githubusercontent.com/25625456/94379077-ea649000-00e2-11eb-9b52-b1e98df6cef9.png) and beyond! You can follow the Github Issue here (https://github.com/elishacloud/dxwrapper/issues/87) but I will provide a summary below;


I am hoping to follow up this post with a guide on how to run the game at higher than native resolutions and scale it down to provide the greatest graphical fidelity.

- Billy

dxwrapper.ini:
Code: [Select]
;; Config file for DirectX DLL Wrapper
[General]
RealDllPath                = AUTO
WrapperMode                = AUTO
LoadCustomDllPath          =
ExcludeProcess             =
IncludeProcess             =
RunProcess                 =
WaitForProcess             = 0
DisableLogging             = 0

[Plugins]
LoadPlugins                = 0
LoadFromScriptsOnly        = 0

[Compatibility]
Dd7to9                     = 0
D3d8to9                    = 0
DDrawCompat                = 0
Dinputto8                  = 0
DisableGameUX              = 0
DSoundCtrl                 = 0
DxWnd                      = 0
EnableDdrawWrapper         = 1
HandleExceptions           = 0
SingleProcAffinity         = 0

[DDrawCompat]
DDrawCompat20              = 0
DDrawCompat21              = 0
DDrawCompatExperimental    = 0
DDrawCompatDisableGDIHook  = 0
DDrawCompatNoProcAffinity  = 0

[ddraw]
ConvertToDirectDraw7       = 0
ConvertToDirect3D7         = 0
DdrawOverrideBitMode       = 0

[Dd7to9]
AutoFrameSkip              = 0
DdrawEmulateSurface        = 0
DdrawLimitDisplayModeCount = 0
DdrawUseNativeResolution   = 0
DdrawClippedWidth          = 0
DdrawClippedHeight         = 0
DdrawOverrideWidth         = 0
DdrawOverrideHeight        = 0
DdrawOverrideRefreshRate   = 0
DdrawIntegerScalingClamp   = 0
DdrawMaintainAspectRatio   = 0

[d3d9]
AntiAliasing               = 0
EnableVSync                = 0
EnableWindowMode           = 0
FullscreenWindowMode       = 0
WindowModeBorder           = 0

[FullScreen]
FullScreen                 = 0
ForceWindowResize          = 0
WaitForWindowChanges       = 0

[DSoundCtrl]
Num2DBuffers               = 0
Num3DBuffers               = 0
ForceCertification         = 0
ForceExclusiveMode         = 0
ForceSoftwareMixing        = 0
ForceHardwareMixing        = 0
PreventSpeakerSetup        = 0
ForceHQ3DSoftMixing        = 0
ForceNonStaticBuffers      = 0
ForceVoiceManagement       = 0
ForcePrimaryBufferFormat   = 0
PrimaryBufferBits          = 16
PrimaryBufferSamples       = 44100
PrimaryBufferChannels      = 2
ForceSpeakerConfig         = 0
SpeakerConfig              = 6
Title: Re: How to run SimCity 4 Natively above 1920x1080 in Hardware Mode!!!
Post by: eggman121 on September 27, 2020, 10:22:48 PM
Top work Billy  &apls

I don't have a screen larger than 1920x1080... However

(https://i.imgur.com/Fg6wXFu.jpg)

So with some tweaks in your graphical settings, (If you have the right hardware), You can spread the game over multiple monitors.

Great work again Billy ;D

(+) 1 ;)

-eggman121
Title: Re: How to run SimCity 4 Natively above 1920x1080 in Hardware Mode!!!
Post by: AsimPika3172 on September 28, 2020, 12:10:16 AM
Thanks! +1 rep to Billy! :D
Title: Re: How to run SimCity 4 Natively above 1920x1080 in Hardware Mode!!!
Post by: jeffryfisher on September 28, 2020, 10:26:40 AM
It has been known to the community for some time that SimCity 4 is locked to resolutions under 2048ish pixels either wide or high in hardware mode, the source of this limit is DirectX 7...

1) Is DX-7 really involved, or is that a typo of DX-9? (I thought SC4 used DX-9)

2) Does the game now handle the region view ok after saving cities in modes with more than 1028 pixel-rows?

Thanks,

Jeff
Title: Re: How to run SimCity 4 Natively above 1920x1080 in Hardware Mode!!!
Post by: Durfsurn on September 28, 2020, 06:23:44 PM
As far I as I can work out SC4 uses DX7. DX9 didn't have this resolution restriction.

Its still not recommended to use the Save to Region button.
Title: Re: How to run SimCity 4 Natively above 1920x1080 in Hardware Mode!!!
Post by: jeffryfisher on September 29, 2020, 10:46:49 AM
As far I as I can work out SC4 uses DX7. DX9 didn't have this resolution restriction.

Its still not recommended to use the Save to Region button.
All my previous reading mentions DX9, but that could be based on backward compatibility to DX7 functionality.

I wasn't asking about the save-and-exit button. I was asking about the appearance of the region view after any save of any city when in a screen resolution having more than 1028 lines. In the past, such saves have produced short snapshots of the cities that don't fill and fit together in the region view (leaving dark-blue bands where the background shows through). Does this wrapper fix that?

And a new question: With this wrapper in place, how far can we go with graphics card driver support for DX versions? Can we now use drivers supporting DirectX 12 but not 9? Or are we still limited to legacy drivers supporting DX-9c?

Thanks!
Title: Re: How to run SimCity 4 Natively above 1920x1080 in Hardware Mode!!!
Post by: Durfsurn on September 29, 2020, 08:05:47 PM
Ah the region preview bug? The one that fills in some of the city with weird black backgrounds on undeveloped land? Yeah that still exists unfortunately. I'm working through the massive amount of options in the dxWrapper and in theory yes SC4 could be mapped to dx9 using the wrapper but I'm almost certain that beyond that is impossible due to how DX10 and above works.

Just on the preview bug, I found that a fully developed tile (Large size) does in fact preview properly but when I saved a tile with untouched land it bugs out. More investigation is need I'm afraid.
Title: Re: How to run SimCity 4 Natively above 1920x1080 in Hardware Mode!!!
Post by: APSMS on September 29, 2020, 10:34:46 PM
Is it necessary to use the SC4 Launcher or can this be used with just the SC4 Shortcut with target command line?
Title: Re: How to run SimCity 4 Natively above 1920x1080 in Hardware Mode!!!
Post by: Durfsurn on September 30, 2020, 03:05:01 AM
A launcher is not necessary. All a launcher does is run the exe with the specified arguments.
Title: Re: How to run SimCity 4 Natively above 1920x1080 in Hardware Mode!!!
Post by: Durfsurn on September 30, 2020, 09:11:45 AM
An update on the region preview bug here: https://community.simtropolis.com/forums/topic/759666-how-to-run-simcity-4-natively-above-1920x1080-in-hardware-mode/?do=findComment&comment=1737849.
Title: Re: How to run SimCity 4 Natively above 1920x1080 in Hardware Mode!!!
Post by: mgb204 on October 08, 2020, 10:51:10 AM
1) Is DX-7 really involved, or is that a typo of DX-9? (I thought SC4 used DX-9)

My understanding is that the code was designed for DX 7, but remained fully compatible up to DX 9, which if I'm not mistaken is included the released CDs. Using DX 9.0c natively, i.e. not as a legacy mode of a later DX version, is not possible in versions of Windows higher than Vista. If you have a later version of DirectX, then theree is the potential for compatibility issues, but the problems are far more likely to come from the GPU side. Because even with a later version of DirectX, it retains compatibility for legacy DX versions. Literally, you can use DX 9 or earlier with a later version of DirectX installed, but your GPU needs to support the legacy API modes a particular app requires.

As the years have gone by, technology has inevitably changed, such that more and more users have trouble using legacy DirectX games. From what I understand, this modified version of DDraw, an API of DirectX, simply gives more modern hardware better legacy support through some sort of emulation layer. I don't personally own GPUs new enough or that suffer from these issues. But if you are on Windows 10 with a modern mid-high end GPU, it does appear using this 'hack' can dramatically improve performance. Although it doesn't allow SC4 to fully utilise the hardware, it just means if compatibility issues were causing poor performance, the method has the potential to resolve the problem. So this is not only useful for those with higher-resolution displays, it has more utility.

Another thing if you're on Windows 8/10 and have suffered from the "Double Click using Multi-Stage MMPs" problem, using DInput from the same package, resolves this problem and now such MMPs work as intended again. I'm re-posing from ST, but you just need to edit the property as follows in dxwrapper.ini:

Dinputto8                  = 0

to

Dinputto8                  = 1

This switches on the included DInput from DX 8. In this case I'm not sure if that's a modified API or if it just allows us to run DInput 8 natively. But this does point the finger of blame squarely at DirectX 12 as the source of the issue. Since Windows 7 users, who can only use DirectX 11, never had the problem.

This is such a great find and potentially could provide even more gifts in future.