Problem with timer replacement (after/for).
Hi, i have read the article "Timers are for chumps - GS optimization tips". And now i am going to replace all the timer by this method to enhance the overall performance.
When i was working on the for/after timer replacement. I found some problem.
Firstly, i have no idea abt this part in the article:
"The only thing we need to ensure now is that the rule is not fired a second after initialization when startTime is 0. Do this by adding if startTime>0 to the previous rule, giving it two conditions. Every time we update startTime, this rule will effectively be fired one second later and all the actions within will be run."
Could anyone explain me more abt it? Any example? Fired? Does that mean it is working like "run to completion"?.
Secondly, further question. How to achieve "run to completion" by this method? Since most of my timer have this function activated.
Thank you very much!
Best Answer
-
Conifer_Apps Posts: 100
There is a reason timers are there. Only replace them with complicated rules if your game is too slow or lags a lot. Otherwise, there is absolutely no need to replace a perfectly good timer . What you're talking about sounds complicated (I did read that article though) so like I said, only replace them if you need to.
Answers
Thanks man! Really helpful!