Can Python be used to create a good game engine?

TLDR; Can Python be used to create a good game engine?

I have been looking at the source code of Panda3D recently, but no matter how much I study it I will never understand it fully, because I did not create it. So, I decided to make my own. I am wandering if an engine like Panda3D, or Unity3D, etc, be created using Python. I chose Python because I am most comfortable with it and its functionality can easily be extended with modules and libraries. I know that Python may be a bit slow, but would it really be that bad, if so is there any way to overcome this, without using C/C++. So, basically what I am asking here, is can python be used to create a good and professional-quality game engine? (I have a lot of free time, so that isn’t a problem)

Panda3D isn’t written in Python, so I don’t speak from experience here.

It’s doubtful that certain computationally heavy algorithms for physics and collision detection can be efficiently implemented in Python. However, I haven’t tried it, and I also know that the pure-Python graphics library called pyglet exists and provides a lot of the things a game engine should provide without a line of C/C++ code.

So… maybe. It’d be challenging, though.

What about using Cython? I heard it speeds up Python code quite a bit. Maybe that would work.

If you don’t mind my asking, Konlord, why do you want to create a separate engine? Is there some feature or set of features that you aren’t finding in extant engines? Are you having trouble picking up an extant engine, and hoping that one of your own creation will be easier to apprehend? Do you just want experience in engine-building? Something else entirely?

[edit] My apologies, another look at your first post answered my question. Editing further…

[edit 2] You say that you want to create a new engine because you don’t understand Panda’s source; if I may ask, why is it important that you do so understand it? Is there something that you want to add or change? I’ve seen some of your other threads on the topic of creating an engine or altering Panda, but I don’t recall whether you’ve mentioned your motivation for doing so rather than just using Panda (or even another engine, if Panda doesn’t suit your purposes).

Nowhere is being written in (almost) pure python, using pypy instead of the tradition cpython interpriter (not to be confused with cython). CFFI is being used to link addition c/c++ libraries such as ode and sdl.

@Thaumaturge. To answer your question, it is important for me to understand the source, mainly for educational purposes, and so I know how a game engine works. I already know Python and C++, but I know nothing about game engines, and I would like to develop my own, one day, so I am trying to learn as much as I can. I also had plans to modify the Panda source myself, to add features, that are still missing, eg. deploying games to PS3/4, Xbox, Oculus Rift, etc…

Now, to answer your probable next question; ‘If you know C++ and Python, then why not use C++?’- well, the answer to that is simply, I am more comfortable with Python, and I prefer working with Python.

So, I guess that is why I have been asking so many questions lately (I ask a lot when I learn new things :smiley: ). I hope I don’t bother/annoy anyone…

That’s fair enough: if engine-creation is your goal, then what you say makes sense. :slight_smile:

If I may, I’d like to relate a piece of advice that I’ve seen for creating engines: ironically, create games–then abstract out reusable elements of those games. These reusable elements aggregate over time to become your engine. I imagine that this would involve creating games using low-level APIs–OpenGL and so on–rather than high-level engines (like Panda or Unity).

Simply put, creating games teaches one what elements are useful in an engine: from what I gather, it can be all too easy to end up making features that seem as though they’d be useful, but that turn out to not be so, or that are useful, but aren’t designed in a way that works well with an actual game.

Additionally, I imagine, making games provides milestones along the way to help with motivation both by producing finished products and by demonstrating the utility of your growing engine (this does presume that the games are fairly small–and thus take much less time to make than the engine itself–of course).

Thanks for all the help and advice. It is greatly appreciated!