Python is an object-oriented, general-purpose and high-level programming language developed in 1991 by Guido van Rossum. Since its development, Python has become one of the most popular programming languages in the world. It often ranks high in popularity surveys—for instance, it claimed the top spot in the Popularity of Programming Language index and came in second in the TIOBE index.
Python earned its acclaim as a widely used tool because of its suitability for multiple purposes and for various projects—from data analytics and visualization to artificial intelligence, language development, design and web development.
That said, Python isn’t exactly renowned for its use in video game development. But should this mean game developers should just disregard Python completely? Not at all.
Familiarity Breeds Productivity
Thanks to the language’s simplicity and coding speed, Python is an excellent choice for prototyping. The work product is visible immediately and it’s possible to quickly deliver a playable project to potential investors.
Therefore, Python is also an ideal language to begin a developer’s adventure with creating games, regardless of whether the user is already fluent in it or just starting out.
Due to the newcomer-friendly syntax of Python, developers can focus on the basics of game programming, not the complexity of the language itself.
The effects, which are quickly visible, allow beginners to get actively involved in the process of creating a project. Advanced developers, on the other hand, will appreciate the fact that they can create something playable using their familiar, everyday work tool and that the process of coding will be, as always, very enjoyable and satisfying.
Preexisting Python Tools and Libraries
Python programmers can also take advantage of tools that were written specifically for them.
The most popular library that supports Python game development is PyGame. This engine, available under the LGPL, allows users to build fully commercial projects. Additionally, the library is designed in a way that lets users easily use multiple processor cores. The main functions were written in C and Assembler, thanks to which the user’s project will be 10 to 20 times faster than if it were written in Python alone. This tool is incredibly easy to learn. Its creators also have prepared extensive documentation to help guide users through the process.
There are also available tools for 3D rendering, such as Ursina or Panda3D. Of course, these aren’t the only technologies designed for Python users. In fact, there’s a really large selection of available tools and engines such as PyOgre, PyKyra and Ren’Py that are worth checking out.
Lastly, the Kiva library should also be mentioned. It may not have been created with gaming in mind, but it’s perfectly suited for it. Kiva is a multi-platform tool for creating window applications quickly.
Python for Game Development
If you Google, “Which language should I use for game development?” the first results you see will likely be recommendations to avoid Python. However, that shouldn’t be a deterrent; it can be done!
Python has received criticism in the past regarding its use in game development, mostly centering around the fact that Python is not designed for computational performance but, rather, coding performance. This is justified.
But if a user, programmer or game developer is already familiar with the programming tools and takes advantage of the preexisting tools and libraries at their disposal, then Python for game development has clear promise, both now and also in the future.
If you want proof that a game written in Python can be an international success, I recommend EVE Online—a title that attracts over 20,000 players each day!