How to Choose The Best Python 2D Game Engine?

 

Latest Indonesia Job completion trend in oDesk

Latest Indonesia Job completion trend in oDesk oConomy page

 

A very common question for newcomer when entering IT software development industry is, "Which programming language should I learn, or focus on?". Most of the time, if not all, you will get answer resemblance to, "Depend on what application you would like to built". It's true. First, you got to decide what area of software development that you really have the passion on. Or, what kind of a application that you like to build : Game? e-Commerce? Education? You can have a look at software categorization listed in Wikipedia for this. For example, once you know that you have the passion to develop your own video game, the next logical step is to do some research in what programming language does your game can be programmed with, or to be exact , what library/framework you have to use?

Answering the last question may seems rather difficult.  Why? Simply because it's a moving target. An answer for this question last year, may become obsolete in these recent days. This is the nature of software industry itself : fast paced with sometimes unpredictable momentum in the near future that will change the fate of a technology mercilessly. You simply can not bet for specific technology/platform to exist forever. You got to prepare for the worst.

 

A Broader View : Checking Python Trends

For starter, let us check where do our beloved Python popularity rank fall in Tiobe Index this month (Dec 2013):

Python still fall within Tiobe Index of Top 10 Programming Language Popularity

Python still fall within Tiobe Index of Top 10 Programming Language Popularity

This index doesn't try to answer the question : "What is the best programming language?". For that, the most accepted answer would be the quote : "The Right Tools for The Right Job". This index merely expressed programming language popularity, based on : the number of skilled engineers world-wide, courses and third party vendors. Popular search engines such as Google, Bing, Yahoo!, Wikipedia, Amazon, YouTube and Baidu are used to calculate the ratings (taken directly from Tiobe website).

Hence, using this index we can be quite assured that our beloved Python language is widely adopted. That's great!

Study Case : Choosing Game Framework

This is my actual process of selecting which game framework/library should I choose for my next 2D game development. "Just pick one. Any will do, as long as your game eventually built and met your demand", you may argued. But, in my opinion, it's not that simple. Time is an Asset. An asset that will never be renewable.  Once you allocate your time for a decision, time spent for that decision will never be returned to you (I was only talking about the time, as for the knowledge gained it will be there forever). Pick your selection wisely.

If you try to surf the internet using keyword : python game engine, you will quickly notice several game engine there exist in the Python world. How do we carefully pick one game engine/framework that will bring the most advantage for us? In term of professional career in software development industry, it's simple : make sure what you choose is having the highest (or simply a good) demand in the IT job market. Let use two tools for this : Google Trends and oDesk oConomy.

Using Google Trends

Have a check on this Google Trend result, which interestingly gives us the trend of popular game engines since 2004. I depicted below the result of it for easy reference.

 

Google Trend of Popular Python Game Engine

Google Trend Result of Popular Python Game Engine

 

PyGame is rather stable, while the most interesting or even spectacular pattern can be easily spotted for Cocos2d. But, people commonly refer Cocos2d for the Cocos2D-iPhone, not the Python desktop version. So, the pattern can quite easily understood there. Also, try to open that Google Trend link and add Cocos2d-x. You can see that it's highly possible that the decrease in Cocos2D-iPhone was cause by the emergence of Cocos2D-x (which will target not just Android, but also iPhone, Windows and MacOS X, hence, -x). We can also see that Kivy is increasing as its gain popularity (was there exist Python programmer in the face of planet earth, who didn't want to develop mobile game using Python? That's what Kivy stand for!)

So, base on this Google Trend result the winner is Cocos2D for sure (although it's a mixed with its iPhone port). And digging further on Cocos2D, we got this interesting diagram from Cocos2D-x:

Cocos2D Family

Cocos2D Family : It started as Cocos2D Python version toward Desktop Application

 

What can we conclude from this diagram? One simple conclusion would be : If you learn Cocos2D, you will open the opportunity to learn other Cocos2d port for different platform. Sure, it will be a different programming language in its entirely, but the basic concept and framework design will be the same. Your time spent in learning Cocos2d will not just get wasted.

Using oDesk oConomy

Using the above Google Trend result already satisfying enough to be confident that learning Cocos2D (its Python version) is the perfect choice. But, is it true that market demand for Cocos2D (all family of its) were high? How can we know it? Well, as I am an oDesk Freelance (you can see my public oDesk profile here), naturally I use oDesk job search result for trends in Cocos2d demand. The result was rather impressive:

 oDesk search result for Cocos2D (iPhone)

oDesk search result for Cocos2D (iPhone). At the time of this writing, searching of Cocos2d-x bring 18 result,
while it bring nothing to Cocos2d Python.. sigh Cry

 

For the unaware, oDesk  is (taken directly form their website) : a global job marketplace with a series of tools targeted at businesses that intend to hire and manage remote workers. Simply put, it allows employer to post/manage/pay job online and get attention from freelancers all around the world. All kind of jobs (not related to programming only) exist in oDesk. From my perspective, it's a perfect place to develop your career, while at the same time balance your life.

You can have a deep understanding of how the world works in oDesk perspective using its new oDesk oConomy page. It can shows you which country having the highest total in project completion or in what country, what is the biggest category of project being completed. Actually, previous oDesk oConomy also gives you an interesting chart of technology trends in oDesk. It shows you whether Python job demand is increasing or not. But in 2012 they get rid of that and introduce something new entirely.. 

But, whatever, in the context of our research, Cocos2D FTW!

Conclusion

Actually, it's not easy (and rather risky) to bring the topic in the are of : "What is the best programming language or framework or editor?". It may even like trying to debate what is the perfect religion or whether God exist or not : people may kill each other there. But using the above Google Trend and oDesk search result, we can be more confident, that at the time of this writing, if you plan to develop a 2D video game, your best bet is Cocos2D.

Your next step will be simpler : Cocos2d, Cocos2D-iphone or Cocos2D-x? Although currently I am working with the Cocos2D python version, I am flirting Cocos2d-x due to its wider target platform. I just have to find a way to bind Python to Cocos2d-x, as my target is developing Python teaching aid for kids. The result so fa seems promising :)

 





Leave comments

 authimage
  • Important note, have a look at this : http://www.cocos2d-iphone.org/forums/topic/future-of-cocos2d-iphone/page/2/

    ===
    "A few months ago I started to lose motivation/energy to keep developing cocos2d-iphone. And I guess my “de-motivation” is related to:
    – I have been doing this for 5 years.
    – The context changed: I was never an Apply fanboy nor an Android fanboy, nor a Windows fanboy… I just I love to develop technology. iOS is still a great platform, the best mobile platform, but there are other interesting platforms out there as well (Android, but PC is interesting too).
    – cocos2d is already a sort of de-facto standard for 2d games. And now, my goal is to bring cocos2d to as many platforms as possible (from phones to PC, and consoles if possible).
    – And in my opinion, cocos2d-x is the best solution for that."
    ===

    So, moving now to its C++ version

    • eko
  • I am quite disappointed actually, with the Cocos2d version. It missed one thing that important for my current project : an isometric TileMap. I have try to implement it, but as I consulted the dev in google groups : https://groups.google.com/forum/#!topic/cocos-discuss/IuIuoWKs-8k, I realise that it's development kinda .. freezed.

    And as I said that I am flirting with Cocos2d-x .. there you go. I am focusing now on the Cocos2d-x part, stop trying to contribute to its Python version. I also seriously trying to bind it with Python using Boost:Python module. This will serve as interactive python environment for the kids in using my educational game.

    I will prepare my next article talking about this decision

    Thanks for your reply!

    • eko
  • Personally I don't think simply looking at popularity metrics is very helpful in the world of game design. If you want to create your own game then the most important aspect is actually which framework helps you achieve what you want with the least pain. That's a factor of community and popularity to an extent, but also of the tool ecosystem, and even just how well the framework fits your way of thinking.

    I speak from personal experience trying to get anywhere with both Cocos2d-python Cocos2d-js. After struggling for a while I realized there's just something about the way they expect you to work and think that doesn't fit with the way I work. The documentation didn't seem to be telling me what I wanted to know, the API didn't seem to do what I thought it should. There's a lot of personal preference and that's really important if you want to work in a small/one man team.

    On a side note: Cocos2D is VASTLY more popular for it's iOS and C++ ports than for the original Python version (which has languished in a half finished state for over a year now). In turn the Python version is based on pyglet, which has also been stuck in alpha for over a year.
    I'm personally a huge python fan, but despite my enthusiasm I find it hard to recommend anyone try to learn game programming with python right now - you're probably better off starting with one of the many JS frameworks. Hopefully as things like kivy or pysdl2 mature this will improve...

    • mangecoeur

Copyright(c) 2014 - PythonBlogs.com
By using this website, you signify your acceptance of Terms and Conditions and Privacy Policy
All rights reserved