1983 · Legend

Valhalla

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

The 81 places, how each picture is drawn from its place's number, the way to the six quest objects, and what help leaves out.

01 · The map

The world, place by place

Hell fills the five southern rows of a nine by nine grid. North of it, the five western columns are Midgard and the four eastern ones Asgard. Each place is one row of eighteen bytes.

The map and the panel read the map table, $BF37, and the special places, $C644, from the listing as the tape loads them. Colours are the terrain; a thick border is a special place; a solid line is an exit that is always open and a dashed one an exit of a special place, which needs something carried or someone present. The number in a corner is where the place's ringway leads. The pictures are the game's own drawing: the commands each place sends run through the graphics code at $F7AF in a Z80 simulator, and 13 of them, read from the emulator's screen, were the same to the byte.

A row of the map holds the terrain, the exits as eight bits from north round to north-west, the place a ringway leads to, the crowns lying there, six pairs of an object and its column on the screen, and a scene feature for the picture. An object in a chest or cupboard has the column 255. A place holds six objects at most, which comes back in the bugs below.

Thirty-six places are special, with 128 plus a number in place of the terrain. The number picks a row of nine bytes in s$: the real terrain, the place's name, the object or character it needs and the one it forbids, the extra exits those two govern, and up to four more scene features. The description the game prints is put together from these (line 3902): a name only for a special place, "hall" after a name ending in an apostrophe, the terrain, and the world, which is Hell for places 1 to 45, Asgard for the four eastern columns above that, and Midgard for the rest.

02 · The pictures

Every picture comes from its place's number

No picture is stored. The game draws each one as you arrive, from the terrain here, the terrain one step north and random numbers seeded with the place's number, so a place looks the same every time.

    The commands

    The graphics commands lines 7010 to 7039 send for the place chosen above, in order, worked out by a port of those lines with the ROM's random number generator. test_pictures.py draws all 81 pictures from these commands with the game's code in SkoolKit's simulator and holds the sheet the map shows against them.

    The BASIC builds each command as a string and hands it to one machine-code entry, $F7AF, with LET x$=STR$ USR gi. Command 1 draws the place: the terrain picks one of eight drawers from the table at $E352 (icy waste, marsh, plain, lakes, forest, mountains, cave and hall), and the terrain one step north picks the view on the horizon from $E362. Before drawing, $DE35 seeds the machine code's own 32-bit shift register at $DAB0 from the place's number, so the ridges, dots and towers it scatters fall the same way on every visit. Valheim left and entered again gave a picture the same to the byte.

    The windows are chosen in BASIC. Line 7010 runs RANDOMIZE h*100*5, which sets the ROM's generator to the place's number times 500, and the following lines draw RND to choose which windows each castle gets and where a hall's tall windows go. Line 7010 also sends command 19 first for every place in Hell and for places 56, 57, 65, 66 and 81, which turns their buildings red on black.

    03 · Quests

    Secret: Felstrong can be the first quest

    The manual puts Felstrong fifth. On the map's own tables, nothing stands between the start and its cave but a ring.

    The route walked in the emulator from the start, with a ring poked into your pack: two steps west, a ringway, one step west, a ringway, north-east, north into Rankle's hall and its ringway to the cave. The game answered "You are not strong enough to open the cupboard."

    The table is a search of the map and the special places, which takes every condition but a quest object as met: the right ordinary object or character at hand, a ring for every ringway and someone strong enough for every lock. Each quest needs only the ones listed beside it. A chest or cupboard opens with the key and (35-sp)*6 strength, sp being the special place's number (line 1955). That is 174 for Ofnir, which you can manage at your full 175, and 180 to 204 for the other five, so for those you must tell someone stronger, with a key of its own, to open it.

    04 · Help

    Bug: help never says what is forbidden

    At a special place, help is meant to say what the extra exits need and what they forbid. What they forbid never reaches the screen.

    Every special place from s$. An extra exit is open when what it needs is carried or present and what it forbids is neither (line 3860).

    Line 6555 skips the extra exits altogether where a place both needs and forbids something. Where it only forbids, line 6563 starts the sentence again with "You can go ", over the forbidding text. Both were seen in play with the two bytes set by hand. Sixteen places forbid something, and help names none of them.

    05 · Chests

    Bug: a chest at a full place stops the game

    Putting an ordinary object into a chest or cupboard where all six places are taken stops the program with "3 Subscript wrong, 5310:5".

    An object put down where there is no room brings Klepto, who takes it to a neighbouring place: "Klepto steals the rock." Line 5309 works out where Klepto should stand from the column of the object, and an object in a container has the column 255, so the subscript of the screen's column array is out of range. Both were seen in play.