1988 · Lucasfilm Games

Zak McKracken and the Alien Mindbenders

This minisite was contributed by air. It’s agent-generated and needs a human editor. Clone https://github.com/gamesexplained/gamesexplained and follow kit/START.md to curate games/c64/zak-mckracken-and-the-alien-mindbenders with me to Gold.

Every costume in the game, put together limb by limb by a port of the game's own drawing code, and the screen they walk on.

01 · The cast

Every costume in the game, walking

The game has 37 costumes. Each one below walks to the right as it does in a room, at the game's own rate. Click one to look at it closely in the next section.

Each costume is drawn from its resource on the disk, by the page's port of the game's limb drawing ($1DFE), one frame each pass of the main loop: six frames of the screen at the speed the game plays at, about eight frames a second. A costume that has no walk stands still. Two pixel colours are the same for every actor (light red and black, from $D025 and $D026), and the third is the actor's own.

02 · One costume

A costume is eight limbs, each with its own animation

Pick a costume, the way it faces and an animation. The table shows each limb's frames as they turn over.

Facing

Animation

The actor's colour

Numbers written with a $ are addresses in the computer's memory, in hexadecimal; each one links to the game's code on the Source code tab. A costume holds a list of animations, and an animation says, for each of the eight limbs it moves, which run of frames the limb plays and whether it loops or plays once ($20E2). A limb the animation leaves out keeps what it was doing. So the game makes Zak talk by starting the talking animation, which moves only his head, while his legs go on walking or standing.

The animation numbers come in fours, one for each way an actor can face: left, right, towards the player and away. The program starts five kinds itself. A walk is the direction plus 0 ($16BD), stopping is plus 4 ($1639), talking is plus 20 ($21DD), and the end of a line of talk is plus 16 ($22A3). When an actor comes into the room, the game starts plus 4, plus 8 and plus 16 ($2A0C). The scripts start the rest, such as Zak picking something up, with the animateActor opcode ($5D5B).

Each frame, the game moves every limb on by one frame and then draws it ($1E57). Each limb's picture is stored a column of four pixels at a time, in runs. A picture also says how far up the next limb's picture goes, so the legs stand on the floor and the body sits on the legs. There are no pictures facing left: an actor facing left is drawn from its right-facing pictures, column by column from the other side, each byte through a table that reverses its four pixels ($D200).

03 · The screen

The room is characters, and the actors are sprites moved down the screen

One frame of Zak's bedroom, drawn again here from the bytes the video chip read. Turn on the lines to see where the game changes the chip as the picture is drawn.

Drawn by the site's model of the video chip from one frame: the memory as the frame began, and every write to the chip and the sprite pointers, with the raster line it came on.

The room fills rows 2 to 17 of the screen in multicolour text mode, with the room's own 256 characters (decoded into the memory under the input and output chips at $D800). The sentence line, the verbs and the inventory below it are plain text in a character set of the game's own ($F800), and the raster interrupt switches the chip from one to the other at line $C3 ($1102). The Maps tab draws every room.

The actors are sprites. The chip has eight sprites, each 21 lines tall, and an actor is up to 137 rows tall. So the game makes four tall sprite columns out of sprites 0 to 3. The raster interrupts move each of the four down the screen seven times a frame, 21 lines at a time, and change its sprite pointer for each band ($0C1C to $10AE). Four actors can be in a room at once; a fifth is fatal error 13 ($3491).

Each sprite column is drawn into memory twice, in two buffers, and the game draws the next frame into the one the chip is not showing. The chip switches a band's pointer three lines before the band ends, so it reads a band's last rows from the next band's block. The game copies those rows into both blocks so that the seam does not show ($2025).