Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Rabagast on November 06, 2015, 11:19:42 AM

Title: Wait Action (Faster than 0.01)
Post by: Rabagast on November 06, 2015, 11:19:42 AM
Hi!

I have a bonus timer which will countdown to zero at the end of the level, but Wait 0.01 is to slow. It takes to long time to countdown. Is it a way to make it faster than 0.01?
Title: Re: Wait Action (Faster than 0.01)
Post by: KellyRay on November 06, 2015, 11:36:48 AM
Have you tried .001?
Title: Re: Wait Action (Faster than 0.01)
Post by: rik on November 06, 2015, 11:44:53 AM
use 0.001
Title: Re: Wait Action (Faster than 0.01)
Post by: Rabagast on November 06, 2015, 11:56:06 AM
I have tried that, but the limit is 0.01 sec. 0.001 doesn't make it faster.
Title: Re: Wait Action (Faster than 0.01)
Post by: dudebxl on November 06, 2015, 12:33:26 PM
have you tried 'Next Frame Event' or 'Wait late Update' actions ??
Title: Re: Wait Action (Faster than 0.01)
Post by: Rabagast on November 06, 2015, 12:42:32 PM
I have tried Next Frame Event, but it's as fast as Wait 0.01. Where can I find Wait Late Update? I don't have that
Title: Re: Wait Action (Faster than 0.01)
Post by: dudebxl on November 06, 2015, 01:14:04 PM
on the ecosystem.. but i don't think it will help you. Maybe you should use the countdown action. It is somewhere in this forum then format the string. Anyway, maybe you could explain more..
Title: Re: Wait Action (Faster than 0.01)
Post by: djaydino on November 06, 2015, 03:28:26 PM
Hi,
Countdown Timer is also on the EcoSystem (https://hutonggames.fogbugz.com/default.asp?W1181)
Title: Re: Wait Action (Faster than 0.01)
Post by: Rabagast on November 06, 2015, 07:20:47 PM
It didn't help with Countdown Action. Too slow, but I got it to work anyway, with a little bit help from 600 from JabbR. I can use Float Interpolate or Ease Float. Only tried with the first one, but it works very well. Of course I got some problems, since I need to add the bonus to the score in one state. I had to find a way to update the score.

If you want, I can show how I did it. :)
Title: Re: Wait Action (Faster than 0.01)
Post by: djaydino on November 07, 2015, 02:11:16 AM
Hi,
yes indeed that will work and yes you can show how you did it.
there will always be someone happy with it :)
Title: Re: Wait Action (Faster than 0.01)
Post by: Rabagast on November 07, 2015, 10:19:10 PM
Instead of give an explanation which I am not good to do, I upload the file so people who want can take a look. It's no explanation, but it's only two states with Actions, so it should not be that difficulty to understand. It's better to ask me if you need help! :)

I created another FSM also which accelerate the timer, so it starts slowly and increase the speed over time.

Hope it can be useful for someone! :)
Title: Re: Wait Action (Faster than 0.01)
Post by: Rabagast on November 07, 2015, 10:21:31 PM
Just one thing:
You need the uGUI Package from the Ecosystem.
Title: Re: Wait Action (Faster than 0.01)
Post by: phannDOTde on November 14, 2015, 08:13:20 PM
There is also an Int interpolate in the ecosystem that I found really helpful to do this. The upside with interpolate versus a "wait" solution is that you can exactly define how long it takes for the "Bonus Score" to show up no matter how many points the Player archived.
Title: Re: Wait Action (Faster than 0.01)
Post by: ManicMinerUK on November 15, 2015, 11:11:33 PM
its probably worth bearing in mind that by default, 0.02 seconds is the duration of a frame in Unity, so if you want delays shorter than that, you will need to go to the project settings/Time and shorten the default timestep.

This might be why you are having problems with your waits as well?
Title: Re: Wait Action (Faster than 0.01)
Post by: Lane on November 16, 2015, 12:00:31 AM
Basically, you cannot Wait for a period of time shorter than the time it takes for the hardware to process the frame.

The timer will be analyzed on the next tick (as soon as possible) and decide at that point but it always takes a minimum of one frame so at that (rather instantaneous) speed, you are constrained by the framerate.

 It can be perceived as slowness if you are relying on it to do many tasks in rapid succession because they will always take one frame to do each one. If that's the case you have to manually throttle how many tasks are done per frame (more than one), based on current framerate or some arbitrary number that seems good.
Title: Re: Wait Action (Faster than 0.01)
Post by: Rabagast on November 16, 2015, 10:46:49 AM
Ok!

But I got it to work anyway with Float Interpolate! :)