1994 · Psygnosis

Lemmings

This minisite was contributed by air, Nico-van-der-Zijden. It’s agent-generated and needs a human editor. Clone https://github.com/gamesexplained/gamesexplained and follow kit/START.md to curate games/c64/lemmings with me to Gold.

All 100 levels, each drawn from its own file on the disks, with the figures its briefing gives and the access code that leads to it.

01 · The maps

Every level's terrain, as the game unpacks it

A level is 312 multicolour pixels wide and 168 lines high: three and a half times the width of the play area, and its full height. Every other block of 48 pixels sits 8 lines lower, as the two halves of the sprites do on the screen.

Drawn by this page from the level files. Each file was unpacked by the game's own code on the kit's 6502: the loader's unpacker ($CDFB), then the routine every level file carries, which unpacks the terrain and lays it out as sprite shapes at $8000 (unpack_terrain, $E094). The page reads the shapes back in the order that routine wrote them. For level 1 of Fun, the terrain and the 160-byte header match the game's memory at the briefing byte for byte. Colours are the level's own, from its header at $E05C-$E06B. The objects (trap doors, exits, traps, decoration) are ORed into the terrain as the game does it (animate_objects, $2A48): each entry of the level's object tables is a few bytes of graphics for one place in the sprite shapes, shown when the object's frame matches its own, and the map shows frame 0, the level as it starts. Water is characters in play (animate_water, $2B96), drawn here as a blue fill from each column's surface row down. The markers, when on, are where the header puts the trap door (yellow) and the exit (cyan).

Every pixel takes one of four colours: the background, two colours shared by all eight sprites ($D025 and $D026), and the sprites' own colour, the same for all eight. A level picks its four from its header, which holds each of them four times, one step of the fade-in or fade-out at a time (set_colours, $0E1C). Most of the levels draw their earth in brown and orange with green grass, and a few use blues and greys.

The play area is 168 screen pixels wide, which shows 84 of the level's 312 multicolour pixels at a time, and scrolls sideways. How eight sprites cover it is on the How it works tab.

02 · The table

The briefings of all 100 levels

Each rating has 25 levels on its own side of a disk: Fun on disk 2 side A, Tricky on side B, Taxing on disk 3 side A and Mayhem on side B.

From the header each level's file unpacks to $E000. "Save" is the number of lemmings the level asks for, which the header stores beside the percentage the briefing prints ($E040 and $E03D). The skills are climber, floater, bomber, blocker, builder, basher, miner and digger, in the order of the panel. The release rate is the figure the briefing prints. The access code is the one the game shows at the end of the level before, and the one to type at the title's option 3 to start here. Click a row to see its map.

The number to save is always the percentage of the lemmings rounded up: 10 % of 25 lemmings asks for 3, and 83 % of 30 asks for 25. The header keeps the rounded number, so the game never works it out.

The 100 files hold their own level number, the next level's and both access codes. The end-of-level screen prints the next code from the level just played ($E00F), and the menu checks a typed code against its own table of all 100 (access_codes, menu part $9701). Level 1 of Fun has the code WANNABFREE, which at the menu does something else as well: see Discoveries.