Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Framecallback runs while paused. Feature ? cosmetic bug ?

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Framecallback runs while paused. Feature ? cosmetic bug ?

Post by Frame »

Testing Framecallbacks for the polaris animated Turrets, and i noticed that the the framecallback ofcourse runs while the game is paused, however that means anything i put into a call back funtion would run while the game is paused, even
turret rotating and/or tracking, even the spawning of turrets projectiles/plasma bolts...

cosmetic bug or feature ?...

Cheers Frame...
Bounty Scanner
Number 935
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: Framecallback runs while paused. Feature ? cosmetic bug

Post by Thargoid »

It's a feature. You can check for the delay between the callbacks though, and if it's zero then the game is paused. You can use that to disable script operation if the game is paused.

If I remember correctly both points were included in the release documentation when the feature was introduced.
User avatar
CommonSenseOTB
---- E L I T E ----
---- E L I T E ----
Posts: 1397
Joined: Wed May 04, 2011 10:42 am
Location: Saskatchewan, Canada

Re: Framecallback runs while paused. Feature ? cosmetic bug

Post by CommonSenseOTB »

Are you serious? Nothing should run while the game is paused. Do timers run as well? Whatever the case timers and framecallbacks should be similar in this and if allowed to run while the game is paused there should be some way to shut them down if the game is paused and restart them again if not paused. This could have applications for animations and intermission screens while paused so I would rather see both run while paused but have control over it. Let us know what you find/decide about this please.

Not to derail this thread but I have not heard from you on the Save Anywhere PMs I sent you. If it pleases you to do so may I please have a decision on this. Thanx.
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.


CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
User avatar
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Re: Framecallback runs while paused. Feature ? cosmetic bug

Post by Frame »

Thanks Thargoid, i cannot however find any documentation on the wiki, nor on BB, I have slight memory of it being announced..

CommenSenseOTB: i'm still thinking, i mean, i know I have been gone for a while, but that was due to double crashing HDDs..

I mean I already gave control away for the Rock Hermit Locator & the Fuel Collector, but that was to two very well known residents of these boards :), while I have been looking at your numeric HUD and found it very impressing.. So i'm still thinking about it...

In regard to nothing should run, I was unaware of the delay measure, & that was what i needed... a FrameCallBack should IMO allways run, since frames are drawn, even when paused. I need to bind the movements of the turrets to time then though, while i like the idea of doing things in between frames...

Cheers Frame...
Bounty Scanner
Number 935
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: Framecallback runs while paused. Feature ? cosmetic bug

Post by Thargoid »

It's mentioned here in the RFC thread for the topic, linked from the release announcement of 1.75.0 when the feature was introduced.

The delta parameter (which you can access as a parameter of the function) is the one to check to see if the game is paused.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Framecallback runs while paused. Feature ? cosmetic bug

Post by JensAyton »

CommonSenseOTB wrote:
Are you serious? Nothing should run while the game is paused. Do timers run as well?
Well, yes; technically timers run when paused, but they can’t fire while pause because they run in game real time, and game real time does not advance while paused.

Frame callbacks are invoked every frame, no exceptions. Exceptions make life complicated, and reduce flexibility.
CommonSenseOTB wrote:
Whatever the case timers and framecallbacks should be similar in this
Why? Frame callbacks are designed to look entirely different from timers, as they fill different functions.
CommonSenseOTB wrote:
and if allowed to run while the game is paused there should be some way to shut them down
By whom, and why? Most meaningful frame callbacks will either be tracking objects that aren’t moving, scaling their actions by the time delta parameter, or both, so they’ll automatically pause anyway. Any other frame callbacks can check for a zero delta.
Post Reply