Is Panda3D a good choice for my artificial life project?

Hello everyone,

I’m starting a new project in the field of artificial life, and I’m considering using Panda3D as my game engine. The simulation will involve thousands of individuals interacting with one another, each with its own neural network using Neuroevolution of Augmented Topologies (NEAT). I am working with a team, and the only language everyone knows is Python, so we would like to use this language for the project.

I’d like to know if Panda3D is a good choice for this type of project, and if anyone has any suggestions for the best libraries to include the NEAT neural networks in the agents. Additionally, what are some good practices for optimizing performance, and is it possible to implement a data-oriented architecture (Entity Component System) instead of traditional Object Oriented Programming?

Any advice or insights would be greatly appreciated.

Thank you!

1 Like

Welcome to the Panda3D community!

If your whole team knows Python and you are looking for a 3D engine to use for visualization/as a UI for your game Panda3D will fit your needs very well.

I don’t know the best library for NEAT neural networks specifically would be but looking at libraries like PyTorch or TensorFlow would be a good place to start.

Panda3D has a part of its docs dedicated to performance/optimization and you can find some good practices in their. For your use case though it will most likely have to be trial and error on your end. As running the NEAT algorithm for 1000s of individuals (not rendering) will likely be the heaviest part of the program.

As for ECS it is very possible but you’ll have to work somewhat around Panda3D’s scene graph which by its very nature is object oriented. Besides that part though Panda3D is very unopinionated about how you design your projects.

Hopefully that answers some of your questions! If you have anymore questions feel free to ask either here or on the discord server.

I hope that you and your team enjoy working with Panda3D!

1 Like

Thank you very much for your aid! I did know Panda3D was object oriented by nature, so yeah it might be hard to work around that… Do you know of any Panda3D projects that have used ECS?
Another question I have is regarding the language. In my understanding, Panda3D is written in C++, right? Does that mean that, even if I code my game in Python, the performance will be that of C++? Because Python is not very performative in with the low level, so that concerns me a bit.

Looking around the forum (prompted by vague memories of seeing such things), it does look like there have been a few such projects.

Here for example is one:

I haven’t used it myself, nor heard much, so I can’t recommend for or against it, but it does appear to be one such project!

There’s also this thread regarding the use of a third-party ECS system:

I believe that this is pretty much accurate, yes.

In short, the parts that use Python (in particular your own Python code, but also a few other components) will (naturally) run as Python runs. But with most of the engine written in C++, most of the engine should indeed run as C++ runs.

(Indeed, I’ve seen it recommended that, if one finds particular parts of one’s Python code running over-slowly, one can re-write the same in C++, incorporate it, and potentially get a performance boost for those parts.)

1 Like

That’s awesome!! You’re truly helping me kickstart this project, can’t thank you enough! I’ll be reading the discussions you linked here for those seem very aligned with what I have in mind, and any other problems/questions I have I’ll come back to this forum to seek further aid! :slight_smile:

1 Like