Monday 22 August 2011

Ludum Dare "Dummy" attempt

I've never done a restricted time game session before - of any kind.

I'd been thinking of seeing if I could make a game in a weekend for a while, when I noticed (probably from the Twitter feed of Notch - Minecraft's creator) that Ludum Dare 48 hour competition was to take place last weekend.

So... armed with only a distantly fading memory of making 2D platformers on the Amiga... I thought I'd give it a go.

I decided immediately that, having never done anything like this, I would not be officially entering the race (seemed kinda wildly pointless). But I would otherwise stick to their rules, and develop my game alongside everyone else (time-wise).

Tools I would use included XNA 4.0 (never written anything with XNA before this), a little sound app called sfxr, Paint.Net combined with ASESPRITE.

"sfxr" i actually discovered during the weekend, while watching Notch's own LD feed. It's a great little app for making square, sine and sawtooth sound effects, combined with other after-effects applies (stuff that a DSP would give you in hardware, all done in this fab little software tool).

So, what did I achieve?

Well... I made a game. Of sorts ;-)


It is "complete" in the sense that you can play it through from start to finish, and win (you do so by collecting all the coins, which then opens up a special escape room that you can't otherwise access).

It's also pretty dire :-D

In fact, it turned out the most problematic part for me was doing the graphics. Years ago, I was fairly proficient at average quality sprites, but I realised (while doing this LD dummy run) that I used to take *ages* to make those. Trying to get quality out of 48 hours worth on graphics *alone* would probably be unlikely.

You can see this from the game itself:

http://www.youtube.com/watch?v=KWIz_e7Upt8

(Note: terrible updating and weird coin animation are down to the screen capture software... although the animation in the game is nowt to write home about anyway ;-))

So, I finished a (rather crap) game in under 48 hours - and in all honesty, not even focusing on it for most of that time...

So what did I learn from all this?

1. Dedication

As I just mentioned, my focus was not entirely on the project. At all. And on the first night, I even had some wine (which was a terrible mistake! Alcohol and coding do not mix at all well for me...)

Next time around (when I plan to actually enter one of these things), I will put aside the entire weekend - making sure shopping, clothes washing, etc. is all completed - so there is nothing else other than the game.

2. Graphics (specifically pixel art) practise

Boy, do I need this!

Watching people like Notch do this, you can easily see how they achieve their effects, and that can make it seem much easier than it actually is to do this in a short period of time.

Those people have been doing these sorts of events for years. They've picked up skills. I need to hone mine overall, but nowhere more significantly than on the graphics.

(A side remark about this from a friend, in answer to my own knocking of the graphics, was almost enough to demotivate me completely from the project... I did not expect that, but then... I didn't expect to be this crap at it either. So noted for future).

So, before the next competition, I will be practising making sprites. Lots of sprites. Also, rather than just importing individual .png files, I will probably attempt to write several sprite sheet importers, just for the practice of doing it quickly. I lost a fair bit of time adding endless variables to store textures in, simply because I hadn't thought the animation frames through from the start.

3. Random enemies == BAAAD!

I knew from the start that I was going to procedurally generate some of this game, both because I thought it would be easier, but also because the game I had in mind early on was derived from an ancient Dragon 32 game called Android Attack (which itself ripped off Beserk):

http://www.youtube.com/watch?v=hFYXnFkNoZQ

Turns out that in coding (and ultimately gameplay) terms, this was the single worst decision I made.

The added irony is that I could have so easily placed the enemies in the level files, since I made code to load in bitmaps for that! (And then added the coins in that fashion).

I did add some allowance for the player's start position at the beginning of the game, so the enemies would not simply appear on top of him (before that, you could end up in a Jet Set Willy style infinite death loop right from the first moments!)

Even with that, I did not make the game generate the enemies when the player first enters the room (allowing for his initial position), so it was still possible to die on first encountering a room. However, even had I added this, because each room has multiple doorways, and because I stored all enemy positions for each room so they would be in the last place they were when you last entered, it would still be possible to enter from a different door and get trapped.

Proper placement of *designed* enemy starts and paths would have eliminated this pathetic design flaw.

I will only ever make randomly placed enemies in future, if and only if the play area is a large open space (i.e. devoid of close-knit walls and passages).

BIG lesson learned there!!

(To be fair to myself, in all the games I used to make years ago, I never ever made any that relied on random positions of enemies: they always had level designers of some form).

4. XNA is easy peasy... but you still have a learning curve (even if tiny!)

The hit I took for learning XNA as I went was actually pretty small. But I expect this to be almost non-existent in future attempts.

I am, for example, unsure of the best way to load sprite banks, and need to find that out before another game is done. (I was loading all textures individually, although associating them with loops for related stuff - the exception to this being the main character. I need an established pattern for that, but this is my own issue, not XNA's).

Also, I - at the last minute, of course - tried to run the game on the Xbox 360 - only to find that both the resolution was wrong, and also that (even with rez independence) I could not persuade it to offset the top left of the screen correctly.

Little things like this cost valuable time on the project. You could argue that it was possibly made up for by many other things simply being done for you (some function argument discrepancies between floats and ints annoyed me, but I could see why they made the decision - and you don't want endless API overloads for a compact console Made For Idiots game system :-D)

Conclusion

So overall, I think all of this stuff can be addressed with some small game experiments in coming weeks, in my spare time.

Once I have formed regular patterns for 48 hour shots of time, then I am pretty certain I can make decent to very good 2D games, within only a few more attempts.

However...

Notch's game also made me want to try other stuff, like the pseudo 3D Wolfenstein / Dungeon Master type games that he often does. It should be noted, though, that Notch doesn't always succeed at these (his last attempt was a big fail, unlike this one), and he's been doing games like that for years and years...

So, maybe I should try that type of game as a dummy run of its own.

And then of course there are proper 3D games. I know for certain that my inability to model anything would be a HUGE hurdle for those (even outside of 48 hour competitions!) - so I think I will take such things slowly...

(Or just go for really basic, ultra-retro abstract shapes... But that could get wearing very quickly ;-))

My game from this round - just called "Escape!" (this being the theme of this contest) is a success in terms of my completing something recognisable as a game, but an epic failure as anything you'd really want to play out of any kind of choice.

But it has awakened in me a desire to do many many more games... and that was something I thought had long since left me.

This can only be a totally fantastic development :-)

EDIT:

Should you be a mad freak, who wishes to discover all the weaknesses I never mentioned in this article, then here is the game.

You will also need:

http://go.microsoft.com/fwlink/?LinkId=199021

and

http://go.microsoft.com/fwlink/?LinkID=148786

to make it run.

Then just grab this... you sadist :P

http://dl.dropbox.com/u/12219256/escape_thing.zip

(let me know if it fails... seems XNA doesn't want you to try it out...)