narzoul / DDrawCompat

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

F1 World Grand Prix in windows11 #185

Closed Buechnerstod closed 5 months ago

Buechnerstod commented 1 year ago

attached is the log

ghotik commented 1 year ago

I'd like to add my considerations to this thread started by Buechnerstod (that I presume is the same guy who started a similar thread on DxWnd forum). The game is F1 World Grand Prix released in 1999, not to be confused to the later release F1 World Grand Prix 2000, similar name but quite different architecture. We are testing this game with DxWnd because it seems to need an option to ignore some exception (I'll investigate that apart, since it seems related to the MS Sidewinder Precision Pro) that can be provided by DxWnd, but probably as well as some other shim. What puzzles me now is that the game has invisible parts (some text in the menus and some sub-menu tabs) that on Win11 affect the game both in native mode, with DxWnd and with DDrawCompat. But curiously dgVoodoo2 is able to fix the problem (though I couldn't make it run the 3D part yet). I am attaching some screenshots taken with DxWnd and the different ddraw wrappers. I am wondering if you could detect the problem, fix it in DDrawCompat and suggest a solution for DxWnd as well. P.s. the game is available on MyAbandonw*re. screenshot of game options with DxWnd alone dxwnd_alone screenshot of game options with DxWnd + DDrawCompat ddrawcompat screenshot of game options with DxWnd + dgVoodoo2 dgvoodoo2 BTW I have other screenshots (that I spare you) that demonstrate that the problem is not a simple problem of missing text (which could be accounted to some GDI32/USER32 function) but instead entire blitted surfaces get lost after ddraw operations.

narzoul commented 1 year ago

The crash doesn't seem to be DirectX related to me, or at least I couldn't see any obvious indication of it from debug logs. I don't have time to debug it further for now.

@ghotik I don't have any missing text in the menus with DDrawCompat. Are you sure the issue is not caused by DxWnd? I noticed none of your screenshots are with DDrawCompat alone.

ghotik commented 1 year ago

I didn't add a screenshot in native mode because the game has some difficulty to start in this way, so I had to run it with DxWnd using also the tweak to ignore some exceptions. But what puzzled me was the fact that DxWnd alone or DxWnd+DDrawCompat showed the problem while DxWnd+dgVoodoo2 was working correctly, in some way exonerating DxWnd from being the culprit. Now I repeated the test without DxWnd. The game alone doesn't start, but adding the DDrawCompat ddraw.dll it now starts and shows the same problem. Beware: the problem is not limited to text only and it is better seen in the options menu (in effect, the main menu shows a different problem but the test is perfectly visible there). I also tried to capture a screenshot with DDrawCompat alone as you wanted, but unfortunately it was not possible: the game selects a video mode that turns all screenshots into a black rectangle.

narzoul commented 1 year ago

Strange, I can capture screenshots too. It should work fine with the FullscreenMode=borderless (default) setting. Are you using the latest DDrawCompat release, v0.4.0? Only earlier releases should have the black screenshot problem. Here is one from my system, with the config overlay enabled, just to show that it's running with DDrawCompat v0.4.0:

f1

And you can also see in the background that the text is fine. This is all with default settings. Please upload the debug logs of DDrawCompat (running without DxWnd).

Buechnerstod commented 1 year ago

wow i did not see that there wa sa config overlay - how does one acces that in a game

F1wgp for me though has athe much bigger bigger problem of its AI and car physics being completely broken now in windows11 - it ran fine on my previous asus rog windows10 computer, but now the AI wont drive faster than 40kph upon race start and it basically refuses to do any overtakes, its as though it now thinks every other car that is near it is like some obstacle i must incredibly slow near - its all really weird and makes the game completely unplayable

if you can run teh game Narzoul and if you have windows11 tell me if you find that also.

narzoul commented 1 year ago

I see you still haven't read the Configuration wiki, which I pointed out in your other issue also. :) You can show/hide the overlay with shift+f11, like the wiki says.

I have the same experience as you with Win11, the game crashes before entering the race, so I don't know how AI/physics would behave.

Buechnerstod commented 1 year ago

yes sorry i havent gotten round to reading th config wiki, but i didnt even imagine it would contain info on an ingame overlay, i just assumed it would be the case thatone makes some text conf file - i hadnt got back to it as i had not gone back to trying to slow down how fast "Napoleon's Battles" plays yet

ghotik commented 1 year ago

I start to believe that this game is baffling me (or us). I run it alone (no DxWnd) with DDrawCompat last release v0.4.0 in debug build (compiled in release profile) and on my computer the game still misses some surface display, same behavior as before. I tried then to get a screenshot and this time I succeeded (who knows why with the non-debug release I got a black rectangle) but the screenshot captured only one tiny part of the screen, by the way the only part where text was visible! Anyway I got a log for your reading, and maybe an interesting theory: one of the operations that I did while blindly clicking on the missing text was to increase the game resolution from the default 640x480 to a higher value. Is it possible that the different behavior depends on the lower resolution in your testbed (behind the overlay panel I can see a 640x480 resolution value) ? The captured part is 800x600 pixel, another couple of numbers that usually remind something... Well, I don't know, I suspect that there is some vicious mix of ddraw, GDI32 and windows here, quite a graceful mess. DDrawCompat-F1wgp.log ddc-debug

narzoul commented 1 year ago

I tried changing the resolution setting in the menu, but it doesn't change the menu resolution at all, and the text is still correct for me. Maybe DDrawCompat doesn't work well with old Intel drivers anymore, I couldn't test it in a long time since I don't have such a GPU anymore (my "new" Intel GPU only runs on D3D9On12).

Maybe try changing the DisplayResolution setting in DDrawCompat.ini to "app", in case it's some issue caused by DDrawCompat's display scaling.

I assume your desktop DPI scaling is set to 100%. Anyway, I tried changing that too, but can't reproduce the issue that way either.

Your logs are only release logs (info level). You need to change LogLevel to "debug" in the config, or use the Debug build profile, which defaults to that.

ghotik commented 1 year ago

My DPI is currently 125% but I can try with 100%, though I doubt that the trouble is only on the exceeding 25% of the screen. In attach the new log with debug level, quite a bigger one! DDrawCompat-F1wgp.zip

p.s. I tried to change the resolution again, but I found that the resolution set in the video options only applies to the 3D race while all the intro and configuration panels are rendered at a fixed resolution.

narzoul commented 1 year ago

Hmm, the game seems to load those texts via GDI into a ddraw surface, then probably copies it somewhere purely via locks and CPU (I don't see any blits from that surface, even in my own logs), so it's hard to track what's happening.

Just to rule out any driver issues, could you try setting also ForceD3D9On12=on in DDrawCompat.ini? There are some issues with color keying (e.g. with the cursor) when using that, but at least the text still shows correctly for me with it.

ghotik commented 1 year ago

Wow, quite a different result: now all the text is visible, the only (new) problem now the black cursor sprite. And this time it was possible to capture the whole screen. ddc-d3d9on12

Interesting also what happens when you try to set the different options by clicking on the fields: each time you try to set a different value, the field becomes black.

ddc-d3d9on12-b

then, messing with other screens, it is possible to notice that the artifacts are not simply black, but rather rectangular areas coming from other parts of the same screen, probably from the upper-left corner of some visible or invisible window ... ddc-d3d9on12-c

and, finally, I could just add that these artifacts are cleared by a window refresh, for instance by minimizing and restoring the game window.

Buechnerstod commented 1 year ago

I went into my copy of f1wgp and wanted to try the overlay but found i didnt have actually ddraw compat in use, so i put it in the game folder and the game graphics are all messed up when i do that

what can you suggest i do to fix this in ddraw compat. If i remove the ddraw.dll file the graphics are back to normal, though the menus are still having issues like ghotik had.

I wanted to see if the fpslimiter in ddrawcompat might fix teh weird physics/ai issue going on

i did try out the overlay despite the weird graphics - if i make change there, is that change applied right awy or does it only work after restarting? f1wgp

Buechnerstod commented 1 year ago

i also dont see the option in the overlay to force d3d9on12 - where is that, and also i wanted to export the ini file but not all the options get exported,

if i want to change the fps from teh ini file, what do i need to type exactly? could you provide perhaps a list of how the text commands should be written if one is using the ini file instead of the overlay? I did try and change things in the overlay but nothing changed at all regardless of what i did, it was like the overlay was not functioning at all

Buechnerstod commented 1 year ago

okay i did some playing aroudn with teh ini file details that show up and the colour issue is fixed - not sure what the trick was - maybe the ccolour depth set to 32?

i set the fpslimiter to 30 but the ai issues still remain - cars crawl off the start grid and when they eventually decide to start moving their top speed is only around 140-150 - not sure if that that is kph or 140-150mph , but either way it is still much slower than what the cars normally drive at in the game

Buechnerstod commented 1 year ago

okay some more weirdness found - if i race some tracks the graphics are fine, ie - I tried Italy and Austria, both fine... but if i try Monaco then the graphics are missing all textures, - i have changed nothing in the settings yet a differnt track completely wrecks the graphics.

this issue does not occur if i am just using Dxwnd, only if i use ddrawcompat with dxwnd.

If i could just stick with dxwnd for thhis that would be great but ddraw compat actually has now solved the AI issue it seems

I added in the winversionlie = xp line to the compat file and now the ai runs fine.

monaco weird 2jpg ![Uploading monaco weird.2jpg.jpg…]()

Buechnerstod commented 1 year ago

this is my log

DDrawCompat-F1wgp.log

Buechnerstod commented 1 year ago

Okay - i am having the issue where i got some things working before but then was trying ddrawcompat and now coming back to just Dxwnd, i am finding the game is no longer starting -its just a black screen. are there some shims elsehwere stored that i need to clear or something?

if though there is someway to ensure that monaco actually works in DDrawcompat that would be great

oddly also dgvoodoo doesnt work for me for this game - crashes when race starts to load everytime

narzoul commented 1 year ago

The Monaco one seems to have some fog issue. If you increase the fog intensity even slightly in the in-game graphics menu, it displays fine. It just doesn't work with 0 intensity for some reason.

Buechnerstod commented 1 year ago

okay cool i will try that then

Buechnerstod commented 1 year ago

The Monaco one seems to have some fog issue. If you increase the fog intensity even slightly in the in-game graphics menu, it displays fine. It just doesn't work with 0 intensity for some reason.

okay i went to try this but tell me where do i increase fog intensity? i dont see this option in the game, is it a ddraw compat setting?

Buechnerstod commented 1 year ago

okay i got it sorted - form the in race graphics menu, okay wow this game actually looks even better now then it did on windows 10! thanks to DDrawcompat and Dxwnd - a beautiful alchemical wedding of the two

narzoul commented 1 year ago

Another discovery: the 0 fog intensity is only broken if "D3D Render T&L DLL" is selected in the main menu options. With "D3D Render DLL" it works correctly. It has the same behavior with native ddraw, so at least it's not a DDrawCompat bug.

I think the problem with Monaco is that it initializes fog intensity to 0, which is probably not what it's supposed to be. Other tracks have non-0 fog at the start, and they will also break (when using T&L) if it is manually set to 0. On one of my test runs, actually Monaco started also with non-0 fog, but I couldn't reproduce it again. This might all have to do with those invalid memory access errors when the map is loaded, which is currently skipped by DxWnd (or by the IgnoreException shim in my case). Maybe someone can test on an older system (that doesn't have those exceptions) what should be the default fog settings for Monaco, and if fog is broken at 0 intensity with T&L there too.

narzoul commented 10 months ago

Is there anything still unresolved in v0.5.0 here? Besides the game bugs that are not really in DDrawCompat's scope (random exceptions and such).