Global Game Jam 2013

I’ve just finished another GGJ event in Auckland for this year. This time around, the theme was the sound of a beating heart, so the possibilities were endless. I chose to go with an extremely literal interpretation and actually have the game mechanic based directly on a beating heart. Also, my preferred target platform before coming into the event was the iPad so that influenced the design somewhat. The end product is called ErraticCardioGame (a play on ECG).

Again I found myself in a position where I would be working on my own, which wasn’t something I wanted to repeat from two years ago however there appeared to be a relative dearth of game artists and those that were there were already committed to other projects. I resigned myself to the fact that my finished product would look more like a prototype than I would have hoped.

Being a touch game, I wanted to make it *very* touchy, i.e. requiring lots of fingers to be touching the screen at once. One of the theme ‘diversifiers’ was to make a game requiring ten buttons or controls to be pressed at the same time, which I was inspired by, but ultimately I didn’t tick that off as ‘achieved’ as ECG doesn’t really require *all* fingers to be used (only as many as you can manage!)

The idea of the game is to rapidly tap the heart in the centre of the screen which caused blood cells to flow through the arteries into four possible targets: the brain, the two lungs, and the gut. If any of these organs completely runs out of blood supply then the game ends and your total blood cell count is your final score. To help control where the blood cells go, you can keep your fingers on any of the artery junctions thereby blocking them so the blood cells hopefully go somewhere else.

The finished gameplay isn’t completely to my liking, as the lungs almost never run out of blood supply due to the fact that they each have two artery inputs while the brain and gut only have one. The blood cells also randomly choose a new path at each junction (apart from the blocked paths) which means there is a bit more randomness than I would like, although in such a restricted timeframe sometimes randomness is the best way to go at the time. There were also some features I thought of at the start that I ran out of time to implement such as arteries becoming blocked by fat which the player has to remove.¬†As a prototype I think it works well and I’ll try and develop it into a complete game during the year with actual artwork and sound.

I was impressed with a lot of the other games that were developed at the Auckland event (in total there were 18 games). The games that stand out are the multi-player ones, especially those that have a party-game vibe and demand repeat plays. Next year I’m going to aim at doing a multi-player iPhone/iPad game using ad-hoc connected devices and hopefully capture some of that fun.

AAAAAmaze on iPad

The iPad version of AAAAAmaze is now available on the iTunes app store as a free download. It is almost identical to the original Game Jam version except there are two additional monster types and the key colour changes depending on the type of monster that is killed, i.e. it is no longer random. It also features a new retina-quality title screen that Lianne created especially for this version.

The controls are simple enough; you can use one finger if you like for both moving and attacking. Keep your finger on the screen and move it momentarily in any direction to start walking. Lift your finger to stop. Tap anywhere on the screen to swing your key, however you must be facing to the left or right. You cannot attack up or down the screen. It is still possible to finish the game in under a minute if you manage to locate the boss quick enough and you’re lucky with the key colours.

Notes on an AAAAAmaze

Back in January I once again participated in the Global Game Jam. This time I was part of a team with five others, a big difference to last year when I elected to work on my own. I chose to take care of the programming duties while the others all contributed art, music, sounds and crazy ideas, all of which got thrown at me during the course of the 48 hours. I would have to say I had the most fun this year than in the two previous years and met some fab new people.

I programmed the game using a Java engine that I had been developing over the past year or two. I'm somewhat of a proponent of open-source software so I wasn't too concerned about letting my work go free, in fact I would be quite pleased if someone else found value in re-using my engine code for whatever reason. With that in mind, I'd like to write a little about my design intentions while coding the engine.

The full source code for the final game can be downloaded from the Global Game Jam site. First of all, the re-usable engine code is contained entirely within the "engine" package. I used two third-party libraries: JOGL for the graphics, and the Javazoom library for MP3 playback. Playback of WAV files is taken care of by the standard Java Sound API.

One thing I wanted from the start was a flexible and easy-to-use resource management component. Every type of resource (sprites, sounds, and whatever else a game programmer would want) derives from a base type Resource that keeps a reference count for each instance of a resource. When a resource is no longer needed, it's reference count is 0 and it's automatically freed from memory. To keep track of all loaded resources, a ResourceStore class stores all resources of a certain type in a hash map. I generified the ResourceStore class to ensure that only sprites could be loaded into a ResourceStore for sprites, and so on.

Each ResourceStore has an associated ResourceFactory whose job it is to create and initialise a resource. This came about out of necessity at first because it isn't possible to instantiate a generic type directly, for example by calling new T() from a generic class. Therefore a concrete ResourceFactory for each resource type actually does the instantiation of a Resource. In hindsight I should have also let the factory handle the destruction of a resource – at the moment a resource does its own deallocation, which doesn't cause problems but more complex resource types may have problems with it.

All the ResourceStores are contained in the Engine object. The Engine class can be extended if ResourceStores of other types are added at a later stage.

I also wanted to allow different renderer technologies to be used and able to be easily selectable. Each of the two current renderers (Java2D and OpenGL) derive from the abstract Renderer class. You'll see that not all the abstract rendering methods are fully implemented in the two renderers – mostly due to the fact that Java2D doesn't handle alpha transparency all that well so I concentrated more on the OpenGL renderer.

There's one thing that using OpenGL enforces on a programmer, and that is making sure that all OpenGL operations take place on the thread that owns the OpenGL context. This means that all sprite allocations that depend on GL Textures being created need to be performed inside the rendering loop, which is why the game loop waits until it gets to the redraw() method before getting (or releasing) sprite resources.

I had originally designed the engine around my own custom 16-bit sprite format (4 bits each for R, G, B and A) for which I even created a sprite editor program. This was because I was wanting to do Amiga-ish games using a limited 4096-colour palette (yeah I realise the Amiga could only show 32 out of those 4096 colours at once, but I envisioned a fantasy HAM mode where anything was possible). It was later when I lost interest in that idea that I extended the engine to use the 32-bit PNG format, which is why the Java2D_32 and OpenGL_32 sprite formats exist (and the legacy 16-bit format still exists in the code).

AAAAAmaze would be the most intensive application yet for this engine, with the large amount of sounds and graphics that are loaded and unloaded throughout the game. I would love to see how far the engine could be stretched before breaking completely!

"I knew it, I'm surrounded by arseholes!"

Post-Game Jam

During game jam at 1am on Sunday having not slept in the past 38 hours: Gah… I can't believe I'm doing this… this is definitely the last time I'm doing this.

After game jam finishes and project is handed in: Wow! I want to do this again next weekend!

Still alive

Yep, I've been playing Portal again recently. I beat Portal 2 on the PS3 about a month ago and loved every minute of it. Stephen Merchant as the slightly neurotic and bumbling AI presence was great – although I wonder if he's now typecast in that sort of role. On a side note, I always turn on subtitles in games if there's an option. Sometimes the sound effects can drown out dialog at just the wrong time. Also, is playing with inverted Y-axis so unusual that I have to enable it in every single game these days? I'm sure it was the default back in the Quake 1 days.

So I've just finished re-playing Portal on PC (which I played when it originally came out) just to claim some more Steam achievements and see the altered ending. It is still a refreshingly short game, probably the equivalent of two chapters worth of content in Portal 2 so I was able to whiz through it over a couple of days while taking a break from programming. It's definitely easier the second time around when portaling around levels has become almost second nature. I've almost become one of those types who thinks that real life could be made easier with a carefully placed portal or two.

Only a week to go until the release of Dream Theater's first post-Portnoy album which I'm really looking forward to ripping off the shrinkwrap and "importing" into iTunes (why doesn't Apple just use the term "ripping" like the rest of us?) Oh yeah and I'll probably be listening to it incessantly for the foreseeable future.

I've recently been toying with another game project in my favoured isometric graphics style. It's a bit of an abstract idea at the moment and should hopefully be fairly unorthodox if I can actually make it into a game.

Another GGJ gone

It’s two days now since the end of the third Global Game Jam, and my second, so I thought I’d write a little about my experience. The theme this year was "Extinction", so immediately I started thinking about extinction of species and the various mechanics involved with that. Once we had broken up into groups to discuss our ideas, my thought processes led me into cellular automata and how that can represent the evolution of a life system. However, what about abusing the system so that the player can lead it into a state of total extinction? Well it was the seed of an idea that I could develop so I decided to go with that and see who else would be on board with it.

As it turned out, once we had presented our ideas to the rest of the assembled audience of fellow game developers, no one else was interested at all. I put it down to lack of salesmanship skills and decided that I’d go it alone. After all, in my mind it was something that would be mostly procedurally generated and didn’t need any art to speak of so in that regard would primarily consist of raw Java bytecode and nothing else. I was also really interested in seeing how my vague seed of an idea would develop.

Once work proper began that Friday night, I was still trying to think of how to develop my idea as I created my new Eclipse project and configured my classpath. Screw it, I’ll just throw some little virus-like sprites into a grid on the window and apply some cellular automata rules to them and see where it takes me. At this time I was envisaging it as a two or more player game, where each player tries to force the other players’ cells into extinction. While this may have worked as a game, eventually after looking at my rough sketches for too long and seeing the grinning little virus-cells on the screen, I had second thoughts about the multiplayer aspect and the need to write an AI if it was a single player against the computer. Having had no experience in writing even a simple AI algorithm, it was too much beyond the scope of a 48-hour project for me. So if it was going to be a single player-only game, it would need a bit of a redesign to eliminate the competitive nature of it. By this time it was midnight at the Auckland venue and I was tired and flustered, so I packed up my gear and drove home in the category 1 cyclone that had decided to descend on the city and went to bed with thoughts of despair running through my mind.

For some reason I thought of something that someone said that evening involving the old chicken-and-egg chestnut – as in, which came first. Eggs need chickens to incubate them and bring them to term, and chickens are hatched from eggs. It is indeed quite a deep philosophical argument, one which is best left for actual philosophers not programmers so I set the alarm on my Android phone for 7.30 and fell asleep with the trees outside lashing against the ferocious windstorm and threatening to infiltrate my bedroom window in a not too unforceful manner.

The next morning I awoke pleased that the sun was shining and that my bedroom was still intact, bundled myself into my car and drove back into the city. Thoughts of chicken populations were still stabbing at my neurons. What if there were no eggs left in the world? Wouldn’t that lead to an extinction of chickens, notwithstanding recent advances in chicken cloning? What if there were only eggs, and we’d eaten all the chickens so that there weren’t any around to sit on them until they hatched? And how can I make that into a game?

Once I arrived at the venue, the idea had almost taken shape. Eggs, baby chickens and adult chickens (I wasn’t going to use the word ‘cock’ in my game if I could help it, although in hindsight that probably would have been hilarious) would be the ‘cells’ on the game board and the player would try and grow the number chickens on the board. Once I had my MacBook and Eclipse all fired up again, I drew some rough chicken sprites in Gimp and wrote some code to throw them onto the screen in the 10 x 12 game grid. Fine, now to think of some rules to apply to each cell each turn. Thinking of Conway’s Game of Life, I sketched out some rules for eggs, chicks and chickens on paper, knowing that I’d have to experiment with them to get the balance right between rampant population explosion and certain extinction. I can’t remember exactly my original parameters for each cell state, but they weren’t too far off the mark from the final result that I settled on.

By Saturday afternoon and the first deadline for creating the project on the GGJ site, I still hadn’t a name for my project. The original name as I had pitched it the night before was the Game of Death, however the concept had obviously changed completely now. I thought back to when I had started thinking about the concept, and decided on naming it "A Chicken & Egg Situation" for the colloquialism. I later thought of transposing kiwis for chickens and thus going for the "game for a cause" achievement but by then the name had stuck. Maybe I’ll do that if I decide to rewrite the game on a different platform.

Now the game was coming together as an actual game. Eggs and chickens were popping up and disappearing from the screen in reaction to where the player put a new chicken each turn. Rules were molded and caressed into something playable. Originally I had it that two or more chickens surrounding an empty cell would lay an egg, but found that limiting it to exactly two presented more of a challenge. It also needed animation to transition from one cell state to another – for example, chicks hatching from eggs, chickens dying, and so on. I quickly roughed out two frames of animation per cell in Gimp, coded them all into a switch statement and dropped the framerate down to 10 fps so it wouldn’t animate so quickly. It all worked nicely. My sprites really still looked like terrible programmer art though. Luckily a proper artist was doing the rounds looking for projects to help out on, so I asked if she wouldn’t mind drawing up some 2D chickens at 16 x 12 pixel resolution. I gave her the requirements and was promised the sprites by the next morning. Setting aside worries about how it would look, I programmed in an end-game state when your chicken population became extinct. The player’s score would be decided on how many chickens they can amass at once on the screen before it all goes horribly wrong. By 10 o’clock that night I decided I’d had enough and could finish the rest in the remaining seven hours on Sunday.

The next morning I took delivery of the new chicken sprites and threw them into the project resources folder. What I had neglected to communicate to the artist though, was that I now had animation frames and that I was programming the game in four shades of yellow (since I was going for the "old school" retro achievement to make it look like it was programmed for a Nintendo Gameboy). I sheepishly loaded up her file in Gimp, applied the pencil tool to render the multi-colour masterpiece down to four shades of white (which would get translated to yellow in the program) and re-drew my animation frames to match her pixel art. I think in the end I did it justice.

With some time left over, I drew up a title/instruction screen using a pixel font that I borrowed from a different project sitting in my workspace folder and added a chicken squawk sound effect for extra comedic effect when the player starts a new game. Once the 3 o’clock deadline rolled around, I zipped up everything according to the GGJ rules and hit the upload button. Circly-animation thing, then… "HTTP error 0 has occurred". OK, maybe the site is getting overloaded. Try again in a few minutes… same result. What the furry is HTTP error 0? I’ll ask around and see if anyone else is having trouble. Sure enough, it turned out the firewall at the site was blocking ZIP uploads and, being Sunday of the Auckland Anniversary weekend, no-one was around who could resolve the problem. Despite this, the event organisers ensured that all teams had finished work at 5pm and allowed us to upload our games as soon as we could once we left.

What followed was a show-and-tell session for each game, followed by the local voting ceremony where I failed to garner even a single vote in any category except for my own in the category of "best use of an achievement". Admittedly the other games deserved all the votes.

You can check out my game at and probably have a look at some of the other 1500-odd games as well.

join the dots

Got some coding done when not playing new games over new year holiday. Basic control is in place. Starting with one solitary red dot (henceforth called a ‘node’) another node can be spawned anywhere up to 64 pixels away. Both nodes are then ‘connected’. Play continues by selecting existing nodes and spawning more nodes. All nodes that are found to be within 64 pixels distance are connected to each other. Ideally the space inside a closed polygon that is formed by a player’s nodes will be shaded with that player’s colour.

Each node will have a ‘power’ value, represented graphically somehow on the screen. Power can be shunted between nodes at will. This comes into play when another player tries to capture a node; their capturing node needs to have a power greater than the captured node.


Get every new post delivered to your Inbox.