Search code examples
pythonperformancegraphicsreal-time-strategy

2D RTS in Python?


I am a great python fan. Recently I got an idea to write RTS engine and/or maybe a simple RTS game based upon this engine. There are a couple of things I need to think about and maybe you can give me some advice on these:

  1. Performance. Most games are written in C++. Isn't python too slow for game engine? I am aiming only at 2D, but still it may be too demnading.
  2. Graphics. Are there any good graphics libraries for python? SDL/OpenGL bindings or maybe something more suitable for python?
  3. Game engines. Do you know of any existing RTS engine written in python?
  4. Any tools/libraries for python that maybe helpful in developing RTS

Thanks in advance!


Solution

    1. Performance may be an issue with heavy graphics/math processing. If so, see Panda3D, NumPy, Cython, and PyPy.
    2. Use Pyglet, PyOpenGL with Pyglet, Panda3D (although you are writing in 2D, you can still use a 3D engine), or perhaps some other library.
    3. There don't seem to be existing RTS libraries, but there are definitely pre-existing generalized engines.
    4. Try searching for RTS-related libraries in general: you'll need AI, pathfinding, networking, and so on. Therefore, you may be interested in Twisted, for instance, since it helps with networking.