Battlezone: Modelling 3-D Vector Baddies
The first three-dimensional video game worlds had no surfaces or lighting; they were just wireframe models -- lines rendered on a vector graphics display. The first arcade game to use this formula successfully was Battlezone, a first-person tank shooter that presented the player with a variety of enemy targets within a 3-D landscape.
In my last entry, I showed how you can extract 2-D objects from a vector game, but here I'm going to go a step further and extract full 3-dimensional models. I present the technical details about this extraction at the end of the article.
The UFO is really more for bonus points than anything else, since it doesn't fire at you, but it can be a squirrely target for your gun. Its body has two octagons, one four times the size of the other, with the vertices connected. The UFOs always appear at eye level and spin along their central axis, so their full three-dimensional structure is difficult to discern in-game.
Missiles start coming at you after you've cleared out a few tanks. They drop from the sky and then approach you in a zig-zag pattern, leaving you only enough time for a single shot. Don't miss! The body of the missile consists of two hexagons and is about three times as long as it is wide. A pedestal at the bottom appears to be responsible for the missile's motion along the ground, as it kicks up debris along its path. Finally, a crest-like feature adorns the top, though its purpose is unclear.
The super tank is a beefed up version of the regular tank. It closes in on you much more quickly -- you can outrun ordinary tanks, but not super tanks. The main body of the super tank is a wedge, giving it a more triangular appearance. The super tank has no treads, and its antenna is just a vertical line.
In my last entry, I showed how you can extract 2-D objects from a vector game, but here I'm going to go a step further and extract full 3-dimensional models. I present the technical details about this extraction at the end of the article.
The Enemies of Battlezone
Tank
The first enemy you'll encounter in the game is your direct counterpart, the tank. The body is built on a rectangular base, with three rectangular layers framing the lower half. Horizontal lines in the front of the tank resemble treads, which shift their vertical position as the tank moves forward, giving the appearance of a moving belt. In addition, an antenna at the top spins around as the tank moves. The antenna is the only enemy "part" that moves in space independently of its parent.
UFO
The UFO is really more for bonus points than anything else, since it doesn't fire at you, but it can be a squirrely target for your gun. Its body has two octagons, one four times the size of the other, with the vertices connected. The UFOs always appear at eye level and spin along their central axis, so their full three-dimensional structure is difficult to discern in-game.
Missile
Missiles start coming at you after you've cleared out a few tanks. They drop from the sky and then approach you in a zig-zag pattern, leaving you only enough time for a single shot. Don't miss! The body of the missile consists of two hexagons and is about three times as long as it is wide. A pedestal at the bottom appears to be responsible for the missile's motion along the ground, as it kicks up debris along its path. Finally, a crest-like feature adorns the top, though its purpose is unclear.
Super Tank
The super tank is a beefed up version of the regular tank. It closes in on you much more quickly -- you can outrun ordinary tanks, but not super tanks. The main body of the super tank is a wedge, giving it a more triangular appearance. The super tank has no treads, and its antenna is just a vertical line.
Extracting the 3-D Models
The process I used to extract the above models was very similar to that I described for 2-D vector objects, with the caveat that a single image doesn't give me enough information to determine the coordinates in three dimensions. For the tank and the super tank, I was able to obtain still images that were both face-on and in profile, allowing me to just read off the coordinates in all three dimensions. If the profile and face-on images were taken at different distances, then I would have to account for an overall scale factor between the two images, but no other transformations were needed. Note that it's important for the objects to be at a reasonable distance from the player so that the player's perspective is approximately parallel to the ground and the difference in scale between the front and back of the object is negligible.
The UFO presented a challenge because it's always at eye level, so it's very difficult to make out the bottom of the ship. However, if you get really, really close, you can barely make out the eight vertices of the bottom octagon.
Once I know that there's an octagon at the bottom, I only need one image to infer the the rest of the model. In the game, it spins without changing its size, so I can assume that the octagon is as deep as it is wide.
Finally, the missile was probably the hardest case because it never presents itself in profile. By the time it's close enough to make out the vertices, it's always oriented at least partly in your direction. Fortunately, I can get an idea of its angle of orientation from the legs of the pedestal at the bottom.
In this case, the fact that two of the corners of the pedestal overlap implies that the missile is at a 45 degree angle relative to the player's line of sight. This means that its apparent horizontal length is less than its actual length by a factor of a square root of two. The same is true of any pairs of points along the missile's central axis.
Feel free to drop me a message if you want the data files with the coordinates that make up the models. Note that the models match up with the game objects very well, but they are not exact and should not be viewed as canonical.
Do you know if anyone has ever looked at the code to try finding the model coordinates? I'm assuming they are defined somehow in the code since it appears that the 3-D perspectives are calculated on-the-fly. I might take this as a challenge if no one has done it before.
ReplyDeleteYes, around the time I published this article, someone posted a full disassembly of the game: https://6502disassembly.com/va-battlezone/objects.html. There's some discussion of the 3D objects, though I haven't gone in and actually extracted the coordinates.
DeleteCan you send me the "data files with the coordinates that make up the models?" Thanks!
ReplyDeleteSure, how shall I contact you?
DeleteI'd really like your data files. Big fan of Battlezone. Working on a very simple copy of the attract mode using laser galvos.
ReplyDeleteSend me a private message on Twitter (@MrVGBrow) with your email address and I'll send you the files.
DeleteThis is fantastic! You've done a real service to the retro community.
ReplyDeleteI'm working on a 3D library for Mini Micro, a retro-styled (but modern) virtual computer (see https://miniscript.org/MiniMicro/). I'd love to have these models to display. I'm not able to send PMs on X (formerly Twitter) anymore, but can you send them to support@miniscript.org ?