Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Hugo111 on July 25, 2017, 10:19:30 AM

Title: Fixed time step
Post by: Hugo111 on July 25, 2017, 10:19:30 AM
Hi all, is there a  FSM to change a fixed timestep  at the load of a level, as I have particular heavy physics needs in one level only, which I don't want to effect the rest of my game! Any ideas would be useful, thanks .
Title: Re: Fixed time step
Post by: djaydino on July 25, 2017, 11:52:20 AM
Hi,
I think you mean a Action instead of FSM :)

I made a 'Set Fixed Time Step' Action for you. (in the attachment below)

I tested it a bit and it seems to work.
Can you let me know if it works so i can add this to the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181) :)

Title: Re: Fixed time step
Post by: Hugo111 on July 29, 2017, 09:16:29 AM
Thank you soooo much that works brilliantly !!! Problem solved !!
Title: Re: Fixed time step
Post by: djaydino on July 29, 2017, 03:58:56 PM
Ok! Thats 10 dollar!!

Joke!! i am happy to help  8) 8) 8)
Title: Re: Fixed time step
Post by: jeanfabre on July 31, 2017, 02:58:07 AM
Hi

 Kurt, can you put this on the Ecosystem? thanks :)

 Bye,

 Jean
Title: Re: Fixed time step
Post by: djaydino on July 31, 2017, 03:21:54 AM
Hi jean.

Done! :)
Title: Re: Fixed time step
Post by: Ofonna on July 31, 2017, 03:29:49 PM
hi hugo please what's the purpose of this fixed time step, i'd like to know how it can also help me,

thanks
Title: Re: Fixed time step
Post by: Hugo111 on August 11, 2017, 06:28:42 AM
The purpose of the time step is to speed up in my case is  the number of time the physics engine sees collisions, so better for very fast collisions . But you pay a price on cpu performance !!   
Title: Re: Fixed time step
Post by: Kubold on September 05, 2020, 05:12:37 AM
Hey, this action still works good, BUT.

Can anyone make "Set Maximum Allowed Timestep" Action? Or modify the Set Fixed Timestep Action to also set the Maximum Allowed Timestep.

The Action "Scale Time" resets the Maximum Allowed Timestep to value: 0,2. This makes my game jitter after I turn on slomo. I need a Set Maximum Allowed Timestep Action to set it back to my preferred value.
Title: Re: Fixed time step
Post by: djaydino on September 05, 2020, 09:54:25 AM
Hi.
I tried to google for some code sample to change this in code, but could not find anything.

if you can find a sample script i can make an action for it.
Title: Re: Fixed time step
Post by: Kubold on September 07, 2020, 07:54:50 AM
Hi, I found this:

Time.fixedDeltaTime = 1.0f/(float)PhysicsFrameRate;
Time.maximumDeltaTime = Time.fixedDeltaTime * 2.0f;
Application.targetFrameRate = TargetFrameRate;

from this forum post: https://forum.unity.com/threads/cannot-seem-to-set-maximum-allowed-timestep-from-script.432147/

Is this helpful in any way? I don't know much about coding but maybe it's the "Time.maximumDeltaTime" that refers to Maximum Allowed Timestep.
Title: Re: Fixed time step
Post by: Kubold on September 07, 2020, 08:45:46 AM
Nevermind! I managed to "hack" the original Action and it works :)
I attach the "Set Maximum Allowed Time Step" Action.