Congrats to the Winners!
Winning games look great - well done guys! :-) Appreciate the feedback on my game too - really priceless stuff to hear from you all. Thank you.
On the negative side, why do judges insist on running games that specify require Python 3 on Python 2? Can I help by adding 'Not tested on Python 2' ? I'd rather you guys were playing other games than debugging mine :-)
Also yet again I have to point out that an __init__.py is optional for a Python namespace package. http://legacy.python.org/dev/peps/pep-0420/
Take care, (log in to comment) Yeah, I had to comment out that check in mauve's game :). It's easier to backport the games to Python 2 than to install Python 3 + PyGame sadly.
It really hurts PyWeek I think. Not just the Python 3 situation, but the state of portability of Python games in general. Even us developers fail to run a large number of each other's games. There is not a chance I can let my mom or sister try my PyWeek games. They can never get them working. And the competition is very strong. If I write a game in JavaScript, I can just send the link to my mom and she does not even have to download anything.
A benefit of competitions like PyWeek is to draw attention to such issues and let the libraries and tools improve. But I don't see this happening. It gets worse every year while other platforms get better. I don't mean to complain, just say that maybe it's up to us, game authors to fix this. In between two PyWeeks we could try to figure out the best way to improve this situation.
TL;DR — If you have a Mac OS X PyGame binary for Python 3, please upload it to pygame.org :).
I agree with cyhawk's comment on the portability of Python games. In particular, it would be very nice if there were an easy way to convert/port, say, a Pygame game into anything that is web playable. I believe there were Pyweek games ported to JS, but from the little that I understand, it is very difficult to do that automatically. If I'm not mistaken it looks like the easiest way is still to port it manually. Can anyone with experience on porting Python games to the web comment on this? How much extra effort and time did you spend on doing that, compared to the time you spent implementing the game in Python? Did you rewrite everything manually or were you able to rely on anything automated? I have some experience with that. It's not easy.
I've ported two PyWeek games to JavaScript: Mortimer the Lepidopterist from pygame to HTML5 canvas, and Robot Underground from pyglet to HTML5 canvas + webGL. Mortimer the Lepidopterist is a pretty simple game, so that was probably done with a week of effort. Robot Underground took me about six weeks of effort over the course of five months, but I didn't work on the original and I wasn't at all familiar with the codebase beforehand. I'm also in the process of making a version of Obb, which was originally pygame, to canvas + webGL, but it's not a port so much as a new version, and I'm expecting it to take well over a year. I can estimate that a straight-up port would take at least a couple months.
In all cases I've completely rewritten everything. I mostly kept the same functions and some of the same classes, and in some cases I was able to more or less do a direct translation line by line, just changing the syntax. But I rewrote every line by hand. Core python is actually quite similar to JavaScript, but there are just too many python features that don't have JavaScript equivalents. Some of the gaps, notably comprehensions, are being filled with ES6, but I don't expect it ever to be possible to take one of my PyWeek games and automatically convert a significant fraction. The graphics, sound, and input APIs are all completely different, so I don't think a direct translation will ever be possible here, but I can see a compatibility wrapper being put in place around them.
blakeohare has had more success with automatic conversion, though I'm having trouble finding/remembering which games he's ported. He manages this by writing using a limited subset of python that avoids a lot of the features without JavaScript equivalent, and he uses conversion tools of his own design. alex also ported Goodnight Mr President to the web. I don't know if this can be done with other Bacon games.
I myself have given up on automatic conversion, and python game development in general (with the exception of PyWeek).
I believe it's really important that we improve the landscape for Python game development. Python is used in education and it's a natural target for teachers and school-age pupils. Teachers at the Python UK education track were bemoaning a couple of issues: easy of installing a Python stack (mostly on Windows); and the lack of consistency and clarity about Python 2 vs Python 3 (and we should have courage to say that the answer is Python 3). It's partly because of those conversations that I wanted to target Python 3 and avoid "complicated" dependencies this Pyweek. I actually found Python3 + Pygame pretty easy to install if you can locate binaries, and my README includes the URLs I used on Windows and Linux. It is evident from the review comments that some people didn't read the README, and simply continue believing that Pygame doesn't work under Python 3 or that it's necessarily going to be complicated to install. I don't ideologically support cyhawk's attempt to port to Python 2; I think the effort would be far better spent building a simple Pygame package for Mac, because that's the only target I wasn't able to track down. I don't imagine it's hard to compile, but I don't know Mac at all (or own one). If we can build Pygame binaries, another reachable goal would be to build a simple installer for a Python + Pygame (+ other well known or binary libraries), so that it's easy for schoolchildren and teachers to pick up, and to enable us to share our Pyweek creations with friends and family. Cosmologicon: Thanks for the comment. It's unfortunate that it takes so much effort to port a Python game. I feel much more comfortable writing in Python than any other language, but I guess if you want to write a web-based game it is probably better to use a web-based language directly (especially since if you port it you'll end up having to rewrite the conveniences of Python anyway). blakeohare: That's very interesting. Even if you have to code it in a specific way and the set of features is limited, I find it really nice that you can automatically convert a fairly complex game such as Sentient Storage. I wish I had more time to look into that further - my question was mostly out of curiosity. mauve: About building a simple Python+Pygame installer: while that goal is reasonable, it is also not very hard for us to do a py2exe on our games in order to share it with friends and family (at least those who use Windows, which as you said is common). I guess I don't do it out of laziness, but it does sound like a better solution since they don't have to download anything extra. I used to not like the fact that it inflated the size of the game, but maybe nowadays it's not something that people care about. Maybe a more interesting goal is to turn py2exe and variants into a single easy-to-use program that generates binaries for all main platforms. The scripts in the skellington package are very helpful in setting this kind of thing up (this is the only reason I got py2app to work that one time), but they are out of date and didn't work without some massaging--perhaps some kind soul could share their cross-platform python binary distribution wizardry? Then we could update skellington and make it easier for entrants to make at least one or two binaries. Its super sad to hear this from someone as talented as Cosmo, but I echo the sentiment--I don't even think about python anymore when looking to do new games or programs that I actually want people to see or play.
Davy
Comments
I want to develop Python games because I love the language and love developing as Open Source, but if I want non-developers to play my games then I better develop in Unity instead.
In the past I've done some Python + py2exe but now I don't have a Windows machine and so that route is a shot in the dark. I'm on OSX with Linux as a back-up so, like others, I made a conscious choice to keep it simple and limit dependencies because I did not have time to check them.
Perhaps we need a PyPort-Week - a week long contest to develop the best portability solution for Python games!
it is also not very hard for us to do a py2exe on our games in order to share it with friends and family
I actually found it a nightmare. The closest I came to distributing binaries was a successful run of py2app on OSX--but even this required me to manually edit some paths that it wasn't able to set up correctly (for assets). But yes, I tried everything, on every platform, py2exe, PyInstaller, py2app, cx_freeze--they all had some problem with some dependency (for me personally it was the NumPy requirements of some PyGame features) that I couldn't get around.
I myself have given up on automatic conversion, and python game development in general
mauve on 2014/10/26 13:24:
I made my game abort if people tried to run it with Python 2. Only safe way to do a Python 3 game given how bad people are at reading READMEs.