Page 1 of 4

60FPS Inflight hook

Posted: Mon Dec 03, 2018 6:56 am
by Justagai
EDIT: XWAUP/DSUCP already comes with a 60+FPS hook "hook_time.dll". Do not use my 60FPS hook for XWAUP/DSUCP or there will be an error message stating that the hook could not be loaded. Only use if hook_time.dll is having issues.

Hello folks,

I have created a hook that will increase the frame limit from 30 to 60fps inflight. The game will be much smoother.

This can be applied to any of the games in the X-Wing series: X-Wing, TIE Fighter, X-Wing vs TIE Fighter, Balance of power and X-Wing Alliance

Compatible with the Disc, GoG and Steam versions.

Download: https://1drv.ms/u/s!AoEpIrw6LOkUjbF_1Vza7GDWJGkXXg

Changelog:

1.0.2
- XWA: Hangar is now 60FPS

1.0.1
- Fixed issue with certain machines crashing at game startup

1.0
- Initial version

Re: 60FPS Inflight hook

Posted: Mon Dec 03, 2018 9:52 am
by Darksaber
Hey Justagai, this is great I'll have to test it, I noticed there doesn't seem to be a readme file though :( would be great if you could add one at some point please :)

Re: 60FPS Inflight hook

Posted: Mon Dec 03, 2018 1:34 pm
by ual002
Nice, I'll have to check this out. Get back into the groove and see what I missed.

Re: 60FPS Inflight hook

Posted: Mon Dec 03, 2018 6:01 pm
by JeremyaFr
Nice find.
It works.

A quick question:
Why use a complex hook to change only one byte?

Code: Select all

At offset 10FBF8, replace 08 with 04.
08 corresponds to 30 FPS.
04 corresponds to 60 FPS.

Re: 60FPS Inflight hook

Posted: Mon Dec 03, 2018 7:15 pm
by Darksaber
Huh.. look at that I can just add it to Xwa Exe Patcher :)

Re: 60FPS Inflight hook

Posted: Mon Dec 03, 2018 7:17 pm
by Justagai
Darksaber wrote:
Mon Dec 03, 2018 9:52 am
Hey Justagai, this is great I'll have to test it, I noticed there doesn't seem to be a readme file though :( would be great if you could add one at some point please :)
I'll have a readme available soon.
JeremyaFr wrote:
Mon Dec 03, 2018 6:01 pm
Nice find.
It works.

A quick question:
Why use a complex hook to change only one byte?

Code: Select all

At offset 10FBF8, replace 08 with 04.
08 corresponds to 30 FPS.
04 corresponds to 60 FPS.
I could have just set the byte at the binary offset but I wanted to plan ahead in case there is something else I needed to change. If you have a better method in mind then I am open to suggestions.

As for the reason 08 = 30FPS and 04 = 60FPS...

Since the original X-wing, the way they use time units has been consistent.

They measure one second as "236 time units". They increment 8 time units per frame by default.

236/8 = 29FPS

236/4 = 59FPS

Any time units that are found should be divided by 236 to get the time in seconds.

Re: 60FPS Inflight hook

Posted: Mon Dec 03, 2018 7:27 pm
by Darksaber
Justagai wrote:
Mon Dec 03, 2018 6:56 am
Note: I did not change the frame limit in the hangar, another heads up.
Just wondering was there a reason why you didn't change the frame rate in the hangar? Is it possible though?

Re: 60FPS Inflight hook

Posted: Mon Dec 03, 2018 7:30 pm
by Justagai
Yes it is possible. I was a little afraid to do so at the time in case it was going to break something and I didn't have enough time to test.

I will change the frame limit in the hangar soon.

Re: 60FPS Inflight hook

Posted: Mon Dec 03, 2018 7:59 pm
by JeremyaFr
I propose that:

Code: Select all

At offset 10FBD5, replace 7D24 with EB24.
At offset 10FC8D, replace 0F8D with 90E9.
At offset 58005, replace 83FA08 with 83FA04.
At offset 58027, replace 83F908 with 83F904.

Re: 60FPS Inflight hook

Posted: Mon Dec 03, 2018 9:04 pm
by Darksaber
What do these offsets do Jeremy?

Re: 60FPS Inflight hook

Posted: Mon Dec 03, 2018 9:11 pm
by JeremyaFr
Offsets 1 and 2 disable the fps limit for inflight.
Offsets 3 and 4 set the fps limit to 60 fps in the hangar.

Re: 60FPS Inflight hook

Posted: Mon Dec 03, 2018 11:01 pm
by Justagai
JeremyaFr wrote:
Mon Dec 03, 2018 9:11 pm
Offsets 1 and 2 disable the fps limit for inflight.
Offsets 3 and 4 set the fps limit to 60 fps in the hangar.
Good finds.

I probably wouldn’t remove the FPS limit entirely until more testing can be done (especially for multiplayer).

But if you folks are willing to test out that stuff, that would be very helpful as I’ve got a lot of projects going on.

Re: 60FPS Inflight hook

Posted: Tue Dec 04, 2018 3:38 am
by Bman
Awesome. I'll test it. I have some complex hangar layouts and this might definitely help. Thanks.

Re: 60FPS Inflight hook

Posted: Tue Dec 04, 2018 5:00 pm
by JeremyaFr
Hello,

To get full FPS, you can disable the time hook ( Hook_Time.dll ).

You can also apply this patch:

Code: Select all

; Disable FlushTextureCache inflight
At offset 499E0, replace E808D21400 with 9090909090.
This will prevents the game from reloading the textures inflight.

Re: 60FPS Inflight hook

Posted: Wed Dec 05, 2018 8:50 pm
by JeremyaFr
UPDATE
Hello,
I've included the patch in the time hook.
Here is a preview version:
EDIT: link removed
See viewtopic.php?f=10&t=11338

Re: 60FPS Inflight hook

Posted: Fri Dec 07, 2018 5:32 am
by Bman
THank you Jeremy. Downloaded it but will test it when I get some free time. I"m now a dad of a little girl born this past Sunday evening. Will be a little while before I can get back to all things XWA related. :-) Cheers!

Re: 60FPS Inflight hook

Posted: Fri Dec 07, 2018 6:19 am
by DTM
Congratulations Bman!!!!! Welcome in a new beautiful world!

Re: 60FPS Inflight hook

Posted: Fri Dec 07, 2018 9:27 pm
by JeremyaFr
Hello,
I've updated the above test hook.
It works better now.

Posted: Sat Dec 08, 2018 4:08 am
by Bman
Hi Jeremy, your newest 60FPS time hook works beautifully. Very smooth game play. :applaus:

Re: 60FPS Inflight hook

Posted: Fri Dec 14, 2018 5:15 pm
by JeremyaFr
UPDATE

Hello,
I've included the 60 fps patch to the time hook.

Please redownload xwa_hook_time.zip

Re: 60FPS Inflight hook

Posted: Fri Dec 14, 2018 6:40 pm
by Darksaber
Thank you :)

Re: 60FPS Inflight hook

Posted: Sat Dec 15, 2018 3:12 am
by Darth_Binks
This makes the game a joy to play! Nice work.

The only thing I've seen in my limited skirmish playing was that all the pilot and mission update voices have disappeared.

Re: 60FPS Inflight hook

Posted: Sat Dec 22, 2018 10:24 pm
by Bman
Hi Jeremy, does this latest version also include the 60FPS fix for all interior hangars (pre-fllight)? If not, I can manually add to my patcher.xml file. Thanks.

Re: 60FPS Inflight hook

Posted: Sun Dec 23, 2018 11:31 am
by JeremyaFr
Hello,
It is included.

Re: 60FPS Inflight hook

Posted: Mon Dec 24, 2018 10:34 pm
by Justagai
UPDATE

Early Christmas present!

Added compatibility with steam version as well as all games in the X-Wing series.

Also included readme and 60FPS in hangar.