Reduce CPU usage and increase FPS

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

Moderator: JeremyaFr

Re: Reduce CPU usage and increase FPS

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

Post by JeremyaFr » Wed Aug 03, 2022 9:32 am

WIP

Hello,
Here is a new WIP of the time hook.

Press Ctrl+Q to speed up the time.
Press Ctrl+A to slow down the time.

Download:
xwa_hook_time_WIP_2208031130.zip
You do not have the required permissions to view the files attached to this post.

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7829
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Wed Aug 03, 2022 10:18 pm

JeremyaFr wrote:
Wed Aug 03, 2022 9:32 am
WIP

Hello,
Here is a new WIP of the time hook.

Press Ctrl+Q to speed up the time.
Press Ctrl+A to slow down the time.

Download:
xwa_hook_time_WIP_2208031130.zip
The hook itself works fine @JeremyaFr.
I think the amount it's speeded up though is too fast.
It means you have little control and can overshoot things very quickly.
If the speed up time was reduced somewhat then it would be easier to know when to stop.

Would there be anyway of seeing a visual indicator of when the effect is active?

The slow down time works. I can't really tell if it's the right speed but it's ok.

Obviously this does have knock on effects as sounds play out of time or backlogged messages etc.
But it's handy for the times in the missions you are waiting for docking to finish etc.
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
AngeI
Lieutenant JG
Posts: 524
Joined: Sun Jan 24, 2016 5:27 pm

Post by AngeI » Thu Aug 04, 2022 2:49 pm

JeremyaFr wrote:
Wed Aug 03, 2022 9:32 am
WIP

Hello,
Here is a new WIP of the time hook.

Press Ctrl+Q to speed up the time.
Press Ctrl+A to slow down the time.

Download:
xwa_hook_time_WIP_2208031130.zip
@JeremyaFr I just tested, CTRL+Q speeds up and slows down. CTRL+A doesn't do anything.

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

Post by JeremyaFr » Thu Aug 04, 2022 5:22 pm

WIP

Hello,
Here is a new WIP.

I've reduced the speed up time multiplicator from 10 to 4. The slow down time divisor is 8.
I've added an indicator next to the "Time" HUD string. There is a "+" when the multiplicator is enabled and a "-" when the divisor is enabled.

Download:
xwa_hook_time_WIP_2208041917.zip
You do not have the required permissions to view the files attached to this post.

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7829
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Thu Aug 04, 2022 5:54 pm

AngeI wrote:
Thu Aug 04, 2022 2:49 pm
JeremyaFr wrote:
Wed Aug 03, 2022 9:32 am
WIP

Hello,
Here is a new WIP of the time hook.

Press Ctrl+Q to speed up the time.
Press Ctrl+A to slow down the time.

Download:
xwa_hook_time_WIP_2208031130.zip
@JeremyaFr I just tested, CTRL+Q speeds up and slows down. CTRL+A doesn't do anything.
It did for me. I had wondered if any window modes cause issues.

Ctrl + A is select all I think in Windows.
So maybe it needs a different key?

Thank you @JeremyaFr those changes sound good. Not sure how soon I can test
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7829
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Fri Aug 05, 2022 1:46 am

JeremyaFr wrote:
Thu Aug 04, 2022 5:22 pm
WIP

Hello,
Here is a new WIP.

I've reduced the speed up time multiplicator from 10 to 4. The slow down time divisor is 8.
I've added an indicator next to the "Time" HUD string. There is a "+" when the multiplicator is enabled and a "-" when the divisor is enabled.

Download:
xwa_hook_time_WIP_2208041917.zip
It seems to work fine :)
Yes it's going to affect missions if used in the wrong places, but as a "cheat" option in right spot it's nice.
Well done Jeremy
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

Roshengar
Recruit
Posts: 7
Joined: Thu Jul 28, 2022 11:37 pm

Post by Roshengar » Sat Aug 06, 2022 2:24 am

Works great, thanks!

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

Post by JeremyaFr » Sat Aug 06, 2022 12:02 pm

UPDATE

Hello,
I've merged the WIP version of the time hook into the stable version.

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

Post by JeremyaFr » Fri Sep 16, 2022 3:38 pm

UPDATE

Hello,
I've updated the time hook.

I've disabled the time speed in hangar.

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

Post by JeremyaFr » Fri Nov 11, 2022 8:41 pm

UPDATE

Hello,
I've updated the time hook.

I've fixed a bug with the timeGetTime function.

The timeGetTime function returns the number of milliseconds since the system startup.
This function returns an integer. So the max value is 0x7fffffff.
It overlaps every 24 days. (2147483647 / 1000 / 3600 / 24).
There can be unpredictable things when this happens.

I've fixed this bug by replacing the time since the system startup with the time since the game startup.

User avatar
AngeI
Lieutenant JG
Posts: 524
Joined: Sun Jan 24, 2016 5:27 pm

Post by AngeI » Thu Nov 17, 2022 7:06 pm

JeremyaFr wrote:
Fri Nov 11, 2022 8:41 pm
UPDATE

Hello,
I've updated the time hook.

I've fixed a bug with the timeGetTime function.

The timeGetTime function returns the number of milliseconds since the system startup.
This function returns an integer. So the max value is 0x7fffffff.
It overlaps every 24 days. (2147483647 / 1000 / 3600 / 24).
There can be unpredictable things when this happens.

I've fixed this bug by replacing the time since the system startup with the time since the game startup.
Does this explain why one time I went from fast time to very slow bullet time? I couldn't fix it without restarting.

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

Post by JeremyaFr » Fri Nov 18, 2022 8:37 pm

Perhaps.

One thing I noticed was keyboard input being broken.

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

Post by JeremyaFr » Mon Jan 09, 2023 7:01 pm

UPDATE

Hello,
I've updated the time hook.

I've fixed overlap time.

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

Post by JeremyaFr » Fri May 19, 2023 4:28 pm

UPDATE

Hello,
I've updated the time hook.

The time multiplicator/divisor is written to *(float*)0x0781E60.

Post Reply