Hi there. I
m tottaly new to this engine and I really like the features it offers. Yet Im still thinking about what should I use to start developing: Python or good old C++. I have some skills of C++ (although I`m mostly familiarized with and worked in Java) and no skills in Python. From what I read this engine is mostly written for Python (correct me if wrong).
The question is… is it better to use Python or C++ with this? (Actually “the questions”) If I use Python, will my application be stand-alone like a normal .exe or I need a VM (like Java) to run it? (And maybe others but later)
PS: Oh, and one last question. For C++ can I use other IDE other than MSVS?
You’re correct that Panda has been designed for Python. That doesn’t preclude you from developing in C++ if that’s what you want to do, but the documentation and support for Python is just generally better.
In terms of performance from Panda, you won’t notice a difference between C++ and Python as they’re both using the same libraries. If you’re doing something computationally intensive however Python won’t keep up with C++, but in that case you can write modules in C++ to handle the intensive parts of your code and call them from Python.
So to answer your question: unless you need some specific capability that C++ provides, I’d recommend giving Python a shot. It’ll be very different from what you’re used to, but it’s a wonderful language to work with, and it’s not terribly difficult to learn. And once you have an understanding of Python you’ll probably find that it’s much quicker to develop in.
As for distribution, there are a number of options available, including distributing a standalone executable. For editors you’re free to use whatever you want. For C++ though I think you’d be hard pressed to find something better than Visual Studio.
Thanks for your response wraithix. I think I
ll start looking into Python for now and maybe later if Ill need C++ I`ll create my modules. The explanation you gave me is very clear and valuable. Thank you very much!
Wraithix, can you give me some examples of what you would consider “computationally intensive?”
Python is slow when working with complex mathematical equations. It’s also slow when working with large datasets; if you need to iterate over a list of objects every frame and perform some action on them, Python isn’t an effective solution.
For example, writing physics simulations in pure python (as opposed to using an existing library such as PhysX or Bullet) won’t perform well, as it requires a great deal of calculation.
A more practical example for Panda3D: AI pathfinding may not work well in Python, depending on the implementation and complexity. If you need to constantly recalculate pathfinding for a number of objects then it would be worthwhile looking to write this code in C++, as it will probably be significantly faster.
I’m just a new comer to panda3d, but for my $0.02 I’d say go with C++
I’ve invested a fairly vast amount of time trying to get c / python interop to work correctly and it’s been quite a painful experience.
At least when you’re writing 100% in one language you won’t run into issues like “no that function only takes an object, not a pointer in the python api.”
If you don’t need any c backend libraries I’d say the python api is probably more useful, but from personal experience I can’t recommend a mixture at all.