A small announcement before I get to the post itself: Last entry I mentioned I needed music. I didn’t expect that multiple people would be offering to compose original music for my game for free. I’ve been quiet about these offers for help so far because I didn’t know how to respond, but then composer Fawstoar made this track and I couldn’t say no.
But here’s the thing: I’m really nervous about inviting people to make tracks for the game, because I’m the absolute worst sort of person to make music for. My tastes are lowbrow, but I’m also incredibly picky and I know nothing whatsoever about music. I’m sure everyone has run into the classic Clients from Hell stories, where a client keeps asking for changes because they do know what they don’t want but they don’t know what they do want and in any case they lack the basic vocabulary to even express their preferences. So you wind up with a client repeatedly asking you to change the color scheme of the website and it isn’t until your sixth revision that you discover the color isn’t the problem, it’s that they wanted the buttons to look more “glossy” like [huge boring corporate site that’s looking kind of dated] and they’re actually colorblind and couldn’t even detect most of the changes you were making.
That client? That irritating jackass? That’s me. You don’t want to make music for me. I’m an idiot. I want a very specific kind of inoffensive electronic music, I lack the knowledge and language to explain what it is, and I don’t want to pay for anything. Who would want to deal with that?
While I’m wise enough to see that making music for my game would be bad for you, I’m also selfish enough that I’m willing to offer the chance if you want to try. But rather than asking someone to go out and make music, I’ll just leave the door open for submissions. If you think you have something that fits, just leave a comment with a link to the track on Soundcloud or Youtube or whatever and I’ll give it a listen. If I like it, I’ll put it in the game. If I don’t, I will probably avoid saying why because I don’t want you to spend two days re-working it only to have me still not like it because I gave you bad advice.
Obviously I’m not looking for exclusive rights. I just want tracks that I’m allowed to use in my game. And if you don’t want to do hours of work trying to please an ignorant slob who might not finish the stupid videogame anyway? I don’t blame you.
The mood I’m going for is… uh. I guess pretty much the original Descent:
Except maybe not quite so… 1994 MIDI-ish? (See what I mean about me being a horrible and difficult client?) Perhaps the Unreal soundtrack would be a better example. Tracks don’t need to be epic long compositions. In testing, levels currently only take about five to ten minutes, so a two or three minute track that’s looping-friendly should do just fine. Most players won’t even notice the repetition in that timeframe.
Some of you have already linked to your work on Soundcloud / Youtube / Jamendo. I’ve listened, and I’m considering some of them. We’ll see.
Anyway, let’s talk about the game:
You know what’s fun in this game? Dodging missiles. Maybe it’s just me. So far only two of my seven playtesters (my daughter Rachel and myself) seem to get caught up in missile-dodging.
How it works is this: A robot shoots a homing missile at you. Your lasers are busy elsewhere, so instead of shooting down the missile you cut to the side at the last second and the missile zips by. You feel pretty good until you realize it’s not going to give up that easily. It loops around and while that’s happening another missile is already on the way. The turning radius of a missile is too large to hit you like this, so there’s now a missile circling you in each direction and also the robot is still shooting so you’ve got another one on the way. It seemed like a pretty slick move the first time you dodged one, but now you’re kind of pinned in this circle until you can shoot them down, which makes it hard to avoid all this incoming laser fire.
So dodging missiles is a very temporary solution to the problem, and in fact can make things worse if you let it get out of hand. But it’s fun.
The missile flight patterns are interesting enough that I’m thinking it would be good to have an enemy that moves this way. This would mean making one that moves forward constantly and must turn itself around to change movement direction. So let’s do that. I think I’ll call these new enemies “flyers”, since they fly around you all the time.
It’s kind of boring to have them just fly loops around you, and it also makes them kind of predictable. But after some experimenting I find a nice simple system for keeping their movements interesting. Instead of orbiting the player, they orbit a point a slight distance from the player. If the robot is on your left, it tries to fly around a spot just above you. If it’s on your right, it goes for a spot just below you. When it shoots, it reverses these.
This is complete chaos. These rules are dead simple, but this thing is hard to hit and hard to dodge, which is a surprising combination. Just about the point where I get the little bastard lined up, it’s ramming into me and I have to juke to avoid getting… uh… bitten? I dunno. Whatever we’re calling these melee attacks.
The other thing that makes this fun to fight is that when I’m in a tight passage, it spends about half its time inside the walls. I haven’t written any collision detection for it yet, so instead of slamming into walls it just passes through like Casper. Then I spend a few panicked seconds waving my laser around, wondering where it will pop out.
This behavior is interesting enough that I think it needs to be a feature. So I add some effects to make it look like this thing is boring through walls. When it collides with level geometry, it halves its speed, gives off a scattering of rock particles, and begins emitting a rumbling sound. There’s another sound and particle burst when it exits again.
Great. So I’ve come up with another new and interesting enemy type. Which tunnels through the ground. And which I’ve named “Flyer”. The name is extra stupid, since most of the other robots also fly.
I spend a few minutes re-naming this and everything is great. But speaking of naming problems…
Originally you were going to buy upgrades in this game. Monsters would drop coins, and when you reached a shop you would pay for upgrades. Except, I don’t like the feel of this. If the player happened to miss the shop (easy to do in these tunnels) then they might go for a long time with a bunch of money they couldn’t spend. Also, I wanted to give out lots of upgrades at first and gradually space them out later on. How do I do that? Give more money in the easy early levels and less when the game is hard? That would just incentivize the worst sort of grinding. I could have the costs ramp up over time, but that goes against the type of upgrade system I’m trying to make.
Then I realized that what I wanted was a leveling system. So I replaced the store system with a level system. Except…
I already have a “level” system. In level.cpp, I procedurally generate gameplay areas called “levels”. It took me a couple of days to even notice I’d made this blunder. When I did, I figured it was no big deal. I’ll just make sure to name stuff like “character_level” to differentiate from “place level”. Surely I can keep the two level systems straight, right?
Well, no. A few days later I got myself turned around and started plugging the wrong variable into the wrong system. I was messing with xp per level, which I thought was how much xp it takes to gain a level, but was actually how much xp was available in a specific area of the game. Then later I thought the “max level” variable in the save file was how far something(?) had leveled up, but it was really the highest numbered checkpoint save the player had reached. And then there are skill levels, which is how far individual skills have been upgraded. Basically this Order of the Stick has become a running gag all through my code.
For a while I get by with making the names more descriptive. I’ll call something “character_level” instead of “level”. But there are still situations where meanings can be ambiguous and turning variables into sentences is a poor solution to that. This is only going to get worse. If I’m getting confused when I’m actively working on the project, then this is very bad. If I had to step away from the project for a few days due to sickness or other obligations, then by the time I got back I would have forgotten which level was which and it would be madness.
So over the course of two honkin’ hours I painstakingly rename everything to do with gamespace geometry from “level” to “map”. It probably would have been faster to rename the other sort of level, but I have no idea what else it could be called that I’d remember and that wouldn’t just cause more confusion elsewhere.
I suppose it would help if I had better refactoring tools. Or if I had any at all. When I worked with the Qt platform, the dev environment had a built-in feature that would let you rename a variable. It was smart enough to understand the difference between the variable you’re renaming, and another variable elsewhere that happens to have the same name. (Which is probably why you’re renaming this one.) It’s smart enough to not mess with stuff inside comments, or rename partial matches.
But I’m using Microsoft Dev Studio, and for some unfathomable reason they don’t have a tool like that. The environment is actually aware of variables, but it doesn’t use that knowledge when renaming. All you get is stupid Find & Replace, which is incredibly dangerous. One bad command can make a complete mess of the code, or rename things in ways you don’t realize until much later. And if you’re trying to rename something because it’s too similar to something else, then Find & Replace is like using a Flamethrower to test your smoke detector: You’re likely to cause a catastrophic version of the problem you’re trying to avoid.
(To be fair, maybe the full version of Visual Studio has a proper rename tool. I’m using the Hippie Freeloader Edition™ right now. Then again, I had the pro edition of an old (1998) version at my old job, and it didn’t have smart renaming either.)
It sucks to lose a couple of hours like that, but this sort of thing happens. As a program grows it gets harder to keep the whole thing in your head. If you’re like most people you probably gravitate towards certain words and those habits find their way into code. And if you’re like me then you’re probably getting on in years and finding it harder to remember what you were thinking when you wrote something.
So those are the most interesting problems last week. I have to say this is going amazingly well. I haven’t lost a day to some intractable tech problem. Or had to deal with ongoing crash bugs. I haven’t been plagued by performance problems. Maybe this is because “2D is easy”, or maybe I’m just really at the top of my game, but it feels good when a project flows like this.
The Disappointment Engine
No Man's Sky is a game seemingly engineered to create a cycle of anticipation and disappointment.
The Truth About Piracy
What are publishers doing to fight piracy and why is it all wrong?
Push the Button!
Scenes from Half-Life 2:Episode 2, showing Gordon Freeman being a jerk.
Good Robot Dev Blog
An ongoing series where I work on making a 2D action game from scratch.
How to Forum
Dear people of the internet: Please stop doing these horrible idiotic things when you talk to each other.