playMaker

Author Topic: Next Frame Event Advance (Updated) FixedUpdate / LateUpdate  (Read 563 times)

Digitom

  • Playmaker Newbie
  • *
  • Posts: 47
    • View Profile
Next Frame Event Advance (Updated) FixedUpdate / LateUpdate
« on: February 06, 2020, 11:11:39 AM »
Hello,

I updated the Next Frame Advance(d?) script so it has the option for fixed or late updates. Useful if you need these options for physics-based objects or fixed movement.




krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 1057
    • View Profile
    • Fat Pug Studio
Re: Next Frame Event Advance (Updated) FixedUpdate / LateUpdate
« Reply #1 on: February 25, 2020, 06:33:25 AM »
Awesome!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15330
  • Official Playmaker Support
    • View Profile
Re: Next Frame Event Advance (Updated) FixedUpdate / LateUpdate
« Reply #2 on: February 25, 2020, 09:43:42 AM »
Hi,

 I am not sure this is needed for LateUpdate which is in sync with the Update cycle.

what is your use case for the fixedUpdate? generally you want to use FixedUpdate to apply forces, torques and move, I am not sure why you need this, I am curious actually :)

Bye,


Digitom

  • Playmaker Newbie
  • *
  • Posts: 47
    • View Profile
Re: Next Frame Event Advance (Updated) FixedUpdate / LateUpdate
« Reply #3 on: February 25, 2020, 10:18:03 AM »
Hi Jean,

I was using this to do a very specific loop where I needed to predict velocity of a transform. When I used next frame the values would spaz out but were solid when I made this fixed next frame action.

I ended up just making that GetTransformVelocity action eventually though.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15330
  • Official Playmaker Support
    • View Profile
Re: Next Frame Event Advance (Updated) FixedUpdate / LateUpdate
« Reply #4 on: February 26, 2020, 05:46:01 AM »
Hi,

 ok, odd.

Bye,

 Jean

Broken Stylus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
Re: Next Frame Event Advance (Updated) FixedUpdate / LateUpdate
« Reply #5 on: March 08, 2020, 05:05:06 AM »
This action would be absolutely boss (wink wink) if it were a hybrid of the original Send Event action, all with its sending modes glory, and the frame type plus the frame based delay functions.

Digitom

  • Playmaker Newbie
  • *
  • Posts: 47
    • View Profile
Re: Next Frame Event Advance (Updated) FixedUpdate / LateUpdate
« Reply #6 on: March 09, 2020, 07:48:28 AM »
This action would be absolutely boss (wink wink) if it were a hybrid of the original Send Event action, all with its sending modes glory, and the frame type plus the frame based delay functions.

attached ;)

Broken Stylus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
Re: Next Frame Event Advance (Updated) FixedUpdate / LateUpdate
« Reply #7 on: March 10, 2020, 07:04:34 AM »
Fantastic! Thanks.

What I had in mind with this action is to preload some results, like some produce that a FSM is going to generate based on some numerous operations and calculations that can create spikes in CPU/GPU usage. Instead of eating up some 120 ms of calculations for example, it's possible to spread it over 4 frames that only eat 30 ms each.

So in CPU intensive loops that involve one or more FSMs that at some point validate phases with events, controlling the delay (by remote for example, notably through a Global int var) helps spread certain processes over several frames, this ahead of the moment the final "produce" (whatever the app does that's BIG).

If the device is weak (low entry smartphone) and/or if the FPS rate drops too much, the delay can be changed from 0 to 1 in certains FSMs so as to spread calculations over several frames, either exceptionally or continuously. This provides a dynamic way to manage the density of processes during x number of frames.
This special send event action needs to be placed at several key potential bottlenecks.

This is solely for optimization.

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 207
    • View Profile
    • Haven Made
Re: Next Frame Event Advance (Updated) FixedUpdate / LateUpdate
« Reply #8 on: April 21, 2020, 03:13:35 PM »
Thanks for sharing this Digitom, I've actually found myself needing something quite like this to match my physics interaction when having lots of stacked states instead of all on one 💪