1990 · Thalamus

Creatures

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

Every creature in the game is a few bytes of script: sprite frames with loops among them, which the engine steps every other frame. Below, all of them move as the game moves them. The stages and the three torture chambers are drawn on Maps, and what the game hides is on Discoveries.

01 · The game

Clyde Radcliff and the Fuzzy Wuzzies

The Fuzzy Wuzzies are small furry aliens from the planet Blot. They crash-landed in the Pacific, swam ashore to an island and built a village there, and the island's demons, who hated the noise, invited them to a party, threw a net over them and carted them off to their torture chambers. The one Fuzzy they missed was Clyde Radcliff, who was being sick in the bushes. The manual says he woke the next morning with breath that could scorch a tree at six paces, and in the game that breath is his strongest weapon.

Each of the three levels is two stages of scrolling landscape, crossed from left to right against a timer. Some of the creatures in them are Magic Potion Creatures, which Clyde collects as money for the witch's shop, visited before every stage after the first, where they buy weapons and clues. After each level's second stage comes a torture chamber: one screen, one of Clyde's friends about to die, and a puzzle that saves him if Clyde solves it in time (Maps steps through each one). The ending follows the third chamber.

The title screen: the Creatures logo and the credits to John and Steve Rowlands
The title, a program of its own on side A.
Level 1.1: a hot-air balloon with a creature in its basket above a landscape of mushrooms and palms, the score panel below
Level 1.1. The balloon is two sprites side by side.

02 · The creatures

Every creature, moving as the game moves it

Each world's creatures, with the colours and speeds their levels give them. Pick one to see its frames and the script that plays them.

Speed

Every creature is stepped by the engine's own rules, ported (the cr-anim block in this page), over its script and colour list as the level file holds them, at 50 frames a second. test_gallery.js runs the engine's animate_objects and object_colours on a 6502 simulator beside the port for 3,000 frames of each script here and finds every frame and colour the same. The colours are those of most of the creature's spawn records. The background is the colour behind the top of the world's first stage, or black for a creature drawn in that colour. A few creatures move only when Clyde shoots them, and here they are shot twice a second.

A creature is an object in one of fifteen slots, and the level's spawn records fill the slots as the landscape scrolls in. A record names a type, and the type names an animation script and a speed in the level file's tables (anim_lo, anim_hi and anim_speed, from $8D5A in every level file). The engine's animate_objects reads one byte of the script at a time:

$02-$3Fa sprite frame: one of the engine's shapes, the 64-byte block at $4000 plus 64 times the byte $80-$FFa sprite frame: one of the level file's shapes, found the same way, from $6000 $40-$7Fa loop: the next byte is the distance back, and the body plays once more than the low six bits say $00start the script again $01remove the creature, the end of every death and burst

The engine animates the even slots on one frame and the odd slots on the next, by turning one branch at $C769 from BEQ to BNE and back, so each creature has its turn every other frame. A creature's speed counts those turns. At speed 1 a new byte comes every fourth frame, twelve and a half times a second, and at speed $7F one comes every 256 frames, which is how the still creatures are made. Colour works the same way, from a list of colours with loops of its own (object_colours), which is how the potion creatures change colour.

Some creatures move only when shot. A spawn record whose hit response has both low bits set leaves the animation off (object_spawn, at $20EE), and each shot gives the script one more turn (hit_response_3). The swelling balls of world 2 swell a frame with each shot until they are gone, and level 2.1's end creature, the crescent, changes only when it is hit.

Shapes are shared between scripts. The walking devils of world 1 have five scripts over the same thirteen frames, and one of the five holds a single frame still. A creature too big for one sprite is two or four objects that the level places side by side, like the dragon at the end of level 1.1, a head and a body. Two shorter scripts, types 41 and 42, move the dragon's shapes again, mostly in level 1.2.

03 · Music

Music: in a level the tune has one voice, and the effects two

The page runs the game's own music player: its code and every tune's bytes, from the listings, on the kit's 6502 simulator, from the cr-music block, once a frame, through the site's model of the SID. test_music.js calls the same code on the simulator directly and compares every write to the SID, frame by frame, for every tune: to its end, or for 20,000 frames where it repeats. The level tunes play as they do in a level, on the third voice alone; the rest play on all three.

One player serves the whole game. The engine keeps it at $0334, and the title carries its own copy of the same code, assembled $CC bytes higher, because the title is a separate program. A tune is a header of two voice offsets and three voices of two-byte commands that call shared sections, and all eighteen tunes are in that form.

Before a level starts, music_hooks_ingame writes three bytes into the player's own instructions ($0456, $087C, $0887): where its voice loop stops, and which registers its copy to the chip starts and stops at. In a level the loop runs for the third voice alone, and the copy skips the registers of the first two, which are left to the sound effects. On the Get Ready screen, left and right on the joystick turn the level's music off and on.

04 · Sound effects

Sound: the effects take the voices the tune leaves free

The page runs the engine's own sound effect code, its routines and tables from the listing, on the kit's 6502 simulator as the music is, once a frame. Each sound starts as the game starts it, with the same requests, from silence, with the music off and the effect channels idle as they are when a level begins. The charge turns into the flame after 36 frames, as a full charge does when fire is let go, and the waterfall's roar takes the loudness level_sound gives each column of the map, a column every 32 frames here. The five creatures' sounds are named after a creature whose movement script plays them. test_sfx.js runs the same calls on the kit's 6502 simulator and compares every write to the SID, frame by frame.

A part of the game asks for an effect by its number, 0 to 28 (sfx_request). Three tables give each number its channel, its priority and the definition it plays, and the request takes its channel only if nothing of higher priority is playing there. Once a frame sfx_play_pending starts one waiting effect at most, so the two halves of a shot or a pickup start a frame apart, and sfx_update steps each channel. A definition is 20 bytes (sfx_definitions): an envelope, a length, and two sets of waveform, pulse width and a frequency that sweeps up or down between two limits, with the sound switching from one set to the other every so many frames.

With the music on, the tune has the third voice, and sound_set_music_mode writes an RTS over the test for the third channel's requests, so the effects share the other two. The effects that belong to the third channel then never start: world 1's waterfall, and the sounds of the creatures' movement scripts, whose sound command does nothing with the music on anyway ($C4CF). Turn the music off on the Get Ready screen and the hoppers, the bombs and the discs can be heard. Five of the 29 numbers are asked for by no code in any of the game's files (Discoveries).

05 · Weapons

Potion creatures buy the weapons, one grade at a time

Fire held and let go breathes the flame. The manual says to hold fire for a second; the charge counts 36 frames, about three quarters of one, and a released charge turns both of Clyde's shot sprites into the flame for 24 frames (player_fire). Down and fire opens the weapons tablet, which offers only what the witch has sold him. While the tablet is open, the engine keeps the flame's eleven sprite shapes aside and puts the tablet's in their blocks (tablet_swap_step).

The witch sells each weapon a grade at a time, up to the third, for Magic Potion Creatures of each kind (item_cost_1 to item_cost_3). A creature on a double-height sprite is worth five. Droopy comes at its first grade, so the shop sells it from the second.

WeaponCost of each kindWeaponCost of each kind
Droopy0 / 1 / 1Wiggler2 / 1 / 2
Super Droopy2 / 0 / 1Curly Wurly3 / 2 / 1
Fireball2 / 1 / 2Flamer6 / 3 / 4
Fall Up3 / 1 / 2Scatter Ball3 / 5 / 5
A clue6 / 6 / 6

06 · The witch's shop

The witch picks her greeting by Clyde's lives

Lives

The page runs the shop's own message code, with each level's messages from the listings, on a small 6502 (the cr-cpu block): the choice of greeting by the lives, the boxes that grow to size, the letters printed one every third frame, and the purchase of a clue, refused as the shop refuses it. The rest of the screen is two frames recorded in the emulator, before and after the weapons tablet opens, drawn line by line. The page does not run the tablet. When the INGREDIENTS box's turn comes, it shows the recorded screen with the box and the tablet open. test_shop.js holds the page's message box against the emulator's, frame by frame, through the greeting before level 1.2, three clues bought and a fourth refused, and checks every byte against the listings.

Each level file carries the witch's lines: six message addresses and a lives mark at $8EEF. The shop reads them from the level that has just loaded ($EB50). With fewer lives than the mark she says "YOU BETTER BE MORE CAREFUL", and with the mark or more "HI THERE MY CUTE BUNDLE OF FLUFF". The mark is 6 before level 1.2, 7 before level 2.1 and 3 before the rest. Clyde starts with four lives and gains one at each stage, so a player who has lost none and picked up no extra life meets the first shop with five, and is warned.

She has a third greeting, for a Clyde with no lives, that no player hears (Discoveries). Set the lives to 0 above to see her say it.

INFORMATION sells three clues to the next torture chamber, each for six potion creatures of every kind. They are counted at $CFED, which goes from 2 to 5 and back to 2 at each chamber, and the third clue is the level's message 5. Message 4 is never read (Discoveries).

07 · The levels

Six stages in three worlds

StageThe Get Ready screen calls itTimerSpawn recordsEnd creature
1.1Lilly Lakes leading to the Caves of Slime600114the dragon
1.2Creepy Caves followed by Watery Falls800114a double frog
2.1Manic Meadows leading to Piranha Ponds75096a crescent that splatters
2.2Piranha Ponds leading to the Black Forest of Gateau600113the flipping stones
3.1Gruesome Graveyard followed by the Creepy Castle500126the patterned blocks
3.2Dingy Dungeons leading to the Final Conflict500136a waving ghost

Side A's MENU is the title. Fire there loads GAME, the engine, which stays in memory to the end and loads everything else from side B with its own fast loader. A file's name is a letter for what it is (L for a level, T for a chamber, C for the ending) and the stage number as a letter: LA, LB, TC, and on to CJ. The attract sequence and the witch's shop take turns in one block of memory at $E000. The shop arrives with level 1.2 over the attract code, so a game over reloads the attract block from a copy of its own on side B, a file called 1@.

Each world is one file loaded to $5800-$ABFF, with its character set, its sprites, its tunes and its own code at $A300. The second stage is a smaller file loaded over the first from $8700: a new map, new spawn records and new text over the same graphics and code. The engine calls a level's code through five hooks, which is how world 2 adds swimming, with an OXYGEN bar that empties in about 31 seconds, and world 3 a broomstick that flies in four directions for about as long. Each new stage adds a life.

08 · Scenery

Distant scenery scrolls by rotating its characters

The backgrounds move more slowly than the landscape, though the machine has one scrolling layer. While the screen scrolls, the level's frame routine rotates the bit patterns of the background's characters a pixel against the scroll, each strip at its own rate: in world 2 the green grass every fourth frame and the woods every other one, in level 3.1 the distant graves at three paces ($A8C3, $A95F).

09 · The ending

The ending writes its text as holes and hides the gang behind a sprite

Go to

The page runs the ending's own code, 15,303 bytes of it and of the engine from the listings, on the 6502 of the shop above, in a machine that has only what the ending touches (the cr-end block): the raster interrupts that split the screen into bands, taken through the KERNAL's entry as the game takes them, the cycles the video chip takes from the processor, and the joystick's fire. Each frame is drawn line by line from the chip's registers and the writes to them. The sound is the music player's port of the driver, started on the ending's tune when the ending starts it; the fade at the end is not played. test_end.js holds the run against the emulator's, all 2,452 passes of the scenes, and five frames against its pictures. They match to the pixel, but for 4 pixels on the line where the village's cliff colours come in.

The text screen brings in the engine's text characters and inverts them (ending_start), so each letter is a hole in a solid cell and shows the background, which steps through eight colours until fire. Without the cheat it adds a hint to use it (Discoveries). Tick cheat used to see the screen a cheater gets.

Each scene has raster routines of its own that change the background colours partway down the screen: the sky over the village and the cliff below it in the first, the shack's roof, its walls and its ground in the other two. The routine at line $FF plays the music and sets a flag. The scene's loop waits for the flag once a frame, moves every sprite on with a small animation engine (anim_all: a frame held, a loop, back and forth, once forward or once back) and steps the scene's script. In the rave, sprite 0 is a block of orange stripes over the shack's wall. The logs are drawn in front of it and it is drawn in front of the gang, so where the logs leave a gap the fuzzies walking past show as stripes, and they seem to go inside.

After the pair go back in, the ending fades the tune out and sets the stage to $FF, so the game reloads from the start and goes to the high-score check, as after the last life.