Sinkhole Postmortem

This past weekend I participated in my third Ludum Dare. I created an HTML5 game called Sinkhole from scratch in 48 hours. It was an awesome experience and the game didn’t turn out half bad either. Last time I had just launched The Last Rocket. This time I had just launched Chunks, a native port of my previous Ludum Dare creation.

The theme this time around was Alone. Unlike the previous two Dares where I came up with three ideas and then slept on them before starting, this time I had an idea I was really excited about and after only half an hour set to work.

The first three lines of my notes from that first night read:

  • top-down
  • exploration by flashlight
  • something moving in the darkness

I wanted there to be an urgency to the exploration. I wanted the antagonists, the stalkers, to be unseen. Let the players’ imagination do the heavy lifting.

I also knew I didn’t want to have to worry about level design so after bootstrapping the JavaScript framework I cobbled together for the last Ludum Dare I started researching cellular automata and pathfinding so I could dynamically generate solvable maps to use. I managed to get the skeleton of a solution working (ported from C to JavaScript) before bed the first night.

While falling asleep I started imagining the stalkers’ behavior. After a short delay a stalker appears and attempts to sneak up behind the player. Facing the stalker causes them to freeze. Shining a light on them causes them to flee. But every time one flees another, slightly faster, stalker spawns. The player solves their current problem at the cost of future safety. More impetus to find the exit quickly.

In addition to the unseen threat of the stalkers, the player’s defensive and discovery tool, light, is limited. The flashlight’s batteries drain in one minute. Matches burn out after 3 seconds. It takes time to load a new battery or strike a match. During that time visibility is nil. Or rather, you can see the stalkers approach but not the player or the walls of the level. Once the player runs out of light sources and their eyes adjust only slivers of walls are visible on the periphery of their limited cone of vision. The player must rely on these subtle hints and the minimap to find another battery or matchbook to buy them some more time to find the exit.

I eventually fell asleep.

I woke up to the realization that I had attempted (and abandoned) a very similar mechanic during my first Ludum Dare (the original Chibi Pan & Pup idea).

Shaking off the thought of repeat failure I quickly implemented a TileMap class in SI2d.js and a way to crop the viewport allowing the “camera” to follow the player as they moved across the map. I revisted the touch-based controls then created some rough graphic masks to start implementing the different sized beams of light that define the gameplay. Minimaps came quickly. Around this time I realized that the framerate wasn’t going to be acceptable on the iPad and implemented keyboard controls as well.

Power-ups, a compass to reveal the exit on the minimap, batteries and matchbooks to recharge your light supply slotted in pretty easily. Stalkers gave me a bit of trouble initially. They needed to spawn outside of the players cone of vision or else they would flee immediately.

The story arrived in the form of four tweets that became the prologue:

Tomo the Cartographer was on a routine survey mission in Central America when the earth opened up and swallowed him whole.

Miraculously, he survived falling hundreds of feet and walked away with only a broken arm.

Guide Tomo out of the sinkhole before he runs out of flashlight batteries or burns through all his matches.

It will be a lonely climb back to the surface. At least, Tomo thinks he’s alone. He hopes he’s alone.

Around midnight the second and final night I started on the artwork. Like all of my games to date I limited my palette to only colors the NES was capable of producing. Tomo came together quickly, based largely on the Link sprite from the original Zelda (with a strong Mega Man influence). I used Mario from SMB3 as a referene when drawing his vine climbing animation. I had to redraw the power-ups and background tiles a few times but I eventually arrived at something I was happy with. I had a lot of fun creating the onomatopoeia bursts that represent the stalkers.

The remainder of the last day is a disjointed blur. Lots of revisions to stalker behavior. Persisting inventory between levels. In a remarkable moment of clarity I coded, from memory, in one go, an error-free JavaScript port of my Objective-C TextMap class. This allowed me to get some of Tomo’s internal dialog on-screen while playing.

The title screen graphic was a happy accident. While trying to draw grass hanging over the edge at the top of the sinkhole I accidentally turned off (or on) another layer producing the masked out, moss-clinging-to-the-sides effect you see in the finished artwork.

By the end of it all I couldn’t see straight, my own eyes were anti-aliasing the pixel art I had slaved over. But it was totally worth it. It’s creatively rejuvenating, knowing that you just created something, non-negligible, largely from scratch, in just 48 hours. If you participated in Ludum Dare, please play and rate my entry (I’d love any feedback you have as well)!

I’ve been continuing to develop the game in the days since submitting. Improving collision detection, softening cornering, improving keyboard responsiveness, adding Gamepad API support, refining power-up frequency and distribution, tuning stalker behavior. Maps no longer regenerate every time you die. The minimap remembers previously explored areas. Inventory reverts to its unique pre-level state rather than resetting completely. Play the updated version of Sinkhole. Who knows, maybe someday there will be an expanded native iOS version.

Meet the Developer
The Last Rocket Suite
Shaun Inman
December 21st, 2011 at 10:46 pm