elishacloud / dxwrapper

Fixes compatibility issues with older games running on Windows 10/11 by wrapping DirectX dlls. Also allows loading custom libraries with the file extension .asi into game processes.
zlib License
1.23k stars 90 forks source link

Army Men RTS bright issue with Dd7to9 #265

Closed SAM1430B closed 4 days ago

SAM1430B commented 5 months ago

Hi,

The game looks like brighter than it should be.

Not sure if there are better settings or i'm messing something and i've tried all the options and it seems the problem still there.

I have copied ddraw.dll and dxwrapper.dll & .ini .

Thank you for your efforts and this awesome project.

ArmyMenRTS ArmyMenRTS2

elishacloud commented 5 months ago

Can you upload the dxwrapper log file?

SAM1430B commented 5 months ago

Sure thing. dxwrapper-amrts.log.txt

elishacloud commented 5 months ago

Try with this update and let me know if you see any difference: dxwrapper.zip

SAM1430B commented 5 months ago

Yeah thank you, i've got better result.

i'm gonna test Dd7to9 combined with DDrawCompat next week and post a report.

Have a good night✨

elishacloud commented 5 months ago

Ok, very good. I am glad it is working better.

BTW: DDrawCompat cannot be combined with Dd7to9.

SAM1430B commented 5 months ago

I said next week but time flies so fast lol. Anyway after long play test it was flawless getting 60fps which is the most part i like. Except the smoke/dust look more dense. Army_Men_RTS_Screenshot_2024 04 17_-_22 38 08 36

Also i wanted to set a windowed screen with 1920x1080 size (which the game doesn't support it) tried DdrawOverrideWidth/Height seems making black frame rather than a stretched window, even DdrawCustomWidth/Height and DdrawClippedWidth/Height they seem not effecting anything.

elishacloud commented 5 months ago

Anyway after long play test it was flawless getting 60fps which is the most part i like.

Great. Very good.

Except the smoke/dust look more dense.

This could be because I have not added MipMap support.

Also i wanted to set a windowed screen with 1920x1080 size (which the game doesn't support it)

Yeah, those options are mainly for 2D games. I have not updated them for 3D games yet. It is not a high priority for me at this time. I am trying to finish the implementation of all DirectDraw/Driect3D functions first.

SAM1430B commented 5 months ago

Cool, we wish the best and everything goes smoothly.

elishacloud commented 4 months ago

Except the smoke/dust look more dense.

This could be because I have not added MipMap support.

I added MipMap support. See if this fixes the smoke/dust issue: dxwrapper.zip

SAM1430B commented 4 months ago

Seemed to be darker and smoke/dust issue still there. Screenshot_2024-05-13

elishacloud commented 4 months ago

That dark issue is a MipMap issue. I guess it is an autogen issue. I need to collect some logs. Can you use the below build and send me the logs?

dxwrapper.zip

SAM1430B commented 4 months ago

Sure as you wish. dxwrapper-amrts.log.txt

elishacloud commented 4 months ago

That is weird. I am not seeing any of the new logs. Did you run the game long enough to see the issue? Can you try with this one? Make sure you play the game long enough to see any issue.

dxwrapper.zip

SAM1430B commented 4 months ago

You're right it wasn't long play. I wish this would be what you want. dxwrapper-amrts.log.txt

elishacloud commented 4 months ago

Ok, I think this one should fix the dark issue: dxwrapper.zip

elishacloud commented 4 months ago

This should fix everything in this game except the resizing. There is another issue on that already.

SAM1430B commented 4 months ago

Yes, except these two issues which one of them you're already going to add it (Resizing) in the future ✨.

elishacloud commented 3 months ago

I can see the same (I believe it is the same) smoke issue with Dark Reign 2. I have not looked into it yet, but I will check it out.

SAM1430B commented 3 months ago

Yes, they made by the same engine.

elishacloud commented 3 months ago

I know what the issue is but I don't know what is causing it or how best to fix it. The issue is that the game calls SetTextureStageState and sets D3DTSS_ALPHAOP to D3DTOP_SELECTARG1 when dd7to9 is enabled. However, when using the native DirectDraw the game sets D3DTSS_ALPHAOP to D3DTOP_MODULATE.

If I overwrite the game and force the setting to D3DTOP_MODULATE when using dd7to9 it solves the issue. However, that would break other games and is not a proper fix. I am not quite sure why the game behaves differently here.

SAM1430B commented 3 months ago

Yes, i've mentioned this before the game behaves different (e.g dd7to9 caps fps to 60, native to 30 fps) but this was in Windows 10 (not sure if this related).

Anyway i think the alternative way to fix it by making option to force D3DTOP_MODULATE (in the config file maybe).

elishacloud commented 3 months ago

Anyway i think the alternative way to fix it by making option to force D3DTOP_MODULATE (in the config file maybe).

Yes, I thought about that. However, the issue is that there is a whole list of options that are available for D3DTSS_ALPHAOP. In fact the game could send hundreds or thousands of requests to set that option per second. How do I know which ones to force to D3DTOP_MODULATE and which ones should not?

I could just force D3DTOP_SELECTARG1 to be D3DTOP_MODULATE. That would probably work for this game and for Dark Reign 2. But I am not sure how many other games this would work for, Also, I prefer to fix this right the first time. Once this is fixed correctly, the option won't be needed any more. I hate to add an option and then remove it at some point when it is no longer needed. But maybe I will do that for now.

SAM1430B commented 3 months ago

I see your point and i think you don't have to be in a hurry at the moment, you might figure a way to find a better solution in the future to set it up. ✨

elishacloud commented 2 weeks ago

This issue is caused by a failed call to ValidateDevice(). I am looking for a solution.

elishacloud commented 2 weeks ago

Ok, this update should fix the issue: dxwrapper.zip

SAM1430B commented 2 weeks ago

Nice thank you, works flawless 🩶

PS: there are additional steps to run the Army men RTS with DxWrapper on some devices:

1 - An error message could occur something about dbgeng.dll .

Fix: rename dbghelp.dll to something else, it's stored in \Army Men RTS\library\dbg folder.

2 - Issue where the game crashes at the startup without getting any error message.

Fix: go to Control Panel\Hardware and Sound\Devices and Printers , right click your device select Properties, on Hardware tab scroll down to the bottom, will find USB Input Device click Properties then Change settings and Disable Device on Driver tab. I think this is an uncommon issue that happens to Army Men RTS, Commandos 2 Men of Courage and Commandos 3 Destination Berlin

elishacloud commented 4 days ago

Very good. Closing the issue now.