Gravity Grid Dev Update: Infinite* Levels

As if there wasn’t already enough stuff to worry about, Java imposes a pretty hard limit on the size of its methods which means pre-built and shipped levels are going to be a thing of the past. Sort of.

Let me explain.

Originally I thought it would be cool to hand-make a bunch of levels and ship them with the game. If they’re hand-made then of course they’re going to be fun, right? As it turns out, the fun comes from solving the puzzles, and the added benefit of hand-making them really doesn’t end up being anything. Unless you want to count the work it takes to build a level from scratch, because that takes a long time.

I decided to write a level generator pretty late in the development of the game, after a conversation with a colleague about some ways that it might be possible. The level generator was originally a standalone CLI app, and I spent many hours tweaking the settings, building levels, and pasting them into the Gravity Grid app to ship. Fifty levels were fine, a hundred were okay, but as soon as I tried to mimic what a future update might look like and ship 300 pre-generated levels, I ran into a “everything is awful” Java error. And rightfully so: the OOP goddesses would surely vomit if they saw how I prototyped this game.

Polishing takes a long time

Perhaps the most productive aspect of this whole endeavor is the aha moment I had as I was up less than 5 hours ago trying to build a new level handler class: polishing takes a long time. The same was the case when I published Burrow; after the project is done, then the hard work begins. It’s hard work at that point because you think you’re done, the end is in sight, and every time something new comes up you want to throw your hands in the air and just say, “screw it! ship it as is and we’ll fix it later!”

But we’re not a AAA company so we can’t do that.

Instead, I have learned to become cautiously optimistic about my deadlines, which are themselves arbitrary because I have a full-time job already and other full-time commitments (you know, like three kids and a wonderful wife and research and my PhD and two books I’m working on). Polishing in every project is important because even after we cut the mold there is a great deal of finishing to be done before it’s ready to be shown to other people. Sometimes as builders we know what the end result can be and ought to be, and we let our imagination blind ourselves to the raw presentation our product has when we bring it to the real world, to people who have never seen it before.

Infinite* Levels

The end result of putting a level handler and generator in the main game is the opportunity have an infinite number of levels. Technically, you can have upwards of two million, but I doubt anyone would make it that far. Who knows; maybe in the future we can get a leaderboard showing everyone’s highest level completed. For now, though, it seems that the polishing phase has shifted from verifying that the pre-built levels are fun to play to ensuring that every iteration of level the generator could create turns out to be a fun level.

And that, my friends, is why polishing is so important. You can take a good product and make it great.

Leave a Reply