<p dir="ltr">The easier method would be to have a multiplier for the current timestep. A greater than one multiplier would cause an acceleration, and less than one would slow things down. Suspending would have to be handled separately.</p>
<p dir="ltr">--Mitchell Stokes</p>
<div class="gmail_quote">On Nov 22, 2013 12:46 AM, "Arnaud Degroote" <<a href="mailto:arnaud.degroote@laas.fr">arnaud.degroote@laas.fr</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi, I want to propose some mechanisms to allow better clock management<br>
at the Game Engine Level.<br>
<br>
At the moment, there is globally two tick models, one 'real-time' with<br>
possibly frame drop, and another one which basically 'render all frame'.<br>
<br>
What I would like to do is to be able to 'accelerate' game engine, (i.e.<br>
make the world move faster than 'real-time'), or 'slow-down' the world<br>
(bullet effect-like) or even 'pause' the world.<br>
<br>
To 'pause' the world, I can just use suspend(). For 'slow-down', you can<br>
do it in some complex method, using suspend() at different intervals for<br>
different scenes to get more or less the desired behaviour, but it seems<br>
quite complex and costly. To accelerate the world, as far as I know,<br>
there is no easy way to do it.<br>
<br>
What I propose in these patches is to allow a 'user-settable' clock,<br>
i.e. the possibility for the developer to finely control how the time<br>
elapse in its game.<br>
<br>
The next issue is how to call it. Calling it from a 'normal' logic block<br>
is a bit dangerous as, if for any reason, you don't make the time<br>
progress enough, there is good change that your logic brick won't be<br>
called anymore.<br>
<br>
So, one safer possibility is to use the 'main python controller' (see<br>
KX_GetPythonMain) but it may a bit overkill in lot of situation. Maybe<br>
we can add another special property (such as __main__) (I think at a<br>
__clock__ property), and call it automatically, if it exists in<br>
BL_KetsjiNextFrame.<br>
<br>
I would like to have your opinions on my goal (maybe I miss some easier<br>
way to achieve it), current attached patches, and proposal to continue.<br>
<br>
Thanks in advance. Best regards,<br>
<br>
--<br>
Arnaud Degroote<br>
Postdoc<br>
RIA LAAS - CNRS<br>
<br>_______________________________________________<br>
Bf-gamedev mailing list<br>
<a href="mailto:Bf-gamedev@blender.org">Bf-gamedev@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-gamedev" target="_blank">http://lists.blender.org/mailman/listinfo/bf-gamedev</a><br>
<br></blockquote></div>