Some thoughts on writing a 3D game engine in Pytho

posted in Ian's Blog Rants
Published October 08, 2007
Advertisement
Rav suggested I should talk about this a bit, so this one is for you, Rav.

I've been working on writing a game in Python for a bit now (for reference, a multiplayer first person shooter). For the most part, it just started out as an experiment. I started out thinking, "Huh, I wonder how far I could get writing this before it becomes completely and utterly impractical". And then I just kept going, because uh, so far it hasn't turned out to be terribly impractical.

The main thing people bring up with "scripting languages" (although I think calling them that is a misnomer) is the issue of speed. It really hasn't been that big of a deal so far though. I've really only had to rewrite one thing as a C extension, and that actually was pretty straightforward (if you use SWIG, its actually really easy to use C code from Python). Keep in mind this is a pretty heavyweight game -- fully 3D, large terrains, shaders, physics, AI, etc. Its not that Python is particularly fast, its just that the bottleneck is usually in how you're passing data to the graphics driver, or in the physics library, and for those things, it hardly matters what language you're calling them from anyway. Plus it's easier to make high level algorithm changes in higher level languages, which tend to be the kind of optimizations that really help anyway. It doesn't matter what language you're using if your algorithm is O(N^2).

So far my main concern is Python's obnoxious Global Interpreter Lock is making using multiple cores more difficult, and the IDEs aren't as nice as Visual Studio. Mostly I've been really happy with using Python though -- its about an order of a magnitude productivity increase over using C++ (although, on the other hand, unrelatedly, I've become about an order of a magnitude more lazy -- dammit!).
Previous Entry Just let it flow man
Next Entry Sentimental value
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement