I generally have only a limited amount of time each day to devote to projects that don’t directly relate to life-maintenance or my job. Lately, my job has been eating up a slightly higher than usual amount of time, and I’ve developed a new goal for the new year: to create and release a video game.
Yeah. I know.
However, even if I fail at it, I’m building this game in Java, which I’ve never programmed in before. So, regardless of anything else, I’m learning a good deal, at least.
I figured I would start writing a bit about my experience designing and programming a game, and describe my roadmap and to-do list, so as to keep the blog active and still feel like I’m doing something toward the end of completing this game. Join me below the fold, if you’re interested!
Several months ago, I discovered the procedurally-generated platform game Spelunky. I discussed it with a co-worker, and mused on how difficult it might be to build a randomly generated platform game that is still traversable.
I have long had a fascination with procedurally-generated video game content (see my love letter to the roguelike, or my SSA filler post about Shiren The Wanderer). By “procedurally generated”, I mean the game environment isn’t actually designed, per se, so much as built by a random number generator and a series of rules. Games like Diablo feature this heavily — every playthrough, you’re running around in different dungeons built out of hand-crafted setpieces that you might see dozens of times during the run of a game, stitched together to make each level relatively novel. The monsters you fight will be somewhat randomly generated — or at least, randomly chosen from a list of designed monsters. That is procedural generation — random content that isn’t completely random, but random within certain constraints.
I guess part of the reason I like roguelikes or other procedurally-generated video games is that I normally have a drive to complete games at as close to 100% as possible, and just knowing that it’s literally impossible to complete infinite dungeons helps curb that drive.
So Spelunky with its randomly generated platform engine gave me an idea. There are a few other sorts of games that I absolutely love, like retraversal platformers, but lament that they’re so short and have such limited replay value — like the Metroid games, the Castlevania games for the DS, or even the venerable Castlevania: Symphony of the Night. But those maps that are created for those games have certain elements about them that could theoretically be reproduced by some very clever random generation. And with random generation, I could enjoy this sort of game whenever I want, at the scale I want — a small dungeon, or a big dungeon, or anything in between.
I decided to pick up Java, libgdx as my rendering engine, and do something I’d taken a few stabs at in the past — building an honest to goodness video game. I had a concept, so I decided to see if I could build a proof of concept.
A randomly generated Castlevania-alike would require a procedurally generated dungeon. There would have to be clear area delineation, with retraversal to get to other areas and rewards, a general progression in difficulty curve commensurate with the experience and levelling and gear granted, and secrets galore.
So I built a dungeon map generator. I’d say that short of a few rough edges, or attempting to build something even more absurdly complicated like shaping dungeons to be less radial from the point of creation, this map generator is pretty much complete. I built a map screen that probably won’t represent the real end result map screen, mostly just to visualize my random map generation as I progressed. Here’s a pic of its current state:
I’ll perhaps do a post up at some point explaining what all of this is about. There are save rooms (green/black), transporter rooms (pink), boss rooms (black/yellow), locked doors (color-coded to the key level required), and an end boss in a 2×2 square area. You start in a 1×2 room attached to the right edge of the screen (on generation, this first room will randomly attach to the left or right edge).
Some more factors to take into account are that there would have to be something like permadeath, to give you a real challenge in fighting your way through dungeons, while still ensuring that the players feel a measure of progress through a game. And there should probably be a hub-world, or village, something like the village in Chocobo’s Dungeon or Castlevania: Order of Ecclesia, with helpful characters being unlocked as you complete each dungeon and defeat each major boss.
But I suppose to get any of that, first you’ll need an actual platform game engine. And I have a pretty good start in on that too.
This is not randomly generated yet, but I figured out how to start creating a TiledMap resource that this game engine can read, so at some point I’m going to start building those randomly generated rooms. For now, I’m in a bit of a testing jungle gym that I’m loading from disk.
So far, I have collision detection on flat surfaces working properly. Collision detection kinda sorta works on 45-degree angle tiles, but needs a good bit of work to make presentable. Gravity works, and jumping works. The character goes into a special fast-fall animation when falling too far, and will land hard with a three-point landing state after hitting the ground from that state. My animation engine is adapted from the default libgdx to allow for more complex animations with display-times per frame, so I’ve actually gone significantly beyond the game engine I’ve chosen. The tileset is something I took an hour to whip up, and isn’t likely even the final game size — it’s 32×32 now, but I might change it to either 16×16 or 24×24. And the background is just something I grabbed from OpenGameArt.
I started originally roughing in the game using sprites ripped from Castlevania: Order of Ecclesia (Shanoa is an incredibly detailed sprite — her standing animation alone is ten frames!), but decided to rip it all out and use Poser to rough-in my animations until either I get around to doing the pixel art for it myself, or possibly attracting / hiring a pixel artist to do the art for it properly. You can tell that I’ve only just ripped it out at this point in the dev, because the bounding box around the jump animation is still keyed to Shanoa’s jump frame dimensions. Remind me to go edit that, self.
I actually have most of a plot in mind for the game, too. It will involve mythology, mostly Japanese mythology for the main plot but with a whole hell of a lot of every other mythology for bosses and minibosses and enemies. It will involve skepticism and atheism, because I just can’t help myself. It will feature a female protagonist in the role of generalized, omnitalented badass, because every other game in the world is apparently incapable of letting you be a female protag without also making her somehow stand out from the “default” of male, or throwing her into a dungeon to be rescued or a refridgerator to be plot motivation, or hiding her behind a really expensive goal on the project’s Kickstarter page. It will have cutscenes, and it will have an actual backstory for the protagonist. And I’m also debating whether or not to include non-game-engine puzzles, something like Fez’ or Commander Keen’s alien alphabets or button input puzzles. Something that you might notice and wonder about, but not have it occur to you that it means something special and that you should probably try to figure out, which would enrich the game.
But I’ll spare you all that for now. Perhaps that’ll be another post!
This poor game doesn’t even have a name yet, much less a name for the protagonist. I have half her backstory and the plot of the game fleshed out in my brainmeats, but I don’t have any names for the most important parts of this game yet. I gotta get on that.
Meanwhile, two roguelike platform games have already come into existence: Chasm and Rogue Legacy. This suggests to me that either I make this game now, or never.