1986 · Activision

Aliens

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

Every sprite the game stores, stage by stage, played through the game's own animation tables where the code has them.

01 · The sprites

Every stage brings its own sprites

Each stage file carries its sprites with it, so each level's cast is drawn from a different set of shapes. Pick a stage to see them. The animations play at the game's rate, and the sheet below them holds every other shape the stage stores.

Drawn from the bytes on the Source tab. Each shape is labelled with its sprite frame number (the address divided by 64 within the video bank) and links to its bytes. The colours are those the video chip held when each stage was paused in play; where the game gives two kinds of sprite different colours, the Colours menu switches between them.

02 · The drop-ship

Level 1's nearest ring is two sprites moved on every line

The pipe the drop-ship flies down is a row of rings coming nearer, one sprite each. A sprite can be stretched to twice its size but no further, so the nearest ring, larger than any sprite, is drawn another way.

The far rings are sprites 5, 6, and 7, and each takes a larger frame as it nears: ring_frames7 ($8402), ring_frames6 and ring_frames5 give a frame from $BB to $BF for each of eight depth steps. ring_advance ($8163) adds the speed, $50 on a PAL machine and $60 on an American one (speed_table, $83C9), to a fraction, and each carry moves the rings a depth step on. After the eighth, new_ring ($817F) moves every ring one sprite down and starts a new far ring in sprite 7, light blue and yellow in turn.

The nearest ring is sprites 3 and 4 together, its left and right edges, in frames $B6 to $BA. The raster interrupt moves both sprites across on every line from tables of x positions, one table for each depth step (near_x3_tables, $8422), so the two thin edges draw a circle up to 264 lines tall (near_ring_half, $8472). How far that ring is from the centre decides whether the drop-ship crashes.

03 · The Queen

The Queen is five sprites, and two of them draw her twice

The Queen fight shows two large figures, the power loader and the Queen, with only eight sprites. The loader takes four and the Queen the other four, and the Queen's legs come from re-using two of hers lower down the screen.

At line 5, raster_top ($8270) places the loader's claws and arms in sprites 0 to 3, in frames $0603 and $0603 plus $1C, at the heights of the two arms. Sprites 4 to 7 are her head (frames $05 and $06, or $20 and $21, chosen at random), her body (body_frames, $823A), and her tail (tail_frames, $8234). Once the beam is past them, raster_queen ($8347) moves sprites 5 and 6 down and gives them her legs' frames (lower_frames, $8621). The loader's sprites are multicolour and yellow, and hers are single-colour black.

Every eight frames swing_tick ($8625) moves the tail and the legs a step on. At line $DF, raster_floor points every sprite at the blank frame 4, and while she reels from a strike it shakes the screen by a line and a pixel on odd frames.

04 · The operations room

Ten aliens in five lanes come from four sprites

Level 3 has two aliens in each of five lanes, ten in all, each drawn in two halves. That would take twenty sprites. The game uses four, re-placed for each lane as the beam moves down the screen.

raster_lane_a ($81AB) puts the upper halves of a lane's two aliens in sprites 0 and 1, and raster_lane_b ($81ED), six lines further down, the lower halves in sprites 4 and 5, then sets the next call $0E lines on for the next lane. The upper halves step through frames_upper ($89C3) every eight frames. A burning alien shows burn_upper and burn_lower instead ($8A0B). The flame thrower is sprite 2, flickering between yellow and orange from flame_colours ($8A27).

05 · The complex

Levels 2 and 5 animate through the engine's object code

The APC rescue and the Newt rescue share their sprites byte for byte: 112 frames of marines walking four ways, gun flashes, and aliens. They are the two stages that drive their sprites through the engine's shared object code, and they hand it the same animation tables, each from its own file.

A stage hands the engine 18 table addresses from the start of its file, and link_object_tables ($0DC1) writes them into the object code. For each of level 2's thirty animations the tables give a first frame (anim_frame, $93E4), a last step, a speed, flags, and a list of frames counted from the first (frame_lists, $9391). part_frames_tick ($0FA4) adds the speed to a fraction each pass and takes a step on each carry, and frame_step ($1041) reads the flags: one bit plays the animation once, another swings it to and fro. Both levels' tables decode to the same thirty animations, which the viewer above plays from level 2's copy.

06 · The screens

The pictures are bitmaps, packed in the stage files

Most stages show a high-resolution or multicolour bitmap in video bank 1, with the screen matrix at $5C00 and the bitmap at $6000. Each picture is stored packed in its stage's file and unpacked into place when the stage starts.

unpack_inline ($129D) takes the packed data's address and length from the four bytes after its call. In the data, $80 and two bytes set where the next bytes go, a byte from $81 up repeats the next byte (its low seven bits plus one) times, and a byte below $80 copies the next bytes as they are. The briefing's picture of the marines, for one, is 5,325 bytes packed (scene_picture, $9810). The text between the levels is printed into the same bitmap with the engine's own font, which is why the story pages and the pictures share one screen.