rebtd7 / FF13Fix

Performance and bug fixes for the PC versions of FF13 and FF13-2
GNU General Public License v3.0
333 stars 23 forks source link

Versions after 1.4.4 no longer work in older setup #49

Open CactusWizard opened 3 years ago

CactusWizard commented 3 years ago

The last version that worked for me is 1.4.4. I'm using Windows 7 on a laptop (yes, I'm well aware that it's nowhere near the ideal minium setup, I even have to use the smallest resolution possible). I use the fix mainly for the FPS improvement and the enemy intel fix but I wanted the fixes for #19 and #20. When I tried to upgrade to anything newer than 1.4.4 I get the issue #33 for menus, loading screens and mission summary and lose the previous fixes. I even get a Windows system sound during the Square Enix screen. I hope there's a way to fix it. I'll stick to 1.4.4 for now. FF13Fix.log

rebtd7 commented 3 years ago

Hi,

I don't have W7 installed, but I think this may be unrelated to it. I suspect the Direct3D hooks are not working properly. If that's the case, 1.4.4 is probably not working perfectly for you either (you are missing performance fixes)

The Windows sound in 1.5.0+ is expected and not an issue btw

Could you list the dlls in the ffxiiiimg.exe process? I suspect something else is hooking D3D, causing issues

You can use: https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer Then enable DLL display: View → Lower Pane View → DLLs Select the ffxiiiimg.exe process from the list, and go to File->Save As

Other way to do it is to use this command line tool: https://docs.microsoft.com/en-us/sysinternals/downloads/listdlls

Could you also try something else that hooks D3D9 and see if it it works? e.g. Reshade or DXVK

@Nucleoprotein Do you have any idea on how to better troubleshoot this?

Nucleoprotein commented 3 years ago

@rebtd7 I see game calls IDirect3D9::GetAdapterIdentifier only once and this is laptop, maybe it's running on Intel GPU and this is related? it will be good to print data returned from IDirect3D9::GetAdapterIdentifier to log so we have more data - also because in most cases users report problems without any information about their systems... We can validate memory patches by reading memory and compare after writing it. ScissorRect fix is not a hook but it is wrapped in hkIDirect3DDevice9, maybe we should just hook member we need and not wrap full COM objects (similar like here for DirectInput: https://github.com/x360ce/x360ce/blob/master/x360ce/InputHook/HookDI.cpp) Maybe also compile version with printing every hkIDirect3DDevice9::SetScissorRect to log to debug this? it will be ultra slow - i made less blocking than before but it's synchronous and very slow, for faster log we can migrate to https://github.com/gabime/spdlog - we can then add verbosity option to ini file.

@CactusWizard This is happening too with 1.6.0 + DXVK?

CactusWizard commented 3 years ago

I'm very sorry, my old toaster is indeed using Intel GPU and has 6 GB RAM. I tried to get the dlls list but the programs are not working for me. I'm trying to see what the problem is.

Now the results of the tests:

I think 1.4.4 is actually improving performance somehow. As I mentioned, the game ran worse when I removed 1.4.4 to test the other options or just ran the game with only the original files.

Thank you both for looking into this.

Nucleoprotein commented 3 years ago

@rebtd7 1.4.6 is patch based, first one with ScissorRect Fix, 1.4.4 have no ScissorRect fix at all. I think there are two versions of executable ww and asia and maybe this is the case - memory patches NOP bad memory location and game is applying ScissorRect scaling too. Can you add memory reading for ScissorRect fix to check for expected values before NOP them?

EDIT: Maybe i will be have so time to check and add this today after work.

CactusWizard commented 3 years ago

My game is the NA/Global version (steam_appid: 292120).

I got the dlls list for the game when using version 1.6.0. FF13 dlls.txt

Thank you both.

Nucleoprotein commented 3 years ago

"C:\Program Files (x86)\AVG\Antivirus\x86\aswhook.dll" Antivirus software can block our hooks/patches because of they nature - we are overwriting process memory which can be detected as malicious. Also AVG Antivirus is ... trash, it's better to use built-in Windows Defender - which is now best free antivirus.

EDIT: Storing games in "C:\Program Files (x86)" or "C:\Program Files" is also not great idea because of Windows User Account Control virtualization.

CactusWizard commented 3 years ago

Disabling the antivirus didn't work. And disabling both the antivirus and UAC didn't work either. Unfortunately I only have C:

Nucleoprotein commented 3 years ago

Make sure "C:\Program Files (x86)\AVG\Antivirus\x86\aswhook.dll" is not loaded to game process.

rebtd7 commented 3 years ago

I've attempted to reproduce the issue in a old W7(x86) laptop with an Intel GPU, but it works fine for me (just slow)

DLLs for comparison: out.txt

Nucleoprotein commented 3 years ago

Maybe forced DEP? @CactusWizard Right click on "Computer" Select "Properties" and "System Protection" Choosing "System Protection" in the left pane Click on "Advanced System Settings" Under "Performance" click "Settings" Click on "Data Execution Prevention" Check the box: "Turn on DEP for essential Windows programs and services only" http://www.interdesigner.com/images/DEP_off.jpg

CactusWizard commented 3 years ago

DEP was already in the essential-only configuration. Here's the dlls list without the antivirus dll just in case. DLL new.txt