Wednesday, August 6, 2014

Inkscape & acceleration

It's not easy finding time to work on software projects when one works alone and has to support one's self delivering pizzas, but slowly I'm thawing out again.

I've written an Inkscape-svg-to-pyglet tile conversion script to make working on tiles easier.  Currently it only works on solid-color shapes (am working on gradients), and only quads, but it does the trick.  Importantly, it handles multiple layers, so a single vector tile can contain foreground and background elements at the same time.

I keep looking for ways to improve performance.  Here is a round-up of the methods I've investigated, variously and tried to get working recently:

* Psyco was what I used before.  It worked with Pygame.  But Psyco hasn't been developed for years now.  This was the source of the first great delay for the project.  I've given up on using it.

* Cython is a system that will translate a Python script into a C extension.  I have trouble getting it to work though, a problem sourced in stock Python's insistence on a specific development environment for extensions and the need to maintain a whole C-compiler and set it up.  My current issues with it: I can't get it to produce a workable extension, it keeps erroring out with "C:\Python27\libs/libmsvcr90.a: file not recognized: File truncated".

* Pypy, Psyco's successor, is a Python JIT compiler, and looks like it'll be very promising eventually.  There's an issue of how to package it as a standalone interpreter, and currently Numpy, which I use for building buffers for pyglet, is only partly and experimentally supported.  It seems like it has no problems with pyglet itself though.

Those are the two major non-stock libraries I use, pyglet and Numpy.  If it doesn't support those, it's not useful to me.