Dec 02 2010

Enter the Zone

So, Battlezone was a wire-frame 3d arcade game produced by Atari, initially released in 1980. It may have been the first game to use a 3d environment of any type. If you actually want to play Battlezone, you may wish to visit and play the official web port.

What’s presented after the read more is a much more limited version of the game, developed as an intermediate step towards my entry in the 8bitrocket 16kb web game contest.

In the last entry, we had developed a wireframe renderer which had a camera that could move around. The next step was to fire a projectile, and do some simple collision detection. Collision detection in 3d can get extremely complex… but in it’s simplest form, if we treat each object as a sphere, objects are in collision if the sum of the radii is less than the distance between the objects.

(WASD- Move Camera, Space to Shoot, IJKL- Pitch/Roll the target cube)

If you play around with the above .swf, you’ll see that it’s possible for some angles to shoot through the corners and not trigger the explosion. That’s because the sphere used for collision is tangent to the cube’s faces only at the center of each face. (The explosion effect is just a random number of cubes given random velocities and rotations and removed when they fall through the ground plane)

Anyway, having collision detection and rendering, it was time to:
– Build a tank model
– Apply some kind of enemy behavior
– Build a simple UI, scorekeeping, minimap
– Clean up after ending the game, and restart

The result is this:

(WASD- move player, Space- shoot)

Unlike the original Battlezone, after you kill 10 enemy tanks, there will be multiple tanks on the field at once. (I think it’s kind of fun to maneuver so as to make them blow each other up.) :) It’s not a great game, but all the major elements (except sound) are there. Building this intermediate target let me find out things like… I really need to make the radar bigger, and to tweak collision spheres, rotation and movement rates before things become much more complex.

The release build is currently 7.22kb, leaving me plenty of space to work towards my next target.

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment