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 http://globalgamejam.org/2011/chicken-egg-situation and probably have a look at some of the other 1500-odd games as well.