1986 · Firebird

The Sentinel

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/the-sentinel with me to Gold.

Every object on a landscape is drawn by one routine from a list of points and a list of faces: the robots, the sentries, the trees, the boulders, the meanies, the Sentinel and its tower, and the blocks the title's letters are built from. Only the sights and the scanner are sprites.

01 · Everything that moves

Every object, drawn by the game's own 3D code

The ten shapes the 3D code knows, each drawn by the routine that draws it in play, turning. Drag across a picture to turn them by hand, and pick the colours of the title or of a landscape.

The objects are drawn by the game's own code in the built site.

Point at an object for its numbers.

Drawn by the game's routines in the page, over the listing's bytes. place_title_object ($8819) sets up the viewer as the game-over picture does, then the object is moved 10 tiles in front of the viewer and a unit below, and the view's pitch set to −14 in place of the picture's −12, so that all ten fit at one size; draw_object ($8533) draws it with its yaw ($09C0 + n) a step of 4 further on, 16 steps a second. Each picture is a window of the 320 × 200 bitmap at $E000, wide enough for the object at every turn. Landscape colours are the play palette at $869D with colours 2 and 3 from $14F3 and $14D4 by the number of enemies, as $1420 sets them.

An object is a list of points and a list of faces. Each point is three bytes in three tables: its angle around the object's upright axis ($9DE0), its distance from that axis ($A060) and its height ($9F20). To draw an object, draw_object adds the object's yaw to every point's angle and multiplies the distance by the sine and cosine of the sum, so turning an object is changing one byte. The ten types share 160 points, numbered on from each other: the robot's are 0 to 28 and the tower's 124 to 135 ($9CA0).

Each face is one byte at $A1A0, and a list of its corners. Bits 0 and 1 give three or four sides, bits 2 and 3 the colour it is filled with, bits 4 and 5 the colour of its edges, and bit 7 the pass it is drawn in. The colours are the four of the screen, not fixed ones. On the title they are blue, black, red and yellow. In play they are blue, black and two colours set by the number of enemies on the landscape, so the robot that is red and yellow on the title is white and green on a landscape with one enemy.

The three blocks are the pieces the title's big letters are built from, one block for each pair of pixels of a character, on a tile of its own. Each has eight points and only four faces: its top and three of its sides ($A6A0). The fourth side and the bottom are not stored at all, and the title, which looks at the letters from one side, never shows them. Turn a block round in the line-up and, seen from the missing side, it all but disappears.

Drawn from a long way off, a face's edges take its fill colour ($22E2, when the distance's high byte at $7D is $0F or more), so a distant object loses its outlines.

The sights and the scanner

The sights are sprite 0, its shape at $7000 as the game writes it, in the colours $98FF-$9909 give it, white with black, over each of the four screen colours of the palette above. The scanner is sprites 1 to 3 in white, black and green, drawn by draw_scanner ($163F), 50 times a second as the raster interrupt calls it while an enemy is draining the player.

The BBC Micro original drew the sights and the scanner into the screen. The Commodore 64 version makes both of them sprites. The sights are a cross 11 lines high whose pixels alternate between white and black, so it shows on any ground. The scanner at the top right is three sprites side by side, of which only the top four lines are used. draw_scanner fills them a byte at a time with one of four patterns for the state, chosen by two bits of a random number from the page of them at $0200. It reads 32 of those 256 numbers on each redraw, so the static repeats every eight redraws, six times a second. When an enemy can see the player but not the tile the player stands on, the right half is drawn in the quiet pattern. Paused, the whole scanner is solid green.

02 · One face at a time

The title's Sentinel, drawn face by face

The Sentinel on its tower, drawn as the title screen draws it, a face at a time. What is drawn later covers what is already there, so the order decides which faces show.

The bottom right-hand corner of the title's bitmap, 100 × 156 pixels, as draw_title_pair ($887E) draws them: the object on top in configuration 1, then the tower in configuration 2 ($8819). Each picture is the bitmap after one face; the outline marks what that face changed. In the list, faces of the second pass are underlined, and faces that changed nothing are faint.

draw_object draws the faces in the order of the table, each one painted over whatever is already there. A face turned away from the viewer draws nothing. Seen from above, as in the pictures in the first part, six of the boulder's ten faces draw nothing; turned half round, three of those six swap places with three that drew.

A fixed order is right from only some viewpoints. For three types, the robot, the sentry and the Sentinel, when the object stands above the viewer, draw_object makes two passes ($854D-$856D): first the faces with bit 7 clear, then those with it set. On the title the Sentinel stands a unit above the viewer, so its faces go 102 to 104 and 126 to 136 first, then 105 to 125. Seen level or from above, all 35 go in order. A meanie makes two passes too, chosen by which way it faces rather than by its height. The other six types are always drawn in one.

03 · The loading picture

The eye the cassette shows while the game loads

The 1986 cassette shows a huge eye under the game's name while the last of the game loads, with Firebird's logo and the artist's signature, Bob. The game itself never draws it.

The cassette's own bytes, drawn as the video chip draws them: a multicolour bitmap at $4000, its screen colours at $6000, light grey in every cell of colour RAM, on black. The border is the light green it was at that moment of the load.

Until the picture arrives, the tape shows a text screen with LOADING and a count of the blocks read so far, in hexadecimal, from 01 up to 5F. With every block the border moves on to the next of the sixteen colours, about once a second. The eye appears a little over three minutes into the tape and stays for about a minute, the border still changing around it, until the title screen takes its place.

The disk copy this site describes still holds three fifths of the picture's bitmap while the game plays, the same byte for byte as the tape's. The game's character sets cover the top of it and its sprites a strip through the middle, and nothing reads the rest (Discoveries).