Page MenuHomeFeedback Tracker

New SQF command to change sheduler execution time per frame
New, NormalPublic



As we know, scheduler gives 3 ms time to spawned scripts per each frame. This is not enough for some cases.

I suggest to add an SQF command which changes this time frame, for instance:
setSchedulerTimeFrame 6; - sets time frame for 6 ms
Or maybe one more command:
runScheduledScripts 6; - Runs scheduled scripts in this frame for 6 milliseconds, available only in unscheduled env.


Operating System
Windows 10 x64
Additional Information

More on my motivation:
I'm running lots of processing for high level AI in a few spawned scripts organized as event queues. This enhancement would be very helpful for me as I would be able to perform more frequent updates of my scripted AIs. Probably there are more use cases for advanced users. Right now the the need to push everything into the fixed 3 ms execution window is a huge limiting factor against using scheduled scripts.

Event Timeline

Sparker created this task.Nov 5 2019, 5:01 PM
Sparker updated the task description. (Show Details)
dedmen added a subscriber: dedmen.Nov 5 2019, 5:15 PM

startLoadingScreen does that.
Cannot really do this. We can't just have a script command that lower fps for everyone.

Sparker added a comment.EditedNov 5 2019, 5:19 PM

startLoadingScreen does that.

Yes except that we can't tell it how much time the scheduler now has for each frame, it's fixed at 50ms which is too much. Also it's not a valid solution for clients with interface.

We can't just have a script command that lower fps for everyone.

Currently nothing stops me from executing something heavy onEachFrame as well, I don't think that this security argument is valid. I assume that such SQF command would have local effect anyway.

billw added a subscriber: billw.Apr 19 2020, 12:48 AM

Hi, a year later I have another idea. What if the game could read specific config entries, upon which it could decide scheduler's time frame? It solves the problem of exposing this functionality to SQF and cheaters.

It could be as simple as:

class CfgScheduler
   schedulerTimePerFrame = 5.0; // Time per each frame, in milliseconds

Or more complex:

class CfgScheduler
   Mod1 = 5.0;
   Mod2 = 2.0;
// Game reads all values within CfgScheduler and takes max value, 5.0 in this case.
// Or something similar, I'm not an expert in arma's config files.
dedmen added a comment.Nov 4 2020, 3:48 PM

Don't want to do this. Serverside only could be a thing I guess. But no clientside