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:
- 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.
- Graphics. Are there any good graphics libraries for python? SDL/OpenGL bindings or maybe something more suitable for python?
- Game engines. Do you know of any existing RTS engine written in python?
- Any tools/libraries for python that maybe helpful in developing RTS
Thanks in advance!
- Performance may be an issue with heavy graphics/math processing. If so, see Panda3D, NumPy, Cython, and PyPy.
- Use Pyglet, PyOpenGL with Pyglet, Panda3D (although you are writing in 2D, you can still use a 3D engine), or perhaps some other library.
- There don't seem to be existing RTS libraries, but there are definitely pre-existing generalized engines.
- 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.
I can answer your first two.
- Python isn't too slow for games. That all games must be written in C++ is a myth. Sure C++ (or C) might give you the best performance, but it doesn't mean you're unable to write a game in another language.
- Try PyGame: SDL bindings for Python.
精彩评论