Sign In Register

How can we help you today?

Start a new topic
Answered

Scheduler

Our game involve armies slowly moving from node to node on a map. I'm trying to use the scheduler to move an army from a node to another, look for enemy at destination, and if there isn't, move the army further to another node (if the player had order a longer travel). 


Is there something preventing a scheduled module from scheduling itself again? Apparently my module is not able to schedule itself more than once. 

Also, is there a way to debug line per line a module executed by the scheduler?


And the last question which may make the previous ones irrelevant: Is the scheduler the good tool for this?


Thanks for the feedback



Best Answer

Hi Gabriel


We don't allow scheduled items to create new scheduled items, this is a restriction we have in place to stop infinite loops.


We don't currently support inline debugging of modules (they run outside of request scope) It would be a nice feature though to allow you to do this, I'll get it added to our backlog. We may need to create a debug method on the SparkScheduler object, so it would require a code change on your side.


We do allow you to create a new scheduled item from the system scheduled scripts. The every minute script could be used to control this but you'll not get the same exact timings for your game (I don't know if this is important).



Gabriel


Answer

Hi Gabriel


We don't allow scheduled items to create new scheduled items, this is a restriction we have in place to stop infinite loops.


We don't currently support inline debugging of modules (they run outside of request scope) It would be a nice feature though to allow you to do this, I'll get it added to our backlog. We may need to create a debug method on the SparkScheduler object, so it would require a code change on your side.


We do allow you to create a new scheduled item from the system scheduled scripts. The every minute script could be used to control this but you'll not get the same exact timings for your game (I don't know if this is important).



Gabriel

Thanks Gabriel:)


I tought about doing all this from the every minute script, but that meant quite a lot of useless server execution time to check everything when nothing was in-fact happening. The hybrid solution (using the scheduler, but doing the recalling from "Every Minute") does feel a bit clunky but I'll think about it some more.


I completely understand the need to avoid infinite loop but could there be any way to make this a default setting while having a way to allow the scheduler some looping before shutting it off? Maybe by allowing us to set by a parameter in the Spark.getScheduler() function the maximum amount of time it is conceivable that our application make it loop.


I'm also looking forward to that debugging method on the Scheduler!

Has there been any change on this front? I'd love it if I could raise an event automatically every few seconds to monitor some state and take action. One minute delay is too long for my game.

Thanks!
Andrew

 

Is there any forecast to add the line debug feature in scheduler?

Login to post a comment