64DSC - 10

Posted by Tien on April 20, 2014, 4:19 a.m.

This is an archive, stream of consciousness style, devblog of my adventures trying to code up a game for the first time.

The illusion of progress.

Today I thought I'd walk you through my level design process, in a vain attempt to get some levels designed. I'm having too much fun trying to get to the Mun to sit down and work on this game. I have several aids to help me with the level design process. It all starts off in Paint.NET, where I mess around and try to come up with interesting scenarios/levels. Here's one level in progress:

The levels are 33x18 tiles, with each tile being a 16x16 pixel image. On the bottom left is my color reference for the different gameplay elements. Most of the colors aren't ever going to appear in game, but they are needed to differentiate different elements (e.g. stone vs pit). The lone black square denotes the center of the window, as that is where the player starts on each level.

Once I have a rough sketch in mind for how I want the level to appear, I transition to Excel. I messed around with the Conditional Formatting tool to color the cells based on an integer value. Again, the colors don't matter, as long as I know which one maps to which gameplay element. As you can see for this level, there are only two layers, Red and Green. This level is a work in progress, and currently has no actual win condition. The dark yellow tile represents a pit, which is impassable terrain. The black tile (ID 9) represents the exit. There is no designated entrance, as the player always spawns in the middle of the first row.

Once I am content with how the level is mapped out, I convert it to game code. Every level is hard coded in the game, since it was easier than trying to manipulate a data file (and safer). I'm planning on releasing the source to Chromothymia after the competition is over, which would include all of these tools. On the left, in the image below, you can see the excel data copied directly into Notepad ++. I created a quick and dirty Python script to change this into the Java code (an int[][]) for direct copy. It strips out all the whitespace, and inserts '0's where the white path would go.

I then playtest the level, and find out how good or bad it is. Usually I have to rework the level 3-5 times before I am content to let it be. I've had to completely scrap about half the levels already, as they were either too complicated, or too similar. The story may be the hardest thing for me personally on this project, but the levels are the most time consuming. I have a very limited schedule, and so I need to make sure I finish all necessary levels. Below you can see what this level might look like in game.

You may notice a peculiarity: the level is inverted vertically compared to how I mapped it out. This is unintentionally intentional; a feature, not a bug. I'm pretty sure this is because of how I'm implementing the tile system. The coordinate system is Cartesian for the OpenGL axes (0,0 is the bottom left corner). Because my layer code is inverse of this, it is inverted in the game. I really like this aspect, though, as most games have the player moving in the upwards or rightwards directions.

And that's it! If its this easy, why don't I have more levels done, you ask. Well, chalk it up to my laziness and procrastination. I rewrote the story, and I have 21 individual sections. The last 5ish will all be displayed one after another, so I really only have ~16 levels to create. This may change as I revise, but I don't imagine it would be significantly more. If anything, there would be less panels as I make it more concise and fluid.

In other news, I have more or less decided on the sound design. I found one artist whose music I instantly fell in love with. I've talked with them, and have gotten their permission to use their music in my game. Once I work on the audio a bit more, I'll make a post detailing their work and how I am using it. For now, I will stop writing and crash. These blog posts are getting longer and longer, but I'll just blame Acid for forcing me to include screenshots (the lazy mans way of producing content). See you tomorrow.

Comments