DuDuHoX with sound: OpenAL

Working on DuDuHoX is increasingly difficult. I’ve thought about giving up on some problems I had, either with code or libraries.

Putting animations into the game was too complicated. The engine I did has no intermediate state, i.e. the player can only be in a single square at any given time. There’s no data representating the player being half on a square and half on another.

My solution to this was to put the animation data in the interface code (OpenGL). After hitting a key that moves the player, the engine will be in the complete new state, but the interface will block input until it finishes showing the moving animation.

Another big problem I has was when I decided to put sounds in the game. My goals are: background music and positional sounds. I’ve found the OpenAL library for that. It’s made in C and there’s a Haskell package that makes the binding.

But, everything is a surprise. To install OpenAL in Windows is real complicated. I’ve spent an entire afternoon trying to do it. When I finally did it, I realized that the ALUT package was also needed. This one was easy to install, but then I started receiving link problems during compilation. Good thing I’ve found a GHC bug reporting exactly what I was going thru: Ticket 1243. After patching, everything went fine.

I made a music in OpenMPT, drew the player in GIMP and put it into the game.

Despite the difficulties, I’m very happy with the result I’m getting by doing DuDuHoX in Haskell. I’ve recorded a gameplay with CamStudio to share with you: