2D Game Engines for Python
Update: I posted a more extended list of python game and rendering engines.
I was searching for infos on how to do 2D game stuff with python and decided to blog about what i found so far. Maybe it’s useful for others :-) Be aware that this is no indeep review of any of the engines. It’s rather my view after looking into the docs and some examples of some engines.
What exactly was i looking for?
I’d like to write some simple 2D solo RPG to test out some ideas i have in mind. My language of choice is of course python and it must run at least on windows, better with mac and linux support too. Nice community, enough docs and a map engine would be nice additions, but are not mandatory.
What i found so far:
- PyGame Python binding for sdl and more
- Pycap The PopCap Game Framework for Python
- SpriteCraft Small game engine with python bindings
- ika RPG game engine with python scripting
Pygame is a set of Python modules designed for writing games. It is written on top of the excellent SDL library.
LGPL and works where sdl and python run
Best known python 2d framework with plenty of information and code examples around. There are some existing sprite or tiled map engines around, but not directly distributed with pygame.
the ultimate framework for the super slack programmer. Pycap wraps the sweet sweet PopCap Game Framework in a super friendly high level python interface. With Pycap you can start building pretty 2D games without installing a compiler or learning C++.
PopCap Games Framework Licence, Windows only, for Linux or mac take a look at TuxCap
Compilation of the PopCap Framework with embedded python. The mainloop is in native code and contains several callback to the python code. The examples seem to be straightforward. The api doc is ok, but there are no further infos available. Neither a community. On the other hand it seems to be pretty new and still growing :-) Didn’t see a sprite or tiled map engine or some related basic functions.
The SpriteCraft is small and lightweight x86/DirectX 2D game engine for shareware/freeware game development. The engine distributed for free without any fee. You may use SpriteCraft in wide range projects without any fake restrictions.
Freeware, but not open source, Windows only
It’s distributed in form of a dll which contains python 2.4 support, so one can directly import the dll inside python and use it. There’s not much documentation and only 2 samples and one (the mapeditor) didn’t even work for me. But for game writing experienced people it’s probably worth a deeper look.
ika is a game engine designed to allow one to make a console style RPG with a minimum of code, while allowing one who is willing to code an impressive level of power over the look and feel of one’s project, thanks to the embedded Python interpreter.
GPL, Windows and compile infos for linux
The core is written in C++ and the game logic can be written in python. There’s also a map and a sprite editor included. I tried the precompiled binary for windows and pretty much everything worked out of the box. The docs cover some basics which is fine for the first start, but there are no informations on advanced feature and need some clean up imho. Not sure if its still alive, but who cares, its open source.
What am i going to use now?
On first sight ika looked like the ideal solution for me. Even the GPL license was ok in this case. But it has some drawbacks i noticed while testing out.
Theres no possiblity to use a debugger to debug the python code. At least i don’t know how to debug python code embedded inside a c++ app. I mean real debuggin, not print statements.
Then i am bound to their tools and formats and if something doesn’t work in the tools or engine i had to use C++, ugh. So it’s out.
Pycap has the same problem with debugging, where SpriteCraft and Pygame do not. SpriteCraft and Pycap have the lack of docs and share the problem if something in the render part doesn’t work, i can’t even fix it or can’t stand the language i had to use :-) Yep, there remains Pygame with none of the problems above. A mature lib with a huge community and good resource sites. The only disadvantage is imho that i might have to code alot of the basic stuff like map handling alone if i don’t find a proper solution. But i can live with that.
Hope this short entry might help you in a similiar situation :-)
comments powered by Disqus