Ruins Post Mortem. Or: How I coded an indie game in a month

8 Aug Features Games and Gaming



6

screenshot9

Indie game competitions are the open mic nights of the indie game scene. Often new ideas are thrown around, games are cobbled together, and blood is shed. I decided to enter one of these competitions, partially out of boredom, partially out of challenge.

The Independent Game Source is a blog devoted to the burgeoning indie game scene. The forums are bustling with new ideas and games in their infancy, the product of many young talented programmers making games that they themselves want to play. No idea is too strange or outlandish when the stakes are low and the game engines are free.

So every once in a while, one of the forum admins creates a contest, sets a deadline, and the rest of the site buckles down to deliver a game. The theme of the last contest, titled “A Game By It’s Cover”  was to create a game based off previously existing box art. I chose this:

and this is the result:

What the heck is it?

The game is a top down, 3d, shooting game. You move with the WASD keys and aim/shoot with the mouse. I chose this because I play shooters all the time and it’s a good control setup, I believe in it.

I’ve wanted to make a game where the sprites are 2D in a 3D world for the longest time, because it allows me to draw whatever and not have to go through the trouble of modeling something in 3D…texture it….rigging it…animating it…and then sticking it into code. Think Paper Mario.

This also means that collision detection is easier, I can use a sphere (which is relatively easy to calculate) rather than a complex hitbox. I can draw more to the screen, since each sprite is only 2 polygons. Also, it has the distinction of looking unique.

How did you do it?

Many people in the competition have the foresight and knowledge to use prebuilt game libraries and engines to make their games.  I opted to code the game from scratch using the XNA framework with C# as the language. C# is C++’s kissing cousin. XNA is a framework that handles importing sound, images,  drawing polygons, and handling input with a minimum of fuss. It takes the low-level hassle out of building a game loop. The downside is that after the low-level stuff, you are on your own. Thankfully there are enough components, such as bounding spheres for collision detection, that a rudimentary engine can be thrown together fairly quickly.

I spent a lot of time pouring over the XNA Riemer tutorials. I re-purposed a lot of the code regarding the sprites and collision detection to work how I needed it.

What went right.

I accomplished what I set out to do.

I’ve wanted to use 2D sprites in 3D for the longest time, and have made several attempts to do so, but have failed after running into problems and then giving up. Having a deadline forced me to overlook flaws and focus on what needed to go where.

I was able to add features as needed.

It’s not often where I think “This game needs a flamethrower” and be able to add it with a minimum of effort. One of the last features I added, flamethrower mode, was only possible because I had written the whole thing from the ground up and knew what bits of code to stick where to make it happen.

I was able to get to a point in development where tweaking the design came into play

Typically my projects, when nearing completion, get all the necessary requirements to count as a “game” and then are handed in unceremoniously. For Ruins, I had enough time to consider what the player was doing and how hard the game was to new players, and I tweaked settings to make it somewhat fun and challenging.

What went wrong.

The code is a mess.

Basically instead of adding new classes and functions as needed, I threw it all together and tacked on if statements and for loops where needed, so game1.cs is a huge freaking mess. Why? Laziness mostly. Near the end I was able to Control+F and find the code, but this made things needlessly complicated. It meant that adding new features was tedious and error prone. It also means that a lot of the code I made won’t be reusable.

What documentation?

Every once in a while I would comment on what a function does or what a variable stood for, but this was few and far between. When you’re programming often you figure out the solution, which means putting 3 bits of code in 3 different places, so you jump to the next bit instead of sticking around and adding a comment. This means that nobody understands what the code does, and in a few months when I look at it again, neither will I!

Did not realize original idea.

Originally I had a multi-level game planned out, but had to scrap it in favor of a 1-room “deathmatch” game. This was mainly for simplicities sake, so I could focus on gameplay rather than setting up a system for creating levels with complex geometry and hitboxes. It also meant that the game couldn’t have a touching, emotional story that breaks boundaries and elevates the artform. heh.

I want to play!

Download here

Ruins is a game for Windows, compatible with Windows XP service pack 2 and later.

Special thanks goes to the Mefight crew for cheering me on through this thing, and Riemer tutorials for the code samples.

6 Responses to “Ruins Post Mortem. Or: How I coded an indie game in a month”

  1. Niteowl 09. Aug, 2010 at 11:28 am #

    Super duper congrats on this achievement, hellojed.
    Tremendously impressive on so many levels. I think the most complicated I ever coded for fun was a javascript damage calculator for an HL mod. Making a game from scratch kinda blows my MIIIIIND.

  2. stavrosthewonderchicken 09. Aug, 2010 at 9:33 pm #

    This style of game hits all my happy Robotron buttons. Great job, hellojed!

  3. Grither 09. Aug, 2010 at 10:04 pm #

    Yeah, I can’t believe how quickly you put this together and made a playable (and enjoyable!) game out of it! Nicely done.

  4. hellojed 09. Aug, 2010 at 10:42 pm #

    Aww shucks you guys.

  5. Chris Hansen 10. Aug, 2010 at 1:07 am #

    Excellent game, though some of the aiming mechanic seemed odd – though that’s probably just me. I like it though. I like it muchly.

  6. Gemmy 12. Aug, 2010 at 1:07 pm #

    I meant to say this before, but I really liked the game. Great job, good on you!