Monthly Archives: June 2009

Ghostbusters: The Video Game

Before going any further, I’ll preface this by saying I am a insanely huge Ghostbusters fan. It’s been my favorite movie since I first saw it when I was little, and all subsequent 5 billion viewings. I’m surprised my C64 Ghostbusters disk still works from the number of times I played the game, and I have a large portion of the action figures – moreso than anyone should have. I even dressed up as Egon for Halloween when I was 10, and had a Staypuft plush toy. Without mentioning how I own the entire series of The Real Ghostbusters on DVD (oops), I think it’s safe to say I’m a fanatic.

That being said, I’m going to try my best to give a non-biased review of the game. And there were some issues I noticed along the way, so I feel that I’m doing a just critique.

Basic Info

Ghostbusters: The Video Game was developed by Terminal Reality and Threewave Software (for PC/XBox/PS3 versions), and published by Atari and Sony. Its publishing history is a bit bizarre and probably warrants its own post – suffice it to say, it changed hands through mergers until it ended up with Activision, who made the choice not to publish it (Please note, I’ll keep this post professional and make no mention of Activision’s market research team apparently inhaling a large number of drugs that day, or the fact that Activision in general is slightly higher than amoebic dysentery on my list of favorite things). Atari grabbed it up.

It was/will be released for PC, PS3, XBox 360, Wii, PS2, and PSP.

I purchased and played the PC version via Steam.

Ghostbusters - Slimer

The Good

First off, the best part is: it’s GHOSTBUSTERS. Seriously, that just scores a lot of points right there. But without going too fanboy – it features all the original voice cast (Bill Murray, Dan Aykroyd, Harold Ramis, Ernie Hudson, Annie Pots, William Atherton), and features other well known actors (Brian Doyle-Murray, Alyssa Milano). The script was written in part by Aykroyd and Ramis (the former who stated “this is essentially the third movie.” [game informer]).

The story is fun and interesting and visits a lot of locations, characters, and mythologies from the original two films. Some of it is a bit contrived, but overall it flows pretty well. The music is mostly all from the original movie, which is great – I enjoyed it quite a bit. Some people have said it gets repetitive, but I’ve heard that music so much in my life regardless that it doesn’t wear on me.

Ghostbusters - StaypuftMost importantly, the game play is A LOT of fun. A serious amount – the physics engine developed for the game, the “Infernal Engine”, is the absolute BEST I have ever seen in any game. Virtually any item can be broken/burned/moved/etc, and movement is incredibly realistic. They did a really nice job with it – I hope it gets used in more games to come. It must also be fairly efficient, as it didn’t tax my processors as much as Left 4 Dead or other recent games do. Big score on that. And the mechanics of actually catching and trapping the ghosts is just a crapload of fun – from the little guys to (semi spoiler) the Staypuft Marshmallow man. It made me feel like I was actually a Real Ghostbuster (LOLZ).

The Bad

Okay – the big one that has set the forums aflame: There is no multiplayer in the PC version. This was a big shock to everyone, as it was pretty much advertised during the pre-order weeks as having multiplayer. A lot of people, including myself, were pretty ticked off about it, and Atari has done virtually no damage control. Hopefully there will be a patch – this would be a great game for LAN parties.

A lot of people have reported some major issues with saving/restoring games (I experienced a bit of this), slowdowns/lockups, and issues installing it. Also, for those purchasing the PS3 version, they’ll notice it looks quite a bit fuzzier and lower-res than its PC or XBox counterpart.

Lastly, and this one especially bugged me, the code used to process mouse acceleration is the same as what’s used to process joystick acceleration. Because of this, moving the mouse slowly doesn’t fine-control your character, it simply doesn’t have any effect at all. You need to budge the mouse quite a bit to get your character to move normally, which is not great for an action game.

I appreciate the extra time being taken to bump up the gameplay and creepiness, they did an AWESOME job, but there have been enough reports of issues to know that QA was not quite where it should have been on this one.

The Ugly

Really, the lack of PC multiplayer was the only thing that was a major bummer. Overall, I really enjoyed this game – and I want to keep enjoying it, which is why I hope they patch it for multiplayer – the physics and gameplay are awesome, and would be fun for a LAN party or online play.

So Who You Gonna Call?

If you are a Ghostbusters fan, or just want to try a new game, I highly suggest this one – it’s great to see new light brought to old characters with a continued storyline, and the gameplay is just a blast. Overall, if you’re shooting for the best balance of multiplayer and good graphics, pick up the XBox version. If you’re shooting for the best possible graphics and have a bumpin’ gaming rig, pick up the PC version and jack up the settings – and hope they’ll release a patch one day. But regardless of what system you go for, GET THIS GAME NOW!

And an important safety tip while playing: Don’t cross the streams – it would be bad.

Ghostbusters: The Video Game Official Site

5 Reasons for Putting Your Personal Code Into Subversion

If you’ve ever programmed for an organization with multiple developers, you’ve most likely used some kind of system to synchronize, combine, and version code. Without a such a tool, changes to the same files amongst two or more people can get very confusing and hard to manage very quickly. However, even if you’re just dealing with your own, personal projects, a code repository is still a must.

1 – Versioning

One of the most powerful aspects of subversion is the ability to track changes to your code. I can’t count the number of times in the past where I’d make a change to my source and totally botch the program up. And often times, I wouldn’t realize the screw up until later on, when it was too late to remember exactly when it had started acting up. With your code versioned (using copious comments), it is easy to look through the history of changes, revert back to a version or just grab the specific lines of code you need.

2 – Multiple Backups

Though it is, of course, possible to manually back up your code, the nice thing about working with a repository is the ease in maintaining backups. First off, if you’re actively working on a project, you’ll have two copies already – your working copy, and the copy in the repository. And when you backup the repository, you’ll be grabbing all your versions and comments at the same time. Combined with having all your repositories in one location that can be easily be grabbed, this makes for an easy to manage solution.

3 – Synchronize Code Between Multiple Computers

Like many people, I have both a desktop and a laptop (well, a netbook), and when at home, I of course prefer the large screen of the desktop. But I also am a fan of enjoying a cup of tea and a little programming at the cafe around the corner from me. Because of that, having code on my netbook is a necessity. Subversion allows me to quickly and easily synchronize my code between both machines, no problem.

4 – Secure Method of Remotely Accessing Code

Related to #3, since SVN can integrate with SSH, it provides a method of securely accessing your code from anywhere in the world. Though I’ll normally sync my code to my netbook at home, if I get in a jam and ever need to grab my code from another machine, or if I forget to update my code at home, I have the ability to do so. And since it uses SSH, I simply need to map 1 port on my firewall, no crazy set up required.

5 – Integration With Popular IDEs

With Subversion being so popular, many IDEs and other tools have plugins to integrate the use of a svn repository directly into the program. Visual Studio, Eclipse, Anjuta, and Emacs all have subversion plugins/support. Additionally, Windows, OS X and Linux all have utilities to integrate SVN into the file managers/explorers (E.g. TortoiseSVN for Windows). With all these plugins, it makes using subversion a snap.

So if you haven’t already, take a day some weekend and move your source over into Subversion – it’ll take a little time depending on how much code you have, but you’ll be happy you did in the long run – it’s a fantastic tool, whether dealing with 50 developers or just yourself.

Classic Gaming Review – Quackshot

A Fun Activity to Share

One of the interests my girlfriend and I share is our love of gaming, specifically retro gaming. She did a lot of Genesis gaming when she was a kid, while I was exposed mainly to C64 and Nintendo gaming, so we have a fun time sharing our favorites with the other and playing through them together. It’s a pretty relaxing and fun way to spend a rainy Saturday. Recently, we decided to tackle Sega’s Quackshot.

Quackshot Specifications

Quackshot BoxQuackshot was released in 1991 for the MegaDrive/Genesis. It’s a single player game featuring Donald Duck and many of Disney’s Ducktales characters in a platform style adventure.

The game was also released in 1998 for the Sega Saturn. We played the Genesis version on the Fusion Genesis emulator.

Overview

The story of Quackshot features Donald finding a treasure map in one of Scrooge McDuck’s old books, and deciding to set out to find said treasure. Big Bad Pete overhears this and decides to try to stop/steal the treasure from Donald. Donald flies from location to location with the help of Huey, Duey, and Louie who pilot the airplane (why not Launchpad I wonder?). The game is definitely reminiscent of Indiana Jones, and features many of the same scenes (Running from boulder ala Raiders, making a leap of faith across a chasm ala Last Crusade, mine carts ala Temple, etc).

Donald makes use of a plunger he fires from a gun as a weapon, which later can be upgraded to provide different abilities, such as sticking to walls. He also has a popcorn gun which can destroy enemies, and a bubble gum gun that can destroy blocks (makes sense!).

Thoughts

I’m a fan of side-scrolling platformers in general – especially old school 2D ones, just because they’re simple but can be challenging, especially when crazy pit jumping or enemy dodging is involved. I enjoyed this one as well – the difficulty level wasn’t bad (though we were using a game genie code), we cleared it under an hour or two (can’t remember exactly), but it wasn’t an overly long time. I both like Ducktales characters and Indiana Jones as well, so this game made the perfect combination.

Quackshot - SnowThere wasn’t a lot going on in this game – which is not a bad thing. There was a little puzzle solving, but one part I found especially annoying was the Maharajah’s Palace stage, in which you’re trapped in a maze of rooms connected by mirrors. You need to choose the right combination of mirrors to advance to the boss or else you’ll just keep retracing your steps over and over. Maybe the correct sequence was mentioned somewhere in the game, but we missed it – we had to look it up.

The last boss wasn’t bad – if you know his strategy he’s extremely easy to beat, especially as there’s a location on the screen you can’t be hit if you know the pattern. This is either good or bad depending on if you like a big challenge for the last guy. I thought he was pretty cool though, a knight just like at the end of Last Crusade.

Overall

I recommend this game if you’re looking for a fun little platformer to play and enjoy Disney characters. There’s nothing revolutionary going on in this game, but it’s colorful and fun, and the music is not bad – it’s enjoyable. And if Donald eats a bunch of Chili peppers he goes nuts and runs across the screen, invincible to enemies, that part is a HOOT. And there were a few other Disney games released by Sega at this time (reviews on those later!) so you can keep filling that cartoon video game hunger when you’re done with this one. Hurray!

From Pong to Platformers – An Introduction to Game Physics – Part 4

Acceleration for Better Goomba Stomping

So now we understand positioning an object on a screen, moving the object around using the principles of velocity, and how to handle collisions with walls and other simple objects. While we can do quite a lot with these simple fundamentals, there is one more that is key to modeling realistic movement. We can understand a little how it works by watching how Mario jumps in the Super Mario Bros series.

Physics - Mario
Mario jumps in an arc movement

For those who haven’t played Super Mario Bros, Mario jumps in an arc. When he begins to jump, the sprite on the screen moves up very quickly, then slows at the top of the arc, then slowly starts moving back down, until he’s going the same speed as when he started the jump when hitting the ground. The reason for this movement is due to acceleration. Specifically, the game is modeling the affects of gravity, gravity being a force that causes acceleration in the downward direction.

Just as velocity is the rate of change of an object’s position (e.g. meters per second), acceleration is the rate of change of an object’s velocity (e.g. meters per second per second). Gravity is a force that causes constant acceleration in the downward direction. Because of this, though Mario starts with a velocity that causes him to move in an upward direction, acceleration downward causes this velocity to slowly decrease, then reverse, getting faster in the opposite direction.

Programatically, we can handle this the same way we do velocity. In addition to updating position with velocity, we’ll want to update velocity with acceleration – so we’ll need two more variables, AccX and AccY. During our redraw, we’ll want to update both velocity and position: (VelX = VelX + AccX) (VelY = VelY + AccY) (X = X + VelX) (Y = Y + VelY). Acceleration can be used to model many realistic scenarios besides jumping in platform adventures, such engines firing in a spaceship simulator, or shells being fired from a cannon in a tank war game.

Onto More Advanced Topics

We’ve covered position, velocity, acceleration, and basic collisions – with these basic techniques, a wide range of realistic motions can be accomplished when making your next game. There are, however, hundreds of more topics, including friction, complex collisions, fluid dynamics, light oriented (shading, diffraction, reflection), etc. However, before getting too crazy, try some of these techniques in simple games to get familiar with Newtonian Mechanics. After that, more advanced topics will be easier to handle. Have fun with you physics!

From Pong to Platformers – An Introduction to Game Physics – Part 3

Thinking Inside the Box

However, now that we have movement, we run into an issue. When we think of a classic video game, we think of boundaries, such as the edge of the screen, or floors/walls/ceilings, or other objects. In many games, such as platformers, these boundaries will stop the object from moving. In games such as Pong and Breakout/Arkanoid, the boundaries cause the object to bounce.

Physics - Breakout
In the classic game Breakout, the ball bounces off the walls, paddle, and bricks.

The idea of bouncing is the boundary only reverses one dimension of the ball’s direction, while the other dimensions remain unaffected. This is expected behavior that reflects real life, as remember that vectors are treated independently in each dimension. E.g. if the ball is traveling right and up, and hits the right wall, it should continue to travel up, but it should start traveling left. The right wall only affects the left-right dimension, it never affects the up-down direction. If the ball then hits the ceiling traveling left and up, the ceiling will only affect the up-down direction, and now the ball starts traveling left and down.

Physics - Bounce
Each wall only affects the direction in one dimension.

Looking back, our program currently has 4 variables. X (x position), Y (y position), VelX (x velocity), and VelY (y velocity). When redrawing our screen, in the case of boundaries, we would check to see if the ball has “hit” any boundaries – that is, if the coordinates of the ball (X and Y) reside in the same space as the coordinates of any of the boundaries. If so, we adjust the velocity accordingly. E.g. if the ball has an x velocity of 4 (traveling 4 pixels per redraw to the right) and a y velocity of -2 (traveling 2 pixels per redraw downwards), and hits the right wall, the x velocity will be reversed – that is, multiplied by -1 (VelX = VelX * -1). So now the x velocity is -4 (traveling 4 pixels per redraw to the left), and we’ve achieved our bounce. If we apply this boundary check to a movable paddle, we now have pong. If we apply this boundary check to bricks at the top of the screen, we now have breakout as well!

Onto Part 4

From Pong to Platformers – An Introduction to Game Physics – Part 2

Velocity

Velocity is a fancy word for speed with a particular direction. Going 88 MPH would be speed. Going north at 88MPH would be velocity. But forgetting the direction component for a moment, speed is measured in distanced traveled over time. For example, when we say 88 Miles per Hour, we’re saying the object is moving a distance of 88 miles over a period of an hour – i.e. the object is changing its position by that much in an hour.

Remember, our video game object has position too – it has its coordinates. If we introduce velocity into our game, we now give our object the ability to move by the laws of physics. If we redraw our object once a second, and the object is going 5 pixels right per second, we would be adding 5 to our X coordinate (the value stored in our X variable) every second, then redrawing the object. If we want it to move faster, we increase the speed, 6 pixels per second, 7 pixels per second.

Don’t Forget the Vector!

Vector is another mathematical term for a quantity with a direction involved. Remember, velocity is speed with a direction, so it is a vector. There is a helpful property of vectors that allows us to split them up by dimensions – that is, if something is moving in two dimensions at once (north and west, up and north, south and east and down), we can handle each direction separately. If something is moving north and west, we can talk about how much it’s moving in the north direction and how much it’s moving in the east directly independently. In our video game case, we can say “okay, the pong ball is traveling -3 pixels per second in the X direction, and 2 pixels per second in the Y direction). That means every second we’re going to subtract 3 from our X variable, and add 2 to our Y variable, then redraw the ball. The movement of the ball would appear to be going diagonally up and left, as seen here:

Physics - Velocity
We handled each dimension separately, but the end result was the diagonal movement.

Now we can store our X velocity and Y velocity into variables too (for example, velX and velY). So, every time we redraw the screen, we are going to add velX to X (x = x + velX), and velY to Y (y = y + velY). So if we have a very large velX, the ball will be moved across the screen very fast from left to right. If we have a very large negative velY, the ball will be moved down the screen very fast. And we don’t need to press the key each time, our velocity will do the work for us through simple addition (or subtraction if we are adding a negative number).

If we wanted to design a fun experiment, we could assign our arrow keys to change velocity. Pressing left would subtract one from velocity in the X direction, pressing up would add one to velocity in the y direction, etc. This would have the effect of making the ball move in a direction more quickly the more you press the arrow in the same direction, or slow down and start moving backwards if you press the arrow in the opposite direction. Not pressing the arrows would simply keep the ball doing whatever it was doing – e.g. traveling in whatever direction it was before.

Onto Part 3

From Pong to Platformers – An Introduction to Game Physics – Part 1

Before we get started, I feel the need to point out that this entry will in no way even begin to approach the territory of being comprehensive in the study of video game physics. This is targeted toward those who have little background in physics and is very much a starter tutorial. In general, the better and more realistic the game physics, the closer you’re getting to actual physics – and that’s a lifetime study in itself. However, there are some basic tips and tricks to know when dealing with intro action and arcade style games.

Newton and his Mechanics

While games have gone from simple squares on the screen to 2D sprites to 3D-super-rendered-polygon-ray-traced-blammo-wow objects, the actual science behind their movement on the screen has stayed relatively the same – mainly because their movement is based on the movement we’re used to, what we see all around us every day. We reproduce it in our video games (for the most part) because it’s natural and makes sense to us. We’re mirroring physics! Specifically Classical (or Newtonian) Mechanics. We generally don’t need to take into account relativity or quantum mechanics when making Mario jump from one green pipe to another.

So to understand how the pod in Lunar Lander works, we need to understand how a real lunar lander would work. But let’s start out more simply.

Mass and Position

What is mass? This is a large, fundamental question that involves inertia, resistance to movement, the amount of force necessary to move the object, etc. But we don’t need to get that deep into it. Mass is physical stuff. You have mass, a ball has mass, the planet has mass, your dog has mass, Catholic churches have Mass, etc. (ba-dum-dum). Anything physical has mass. It doesn’t start moving for the most part, it stays where it is until something pushes it (in the case of a person, your muscles). If it’s already moving, it doesn’t stop moving unless something stops it (a wall, friction, a large rope, etc). It basically keeps doing whatever it’s already doing.

Reproducing an object that sits there and does nothing is very easy to do in a video game. Simply create a representation of an object, whether it be a colored square (Pong), a bitmap graphic (Mario), or a polygon object (Lara Croft) and put it on the screen. The actual way to do this is outside this tutorial (Check out Creating a Blackberry Game if you’d like to see how to do it in Java). Just as in the real world an object has a position, in the video game world, the object will have a position too – a coordinate on the screen. In the below example, we use a simple object that is 1 pixel in size for a pong-like game.

Physics - Object Location
The green pixel is our pong ball

When programming this, we would need to store the dot’s X coordinate and Y coordinate into variables, in this case, store a 6 in X, and a 2 in Y. If we wanted to use the arrow keys to move this object, we would simply add or subtract from the coordinates as the appropriate key is pressed (e.g. pressing up -> Add 1 to Y, pressing down -> Subtract 1 from Y, pressing right -> Add 1 to X, pressing left -> Subtract 1 from X). Then redraw the object in its new location. Our drawing routine would always just take the values and of the X and Y variables and draw a pixel at those coordinates on the screen.

While this would be enjoyable for 2-3 seconds, it would overall be a fairly boring game. We would be doing physics’ job in this case, telling the object how to move every step of the way. We want physics to carry its load. So let’s program in another property.

Onto Part 2