Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Fat Pug Studio on December 22, 2019, 05:40:27 AM

Title: Target Frame Rate (WaitForTarget FPS) causing significant CPU overhead
Post by: Fat Pug Studio on December 22, 2019, 05:40:27 AM
Hi guys,

i'm using target frame rate action to clamp the frame rate, but there seems to be a lot of overhead every frame. Now i'm not sure how it actually works, does it use the calculated amount of cpu time to actually keep the frame rate in the defined upper limit, or something's just plain wrong. I'm not using Vsync btw, i'm not sure if it's really neccessary, but the action works without it and doesn't push frame rave over defined threshold.

With Target Frame Rate

(https://i.postimg.cc/j2gckjf0/screenshot-485.png)

Without Target Frame Rate

(https://i.postimg.cc/2yKd7KpC/screenshot-486.png)
Title: Re: Target Frame Rate (WaitForTarget FPS) causing significant CPU overhead
Post by: jeanfabre on December 23, 2019, 08:02:14 AM
Hi,

 I think it's the internal mechanism of capping the fps that you see here.

 I would ask on Unity Forum or UA for this.

why do you want to restrict fps? I hope you are not making frame dependant animations :)

Bye,

 Jean
Title: Re: Target Frame Rate (WaitForTarget FPS) causing significant CPU overhead
Post by: Fat Pug Studio on December 23, 2019, 08:14:34 AM
I'm having issues with some timers that use wait and countdown timer, when FPS is not capped they seem to finish a lot earlier.

But yeah, i believe that it's unity capping the cpu to keep the framerate in check, but the thing is, when used via script with vsync disabled it does not create overhead. When used via action with vsync disabled then it does.
Title: Re: Target Frame Rate (WaitForTarget FPS) causing significant CPU overhead
Post by: jeanfabre on December 23, 2019, 12:26:01 PM
Hi,

 timer should use for example, floatAdd and check per seconds, it will then be completly fps independent.

I would say that for the sake of learning and accuracy, you should try to find out why  your timers are not behaving and get to the bottom of it, then you can take a decision.

Bye,

 Jean