1990 · Blade Software

Lords of Chaos

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/spectrum/lords-of-chaos with me to Gold.

Everything on the map is drawn in squares of three characters by three, from tables each scenario brings with it. Every creature, object and piece of ground has its own loop of frames, which the interrupt steps through twenty-five times a second.

01 · The things on the map

Every square shows one of 170 things, each with its own animation

A byte of the map says what a square shows: below $50 a kind of ground, from $50 an object, from $8C a wizard or a creature. Each scenario has its own table of these things, so the same number can look different in another scenario. Here is every one, moving as the game moves it. Choose one to see its frames.

‹›

Loading the scenario…

Drawn from the listings the way draw_block ($A7B6) draws a square, and animated the way the interrupt animates them ($A891, next_frame $A936), one working frame every second frame of the 48K's picture.

Each thing has five bytes in the scenario's table ($D032): the character set its characters come from, the graphic (nine character numbers, three rows of three), the colour set (nine attributes, one for each character), and two bytes of animation, a count and the number of the next frame. On every second frame the interrupt counts each thing's count down, and when it reaches 0 the thing takes the next frame's four bytes from the frame table ($D034): a new graphic, a new colour set, how long to show them and which frame comes after. A count of 255 is never counted, so a thing with 255 stands still.

The animation belongs to the number, not to the creature. Every goblin on the map is the same map byte, $95, so all the goblins step in time together. The four wizards are one figure of four frames in four sets of colours. A few entries draw graphic 0 of set 0 in colour set 0, the look of nothing in particular: a thing that scenario never puts on its map.

Two of the numbers below the objects are effects. When a blow wounds a creature, show_hit ($798B) puts $4E on its square for a moment, two graphics taking turns. $4F is the sparkle: it stands on graphic 0 until the game points its next frame at frame 165, and then it plays three graphics and stops. The cursor is not a thing at all. draw_map draws it in place of the square under it, in character set 0, with one of four graphics and colour sets that say what the player is doing.

02 · A wizard's death

A dying wizard flies apart in eight directions

When a wizard dies or escapes, the window centres on its square and the game draws the wizard's own figure flying out from the middle in eight directions, seven times over, in seven colour sets, with a falling sound.

A port of the game's routine ($8C0C, death_animation_frame $8C6A). The pause after each step is the time the game's sound takes, without the slowing a 48K's screen memory adds.

The figure is the wizard's graphic as it stood when the wizard died, since the interrupts are off from then on. death_animation_frame draws it at eight places round the middle of the window, one character further out each time, ten times, with a sound after each step, and draws over what it drew before, so the figures leave trails. Frame number n of the seven uses colour set n of the scenario, the first seven colour sets in the table, whatever the wizard's own colours are. Then the map is drawn again and the trails are gone.

03 · A hit

A hit flashes three graphics over the square

When a blow lands, a missile reaches its target or a creature attacks a wall, the square shows a burst: graphics $53, $54 and $55 one after the other, in about a sixth of a second.

A port of draw_hit ($AEC2). Each graphic stays for the time the game's sound after it takes.

draw_hit does not go through the table of things. It points the drawing at character set 1 ($BE3C), which is in the program rather than the scenario, and draws graphics $53 to $55 straight from the scenario's graphics table in colour set 0, playing a little of sound 8 after each. When a creature strikes another, the map is drawn again straight after, and the wounded square shows $4E, then the sparkle if the creature died. Scenario 3 gives the same three graphics, in other colours, to one of its own squares: map byte 8, which has no name and lies on four squares of its map.

04 · Missiles

A missile is a cross or a star of pixels

Flame, arrows, thrown objects and spells fly as a handful of pixels, drawn a pixel line at a time from the shooter to the target, with a tail that wipes itself out behind them.

The two shapes as shapes ($AD4E) lists them, line and column offsets from the missile's place, and the seven styles in missile_styles ($B60E), eight bytes each.

set_missile copies a style's eight bytes into place before the flight: the shape, how many pixels it moves a frame, how long its tail is, how far it reaches, its colour, its combat strength, whether it is magic, and its sound. draw_missile then steps along the line from the middle of the window and plots the shape at each place, keeping the last places in its tail and wiping the oldest. A missile that leaves the window moves the view seven squares that way and carries on.

05 · The screen

Nine character cells to a square, each with its own colours

The map window is seven squares by seven at the top left of the screen, and every square is nine of the Spectrum's character cells. Each cell has its own attribute, so a square can carry up to nine pairs of colours without them bleeding into each other.

The thing chosen above, one cell to each box: the character it shows and its attribute, ink on paper. A Spectrum cell has one ink and one paper, which is why the game's figures are cut into cells of their own colours.

The rest of the screen is the game's own: the information display on the right, with the pictures of the square under the cursor (drawn as squares too, by the same routine), its icons and its bars, and the message lines at the bottom. The big map shrinks each square to one character of the scenario's small font.

06 · Character sets

Two character sets in the program, two in each scenario

A thing's first byte picks one of four character sets from the scenario's table ($D07A). Sets 0 and 1 are in the program, the same in every scenario: set 0 holds most of the creatures and the cursors, set 1 the wizards, the bursts and a share of the creatures, objects and ground. Sets 2 and 3 come with the scenario and hold most of its objects and its ground.

07 · The loading picture

The picture that arrives all at once

The loading picture is a crowd of the game's creatures and wizards under the LORDS OF CHAOS logo: a wizard in a magenta robe holding a staff, a hooded figure with red eyes, a warrior with a sword and a bat, signed PIC BY S. McCLURE. It does not build up on the screen. The screen stays black for the 42 seconds its bytes take to load, out of sight in memory, and then the whole picture is copied to the screen at once, 68 seconds into the tape.

The tape's own bytes, as the loader copies them to the screen.

The picture stays up while the game loads after it, until the game's first panel draws over it.