1987 · Thalamus

Delta

This minisite was contributed by chunkypixel, 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/delta with me to Gold.

Up to seven enemies at once, entering one a frame, each flying a path of straight segments, some taking several hits and some changing shape.

01 · Every attack, replayed

The attack waves of all 32 stages, played by the game's own code

Every group of the 31 stages that match VICE (all but stage 29), each enemy drawn with its own sprite and colour, with the state the code keeps for it.

Speed

Recorded, not imitated. Delta's own code, the bytes on the Source code tab, was run in the kit's simulated C64 with nobody at the controls, and every enemy's position, sprite and state was written down once a frame from the start of the game (stages 1 to 32 less 29: 103,350 frames, about 34 minutes, 373 groups, 2,843 enemies). Two stand-ins replace a player, both through the game's own variables: enemy fire is made harmless with the game's own trainer patch, so the ship survives, and a group still on screen after 15 seconds is shot the way a laser hit marks it, which is the only way a boss stage ends (marked "shot" in the group list). Nothing else is changed, so each group flies its whole path; the boss's aim follows the ship, which stays parked at its start. Checked against VICE: each stage was also played in VICE from a snapshot with the same stand-ins, and every enemy's position, life and hit points matched the recording on every frame of every group, up to where the stand-in shots began, and leaving out enemies of a group the shots hit that are still exploding when the next group begins: 538,864 enemy-frames with no difference. In the heaviest frames (56 times in these stages) the game's interrupts run past the main loop's once-a-frame call on a real C64, so VICE takes one sample fewer there while the enemies move on as usual; the kit's machine, which does not model the cycles the video chip takes from the processor, never runs late. VICE's own play reached stages 14, 19, 20 and 25 with different game state, the random numbers the enemies use among it, so those were checked in VICE started from the recording machine's memory at a group's first frame. Stage 29 is left out: even from the machine's own state, VICE drifts within one group, until an enemy enters a frame apart and in another slot. That is probably the cycles the video chip takes from the processor, which the machine does not model. The scenery rows and the player's ship are not drawn. A dashed box is an enemy showing the empty sprite $9B: present and moving, with nothing drawn. That happens for an enemy's first one to three frames, before its animation starts, and at the end of an explosion; in the recordings of all 32 stages no enemy is invisible for longer.

02 · Groups

A stage is a list of groups

Enemies arrive in groups of up to seven, and each group is one eight-byte record.

Each stage is a list of groups ($B800 for stages 1 to 21, $B900 after), and each group points at an eight-byte record in wave_records at $AB00. enemy_spawn ($811F) decodes it: hit points, animation, colour, which side to enter from, points, path, starting height and delay. One enemy enters per frame into a free sprite, up to seven.

The shop is a group too: a record with bit 4 of its third byte set turns its sprites into the weapon icons (How it works). When a group ends and none of its enemies escaped, most groups add a credit (wave_spawn_step, $8010).

03 · Paths

Paths made of straight segments

Every enemy flies a path, and every path is a list of short straight runs.

A path ($B500) is a list of segments ($A880), and each segment runs a list of (dx, dy) steps from $B000 for so many frames a step, mirrored as the record says (enemy_move_1, $82CC, and six copies, one per sprite). An enemy that leaves the play area is gone, and a group with an escapee earns no credit.

04 · Hit points

Hit points and second forms

Some enemies take several hits, some cannot be destroyed, and some turn into something else.

Hit points come from $A100. An enemy with 0 or 1 dies at the first hit, and one with $FF cannot be destroyed. When bit 7 of its segment's fourth byte is set, an enemy whose hits run out changes into a new form instead of dying: the mover copies the bit at $8369 and tests it at $8449.

In waves led by an indestructible enemy in the first sprite, destroying the one in the last sprite blows up the whole wave (enemies_wave_timers, $9024).

05 · Points

Points and extra lives

Enemies are worth 5, 7, 10, 15, 20, 25, 50 or 100, and the panel shows ten times that: the score is kept in five digits and printed with a 0 after them. An extra life comes each time the panel's ten-thousands digit goes up (extra_life_check, $9CD6), so every 10,000 points, up to nine lives.