PS3 game development using python

Investigation into how Linux on the PS3 might lead to homebrew development.

Moderators: cheriff, emoon

Post Reply
ralferoo
Posts: 122
Joined: Sat Mar 03, 2007 9:14 am
Contact:

PS3 game development using python

Post by ralferoo »

As you may know, I've been writing my PS3 stuff with a view to building up a library suitable for writing games and as I thought about it more the idea of using a scripting language for the game seemed the most logical way forward. I plumped on python as I'd used it before for a couple of small jobs and it seemed like a nice language with a lot of support. Plus, it has the advantage of being pre-installed on most Linux distributions and very easy to extend, and so the PS3 library for python was born...

Brief bullet points of the current build:
  • * Support for the PS3 frame buffer on a per pixel basis
    * Support for blittable objects (solid, masked or alpha blended)
    * Support for the PS3 controllers
    * Easy integration with PIL for image manipulation and text rendering
    * A proof-of-concept breakout game
Just to whet your interest, here's an example of how easy the code can be (taken directly from the test.py file):

Code: Select all

image = Blittable(Image.open("miglu.jpg"))
for count in xrange(screen.height-image.height):
        screen.clear()
        screen.blit(image, (count,count) )
        screen.flip()
        screen.wait()
I have created the "Python on the PS3" page at http://www.ranulf.net/ps3/python/ which will be kept up to date with future revisions. Enjoy!

I look forward to seeing some games created with it (and if you get stuck or need extra functionality, give me a shout!)
ralferoo
Posts: 122
Joined: Sat Mar 03, 2007 9:14 am
Contact:

version 0.1.3c release

Post by ralferoo »

I've made another substantial release of the python library, acheiving about a 3x speed increase on version 0.1.2 and immeasurably more than the original version.

As usual, it's available on the sourceforge site above, but I'm also trying out packaging it as a debian (Ubuntu) package. If you'd like to try this out, then add to following to /etc/apt/sources.list:

Code: Select all

deb http://www.ranulf.net/apt ps3/
and then one of following:

Code: Select all

apt-get install python-ps3
or

Code: Select all

apt-get install python-ps3-demo
At the moment the .deb files haven't been signed, so there's an additional confirmation step that you trust them.

The second apt-get will put the current set of demos under /opt/python-ps3/demo for experimentation, as before the best example is breakout.py. If you saw this demo before and was unimpressed at the performance, you'll be pleased to know that the same demo now runs at 60 FPS at about 35% SPU utilisation of 4 SPUs. That should provide plenty of growing room for filling the screen with objects!

Next on my list is sound... ;)
Post Reply