Clean Code and Other Mysteries
Ludum dare. No, it’s not a Latin incantation. Well, it could be, but to the best of my knowledge, it isn’t anything too evil. It translates to ‘to give a game’.
To sum it up; an entrant, for the case of this blog, me; has 48 hours to build a game, from scratch, using no outside assets at all.
There is a more relaxed version of Ludum Dare, called the ‘jam’ that, in contrast to the ‘compo’, gives you an extra day. It also allows you to create in teams, and use outside assets in your game. However after years of watching some of my favourite online personalities enter I decided to show myself that the challenge wasn’t beyond my scope.
Let’s pretend it all went swimmingly, because of course, on my first run through it would turn out I’m just naturally a world-class developer with the skills to pay the bills. Or I could confess that my bravado didn’t exactly qualify me for a job at Apple. Yet.
Organisation is a Wonderful Thing
In the days leading up to the competition the theme voting started.
Therefore right up until the announcement I decided that it would be wise to have at least one idea, even a really bad one, for every theme before it began. I promised myself a few hours on Friday night to put together some form of loose fit of a game.
It didn’t need to be perfect, or even functional. More I wanted to know that it felt, at the very least, comfortable. I knew going in I’d be staring at these little stick men for two days so I knew I wanted to like them.
I allowed myself a few hours on Friday night to flesh out what I could before my ‘point of no return’ the next morning. Luckily, the theme was broad enough and my enthusiasm held enough that I decided to push on through.
I had a plan. I had hours marked out for everything from completing the core mechanics to designing audio and building 3d models. Saturday was marching along and so was I. Even little slips here and there in my code that I couldn’t figure out didn’t phase me. I motored through right through until the early hours of Sunday morning.
Two very late nights and towards the ends I could feel tiredness impacting on my coding efforts so I broke a little from the schedule, opened blender and made some models to replace the primitives that existed in the scene up until that point. Salvaging the evening felt like the smart thing to do.
Sunday Morning, Coming Down
Sunday morning, rise with the lark. Think I’ll stick my nose back in to clean the code up. I knew I was making a mess towards the end of the evening. The mantra for this whole exercise was getting one core mechanic working well and make it pretty and immersive.
But the 4 – 5 Hours of sleep per night was starting to catch up on me. I noticed I was slipping, things that I had brushed off as “tomorrows problem” were very quickly now problems. I wanted smooth camera movement, I wanted a full-fleshed UI. I wanted a game that professional studios would have taken at least a few weeks to put together, by myself, in just forty-eight hours.
It was dawning on me that I would probably have to sacrifice a lot of the more extravagant features for a more solid core.
I quickly disabled what work I’d done on ‘build mode’. AI was a definite no go.
I tried to look at what I’d done. I quickly learned that the best way to confuse myself was to do what made the most sense. Just keep writing code. I wrote everything, sure’ly I didn’t need a good comment structure. I’d remember what everything did. it was only 48 hours.
Let me make this abundantly clear. If I’m rushed. I might not write abstract classes for everything I intend to do, but I will never, EVER omit a comment again.
The sun starts to set early at these higher latitudes as the year draws to a close. I could feel the sun disappear as I grew more and more conscious of the deadline. Honestly, it felt like my chances were gone. But I refused to give up on this. Everyone has had a first Ludum Dare and I was no different.
Everyone had the same amount of time and the same access to Google’s archive of all the problems we were going to face. I committed. Fully. No matter what mistakes or bugs were there that game was getting submitted and was at the mercy of the internet to judge. If nothing else I would learn to judge the scope of a deadline-based project.
But vanity has long been a fault of mine. I cut the fat quickly, and viciously before finally, I opened blender and decided it was time to build my main character. I wanted to create a beautiful ‘unit’. Something that lended character to the game and was in-line with the other modelling I’d done, but better. My signature.
In retrospect, this was a terrible move. I lost hours to a model that in the end had misplaced normals and rendered the texture invisible in parts. I had sacrificed all my time for the audio and sound effect and even the ‘explainer’ so players knew what was going on. I looked at the clock. I settled for text spash screen and I made my builds.
I watched, a little defeated as I uploaded the builds right here to hackerspace, in a folder distinct from the main body of the website and updated the game page.
I ticked all the boxes to confirm that all of the work was my own. Not that that would ever be in question given some of my more ‘non-standard’ coding practices and naming conventions that thinking back, maybe I didn’t stick to as strictly as even I would like. I closed my laptop, and I got some. well deserved rest.
Overall the experience was beautifully chaotic and exactly what I was hoping it would be. If you’re interested in checking it out for yourself, you can visit the Ludum Dare page and maybe even give me a vote.
But most of all I’d love to hear about your experiences with game jams or similar projects. Have you ever entered? Ever thought about it? What’s stopping you from sacrificing your weekend Netflix binge.
Drop a comment below.