Sunday, July 27, 2008

Checkpoints, boxes, and bug fixes

I haven't had any time to work on Extinctathon during the week, but I've had a good two hours to work on it this morning. Things I've taken care of today:

  • Began implementing a basic checkpoint system. When the player crosses the checkpoint, he gets 1000 points and will respawn at the checkpoint if he later dies. This can easily be extended to level endpoints as well, which are a part of the next big goal which is transitioning from level to level.
  • Began work on boxes that pop out powerups. Right now the question mark boxes are popping out fireball powerups, and there's a few issues regarding the bounding boxes that need to be taken care of. I need to make it so that different types of items can come out of the question mark boxes and I need to be able to set this in both the design stage and in game (depending on the circumstances).
  • Fixed one of the audio bugs that was causing crashes when exiting and restarting a level. I wasn't disposing of the background music cue, so in certain circumstances this would cause a memory management issue which would crash the program.
  • And, finally, a couple of smaller bug fixes. Scores no longer pop up over enemies who suicided (i.e. fell off the screen) and the snakeocat no longer rapidly flips back and forth when the player is directly above him.
What's next:
  • I need to work some more on the way that blocks can pop out powerups, how this behaves, and how it is handled.
  • I need to fix an issue with the bounding boxes of the sprites. When the sprites are reformed (this happens to all projectiles), there is an issue that is causing the old bounding box to be retained. This causes a couple of collision problems which need to be fixed.
  • I need to make at least four solid levels. Once I have that, I think, I'll have a good five minutes of gameplay that I can use over and over to work on fixing bugs and polishing the game.
I don't have any vids at the moment, but I might post some later tonight after I've had more time to work.

Sunday, July 20, 2008

Game State Management: Progress!

Due to some stuff in the real world, I haven't had a lot of time to work on Extinctathon in the past week. Still, I had a chunk of time this morning, and I started making headway with implementing the Game State Management Sample without (completely) breaking the game. What actually happened was I started doing that, got fed up, tried to roll my own solution, realized I needed everything the GSM Sample did, but my version would be kind of crappy, so I started over using the sample.

So, yeah. Lots of back and forth. I got Extinctathon to work with the menus, pausing, stuff like that, with a few BIG issues.

  1. The collision detection is broken. It was dependent, before, on the input handling, collision, and updating to be done in a specific order. This had to be moved around to accomodate the new changes, and it no longer works in certain situations. This should show you how shitty my collision stuff is. It need to be completely reworked.
  2. Some minor stuff with the music. This should be easily fixed.
  3. There's a weird bug when you exit out of the game to the main menu and then start a new game. The program crashes and throws an error I haven't seen in C# before. I'll mess with it later.
Video later on.

UPDATE:
The collision detection has been mostly fixed. It's better, with a couple of exceptions, than it was before the game state management was implemented. The main bug that's left is that, when pressing up against a stack of blocks and falling, the player can get snagged on the corners of the blocks which prevents him from falling. I'll take a look at this over the coming days. I'm kind of tired of working on this at the moment, so I'll take care of that later.

The audio bugs remain, but I know what's causing them and they should be trivial to fix. Hopefully.

Video:
Extinctathon: Game state management and one more collision bug (720p, 9.8mb download)
Youtube

Sunday, July 13, 2008

Pills, balls, and bibles



I've added a couple of power ups to Extinctathon, cancerballs and bibles. The cancerballs (I should probably come up with a different name for that) shoot out in a straight line, although I might make them bounce like fireballs in Super Mario Bros. The bibles go up in an arc and cut a swath of heavenly destruction through thine enemies (unlike the balls, which are destroyed when they hit an enemy). There's a fair amount of tweaking to be done, but I'm happy with how the power ups have gone so far.

Since the XBox 360 hates in-game object creation, the player's sprite has a pool of five projectile sprites (five being arbitrarily chosen, adding or subtracting from this is as simple as changing a number one time in the code--it feels like a good number, though) from the time of its creation. The sprites are all "dead", so to speak (i.e. this.state == SpriteState.Dead), so they aren't updated or drawn. When the player hits the B button, it cycles through, finds the first dead sprite, and reforms it into the appropriate projectile. If all the projectiles are active, as in there are five bibles being thrown around, no new projectiles will be created. When the projectiles have died (after a couple seconds), new ones can be created. Simply, the player can shoot out up to five of a projectile at any given time.

I also added some pills, which are basically like coins, rings, or any of the other pointless(ly fun) collectible items from every platformer ever. Each pills gets 100 points, and 100 pills get you a brand new life.

The main thing now is to get the blocks to pop out the power ups (I'm manually spawning them with the level creator at the moment, as you can see in the video). I'd also like to make the brick blocks breakable, and make some brick blocks that pop out power ups, pills, 1-ups, stuff like that.

From here on out, I have a couple of big changes remaining:

  • GAME STATE MANAGEMENT! I keep putting this off
  • serious improvements to the collision detection
  • an improved level editor
  • hardcore optimization for the XBox 360
Everything else that's left to do is basically going to be content creation and a whole lot of polish. I need to add a lot of power ups, a bunch more enemies, more block times, more sound effects, more levels. After all that's underway I'd like to start implementing some visual effects, and even possibly some as-yet not fully fleshed out new game mechanics that will appear in the course of the game. The idea here is that you start out playing something very familiar (the first level being almost identical to the opening of Super Mario Bros.) and by the end it's almost unrecognizable. I realize this is a lofty goal, one that I can't guarantee I'll achieve. Nevertheless, I'm feeling really good about where I'm at with this game so far, and I'm feeling VERY good with the level of extensibility I have set up within the game's code to add on ideas in the future. It's certainly not bad for a first time XNA project. I'll post more as the week progresses.

Video:
Extinctathon: Pills, balls, and bibles (720p 19.1mb download)

Sunday, July 6, 2008

Audio, some refinements, and this week's to-do list

I've spent the past week messing around with the sort and sweep algorithm some more. The main problem, in my case, is that I need to do a good bit of reading on the IComparer class, because I really don't understand it. As it is, if there are multiple objects with the same X coordinates, it isn't necessarily including them all in the appropriate lists of interfering objects. Take, for example, the picture at the top. If we're checking interference with the rabbey (the little brown rabbit monkey thing standing on the question mark block), we look at everything in between his leftmost and rightmost points. In this case, two grass blocks, a mountain, and a question mark box. That'll work, and that's all fine.

If, however, the rabbey is on a stack of ten boxes, all of which have the same position along the X axis, and the rabbey happens to be at exactly the left- or right-most point of said stack of boxes, some funky things start to happen. This is because when we're sorting the list, we SHOULD be putting the rabbey's left coordinates at the beginning of any string of identical coordinates, and the right ones should go at the end of any string of coordinates identical to those. In other words, the rabbey (in this case) should be the very beginning and the very end of any items who might interfere with it.

In my implementation, however, this isn't the case. the list is sorted, but no particular creedence is given to the order of multiple cases of identical coordinates. My short term fix is to test three or four extra objects to the left and right of the object in question, but this is a stop-gap solution and is probably the worst way to handle it. I'll be researching IComparers in order to find a better way. I shouldn't have to sort the list multiple times per update (as that would be prohibitively expensive, CPU-wise), and I think I can just search for certain values in the list. That should hopefully be kind of easy.

The main additions I've made in the past couple of days have been audio (all music and effects copyright My Awesome Talentedness, 2008). A friend of mine is going to do some music for me, and I'm really looking forward to that. I'll mess around with the sounds a bit as well, but it's not a high priority for me at the moment. At this point the voice acting is no worse than Symphony of the Night, and that was one of the best games ever made.

I've also done some minor tweaks here and there, mainly standardizing the blocks' sizes (so they'll all match up, duh), and tweaking a few things in the update cycle (the most noticeable of which being that the enemies don't move unless they're pretty close to being onscreen).

In addition to the aforementioned sort and sweep fixes, I'd like to add some enemies, some block types, and blocks that pop out powerups in the coming week. I also need to add a way to finish a level, load into the next one, stuff like that. Finally, I think it's really time that I implement a game state management system, even if it's hard as hell to do it. I need to be able to pause, have some menus, get a game over, and stuff like that. It won't be fun. But it has to be done. We'll see how it goes.

Videos:
Youtube
High-res download (720p) (recommended)