60FPS Inflight hook

A Forum dedicated to the Suggestion, Creation and Editing of XWA Dynamic Link Library Files

Moderator: JeremyaFr

60FPS Inflight hook

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

Post by Justagai » Mon Dec 03, 2018 6:56 am

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
Last edited by Justagai on Sun Jun 23, 2019 12:45 am, edited 5 times in total.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » 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 :)
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
ual002
XWAU Member
Posts: 983
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Mon Dec 03, 2018 1:34 pm

Nice, I'll have to check this out. Get back into the groove and see what I missed.
Image Image Image Image Image

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

Post by JeremyaFr » 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.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Mon Dec 03, 2018 7:15 pm

Huh.. look at that I can just add it to Xwa Exe Patcher :)
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

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

Post by Justagai » Mon Dec 03, 2018 7:17 pm

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.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Mon Dec 03, 2018 7:27 pm

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?
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

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

Post by Justagai » Mon Dec 03, 2018 7:30 pm

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.

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

Post by JeremyaFr » Mon Dec 03, 2018 7:59 pm

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.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Mon Dec 03, 2018 9:04 pm

What do these offsets do Jeremy?
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

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

Post by JeremyaFr » 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.

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

Post by Justagai » Mon Dec 03, 2018 11:01 pm

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.

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Tue Dec 04, 2018 3:38 am

Awesome. I'll test it. I have some complex hangar layouts and this might definitely help. Thanks.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

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

Post by JeremyaFr » Tue Dec 04, 2018 5:00 pm

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.

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

Post by JeremyaFr » Wed Dec 05, 2018 8:50 pm

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
Last edited by JeremyaFr on Fri Dec 14, 2018 5:16 pm, edited 3 times in total.

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Fri Dec 07, 2018 5:32 am

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!
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
DTM
Fleet Admiral (Administrator)
Posts: 2119
Joined: Tue Apr 22, 2003 11:01 pm
Contact:

Post by DTM » Fri Dec 07, 2018 6:19 am

Congratulations Bman!!!!! Welcome in a new beautiful world!

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

Post by JeremyaFr » Fri Dec 07, 2018 9:27 pm

Hello,
I've updated the above test hook.
It works better now.

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Sat Dec 08, 2018 4:08 am

Hi Jeremy, your newest 60FPS time hook works beautifully. Very smooth game play. :applaus:
Last edited by Bman on Sat Dec 15, 2018 4:20 am, edited 2 times in total.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

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

Post by JeremyaFr » Fri Dec 14, 2018 5:15 pm

UPDATE

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

Please redownload xwa_hook_time.zip

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Fri Dec 14, 2018 6:40 pm

Thank you :)
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

Darth_Binks
Cadet 1st Class
Posts: 120
Joined: Wed Jul 14, 2004 11:01 pm

Post by Darth_Binks » Sat Dec 15, 2018 3:12 am

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.
Blue Zoidberg: As for me I design mansions and then live in them. I'm lying! I'm an apalling failure!<BR>Red Zoidberg: Me too! A big fat one.<BR>-The Farnsworth Parabox, Futurama

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Sat Dec 22, 2018 10:24 pm

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.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

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

Post by JeremyaFr » Sun Dec 23, 2018 11:31 am

Hello,
It is included.

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

Post by Justagai » Mon Dec 24, 2018 10:34 pm

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.

Post Reply