Monday, July 27, 2009

Sandytimes (or: Algae Eaters)

"Why, Nikolas, whatever have you been doing this weekend?"

"I'm glad you asked, Mr. or Ms. Sir! I am happy to tell you the answer - for the truth is, I have been making a game!"

"Oh! Fascinating! Can you tell me more?"

"Luckily enough, I kept a careful "dev-log" throughout the process - so the answer is yes!"

The game was made for this contest - a friendly sort of 'game jam' in which participants are to make a sandbox game (like SimCity or The Sims) within 48 hours time. My first idea was to make a game inspired by the Grow series involving plant growth. But I couldn't think of anything cool about it! So somehow I ended up making a sandbox tower defence game instead.

I initially named it "Monstroyka", after the half-remembered name from this game. (I just thought it sounded cool, really.) But as I was typing the code that added a title to the game window, my father walked by and noted that "like the plecostomus, you are on Team Algae Eater."

So, the game has two names, both fairly unrelated to the game content. I consider this reasonable.

My first concept for the game, verbatim from the design doc (sans hyperlink), was:

Ideas - spawn monsters, dudes. Dudes build towers, man them, shoot monsters. Monsters try to eat dudes, get to center, gnaw on delicious vegetation. (Om nom nom nom!) Killing monsters gives dudes resources to use to build better stuff. ("Spiked Walls", heh). Can eventually build citadels, palaces, unlock better monsters; also, bridges to other areas?
Nearly everything from that paragraph ended up in the game, so as concepts go, it worked pretty well for me.

Within two hours of programming, I was "through the first sentence" (of the concept), and fairly pleased with myself. (This was when I took the screenshot above, showing combat between 'froods' (the blues) and 'mooks' (the reds), as well as their vicious battle-shouts.) After getting distracted for several hours, I resumed work, adding towers (a useful feature for a tower-defence) and the basic resource, wood.

A note on the sound effects - much as with the fairly spartan graphics of the game, I was reluctant to spend much time creating 'assets'. Also, including sound would have added additional 'dependencies' for the game - I would have had to import non-standard Python libraries, which would have inflated the size of the executable and made the source more difficult for other people to run... well. In any case. I had the idea of making sound effects as little floating 'shouts', as can be seen in the screenshot. This worked well, in that I had 'sound' without taking the time to make sound effects; but it had its weaknesses, mainly that many sound effects in a small area tended to become impossible to read. (This was especially bad when creatures were being spawned or in melee combat.) At the very end of the project, I introduced several limiters on the 'shouts', which mostly fixed the problem. We'll see if it crops up again.

Unfortunately, due to Microsoft Paint's wonderful defaults, I managed to end up saving most of my development screenshots in png format with jpg compression. I.e., they look horrible. (As can be seen above.) I didn't end up saving any of my earlier code, so I can't retake the shots... it's a pity. Still, the world will not end.

After putting in towers, I had to make enemies actually collide with them - that is, make the towers solid objects, so that you could create a 'maze' for the enemy to thread. (This is a traditional Tower Defence pastime, like baseball.) The problem with this is that having enemies find the 'correct' paths is a difficult and complex problem - tending to be hard both on the CPU and the programmer. (Not to complain overly.) I'd tried implementing the 'correct solution' to pathfinding - an algorithm called A* before, with poor results. This time, though, it worked rather well - after settling some 'teething bugs', my mooks were threading my tower-mazes in no time. At least one fairly subtle bug managed to make it through there and into the 'release' version - I still haven't fixed it, despite over two hours dedicated exclusively to hunting it down. But for an essentially-first effort, it works well.

This is rambling. Let's tighten my prose up. To the extreme.

Had some ideas for buildings and resources! Mostly followed that blueprint afterwards! Most of the stuff still not implemented! (Was probably too ambitious, which I realized at the time!)

Added a new type of enemy, a mook that was bigger than the first! Called it the 'Big Mook!' Added an area reserved for the enemy-spawning crystals, for aesthetic/gameplay reasons! Screenshot!

(That one didn't get jpeg compressed, thankfully. See if you can spot the tiny arrows flying around on the bottom! The towers don't compensate for the movement of their target - they aim at where he is, not where he'll be when the arrows get there - so they're pretty awful shots.)

A moment of brilliant inspiration! I'd created smoke-effects for a previous game! Re-use them here (which I was already doing for tower-collapses) and add them to melee combat! Cartoon-style brawling, one big ball of smoke! Wonderbar! Done!

(Bit hard to take a screenshot of something so quick-moving! So didn't! Sorry!)

Added 'barracks' to train 'froods' (the blue guys, the good guys, probably) into 'footfroods'! (Like Footmen. Bigger, stronger, armed!)

(Jpeg compression! Hooray!)

(The barracks is in the top-centre. See all the training dummies? Froods will beat those up for a while to train, while the instructor paces behind them. It's all so real, man!)

Also at this point I had arrived at Day Two! This was the second day in which I worked on the game!

Several hours spent debugging the last night's typo-strewn code! I do not work well while tired!

Excerpt from bugs:

"When froods get transformed into footfroods, they roar a constant stream of triumphant exclamations and accelerate off the screen, trailing smoke as they go. (Like motorbikes!)"

(Wasn't too hard to fix, but I was a little bit sad to. Motorbikes are wonderful. Perhaps I should add some?)

(I totally should.)

Actually this is when I added the Crystal Chamber! (The partial-octagon on the left side of the screen.) Whoops! Not quite sure how that makes sense with the third-screenshot not having a barracks! It is all very odd!

Moving on!

Added 'mooks' (enemies) that fly! Named them 'Flying Mooks!' Considered making them flap but was too intimidated by the complex maths I thought were probably going to be required! (To make them be able to flap properly while moving in various directions!) So they just kinda floated forward!

Added a demolish button! Woo! (Surprisingly useful!)

Apparently this is when that third screenshot was taken! The one which I was confused about! How odd!

Added ballistae! They shot gigantic bolts that passed through enemies! Ideally they would damage enemies while they did so! I think I fixed them not doing so but I'm not sure I did so thoroughly! It's all very odd!

At some point around here I added a 'cheat' button for debugging!

Noticed lag for the first time! Fiddled with things to try to reduce it! So-so results!

Added 'mooks' even bigger than the Big Mooks! Called them 'Bigger Mooks!' Eventually renamed them to 'Giant Mooks!' They're a bit lame! Might try to turn them into something cooler later! Or just remove them! Ah well!

Added stone resource to the game!

Had the infinite Mr. Kessler play through the game! (The peculiar Mr. Ethan had played through an earlier version the night before, calling it - not unfairly - 'very weird'!) Mr. Kessler enjoyed it! This was a good thing! (Also he understood it without me having to give him instructions, which I considered a Good Sign!)

Started adding statues to the game! (Inspired by Rocket Slime!) The idea was that they track kills (one statue for each type of enemy), and when elevated to a 'gold' status, upgraded their type of enemy to a dramatically more powerful 'gold' form. They confused Kelsey when he did a second playtest - because I hadn't had the time to put in all the 'hinting' and player feedback that I'd done for other, earlier elements of the game - so it was clear improvement would be needed. I continued in the morning.

After getting up at 6 AM on the third day, I raced to be in time to finish in 48 hours, fixing bugs and problems discovered in the last night's playtest. Stopping at 8:43 AM - I'd started at 8:44, two days before, I packed the source into an executable, uploaded it to a hosting site, started playing the game, taking screenshots... (For I needed screenshots, of course.)

Within five minutes, I encountered a crash bug.

So, I didn't exactly make the deadline. But it's here anyway - an actual game, by me, done! - and that, that, is cooltimes.


No comments: