Tasks versus Interval for Character Control?

Hello All,

I 'm wondering what is the best for character control (like walk , turn etc ) controlled by the player input .( warning only the move forward, orientation change, not the walk animation that is played by the actor).

I’ve seen two kind of implementation

Way 1: spawn a task that updates directly the character position and orientation with calculation of right pos and Hpr based on dt (time elapsed from last frame) and player input (like a polling)

Way 2: player input (ie press arrow ) start an interval (ie move_forward) that does the update of pos and hpr.

Way 2 seems easier to handle pause /resume of game. Also it allows for interpolation accross network more easily.

But what is the best performance wise for Panda?

I have pondered over this myself, although not just for character movement.

The conclusion I came to is this…

Python is slower than c/c++, and thus anything controlled on the python side is going to be slower than if it is handled directly by the panda core. However, for certain objects it would be more beneficial to control them on the Python side due to the way in which they are dealt with.

Ideally, everything should be controlled by the panda core and you should only deal with pure game logic driven by events.

But thats only my viewpoint on this :slight_smile: