60FPS Inflight hook

Need help editing the game? Check for help here!

Moderators: Darksaber, General_Trageton, Forceflow

Post Reply

60FPS Inflight hook

Justagai
Cadet 2nd Class
Posts: 73
Joined: Mon Dec 08, 2014 10:59 pm

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

Hello folks,

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


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

Warning: There may be an issue with large ships not moving at all if their mission throttle is set really low. Just a heads up.

Note: I did not change the frame limit in the hangar, another heads up.

EDIT: If there is demand, I can make 60FPS hooks for the other games in the series.

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 9526
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 :)
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
ual002
Cadet 1st Class
Galactic Empire
Posts: 159
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.

JeremyaFr
Lieutenant
XWAU Member
Posts: 914
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

Fleet Admiral (Administrator)
Posts: 9526
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 :)
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

Justagai
Cadet 2nd Class
Posts: 73
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

Fleet Admiral (Administrator)
Posts: 9526
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?
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

Justagai
Cadet 2nd Class
Posts: 73
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.

JeremyaFr
Lieutenant
XWAU Member
Posts: 914
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

Fleet Admiral (Administrator)
Posts: 9526
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?
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

JeremyaFr
Lieutenant
XWAU Member
Posts: 914
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 2nd Class
Posts: 73
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 JG
Posts: 524
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: ISD-II, XQ-1 Platform1, (Imp) Escort Carrier, Misc, & TFTC.

JeremyaFr
Lieutenant
XWAU Member
Posts: 914
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.

JeremyaFr
Lieutenant
XWAU Member
Posts: 914
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 JG
Posts: 524
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: ISD-II, XQ-1 Platform1, (Imp) Escort Carrier, Misc, & TFTC.

User avatar
DTM
Lieutenant Commander
XWAU Member
Posts: 1097
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!

MTD industries
WIPs: Fixing missions and new editing for the REBCP, Resistance Mon Calamari Cruiser, New advanced base OPT files for all playable XWAUP crafts.

JeremyaFr
Lieutenant
XWAU Member
Posts: 914
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 JG
Posts: 524
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: ISD-II, XQ-1 Platform1, (Imp) Escort Carrier, Misc, & TFTC.

JeremyaFr
Lieutenant
XWAU Member
Posts: 914
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

Fleet Admiral (Administrator)
Posts: 9526
Joined: Mon Jan 10, 2000 12:01 am
Contact:

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

Thank you :)
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

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

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

Post Reply