Added Level files

I’ve never before written down what the final plan for Squares Game, yes that’s still the title, really is. Briefly speaking, there’s going to be a story mode, where there are a bunch of different “levels”, and an exhibition mode, which just gets harder and harder until the user dies.

Implementing the exhibition mode isn’t very hard, although getting everything just right is quite difficult. All I need is a formula that, over time, makes the barriers grow, increases the amount of hunters, decreases the amount of healthpacks, increases the amount of damage the player takes, and so on. Like I said, implementing this is simple, it’s just making sure that it’s fun that’s hard.

Implementing the story mode is much harder. The problem stems from the fact that it isn’t entirely about balancing gameplay, but needs a huge variety of interesting content to be made. The actual content creation is going to be a challenge, but basically it boils down to creating a bunch of different levels. The structure of the game is, quick text based story explanation with background image, then next level. Rinse and repeat until the final level. A simple, and easy way to provide engaging content. What we need though, is a way to actually store and play the right content.

I’m going to be focusing exclusively on the actual on-field action here, or the in-game levels.

It’s important to realize that technically speaking, we don’t actually need to have files that store the levels, we can just hard code this into our program itself. For example, let’s say we have two levels in our game. These levels have varying amounts of hunters chasing the player, health packs to pick up, time he needs to survive for, amount that the health packs heal him for, differing damage from each enemy, and many other differences. Now, we could write this all in code, such as:

//for the sake of clarity, I’m just going to write everything on one line.

if (level == 1){

numHunters = 3; huntDam = 5; numHealthPacks = 4; packHealth = 6; boltDam = 7; time = 50; burnDam = 1; …

} else if (level == 2){

numHunters = 2; huntDam = 2; numHealthPacks = 1; packHealth = 6; boltDam = 5; time = 60; burnDam = 2; …

I don’t think it’s extremely hard to imagine that this is basically a huge irritant even with two levels, let alone 20. In order to simplify this, what I did was create a text file that contains all the data, and then made copies, changing the data a bunch of times in order to get the different levels. So all I do is load in the right text file, and all the data is initialized for me.

I’d put it off for far too long, but it only took about 3 hours to do. I needed to bug fix it, and then I needed to rewrite a bunch of the program, which was using hard-coded constant global values (values that the entire program can access but not change).

Now that it’s done, I can actually make the levels for the game. Although that’s actually too optimistic, since the levels are probably going to have some small amount of scripting.


This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s