FPS hit

Want to edit the game, build your own craft and missions? Here you'll find help, tools, guides and people to discuss with.
Post Reply

FPS hit

Darkblue
Cadet 2nd Class
Posts: 96
Joined: Sun Mar 09, 2003 12:01 am

Post by Darkblue » Sun Apr 08, 2018 11:15 am

Hi

Not sure if this forum is the best, but I wanted to comment on DInput.dll (the main hook one). I have found, by accident while I tried to catch the fps limit :? , that when running XWA with the DInput.dll that comes with the XWAUP 1.5, there is a fps hit from 32 to 22fps. On the other hand, when I use instead the one coming from the downloads section here I do not have any fps hit. This is so, regardless I just replace the DInput.dll from XWAUP 1.5 with the one from xwa_hook_main, or if I also apply the patcher that comes with xwa_hook_main.

I am afraid that if I use the DInput.dll that comes with xwa_hook_main instead the one that comes with XWAUP 1.5, I may be losing something, or I am exposing my installation to some malfunction, but I really don't have idea.

Can I keep the one from xwa_hook_main, which seems not have a fps hit?

BTW, has someone advanced on removing the fps hit? I find it too low, specially if playing in 3D. I was trying to find something with a memory scanner but without luck.

Tx

User avatar
JeremyaFr
XWAU Member
Posts: 3922
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Apr 08, 2018 12:02 pm

Hello,

How the fps evolves if you disable the Hook_Time.dll (prefix the dll name or delete it)?

If you use the older DInput.dll, all the hooks are disabled.

Darkblue
Cadet 2nd Class
Posts: 96
Joined: Sun Mar 09, 2003 12:01 am

Post by Darkblue » Sun Apr 08, 2018 1:24 pm

Ok, that's it.

Without Hook_Time.dll I get 29.0 (and 22 in3D), with it activated, I get 19/20 fps (14/15 in3D). I guess I have to disable the Hook_Time.dll (I will rename it)... and let the CPU work. Note: that is using the DInput.dll that comes with XWAUP1.5 (is it what you call the 'new'?), not the download one.

The fps numbers are the ones in-game (with your hack), the the first post they were from an external overlay.

If only I could unlock the max fps...they are too low! I have only found the address that writes the shown fps value (is easy), but it seems I can't find from where it takes it. Some years ago, by the same method, I managed to fix Silent Hunter 3 to make it 99% 3D compatible, and fixed others bugs I saw, but with XWA I am having problems to find some codes/parameters, depths, etc. Sure my knowledge is too limited...

Justagai
Cadet 1st Class
Posts: 218
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Sun Apr 08, 2018 5:55 pm

I've noticed that for quite a bit of people the Hook_Time.dll seems to reduce fps. But for the few that do need the additional CPU cycles I can see it being worth it.

As for unlocking the max fps, I've been tempted to look into that. It will probably make weird things happen with the animations and other things related to timing (if it doesn't outright crash of course) if the FPS was say, increased to 60.

Darkblue
Cadet 2nd Class
Posts: 96
Joined: Sun Mar 09, 2003 12:01 am

Post by Darkblue » Tue Apr 10, 2018 4:05 pm

The only thing I succeed was to use Cheatengine speedhack to make it much smoother but also fast-motion at the same time :D So it's not a solution... Even with the risk of damaging other things in the game, I think that unlocking the fps is worth a try, if one knows where to start, of course.

Justagai
Cadet 1st Class
Posts: 218
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Mon Apr 16, 2018 6:23 pm

You can use Cheatengine to find an address that holds the current FPS at that time. You may have to edit the exe to show the fps which can be done through xwahacker. If there isn't an address, check the assembly for a function that does mess with the FPS.

User avatar
JeremyaFr
XWAU Member
Posts: 3922
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Apr 16, 2018 6:59 pm

Hello,
The current fps for the last 4 frames is stored in an array of 4 float at address 00782800. The value comes from a variable at address 0080B61C.
The code looks like that:

Code: Select all

s_SceneFramerates[s_SceneFrameratesIndex] = (float)s_V0x080B61C;
s_SceneFrameratesIndex++;

if( s_SceneFrameratesIndex == 4 )
{
  s_SceneFrameratesIndex = 0;
}
The value of s_V0x080B61C is calculated from a value at address 008C1640.
The code looks like that:

Code: Select all

s_V0x080B61C = 236 / s_V0x08C1640;

if( s_V0x080B61C == 0 )
{
  s_V0x080B61C = 1;
}

Justagai
Cadet 1st Class
Posts: 218
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Mon Apr 16, 2018 10:34 pm

Very nice find Jeremy.

Darkblue
Cadet 2nd Class
Posts: 96
Joined: Sun Mar 09, 2003 12:01 am

Post by Darkblue » Tue Apr 17, 2018 6:36 am

Justagai wrote:
Mon Apr 16, 2018 6:23 pm
You can use Cheatengine to find an address that holds the current FPS at that time. You may have to edit the exe to show the fps which can be done through xwahacker. If there isn't an address, check the assembly for a function that does mess with the FPS.
Yes, I did just that some time ago and I found the comparison with 4 that Jeremya found, but I did not understand it as fine as he has done :ops: . That's a good point to keep researching.

Post Reply