multi_core gain or pain ?

I have to admit that I never have done some serious (big) in Panda3d, since I am lacking spare time for this hobby, but this could be an way to utilize IPC (assuming a traditional RPG or FPS game):

Process 1: 3d rendering, GUI and accepting user input. Panda3D obviously.
Process 2: collision detection, physics and kinematics (movement controlled by direct input, which can be either user input or AI input). Could be Python and ODE or PhysX, and no Panda3D.
Process 3: AI and game logic (maybe more than one process for this). No Panda3D needed for this Process. Also a highly parallel process.

What has to be exchanged between the processes each frame:

  • P3 (AI) give a desired velocity for each active NPC to P2.
  • P1 (user input) gives one desired velocity to P2, for the player character.
  • P2 gives actual position & orientation to P1 for each object that has moved.
    This listing is not complete of course, but the amount of information passed is not very much (a few bytes per game “object”), and it can be reduced by clever filtering (“active” objects). I even think that P2 and P3 can run at other “frame rates” than P1.

Stackless: As far as I understand Stackless Python it is not bound to one core, since it has no GIL. Could be interesting.

Hmm… finally it could be interesting to set the Panda3D config variable “lock-to-one-cpu” to false. I think Panda3D (the C++ core, not the Python layer) can create threads which can be move to other cores by the OS. But I am just guessing here. Someone who test it or reads through the code is required.

enn0x