python for game programming

D

Diez B. Roggisch

t3chn0n3rd said:
Is Python program language popular for game programming?
Yes. For starters, google

pygame
pyglet


And python is used as scripting language in quite a few commercial
products, such as eve online.

Diez
 
M

miller.paul.w

Is Python program language popular for game programming?

Well, Python is at the center of my favorite game, Sid Meier's
Civilization 4. :)

Another poster mentioned the pygame and pyglet libraries. I'd suggest
you look into them if you want to code a game in Python. Also keep in
mind the "alternate hard and soft layers" design pattern (as much as I
hate the phrase "design pattern," there's no better way to describe
this particular one.)

The essence of "alternate hard and soft layers" is to design your
application in one of two ways:

* Most of your code is in Python, with C or C++ extensions for
performance-critical areas, or
* Your main app is in C, C++, or some other language that can embed a
Python interpreter. The embedded Python interpreter provides a
scripting interface that can be used by level/scenario designers or
end users to customize the game. The scripting interface can be as
simple as a wrapper around functions in the main code, so you can
choose how much functionality you want to expose.

These two patterns are basically equivalent, but I prefer to use the
first, because it lets me write more Python and less C. In the second
approach, you end up writing most of the game in C and exposing a few
of those C functions to Python.

If you only want to expose a subset of game functionality to Python
(for example, AI or level generation), I'd guess the second way is the
way to go.
 
S

Steve Holden

t3chn0n3rd said:
Is Python program language popular for game programming?
Python is a core technology for CCP, the producers of EVE Online, which
is I believe the largest single-sharded multi-player game currently
running, and which has supported over 40,000 simultaneously logged-in
users on a 200+-CPU cluster if I'm not mistaken.

regards
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top