Python for Commercial Games?

Pete Shinners shredwheat at mediaone.net
Wed Jun 27 12:36:16 EDT 2001


"Kevin Riggle" <vj$ri^gg#guess#l55e at mt$*guess#&cn1e#t.!@n()et> wrote
> I *do* realize that I'm posting to comp.lang.python , so please humor me
> anyway...
>
> I am in process of designing a computer game;  problem is, I want to at
> least have a snowball's chance in Hades of selling the game.  My question:
> Would it be possible to write the dang thing in Python (PyWin), or is C/C++
> the better option in the Windows-centric world of game development right
> now?  Thanks in advance,

hello kevin. i think it would be a smart idea to have your game objects
be done in python code. at some point, you'll likely need some sort of
C extension to do some of the cpu-intensive stuff. how much C code
depends on how complex the display and interactions will be.

two libraries of interest to you will be Pygame and PyOpenGL. Pygame
provides a great way to do 2D graphics, as well as handle sound and
input. PyOpenGL is obviously a python wrapper for opengl. Both are
fast enough to do a complete game without needing extra C extensions.

if you want to do more of a first-person shooter with all the goodies,
you'll need a much bigger chunk of C code. stuff like managing the BSP
trees, collision detection, raycasting and all that jazz will be much
more suited to C. Think of something like Quake3 or UnrealTounament,
where the game "engine" is written in C, but the actual game is run
from a bytecompiled scripting language.

take a look at my solarwolf game. http://shredwheat.zopesite.com/solarwolf
it should give you a decent idea of what is possible and what type of code
it involves. all the source is available for the game, so take a peek
under the hood.

writing games is actually a lot trickier than you'd think. if you are
planning your first game project, i can't stress enough that you should
start with something basic. (don't bother going commercial on your first
run) :]  trust me on that, just do something simple and fun. by the time
you finish it up (actually long before that) you'll realize that there's
a lot more to manage than what you first think. you get to the point
where you say "well i designed this completely wrong". but with a simple
game you can just rough it out and finish things. with a bigger game
you end up getting bogged in bad design and are forced to rewrite most of it.









More information about the Python-list mailing list