Frame independent Movement

Greetings!

My teammates and I work on a music-game since Oct. 07 and there is still a long way until we finish our project, but our major problem is the timing.
There are a lot of dance parts in the game, where the player must hit the right button, at the right time. Problem -> You can’t time the game-mechanics with a songs rythm on diffrent machines, because of the increasing and decreasing frameRate.

My question now( we couldn’t find anything in the documentation or by searching the forums) : Are there any mechanics/functionalities included in the panda-engine for frame independent movement and how do I activate it?
Else, we must create this kind of game-functionality by our self.

I hope someone can help us.

With best regards from austria,

Nordri. :slight_smile:

panda provides some basic timing class -> https://www.panda3d.org/manual/index.php/The_Global_Clock
you could also use python’s build-in timing. there are also task you can fire up with an delay.
hope this helps a little

you can multiply movements by task.dt in your tasks, which makes your movements framerate independent. You can take a look how Roaming Ralph does it, using task.time.

Thx pro-rsoft. We did it with task.dt and it works greatly!