Tuesday, January 12, 2010

Dreg wishes you a noisy 2010

Arrow keys for movement and crouching, spacebar to jump. Use arrow keys while swinging to increase his spin. Hold down spacebar to make the jump last longer. Hit spacebar again when holding on to a wall to wall jump. A is for punch and D for kick. ENTER to interact with buttons and things. S to use objects.

It's a new year! And my Christmas deadline is looking more and more ridiculous!

It's not through want of trying, at least this time, it's mostly through want of skill, but I'm working on that, and soon I shall be an uber-programmer!

This latest update is a case in point - I had an idea of how I wanted to deal with music, but thought it might not work, then I had an even better idea, but had no idea how to do it, then went through the horrendously difficult struggle to understand the tools to make the idea work, a process which took me a few weeks, then the idea worked, but was too slow, so I went back to the original idea, which I set up in about 20 minutes. Hooray!

Though it's never really time lost. Very often I've had a problem that I've tried to solve with the wrong tool (a tool I don't understand) then I fruitlessly toil away trying to fit a square peg in a round hole (or is it the other way round?) until I give up and do it the right way. I feel like I've wasted loads of time, but then a few weeks down the line I come across another problem which requires the tool that I'd so uselessly mucked around with earlier, and the problem is solved effortlessly. So now, thanks to my initial silliness, I can add a few more strings to my hat, and feathers to my bow, and birds to my stone, or whatever the damn expression is (on a side note: since moving to Spain my already tenuous grasp of English idioms is rapidly failing).

Anyway, as you can probably hear (and wish you couldn't), the game now has crappy music, and a couple of crappy sound effects. I need to figure out the best way to record sounds, and make decent music. I'll have another shot at it later. Also, I've only added noises for his footsteps (banging my shoes together - doesn't sound anything like footsteps... *sigh*) and jumps (me grunting embarrassingly into the microphone).

The point so far is to figure out how I'm going to integrate all these things, and I'm relatively happy about that. The next bit gets technical, so casual readers can stop here. Have any of you found all 10 pointless collectibles yet?

< geekology >

So my problem was to keep the size down. A two minute mp3 could add a huge amount to the size of my .swf, unless I made the quality really crappy. So I decided my approach would be to just add the individual instrument and drum loops to the game, then stitch them together within the game. This way I kept the music load to about 700 K, which is still twice as much as the rest of the game put together.

Then the problem became synchronisation. It still is a problem, and you'll sometimes here the music not quite loop properly. It sucks, but the solution I found for it made things worse. But I'm quite proud of it nonetheless.

What I wanted to do was extract the sound data for each loop, then create a new sound file with all the others combined into it. It turned out to be more complicated than I had anticipated, but after the afore-mentioned head-banging, I got it all to work! I felt very proud!

The problem was that stitching the loops together took a lot of processing power, and the game would pause for ages before starting as it worked. I tried all sorts of optimisation techniques but to no avail, so in the end I just went with a sound channel that played each loop when required (but this occasionally leads to the pauses between loops).

Maybe I'll have another go one day and see if I can make the sound combination method worthwhile...

Anyway, enough! I must have lunch!

</ geekology >