dxwrapper icon indicating copy to clipboard operation
dxwrapper copied to clipboard

Somewhat minor Plants vs. Zombies Rendering issues [Dd7to9]

Open Windowslover1234 opened this issue 1 year ago • 4 comments
trafficstars

Issue 1

This only happens when you toggle "3D Acceleration" in the settings menu. The issue goes away when you restart the game. The Location of the bugged backdrop is rendered in the front-most layer and it's position dependent on the game window's position as well. 20240704122432_1

Issue 2

The "Full screen" option's scaling is broken with "3D Acceleration" enabled. The game is rendered in the corner of the screen while the button hitboxes are scaled in the center of the screen. 20240704123653_1(1)

Final Thoughts

Disabling "3D Acceleration" fixes both these issues, but this wrapper gives me much higher performance than WineD3D on my system in the "Seed Selection" screen in the first screenshot, about 30FPS with 3D Acceleration enabled, excellent work!

Windowslover1234 avatar Jul 04 '24 18:07 Windowslover1234

Issue 1: This only happens when you toggle "3D Acceleration" in the settings menu.

Can you confirm what build you are using or upload your log files?

Issue 2: The "Full screen" option's scaling is broken with "3D Acceleration" enabled.

Yeah, I have not yet built scaling for the 3D games yet. It is showing the original size of the game and just stretching the window to fill the screen. I may be able to put a quick fix in for this. I will take a look when I have some time. I think issue 1 should not happen in full screen. BTW: can you confirm with full screen setting you are using?

elishacloud avatar Jul 04 '24 20:07 elishacloud

Issue 1 Log: dxwrapper-popcapgame1.log Still happens in full screen. This happens in any part of the game that gameplay happens and stays onscreen until you quit.

Issue 2 Understandable that you haven't gotten 3D scaling working yet.

I'm using the game's built-in fullscreen option with 3D Accel, without 3D Accel basically does the same thing as the "ForceExclusiveFullscreen" option in the config file. With or without 3D Accel, the game caps the framerate to 60FPS. The mentioned "ForceExclusiveFullscreen" option works perfectly with this game, but I would like to be able to use the game's built in option.

Windowslover1234 avatar Jul 05 '24 00:07 Windowslover1234

For the full screen try setting DdrawOverrideWidth to 800 and DdrawOverrideHeight to 600 in the dxwrapper.ini file. This should force the game into this resolution and then allow the scaling to be done by your monitor.

elishacloud avatar Jul 05 '24 20:07 elishacloud

DdrawOverride caps the resolution so that the window looks correct but the hitboxes are unaffected.

Toggling 3D Acceleration with DdrawOverride also causes a 1600x900 canvas to be created which looks like the Issue 2 but is squished into windowed mode, but can be fixed by alt-entering to toggle full screen on and off. With or without DdrawOverride, the "Full Screen" option in settings causes Issue 1 to occur where gameplay happens as-well.

Also, the game window flashes when any part of the window is off-screen on the right when 3D Acceleration is enabled and spams this in the log:

9604 14:06:14.484 m_IDirectDrawX::CreateD3D9Device Direct3D9 device! 1600x900 refresh: 0 format: D3DFMT_UNKNOWN wnd: WND(000907F4,MainWindow,{840,162,1646,791}) params: {1600,900,D3DFMT_UNKNOWN,1,0,0,1,WND(000907F4,MainWindow,{840,162,1646,791}),1,0,D3DFMT_UNKNOWN,0x0,0,0x80000000} flags: 0x46
9604 14:06:14.549 m_IDirectDrawX::CreateSurface2 Primary surface 0x0 dwFlags: 0x1 ddsCaps: 0x2200, 0x0, 513
9604 14:06:14.574 m_IDirectDrawX::CreateD3D9Device Direct3D9 device! 800x600 refresh: 0 format: D3DFMT_UNKNOWN wnd: WND(000907F4,MainWindow,{840,162,1646,791}) params: {800,600,D3DFMT_UNKNOWN,1,0,0,1,WND(000907F4,MainWindow,{840,162,1646,791}),1,0,D3DFMT_UNKNOWN,0x0,0,0x80000000} flags: 0x46

Seems like either the game or the wrapper is constantly swapping between 800x600 and 1600x900 for some reason.

Windowslover1234 avatar Jul 06 '24 20:07 Windowslover1234

Try with this build. You may only need to enable the dd7to9 option now. dxwrapper.zip

If you have issues please upload your log file.

elishacloud avatar Sep 08 '24 02:09 elishacloud

Thanks! I'll give it a try around 4PM, I'm at work right now.

Windowslover1234 avatar Sep 10 '24 16:09 Windowslover1234

OK, been giving it a somewhat thorough test, and all mentioned issues are gone, I will close the this, but I'm going to assume the scaling implementation is temporary? Performance seems pretty low, 100 down to about 35 FPS on the Main Menu. The most demanding part, the seed selection, goes from 38 to 12 FPS. GPU usage doesn't go up, so you might be able to GPU accelerate the scaling process without too much performance loss, but I have no idea how you would do that.

Windowslover1234 avatar Sep 10 '24 22:09 Windowslover1234

Yeah, performance is something can can be improved. However, I did put a number of perf improvements in this latest build from today: dxwrapper.zip

elishacloud avatar Sep 10 '24 22:09 elishacloud

No problem, title screen performance was literally doubled from the new build, and Seed Selection got a 8FPS boost as well! I am noticing that alt-tabbing in full screen causes Issue 1 again, but it doesn't require a restart to fix, just toggling full-screen or HW acceleration, and I actually don't know how often I alt-tab while playing games in general.

Windowslover1234 avatar Sep 10 '24 22:09 Windowslover1234

Glad to hear the performance is better. As far as the alt+tab issue, did that happen in the build I gave you a few days ago?

elishacloud avatar Sep 10 '24 23:09 elishacloud

Yeah, probably should have mentioned it.

Windowslover1234 avatar Sep 10 '24 23:09 Windowslover1234

Ok, thanks. I will need to look into the alt+tab issue later. There is a lot of stuff I probably need to do there.

elishacloud avatar Sep 11 '24 20:09 elishacloud