[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] people hating python for game dev.



Haroon Khalid wrote:
I am new to game dev, and it seems lots of people are being an asshole when it comes to some
gaming help. When I mention that python is ok for game dev, they start some shit about "there is
like 1 commercial game in python" and all this other garbage. So does anyone know why these people
are giving me shit about it. It seems that they hate it since its not popular compared to C.

I was just writing about this: http://niss-the-ai.livejournal.com/2006/05/14/

Compared to C/C++, Python is said to be relatively easy to use, yet powerful in that you can do with it anything your computer is capable of doing; with the disadvantage that it's slower. There are several ways to improve the speed. In my experience, the main source of pain from Python comes from trying to get programs native to C to run with it, eg. I stopped using PyOgre for a while because they couldn't get the GUI part of it working in Python. When I tried to use CrystalSpace, its makers told me to download several other programs (which didn't work) to build a Python-compatible version myself from the C code! If I wanted to muck about with C, I'd use it directly.

Python itself is an early example of an "intelligent" piece of software. Programming languages range from "low-level," where you're addressing the computer directly with commands like "Copy this piece of data to this memory slot," to "high-level," where you use commands like "Lay in a course for the Forbidden Zone." Python is fairly high-level, in that it does certain things for you, and uses English-like syntax. You don't have to worry about allocating specific chunks of memory, for instance.

In C you have to say, "Now, I'm going to start storing text inside a specific container labeled 'name', so get ready. Now here's its value: 'spam'." In Python you say, "Store 'spam' as 'name'." Closer to how you'd interact with a human. I try to make my code English-like wherever possible, for instance making a music-playing function that you can use by typing, "PlaySong('Battle Theme')". Python encourages friendly code like this (and Monty Python references) in several ways. Having started programming with Apple Basic, I can appreciate modern programming languages!

I heard of an MIT project that attempted to translate normal English into code. Their example was something like: if someone said, "Pac-Man is a yellow guy who likes to eat dots, and who gets chased by ghosts," the program would create the shells of code for entities called Pac-Man, dot, and ghost, with outlines of functions like "chase" and "eat." If you could combine something like that with some basic understanding of what those concepts mean, you could get even closer to an English-language programming environment. The danger is that you can end up with an environment too sandboxed for serious users to like, because the range of things you can do is too limited and it makes too many assumptions about the kind of program you want (eg. only shooter games).

I got criticized with a dismissive, "Oh, you insist for some reason on doing everything in Python." (No blame to the person who said this!) Working with some other code was enough to make me wonder if I should (re)learn C++ and use that for maximum power and flexibility, but really it'd be an act of masochism. It's like being told you're not sufficiently studly unless you enjoy having to open doors with your teeth. Python is an easy language to learn and use, and it's free. There are still some weak aspects in that it's not obvious what code is included where, or which functions/modules you need to do X, but today the main barrier to writing computer programs is the challenge of how to think like a computer.

I never had it really bad, even with Apple BASIC. An older friend once [asked] me what size punched cards I'd used... she was a "key-puncher," who punched cards for the programmers. They had to write the programs, take them to the human key-punchers, then wait for results just to get a stack to test out on a machine. (Athena help you if you dropped the cards.) The modern equivalent is to hit "Save," then F5 to run.

I can't find any on my hard drive right now, but I've noticed commercial games having some sort of Python as part of their installation -- it's being used somewhere in the program. http://mail.python.org/pipermail/python-list/2004-January/203383.html mentions Freedom Force, Uru: Ages Beyond Myst, etc.. Good, big-name 3D games.


Kris