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:


One thought on “DuDuHoX with sound: OpenAL

  1. Have you tried using the package http://hackage.haskell.org/package/sfml-audio- ?

    It's a partial binding of the audio part of the sfml library (sfml-dev.org), which is multiplatform (its developers uses Windows) and internally uses OpenAL. It is very simple to install and use and alleviates a lot of the hassle coming with the use of bare OpenAL.

    The binding is developped by Sönke Hahn from Joyride Labs, and they use it in their game Nikki and the Robots.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s