I would like some advices on tick-based execution.
I'm working on a multiplayer game, but not a classic architecture. The client side is view only, the server is the onnly one to get the state of the game. Scripts can be run on client side to allow the player to predefined some actions.
The big tasks, that can be executed in parallel, are as follow on the client side (where i got the problem):
INPUT: input acquisition and processing -> generate Actions (some of them are sent to the server instead of processed by the client) SCRIPTS: (local) scripts execution -> generate Actions VIEW_UPDATE: view update (including GUI) -> process a list of Actions and update the graphic and audio state accordingly GRAPHIC_RENDERING: rendering graphics
Now, the graph as I want it to be: Every t_i seconds,INPUT acquire raw input, process them and generate a list of Actions that are feed into a buffer for VIEW_UPDATE. Every t_s seconds, SCRIPT execute a bunch of scripts that may generate a list of Actions, that are feed into the VIEW_UPDATE buffer. Every t_u seconds, VIEW_UPDATE lock it's buffer of Actions and process them all, updating first the graphic state (locking it the necessary time) then the audio state (the same way) . Every t_g seconds, GRAPHIC_RENDERING locks the graphic state and do a rendering, then release it. (the VIEW_UPDATE actions buffer can also be fed by sever messages processed, but say we simplify this)
This doesn't include resource loading and other stuffs that will happen occasionally that I'm voluntarly ignoring here for the example. The important thing is that t_i, t_s, t_u and t_g are different values. So the question is: how do I express timed-tick based execution in Flow Graph? From the interface, I see nothing related to time. I tried a prototype to do this, it works nice with sleeping the thread but then I'm killing potential work-power. Is there a way to say "call this node only if last call was more than T time ago"? If there is no way, I'd better go with class Task management instead of using the Flow Graph, I suppose.