Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Python: Where is it notably used in game development?

J1M

Arcane
Joined
May 14, 2008
Messages
14,650
I am learning some basic python for unrelated reasons, and am curious where python has been used in game development. I was impressed that python appears to have a good IDE now in the form of Visual Studio with Python Tools installed. When I've seen other people advocate it in the past, they made it seem like python development was still stuck in the dark ages of notepad and VIM.

I know some pet projects have been written entirely in python (pygame?), but I suspect that is not very common. Instead, I expect it sees use only as a scripting language for a handful of games as an alternative to Lua?

Please leave your thoughts if you have experience using pygame, python game scripting, or any large-scale python development.
 

tuluse

Arcane
Joined
Jul 20, 2008
Messages
11,400
Serpent in the Staglands Divinity: Original Sin Project: Eternity Torment: Tides of Numenera Shadorwun: Hong Kong
Eclipse with pydev has existed for a while, it's pretty slick

However,
>vim
>darkages
:rpgcodex:
 

Aikanaro

Liturgist
Joined
Feb 3, 2004
Messages
142
Panda3D is an engine that uses python on top of C++ (all the actual game programming done in python, usually). It used to be Disney's in-house engine and they made several games with it.
It's a nice engine, but it seems everyone's jumped on the Unity train.
FIFE is similar ... but have any of those FIFE projects ever been released?

I used to use Python with pyglet quite a bit, but have moved on to Haxe for smaller projects, which is just generally more convenient and has better libraries.
 
Self-Ejected

Davaris

Self-Ejected
Developer
Joined
Mar 7, 2005
Messages
6,547
Location
Idiocracy
If you're using scripted AI for a game, use a Behavior Tree written in C++, if you can get a hold of a good library.
 

Midair

Learned
Joined
Apr 27, 2013
Messages
101
Keep in mind that if you use a low level library like opengl, it is going to be low level even if you use Python or another high level environment, which at best might provide a thin wrapper. Game engines are usually written in c++, not because Python or other languages are slow, but because their benefits are not relevant in a low level context.
 

Destroid

Arcane
Joined
May 9, 2007
Messages
16,628
Location
Australia
Python has been used to script a variety of games, notably Civ4. Few games are written entirely in python, but it's quite common for frameworks to have a python binding.
 
Unwanted

Sycophantic Noob

Andhaira
Andhaira
Joined
Nov 20, 2013
Messages
236
http://www.renpy.org/

http://www.katawa-shoujo.com/

These two as an example.

There is also http://www.pygame.org/news.html. Pretty nifty, I tried playing around with it some time ago, it's easy to get into. I don't think there are any notable games using it though.
I know for a fact that many games are using python to script the ai routines. Vampire: The Masquerade - Bloodlines in particular was known for that.

There is also http://doryen.eptalys.net/libtcod/, a library with python bindings. A kickstarter project featured on Codex some time ago (Cult, now known as Empyrea) is being written in Python, using libtcod library.
 
Last edited:
Joined
Dec 29, 2006
Messages
372
With regards to speed, in general, Python will be fast enough for the majority of what most people will need. Frankly, there are few people who can really take full advantage of the 'fast' languages. You can just be lazier in some other languages. Its quite easy to write slow C++ code without even realizing it. Of course, this is true of just about any language, if you don't know what you're doing. There's also a few libraries available that can be used to help speed up Python, such as psyco, if you are having problems.

Where Python really shines, though, is rapid prototyping and development. It has a vast set of standard libraries, about on par with C# and Java, plus there are a number of useful third party libraries available. And, you can usually get the same amount of work done in far fewer lines than other languages.

I used it for a while as a standalone, on a couple projects, mostly with PyOpenGL, PyOgre and Pyglet. What I found particularly nice was the ability to store my data files in Python. I could use lists, dictionaries, and even code in those files. There really isn't a distinction between the engine, scripting, or data.

At the end of the day, Python is just another tool. Its good at some things, and not so good at others. If you like it, use it. If you don't, don't.
 

Severian Silk

Guest
VegaStrike uses python. Also the remake of GearHead RPG will use Python (assuming anyone is still working on it...).
 

shihonage

Subscribe to my OnlyFans
Patron
Joined
Jan 10, 2008
Messages
7,163
Location
location, location
Bubbles In Memoria
Python is probably a dream come true for making complex text adventures. However if I had to do a MUD server, I'd use a faster language. Even modern Pascal (Free Pascal/Lazarus) is faster than Python.
 

SCO

Arcane
In My Safe Space
Joined
Feb 3, 2009
Messages
16,320
Shadorwun: Hong Kong
Bloodlines and ToEE for some. Probably loads more, why don't you wikipedia it?
 

megalomaniac_tom

Barely Literate
Joined
Jan 8, 2014
Messages
4
*googles .. Python Games..
https://wiki.python.org/moin/PythonGames

But the above stuff is using wrappers, like how battlefeild 2 is using it for AI and what not.
So the entire 3d scene is prob loaded in a single function wrapper that can load the entire
enviromet all in c++ then the python program is just running models around the established
enviroment and setting up the general gameplay if it's even used that much..

Looks like Eve-Online is using Stackless Python to get the kind of speed they need in order to
have alot of there engine in python. But that's just to save money by cutting dev time.

The games using panda3d are just using wrappers for a 3d engine that is in c++,
Like with Disney's Pirates of the Caribbean game, but this means that the
loading of models and setting up of the scenes is all done using python code.

As far as pure python stuff.... . . . .
Here a guy uses pygame to make a 3d engine from scratch
http://www.petercollingridge.co.uk/pygame-3d-graphics-tutorial

also a random one on youtube, "a one" as in another 3dengine in pure python.
http://www.youtube.com/watch?v=80AzODHwaOw

And on a random note.... . . . .

Here is a library that lets u make wrappers for your c++ code so u can write a python
program that runs your c++ engine as if it's a part of the python program.
And I think u can also use this to even load a python terminal inside your c++
unless im mixing this up with yet another libary..
http://www.boost.org/
http://www.boost.org/doc/libs/1_55_0/libs/python/doc/tutorial/doc/html/index.html

but that's about i could find as far as 3d anything that is using pure python.
well.....
that's all i care to look into this.. :D
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom