Programming Games Is Really Hard - Apozem Blog -
Switch Lights

The lights are on

What's Happening

Programming Games Is Really Hard

College can be cool sometimes. There's a lot of work and tests involved, but occasionally you get to take interesting classes. This semester I'm trying my hand at programming by taking an introductory-level course on programming. It's nothing complicated. The stuff we write would have been laughed at in 1975. It's simplistic.

We're learning the basics of Java and object-oriented programming. That probably won't mean anything to people who don't program (in fact, non-programmers can skip this paragraph). Those of you who do know programming or work in IT, you can laugh at me. My programs still run from the command line with String[] args and use simple input/output. A typical assignment in class involves putting together a .jar file with maybe five or six classes that are linked in some way. We don't even use Eclipse... class is taught in jGrasp, an IDE that's geared more towards beginners and students. To date, I think my single longest method was 147 lines. We just finished implementing exception handling for the first time.

The program I use for programming

Non-programmers still with me? Good. The point of the last paragraph was that I am learning how to write code on a small scale. The most complicated game I could create is probably a short text adventure.

Taking this class gives me a hell of a perspective on programming. I spent about three days trying to write, compile, and debug a program that was around 800 lines long. It was difficult and required most of each day. Unreal Engine, the driver for most modern console games, has more than 2 million lines of code in it. And that's just the engine. It doesn't even count all the code the developers write in addition to Unreal for the specific game.

Modern video games are huge.

This might seem like an obvious realization. Sprawling virtual worlds like the Capital Wasteland and the Citadel don't create themselves. Of course large video games would require a lot of programming. However, this is like looking at a mountain from a hundred miles away. You can tell it's large, but you can't really get a sense of its scale without getting up close. Writing simple programs is to me like moving closer to the base of a mountain of code.

Creating virtual stuff takes an amazing amount of work. Consider the simple dialog selection, like in Mass Effect. You have to write code to play an audio file (probably a question from an NPC), display the correct subtitles on the screen, and present the user with a menu of choices. Each choice has to be correctly labeled and perform the appropriate action when selected. The game also has to record the user's choice and add appropriate Paragon/Renegade points.

After writing this theoretical dialog selection, you have to go through the code to find the errors. Programs often contain hidden problems, referred to as "bugs." Debugging can be lengthy and tedious. You have to do every possible action to make sure that everything works... and things rarely work as they should.

That's not all. Simply having a game without glitches is just the beginning. Once the game works, then you have to start worrying about all the things that the players see. Is the game fun? Is it balanced? How's the pacing? Are the mechanics unique? Is the difficulty right? It's like a whole new level of work atop the monumental achievement of creating a working video game.

The worst thing in the world for a developer is to make a mediocre game. Imagine working for a year painstakingly writing line after line of code building a virtual world for the player, debugging that world, making sure that everything works, finally releasing, and then eating middling review scores. That would frustrate the hell out of me. "This isn't mediocre!" I'd shout. "Instead of looking at the broken stuff, look at everything that does work!"

BioWare has to be furious.

So as you play a game this week, take a moment to appreciate the stupendous work that went into creating it. Try to think of all the time and effort that the developer spent building a bit of software that you might complete in a few hours and never play again. If you're feeling up to it, send a thank-you letter to your favorite developer telling them that they did a great job. Developers appreciate their work being appreciated.

It's crazy how much work goes into creating games. We should make every effort to thank developers for building such entertaining creations.

What do you guys think? Do you ever think about how complicated games are? Does anyone work in IT and feel like laughing at my primitive Java programs?