narzoul / DDrawCompat

DirectDraw and Direct3D 1-7 compatibility, performance and visual enhancements for Windows Vista, 7, 8, 10 and 11
BSD Zero Clause License
907 stars 69 forks source link

Sim City 4 could not initialize Direct Draw #106

Closed MatthiasHeppner closed 3 years ago

MatthiasHeppner commented 3 years ago

image

The same with v0.3.0.

V 0.2.1 is working, but relatively slow. I have a version from 2020, but it is not 0.3.0 or 0.3.1 and it is working (but here the ddraw.dll is unzipped nearly 1MB in size, the ddraw.dll from 0.3.1 is 585 KB) and it was the fastest Wrapper I could find for Sim City 4, but not perfect (Tearing, some slowness).

The 0.3.1 config

Log generated on 6/29/2021, 00:34

Flags
-----
hardwareDriver = false
DXT = true
fullscreen = true
MMX = true
FPU = true
backingStore = true
forcedFSAA = false

Strings
-------
userName = xyz
appName = SimCity 4
version = 1.1.641.0
osVersion = Windows NT 5.1
computerName = DESKTOP-xyz
CPU = GenuineIntel
sglDriverName = Software
sglDriverVersion = 1.0
driverName = DISPLAY CDD
driverVersion = Product: 1025, Version: 1025, SubVersion: 0, Build: 0
cardName = 
cardVersion = DISPLAY CDD
cardIdentity = 
soundDriverName = 
soundCardName = Primärer Soundtreiber
buildType = Release

Numbers
-------
cpuSpeed = 2712
memory = 1024
freeMemory = 1024
screenWidth = 1920
screenHeight = 1080
screenBPP = 32
videoMemory = 16
textureMemory = 16
textureStages = 1
bogoFPS = 0
bogoMPPS = 0

Rules
-----
applying Sound
applying high sound detail
applying City Detail and Day/Night Settings
applying City Detail and Day/Night Settings>
applying high computer power
  option 9 = 3
  option 13 = 1
  option 15 = 3
applying Texture Quality and Building Variety Settings
applying Texture Quality and Building Variety Settings>
applying high memory
  option 3 = 3
  option 14 = 3
applying Variable Speed Automata
applying default
  option 10 = 1
applying Standard software
  option 0 = 1
  option 1 = 1
  option 2 = 1
  option 4 = 0
  option 5 = 0
  option 8 = 1
  option 7 = 0
  option 6 = 0
  option 11 = 0
  option 12 = 0
applying Standard software>
  option 0 = 2
applying Standard software>>
  option 4 = 1

Options
-------
Visual Effects       current:   2 recommended:   2
Cars/Sims            current:   1 recommended:   1
Shadows              current:   1 recommended:   1
Atmospheric effects  current:   1 recommended:   1
Water effects        current:   0 recommended:   0
Software/Hardware    current:   0 recommended:   0
Cursor               current:   0 recommended:   0
VariableSpeedAutomata current:   1 recommended:   1
Translucent UI       current:   1 recommended:   1
Graphic Detail       current:   3 recommended:   3
Building Load Speed  current:   3 recommended:   3
Texture Quality      current:   3 recommended:   3

Properties
-------
forcesoftwaredriver = false
renderdynamicview = true
renderstaticview = true
renderwatereffects = true
rendercloudsandfog = true
forcepointsampling = false
forcebilinear = false
forcenoalphablend = false
forcenoalphatest = false
rendershadows = true
renderdecals = true
usesecondstage = false
forcedebugtexture = false
renderparticleeffects = true
renderflorashadows = true
renderterrain = true
showupdateregions = false
usecursoreffects = true
drawlottextures = true
drawlotfoundations = true
drawlotwalls = true
forcetexturerepeat = false
usescreenshake = true
renderui = true
useupdaterectclipping = true
usevertexbuffers = true
showboundingboxes = false
useoverlayculling = true
rendersnapshot = false
noaddsigned = false
nopartialbackingstorecopies = false
usescreenflash = true
renderautomata = true
preferopaque = false
displayalertborders = true
drawlotopaquetextures = true
useviewcleanup = false
doautozoomandrotationchanges = true

viewoffsety = 0
viewoffsetx = 0
texturebits = 32
lodoffset = 0
shadowdebug = 0
maxparticlestarget = 10000
particlelodoffset = 0
effectprioritylevel = 5
backingstoremaxzoomall = 5
backingstoremaxzoombuildingsprops = 5
backingstoremaxzoomterrain = 5
backingstoremaxzoomflora = 5
shadowquality = 2
minvehiclezoom = 3
minpedzoom = 4
cursortype = 1
depthoffset = 2
debugtexture = 0
dirtyrectmergeframes = 1
sounddetail = 2
buildingvariety = 2
buildingloaderspeed = 1
modellodoffset = 0
stringtexturecachesize = 1024

particleeffectslod = 5
splattexturescale = 50
texbindmaxfree = 4
particledensity = 1
particledamping = 0
particlescale = 1
lightingupdatedelta = 0,0001
shadowmodelthreshold = 12
demolishmodelthreshold = 12
rendermodelthreshold = 6
rendermodelthresholdscroll = 40
particlesizethreshold = 300
maxvehiclepct = 1
maxpedpct = 1
opaqueuialphavalue = 0,55
The config from the ddraw.dll, which is working

1d48 13:27:41.304 Process path: C:\Program Files\SimCity 4 Deluxe Edition\Apps\SimCity 4.exe
1d48 13:27:41.304 Environment variable __COMPAT_LAYER = "DWM8And16BitMitigation HighDpiAware RunAsAdmin Installer"
1d48 13:27:41.304 Loading DDrawCompat dynamically from C:\Program Files\SimCity 4 Deluxe Edition\Apps\DDRAW.DLL
1d48 13:27:41.306 DDrawCompat loaded successfully
1d48 13:27:41.306 Installing display mode hooks
1d48 13:27:41.306 Installing registry hooks
1d48 13:27:41.306 Installing Direct3D driver hooks
1d48 13:27:41.306 Installing Win32 hooks
1d48 13:27:41.312 Hooking user mode display driver: C:\Windows\System32\DriverStore\FileRepository\iigd_dch.inf_amd64_38bfcb542ef4272e\igdumdim32.dll
1d48 13:27:41.325 Dynamic vertex buffers are not available
1d48 13:27:41.325 Dynamic index buffers are not available
1d48 13:27:41.327 Installing DirectDraw hooks
1d48 13:27:41.327 Installing Direct3D hooks
1d48 13:27:41.332 Installing GDI hooks
1d48 13:27:41.356 Finished installing hooks
1d48 13:29:24.117 Detaching DDrawCompat due to process termination
1d48 13:29:24.117 DDrawCompat detached successfully

Here the working ddraw.dll from you of the year 2020

https://drive.google.com/file/d/1cVqgzVzAhqqMR-gTvJ_C9SlF2mZv7MXL/view?usp=sharing

narzoul commented 3 years ago

The GOG version still works fine for me, even with Intel GPU drivers. Please attach the logs written by the ReleaseWithDebugLogs build of v0.3.1 (in DDrawCompat-v0.3.1-debug.zip).

MatthiasHeppner commented 3 years ago

I have the GOG version of Sim City 4.

My System:

Lenovo Thinkpad E570e with Core i5-7200u, NVidia GTX 950M, 16 GB Ram, Win 10 Pro 64-Bit

Here is the log with the debug-version of ddraw.dll (the same error like the normal ddraw.dll v0.3.1)

Log generated on 6/29/2021, 20:54

Flags
-----
hardwareDriver = false
DXT = true
fullscreen = true
MMX = true
FPU = true
backingStore = true
forcedFSAA = false

Strings
-------
userName = xyz
appName = SimCity 4
version = 1.1.641.0
osVersion = Windows NT 5.1
computerName = DESKTOP-XYZ
CPU = GenuineIntel
sglDriverName = Software
sglDriverVersion = 1.0
driverName = DISPLAY CDD
driverVersion = Product: 1025, Version: 1025, SubVersion: 0, Build: 0
cardName = 
cardVersion = DISPLAY CDD
cardIdentity = 
soundDriverName = 
soundCardName = Primärer Soundtreiber
buildType = Release

Numbers
-------
cpuSpeed = 2712
memory = 1024
freeMemory = 1024
screenWidth = 1920
screenHeight = 1080
screenBPP = 32
videoMemory = 16
textureMemory = 16
textureStages = 1
bogoFPS = 0
bogoMPPS = 0

Rules
-----
applying Sound
applying high sound detail
applying City Detail and Day/Night Settings
applying City Detail and Day/Night Settings>
applying high computer power
  option 9 = 3
  option 13 = 1
  option 15 = 3
applying Texture Quality and Building Variety Settings
applying Texture Quality and Building Variety Settings>
applying high memory
  option 3 = 3
  option 14 = 3
applying Variable Speed Automata
applying default
  option 10 = 1
applying Standard software
  option 0 = 1
  option 1 = 1
  option 2 = 1
  option 4 = 0
  option 5 = 0
  option 8 = 1
  option 7 = 0
  option 6 = 0
  option 11 = 0
  option 12 = 0
applying Standard software>
  option 0 = 2
applying Standard software>>
  option 4 = 1

Options
-------
Visual Effects       current:   2 recommended:   2
Cars/Sims            current:   1 recommended:   1
Shadows              current:   1 recommended:   1
Atmospheric effects  current:   1 recommended:   1
Water effects        current:   0 recommended:   0
Software/Hardware    current:   0 recommended:   0
Cursor               current:   0 recommended:   0
VariableSpeedAutomata current:   1 recommended:   1
Translucent UI       current:   1 recommended:   1
Graphic Detail       current:   3 recommended:   3
Building Load Speed  current:   3 recommended:   3
Texture Quality      current:   3 recommended:   3

Properties
-------
forcesoftwaredriver = false
renderdynamicview = true
renderstaticview = true
renderwatereffects = true
rendercloudsandfog = true
forcepointsampling = false
forcebilinear = false
forcenoalphablend = false
forcenoalphatest = false
rendershadows = true
renderdecals = true
usesecondstage = false
forcedebugtexture = false
renderparticleeffects = true
renderflorashadows = true
renderterrain = true
showupdateregions = false
usecursoreffects = true
drawlottextures = true
drawlotfoundations = true
drawlotwalls = true
forcetexturerepeat = false
usescreenshake = true
renderui = true
useupdaterectclipping = true
usevertexbuffers = true
showboundingboxes = false
useoverlayculling = true
rendersnapshot = false
noaddsigned = false
nopartialbackingstorecopies = false
usescreenflash = true
renderautomata = true
preferopaque = false
displayalertborders = true
drawlotopaquetextures = true
useviewcleanup = false
doautozoomandrotationchanges = true

viewoffsety = 0
viewoffsetx = 0
texturebits = 32
lodoffset = 0
shadowdebug = 0
maxparticlestarget = 10000
particlelodoffset = 0
effectprioritylevel = 5
backingstoremaxzoomall = 5
backingstoremaxzoombuildingsprops = 5
backingstoremaxzoomterrain = 5
backingstoremaxzoomflora = 5
shadowquality = 2
minvehiclezoom = 3
minpedzoom = 4
cursortype = 1
depthoffset = 2
debugtexture = 0
dirtyrectmergeframes = 1
sounddetail = 2
buildingvariety = 2
buildingloaderspeed = 1
modellodoffset = 0
stringtexturecachesize = 1024

particleeffectslod = 5
splattexturescale = 50
texbindmaxfree = 4
particledensity = 1
particledamping = 0
particlescale = 1
lightingupdatedelta = 0,0001
shadowmodelthreshold = 12
demolishmodelthreshold = 12
rendermodelthreshold = 6
rendermodelthresholdscroll = 40
particlesizethreshold = 300
maxvehiclepct = 1
maxpedpct = 1
opaqueuialphavalue = 0,55
narzoul commented 3 years ago

Not this one, it's not generated by DDrawCompat. Send "DDrawCompat-SimCity 4.log" please.

MatthiasHeppner commented 3 years ago

image

Where is it?

In the C:\Games\SimCity 4 Deluxe Edition\Apps I see just the DESKTOP-GNOEDOJ-config-log.txt

narzoul commented 3 years ago

It's supposed to be under Apps, but I think the error happens before any logs are written. I just noticed you have a dbghelp.dll file there, you probably need to delete it. I already deleted it on my installation, just forgot about it. After re-adding it, I get the same error as you.

Don't play with the debug version if this solves the issue, switch back to the Release build. The debug version is slower and the log file will be big.

elishacloud commented 3 years ago

@narzoul,

I just noticed you have a dbghelp.dll file there, you probably need to delete it. I already deleted it on my installation, just forgot about it.

What if you put a fix in like this to eliminate the need for the user to manually delete the dbghelp.dll file?

MatthiasHeppner commented 3 years ago

Thy, the dbghelp.dll was the villain ;-)

I deleted this file and put the normal ddraw.dll v0.3.1 into the folder and it started correctly and is as fast as the version from 2020.

Many thx for your help and also many thx for this wonderful DirectX Wrapper. I appreciate your work with it much :-)

This ticket can be closed now.

narzoul commented 3 years ago

@MatthiasHeppner Thanks for confirming!

@elishacloud Thanks for the tip! I might do something similar. But I've seen cases (Settlers 4 comes to mind) where these stray dbghelp.dll files conflict even with the AMD display driver and throw you a bunch of errors, even without any ddraw wrappers, so I prefer to just delete them anyway.

settlers4_dbghelp