Phil Hassey - game dev blog
Phil Hassey as Rambo
".. I've been there,
I know what it's like,
and I'll do it again if I have to."

Archive for November, 2007

Attacking PyPy

Friday, November 30th, 2007

Hey, more fractal fun tonight as I attack PyPy! I must admit, this effort was more challenging – PyPy is pretty big and scary, but I found the folks in #pypy to be quite helpful. exarkun helped me quite a bit in working out the details. (Apparently PyPy doesn’t use ctypes anymore, it uses rffi .. which is sparsely documented.) Anyway with exarkun’s help I got a crude SDL wrapper put together!

pypy-mandel2.png

Initially I just implemented my julia demo again, but I figured it would make for a boring blog entry to have the same pictures two days in a row. As it turns out, the julia was about 30% faster in PyPy than in shed-skin. Both shed-skin and PyPy appear to have similar limitations. shed-skin’s error messages are less cryptic than PyPy’s. Both FFI’s were somewhat challenging to work with, though I think I prefer shed-skin’s.

If you want to give it a whirl, download PyPy and my junk. The NOTES.txt file lists the command I used to build the executable. Sorry if the mouse interface is a bit lousy, but it was the best I could do in 2 minutes.

Taking on Shed-Skin

Thursday, November 29th, 2007

There’s this swell python to c++ compiler called shedskin. It’s really interesting. I took a few hours tonight to make it do something:

shedskin-julia2.png shedskin-julia4.png shedskin-julia3.png

Yep those are real-time julia fractals 🙂 If you dare – check it out (make sure python and SDL-devel are all setup):

wget http://www.imitationpickles.org/tmp/juliashed.zip ; unzip juliashed.zip ; cd juliashed ; python ss.py test.py ; make ; ./test

I’ve sent Mark an excessively long e-mail with my comments. I’ll spare you the trouble and just give the highlights:

  • My C++ skills don’t exist
  • python descriptors are probably the feature I would like to see most – so I could implement pygame.Rect style Rects!
  • misc packaging issues (see his previous blog post)
  • The README says it “does not scale very well beyond a few hundred lines” – so I guess I’ll wait a while before I try to make a game with it. (Even simple games I make are around 1500 lines.)

Anyway, it’s a cool project. I plan to keep an eye on it.

This just in – I made a python+pygame equivalent. The shed-skin version is ~100x faster! Also, the black areas in the middle of the shapes are caused by my access of out-of-bounds palette entries. I added the -b (bounds check) to the command line and fixed the bug. The bounds check gave me no noticeable speed penalty.

Customizing WordPress

Wednesday, November 28th, 2007

As far as code goes, I’ve usually been a do-it-yourself kind of guy. However, I’ve been so impressed with WordPress I’ve actually used it to implement four of my sites in the last couple months. WordPress is an easy to use, smart piece of blogging software. It really seems to have just the right set of features in its default installation to be useful for most cases out of the box.

However, there comes a time when what’s given just isn’t enough. Thankfully, its got an extensive collection of plugins! Everything from blog aggregation to voting to forms to photo galleries. Not all plugins are great, but usually if you check out a few you can find one that will do what you want.

That is .. until you want something different! I might be hosting the 10th Ludum Dare compo. For that I needed some special features for collecting ratings of contestants entries, showing screenshot grids, and giving trophies to entrants.

Ludum Dare Screenshot Grid

WordPress comes with a fairly nice themes and plugins system which made it possible to add all those features to my blog without modifying the core-code of WordPress. Frequently I would implement a feature, and after learning more about WP internals, I was able to refactor it to be simpler by using more of the existing WP framework.

It wasn’t all fun and games, though, the learning curve was a bit painful for some features. A couple WordPress features (like table deltas) seemed a bit too clever (not to mention broken) for their own good. Fortunately, I was able to get away with not using those features.

The other challenge I had was when I came across a bug in WordPress. I did my best to figure out the bug, but it appears to be some strange javascripty thing which was beyond me. So I’ve reported the bug, and according to their schedule, it probably won’t be fixed for about six months. Ah well, at least it’s pretty minor.

All that said, it has been a fairly enjoyable process. I’ve been able to develop more site in less time by working with the WordPress plugin system. I have *considerably* less code to maintain, since I’m only responsible for the plugins I’ve made. Had I created this from scratch, I wouldn’t have gotten even half as far given the amount of time I invested.

This just in, the WordPress spell checker chokes on the word “with” .. weirdness!

Ludum Dare X – Dec. 14-16th

Wednesday, November 14th, 2007

It’s time for the 10th Ludum Dare compo!

Dec. 7-14th – Registration and Theme Voting
Dec. 14 at 7pm PST and runs until the 16th at 7pm PST

Join the fun in irc.afternet.org #ludumdare
With luck, the compo will be held on www.ludumdare.com ..
Be sure to join the irc channel for the most up-to-date information.

– Phil

Galcon talk at pycon

Monday, November 12th, 2007

I’m working on writing up a proposal for a pycon talk. Which of these ideas sounds the most interesting?

– Galcon post-mortem – stuff that worked, stuff that didn’t – gfx, networking, python, etc. What I would do differently “next time”.

– Galcon modding – how to build a Galcon bot and other nifty tricks.

– Galcon business – all the grisly details of selling a game

– Something else?

I’d like to do an open space for people who want to have a Galcon bot writing competition as well as another open space for a real-people tournament.

Halloween game development

Thursday, November 8th, 2007

Marshie Attacks: Halloween Interactive Driveway Activity

Some really cool game dev going on there.  They used python, pygame, pysight, lasers, bedsheets and potato canons to create an interactive Halloween game!

Watermelons on facebook

Thursday, November 8th, 2007

Watermelons was a pygame game made in about 8 hours one evening on the #ludumdare channel. Since then I’ve ported it to flash using haxe. This past weekend I integrated it into the facebook API. You can check the app out here. My server-side high score system was written with PHP.

The integration was somewhat challenging, since I was using a language not supported by facebook (haxe) and my integration involved using flash, which has some restrictions when used within FMBL. To work around these things, I had to embed my flash object within an iframe and then pass high scores back through my main web script in the browser window (instead of as a background request) in order to be able to use all the facebook notification features.

So far (after about 5 days) the app has about 160 users, which isn’t very many. But I suppose it’s not bad for my first shot at writing a facebook app.

Summer Sausage Festival 2007

Friday, November 2nd, 2007

The time has come for us to begin living our lives! Check out www.summersausagefestival.com for the MOST EXCITING thing that is going to happen in 2007!!!

-Phil

pygame.org updated

Thursday, November 1st, 2007

I just spent the last few hours working on an update to pygame.org . The most exciting feature is the tagging which I’ve added. Now you can look up all pyweek entries by going to www.pygame.org/tags/pyweek for example (at least, once people start filling in their tags!)

I haven’t had lots of time lately to work on the pygame site, but I’m glad I was able to round up a few hours today, I think this is a nice feature and I hope it encourages people who use other python game frameworks to post their games there as well, now that they can tag their games as “soya” or “pyopengl”.