Lisp Game Design Challenge 2010/03 postmortem

I didn't have time to do a full 7 days before the 1 April deadline, so I tried to do something simple in 3 days instead. The goal was to have a simple flash jigsaw puzzle, with a few switchable images, and variable number of pieces. I didn't manage to get done all the features I wanted, so it isn't really a success, but it is a sort of playable prototype, so not a complete failure either:

(see intermediate versions here)

What went right?

  • Libraries: When I can figure out how to use them, the flash built-in libraries take care of a lot of the details. For example, drag-and-drop of pieces is trivial, as is loading images (aside from the security restrictions), and quadratic splines make nice edges for the pieces.

  • Deployment: Deploying flash is easier than with a lot of lisps, and the final binary is about 7K.

  • Working outside.

What went wrong?

  • Working outside: I didn't have the standalone/debug flash player installed on my laptop, and due to some network problems, didn't want to install the 150MB or so of 32 bit libraries needed to run it, so I spent a large fraction of the first day trying to debug a problem that was obvious once I could actually see the error message.

  • Unfinished compiler: The lisp->flash bytecode compiler I use is still a work in progress, and doesn't have any SLIME integration yet, so it can be hard to tell whether I've implemented a particular CL function yet, and sometimes the flash VM rejects the compiled code for non-obvious reasons. Trying (and failing) to debug problems with the bytecode generated by (LOOP ... WHEN ...) took up a large chunk of day 2.

  • Libraries: Failing to figure out how to use the built-in libraries is a good way to waste a lot of time. Most of day 3 was spent trying to figure out how to the use alpha channel of a bitmap to mask the shape of the puzzle pieces. Using a vector mask worked as expected, the mouse only affected the visible part of the piece, and clicks would pass through the transparent parts to the pieces below it. Trying to use a bitmap as a mask would mask the color of the piece, but the transparent parts would still be active to the mouse, and the positioning of the mask seemed to behave differently than masking with a vector object.

  • Tools: As far as I know, there isn't a 64 bit version of the standalone/debug flash player, and the 32 bit Linux version seems unstable/unfinished, segfaulting pretty much every time I tried to reload the swf.

What's lispy about my entry?

Not much, though if I had gotten to the point of using arbitrary images, I would have included some lisp-related pictures.

What interesting algorithms or designs did I use?

Not much here either, didn't really get to anything complicated enough to justify 'interesting' code, and flash handled most of the hard parts.

What did you learn?

Probably the main thing I learned is that I need to learn the flash libraries better if I want to be able to use them quickly.

Things I already knew and was reminded of:

  • I need a better workflow for using my compiler, compile-run-test is annoying.
  • I need to add support for SLIME Autodoc
  • I'm not very good at estimating project time.
  • I need to implement (or port from sicl or sacla) more of the CL standard library
  • The compiler needs to be smarter to reduce the chances of generating code that will be rejected by the VM.