ZXFeud Compendium A fan guide built from the game's own code
Contents
  1. Overview
  2. Controls
  3. The screen
  4. Herbs and brewing
  5. Spells
  6. Herbs
  7. Characters
  8. How Leanoric thinks
  9. Locations
  10. World map
  11. Strategy
  12. Trivia
  13. Notes for game makers
  14. About this guide
  15. Still to explore

Feud

ZX Spectrum, 1987

Feud is a top-down action game in which two rival wizards, Learic and Leanoric, race across a countryside of graveyards, villages and woods to gather herbs, brew spells and destroy each other.

You play Learic. Both wizards start with 40 energy. Collect pairs of herbs, brew them into spells at your cauldron, and use those spells to drain Leanoric's energy to zero before Leanoric does the same to you.

Win, and the game declares THE FEUD IS OVER!! YOU ARE VICTORIOUS!! Lose, and it tells you YOUR LIFE ON EARTH IS TERMINATED!

Damage is never instant. Each hit queues up 1 point of damage, and the energy portrait drains one point per game update. The game updates about 14 times a second.

Controls

On the title menu, press 1 for keyboard, 2 Kempston joystick, 3 Sinclair joystick or 4 cursor joystick, then 0 to start.

Q Up
A Down
O Left
P Right
SPACE Fire

The view flips a screen at a time: walk off an edge to move to the next screen. Neighbouring screens overlap slightly, so you always see a little of where you're heading.

Fire does two jobs. Normally, holding fire opens the spell book. While an attack spell is active, fire shoots instead.

The screen

Learic beside a thatched hut, with the spell book, portraits and compass below
The first screen of every game.
Spell book, portraits and compass
The status panel.
Spell bookShows one spell per page, with the two herbs it needs.
PortraitsLearic (left) and Leanoric (right). Each portrait drains as that wizard loses energy.
CompassAlways points towards Leanoric.

Herbs and brewing

Every spell needs two specific herbs. The spell book has a page for each of the 12 spells, plus a title page reading LEARICS OWN CONCOCTIONS.

  1. Collect both herbs. Walk over a herb to pick it up. The spell book jumps to that herb's page. A picked herb grows back in the same place after about 70 seconds, but never while its spot is on screen.
  2. Brew at your cauldron. Go to Learic's cauldron, one screen south of where you start, and stand on the square just above it. Hold fire, turn to the spell's page with left (next page) or right (previous page), then release fire. The herbs are used up.
  3. Cast it. Anywhere in the world, hold fire, find the brewed spell's page and release fire. When the spell wears off, you'll need both herbs again to brew it again.
Black text: herb not collected yetRed text: herb collected, or spell brewed

Leanoric collects herbs, brews and casts by the same rules, at a cauldron in the far south-east.

Spells

Durations are in real seconds. Spells can't be stacked: casting one that is already active does nothing.

SpellIngredientsEffectLastsCode
Teleport
Utility
DandylionBurdockInstantly returns Learic to the brew spot beside the home cauldron. The game never clears this spell after casting, so once brewed it appears to stay available. needs verificationInstant#CD34
Protect
Defence
PipewortRagwortLearic can't be harmed. Leanoric's spells and the Hooded Figure do no damage.10 s#C045
Sprites projectileSprites
Attack
SnapdragonToadflaxEach press of fire launches a sprite at Leanoric. Every hit deals 1 damage.10 s#C053
Zombie
Attack
DevilsbitBonesTurns a villager on the current screen into a zombie that copies Learic's movements. While the zombie shares a map cell with Leanoric, Leanoric loses 1 energy every update (about 14 a second). Needs a villager on screen.60 s#C071
Swift
Utility
SpeedwellMad SageLearic moves at double speed.10 s#C0C9
Freeze
Defence
Bind WeedBog BeanLeanoric, the Hooded Figure, any zombie and the villagers stop moving.10 s#C0DA
Doppleganger
Utility
Fox GloveCatsearTurns a villager on the current screen into a double of Learic: the villager flashes through the colours and a white Learic look-alike walks off in its place, while the real villager is hidden. After 30 seconds the villager returns. Nothing else in the game reacts to the double: Leanoric's movement and spells only ever look at the real Learic, so it fools nobody but a watching human (tested). Needs a villager on screen.30 s#C0E8
Invisible
Defence
ChondrillaHemlockLearic vanishes from the screen and can't be harmed.30 s#C130
Reverse
Attack
ThistleSkullcapScrambles Leanoric's directions. needs verification The game also has code for Leanoric casting it, which would reverse your controls, but Leanoric never chooses Reverse.20 s#C13E
Heal
Defence
BalmFeverfewRestores 1 energy every update, up to 15 energy in total. Energy never goes above 40.Until done#C168
Fireball projectileFireball
Attack
DragonsteethMousetailLike Sprites, but with fireballs. Every hit deals 1 damage.10 s#C171
Lightning projectileLightning
Attack
Cud WeedKnap WeedLike Sprites, but with lightning bolts. Every hit deals 1 damage.10 s#C18F
A yellow villager flashes through colours and becomes a white copy of Learic, which walks off to the left
Doppleganger cast on a villager (recorded in an emulator): the villager flashes through the colours, and a double of Learic walks away.

Herbs

The 24 herbs always grow in the same places. Each card shows the screen the herb grows on, with the herb outlined in yellow. "From start" counts screens east and south of Learic's starting screen, and the map cell is (row, column) on the world map.

Dandylion

Used in Teleport with Burdock

The screen where Dandylion grows, with the herb outlined
Map cell
33, 81
From start
13 east, 16 south

Burdock

Used in Teleport with Dandylion

The screen where Burdock grows, with the herb outlined
Map cell
12, 12
From start
1 east, 5 south

Pipewort

Used in Protect with Ragwort

The screen where Pipewort grows, with the herb outlined
Map cell
18, 55
From start
9 east, 8 south

Ragwort

Used in Protect with Pipewort

The screen where Ragwort grows, with the herb outlined
Map cell
27, 32
From start
5 east, 13 south

Snapdragon

Used in Sprites with Toadflax

The screen where Snapdragon grows, with the herb outlined
Map cell
46, 7
From start
1 east, 22 south

Toadflax

Used in Sprites with Snapdragon

The screen where Toadflax grows, with the herb outlined
Map cell
2, 59
From start
9 east

Devilsbit

Used in Zombie with Bones

The screen where Devilsbit grows, with the herb outlined
Map cell
8, 72
From start
11 east, 3 south

Bones

Used in Zombie with Devilsbit

The screen where Bones grows, with the herb outlined
Map cell
20, 3
From start
9 south

Speedwell

Used in Swift with Mad Sage

The screen where Speedwell grows, with the herb outlined
Map cell
50, 33
From start
5 east, 24 south

Mad Sage

Used in Swift with Speedwell

The screen where Mad Sage grows, with the herb outlined
Map cell
2, 22
From start
3 east

Bind Weed

Used in Freeze with Bog Bean

The screen where Bind Weed grows, with the herb outlined
Map cell
36, 7
From start
1 east, 17 south

Bog Bean

Used in Freeze with Bind Weed

The screen where Bog Bean grows, with the herb outlined
Map cell
29, 71
From start
11 east, 14 south

Fox Glove

Used in Doppleganger with Catsear

The screen where Fox Glove grows, with the herb outlined
Map cell
38, 5
From start
18 south

Catsear

Used in Doppleganger with Fox Glove

The screen where Catsear grows, with the herb outlined
Map cell
12, 49
From start
8 east, 5 south

Chondrilla

Used in Invisible with Hemlock

The screen where Chondrilla grows, with the herb outlined
Map cell
38, 11
From start
1 east, 18 south

Hemlock

Used in Invisible with Chondrilla

The screen where Hemlock grows, with the herb outlined
Map cell
47, 60
From start
9 east, 23 south

Thistle

Used in Reverse with Skullcap

The screen where Thistle grows, with the herb outlined
Map cell
48, 6
From start
23 south

Skullcap

Used in Reverse with Thistle

The screen where Skullcap grows, with the herb outlined
Map cell
10, 26
From start
4 east, 4 south

Balm

Used in Heal with Feverfew

The screen where Balm grows, with the herb outlined
Map cell
50, 30
From start
4 east, 24 south

Feverfew

Used in Heal with Balm

The screen where Feverfew grows, with the herb outlined
Map cell
47, 20
From start
3 east, 23 south

Dragonsteeth

Used in Fireball with Mousetail

The screen where Dragonsteeth grows, with the herb outlined
Map cell
22, 11
From start
1 east, 10 south

Mousetail

Used in Fireball with Dragonsteeth

The screen where Mousetail grows, with the herb outlined
Map cell
51, 3
From start
25 south

Cud Weed

Used in Lightning with Knap Weed

The screen where Cud Weed grows, with the herb outlined
Map cell
2, 82
From start
13 east

Knap Weed

Used in Lightning with Cud Weed

The screen where Knap Weed grows, with the herb outlined
Map cell
23, 49
From start
8 east, 11 south

Characters

Learic The player

Learic is the wizard you control. Learic wins by draining Leanoric's energy to zero using spells brewed from herbs.

Colour
White
Energy
40
Starts
Home, far north-west

Leanoric The rival wizard

Leanoric plays by nearly the same rules: collecting herbs, brewing and casting spells. Leanoric always brews Teleport first, then one attack spell and one defence spell, and only comes hunting when holding both. Below 20 energy Leanoric drops everything to find the Heal herbs. The compass always points towards Leanoric. See How Leanoric thinks.

Colour
Magenta
Energy
40
Starts
Home, far south-east

Hooded Figure Hostile

A hooded figure that hunts Learic, but only while Learic is in the westernmost 15 map columns (about two and a half screens). Sharing a map cell with it drains energy fast: about 14 a second. Protect, Invisible and Freeze all counter it.

Colour
Green
Damage
1 per update on contact
Starts
Far south-west

Villagers Neutral

Four villagers walk the road across the middle of the map. They are harmless, and are needed for the Zombie and Doppleganger spells, which only work when a villager is on screen.

Colour
Yellow, cyan, green, magenta
Count
4
Starts
Along the road

Pitchfork villagers Neutral

Despite the pitchforks, they're harmless. Each picks a random empty spot in an area around the middle of the road (map rows 18-32, columns 27-45) and walks there, with random detours, then picks another. Nothing in the code checks where they are except their own walking and drawing, so they can't hurt or block anyone. They stand still while either wizard's Freeze is active, and they count as villagers for Zombie and Doppleganger.

Colour
Red, yellow
Count
2
Damage
None
Roam
4-7 screens east, 8-15 south

Zombie Summoned

Created by the Zombie spell from a villager. It copies Learic's movements, so steer it into Leanoric.

Colour
Cyan
Lasts
60 s
Damage
1 per update to Leanoric

How Leanoric thinks

Leanoric is driven by a short list of priorities, checked in order every time Leanoric moves (#B030). The first one that applies decides what Leanoric does next:

  1. Heal if badly hurt. Below 20 energy, Leanoric heads for the two Heal herbs. With both in hand, Leanoric teleports straight home and heals at once, without brewing, for up to 15 energy.
  2. Hunt when armed. Holding an attack spell and a defence spell, Leanoric walks towards you. Whenever you share a screen, Leanoric casts the attack spell, plus the defence spell if Leanoric's energy is below 30.
  3. Get Teleport. Leanoric's first job in every game: collect the two Teleport herbs and walk home to brew it.
  4. Fill the gaps. Otherwise Leanoric picks a missing spell at random, first an attack (Lightning or Fireball), then a defence (Protect, Freeze or Invisible), and walks to its herbs. On picking up the second herb, Leanoric teleports home and the spell is brewed instantly.
  • Every spell is used once. When one of Leanoric's spells wears off, its herbs have to be collected again (#D180), so after each attack Leanoric goes back to step 4.
  • Leanoric picks up any herb it walks over, even ones it doesn't need, which denies them to you.
  • Only seven spells. Leanoric only ever uses Teleport, Heal, Lightning, Fireball, Protect, Freeze and Invisible. Leanoric's Freeze stops you and the villagers in your tracks.
  • A quirk: when Leanoric's Heal wears off, the code also clears Leanoric's defence spell, so Leanoric has to fetch a new one before hunting again.
  • Leanoric stands still while your Freeze is active.

Tested in an emulator with Learic standing still at home. Leanoric brewed Teleport by walking home (about 2 minutes in), then Lightning and Invisible, and first reached Learic after about 5 minutes. From then on Leanoric returned with a fresh attack spell roughly every 2 minutes. With its energy set to 25, Leanoric cast Invisible straight after Lightning; set to 15, Leanoric fetched the Heal herbs, teleported home and healed from 15 to 30 in about a second.

Locations

The map is one continuous world of 364 screens. These are some of its landmarks.

Learic's hut
Learic's hut Where every game begins, in the far north-west corner of the map.
Learic's cauldron
Learic's cauldron One screen south of the start. Stand on the square just above the cauldron to brew.
The graveyard
The graveyard Headstones and dead red trees fill the north-west.
The ruins
The ruins Crumbling stone walls along the northern edge.
The village
The village Thatched huts in the middle of the map.
The river
The river Runs the full height of the map, east of the village.
A bridge
A bridge Stone bridges are the only way across the river.
The road
The road Crosses the whole map from west to east. The four villagers walk it.
The eastern woods
The eastern woods Leafy trees and more graves east of the river.
The hedge maze
The hedge maze Green hedges wind across the south-east.
The fields
The fields Ploughed rows behind a fence in the south-west.
The pine forest
The pine forest Tall conifers in the far south-east.
The lonely hut
The lonely hut A third hut and cauldron in the south. Only the two home cauldrons work for brewing.
Leanoric's hut
Leanoric's hut Leanoric's home and cauldron in the far south-east corner.

World map

82 × 52tiles of 32 × 32 pixels
364screens (14 across, 26 down)
24herbs, in fixed places
2working cauldrons

The complete map, drawn from the game's own data and checked pixel for pixel against every screen the game draws. Herbs are labelled, grey boxes mark each screen's walkable area, and the boxes above the two cauldrons are the brew spots.

The complete Feud world map with herbs labelled

Strategy

  • Leanoric only comes after you while holding both an attack spell and a defence spell. Taking the herbs Leanoric is after delays the hunt.
  • Each of Leanoric's spells works once. After an attack, Leanoric has to fetch new herbs, which gives you a breather.
  • Leanoric's first job is always Teleport, brewed by walking all the way home. The opening minutes are the safest time to gather herbs.
  • Only two things can hurt Learic: Leanoric's spells and the Hooded Figure. Protect and Invisible block both.
  • Zombie is the strongest attack by far: up to about 14 damage a second for a full minute, against 1 per projectile hit.
  • Teleport is the quickest way back to the cauldron to brew. Brew it early.
  • Keep the Heal herbs (Balm and Feverfew) in mind. Both grow in the south, near the lonely hut.
  • Stay out of the far west unless you're protected, invisible or have frozen the Hooded Figure.
  • Leanoric goes for the same herbs you do. Taking a herb first denies it to Leanoric for about 70 seconds.

Trivia

Facts found while taking the game's code apart.

  • Leanoric's list of attack spells has three entries (Lightning, Fireball and Sprites), but the random pick only ever chooses from the first two. Leanoric's code for casting Sprites, Swift and Reverse is never used.
  • When Leanoric's Heal wears off, the code also throws away Leanoric's defence spell, so Leanoric has to collect a new one.
  • The Doppleganger spell fools nobody: Leanoric only ever looks at the real Learic. The double is a white Learic look-alike walked around by a spare copy of the villagers' wandering code, which the game rewrites (changing the bit numbers inside its own BIT, SET and RES instructions) so the same routine can serve it.
  • The "pitchfork" villagers are the only characters that wander freely; the other villagers walk the road.
  • The road isn't stored in the map. When the game looks up row 24 of the map, the code simply returns an empty tile.
  • All 24 herbs share just four pictures. Each herb has its own colours, which makes them look different.
  • The spell book's current page isn't stored in a normal variable. It lives inside a machine-code instruction (at address #BE00), which the game rewrites as you turn pages.
  • Neighbouring screens overlap by a row or column of tiles. That is how one grid of 82 × 52 tiles makes 364 screens.
  • Sprites are drawn from the bottom row up. To place them at any pixel, the drawing code jumps into the middle of a long run of shift instructions, skipping the shifts it doesn't need.
  • There is a third hut and cauldron in the south, but brewing only works at the two home cauldrons, whose positions are written into the code.
  • Damage drains gradually. Each hit queues up 1 point, and the energy portrait loses one point per update.
  • The game updates about 14 times a second, but spell timers run 50 times a second on the interrupt. That is why spell durations are in real seconds.
  • The map, tiles and character sprites fill about 63% of the 40 KB game. The code is only about 25%.
  • The map is the same every game. Only the characters' movements are random.
  • Herbs never regrow while their spot is on screen, so you will never see one appear.

Notes for game makers

Feud packs a 364-screen world, two wizards, a dozen spells and a cast of villagers into a 48K Spectrum. Here are the techniques and ideas in it that are worth learning from, with addresses for anyone reading along in the disassembly.

For developers

  • Data fills the machine, not code. The map, tiles and sprites take about 63% of the 40 KB game; the code is only about 25%. Small, general routines leave room for a big world.
  • Overlapping screens. The world is one grid of 82 x 52 tiles, one byte each (#608D). Each screen shows 8 x 4 tiles, and neighbouring screens share a row or column, so the same grid gives 364 screens (#BB17).
  • Leaving things out of the map. The road across the middle isn't stored at all: when asked for that row, the tile lookup simply returns an empty tile (#BA9D).
  • Sprites at any pixel, without pre-shifted copies. To place a sprite at any horizontal pixel, the drawing code jumps into the middle of a long run of shift instructions, skipping the shifts it doesn't need (#C55B).
  • State kept inside an instruction. The spell book's current page is the operand of an LD BC,nn instruction at #BE00. Turning a page rewrites the instruction, and other routines read the page straight from it.
  • Recolouring instead of redrawing. All 24 herbs share four pictures; each has its own colours.
  • Two clocks. The game logic runs about 14 times a second, but spell timers count on the 50 Hz interrupt (#A61C, #C219), so a spell lasts the same real time however busy the screen is.
  • One record shape for everything that moves. Learic, Leanoric, the villagers, the Hooded Figure and the spells in flight all use the same 41-byte record layout (#A6C6-#A860), so one sprite routine (#C55B) can draw any of them from a pointer in IX.
  • Strings after the CALL. The print routine (#A4BD) reads its text from the bytes that follow the CALL instruction and returns just after them, so printing a message needs no pointer set-up.
  • Queued damage. A hit adds a point to a queue, and the energy portrait drains one point per update, so damage is shown smoothly without extra animation.

For designers

  • A rival who plays by your rules. Leanoric gathers the same herbs, brews at a home cauldron and casts the same spells. The game is a race and a duel at once, and taking a herb first denies it to Leanoric for about 70 seconds.
  • An opponent driven by priorities. Leanoric checks a short list every move: heal if badly hurt, hunt if armed, otherwise gather. A few rules make a rival that seems to plan, and that a player can read and exploit, for example by taking the herbs it needs.
  • Crafting that sends you exploring. Every spell needs two herbs that grow out in the world and can only be brewed at your own cauldron, so each spell is a journey out and back. Teleport, itself a spell, cuts the trip home short.
  • A danger zone, not danger everywhere. The Hooded Figure only hunts in the westernmost 15 columns, which gives the map a geography of risk.
  • Background characters with a job. The villagers are harmless, but Zombie and Doppleganger only work when one is on screen.
  • Every threat has an answer. Protect and Invisible block both things that can hurt you, and Freeze stops the Hooded Figure.
  • Information as a tool. The compass always points to Leanoric, so finding your rival is never the problem: deciding when to meet them is.
  • Keeping the illusion. Herbs never regrow while their spot is on screen, so you never see one pop into existence.

About this guide

Cheat codes: every keyboard read was checked (the menu scan at #A597, the game keys at #A580, the any-key wait at #A5CE): there is no cheat code or hidden key. Two leftovers: the menu has an exit to BASIC on SPACE (#A38E) that an earlier check makes unreachable, and the key table has spare entries and labels that look like an unfinished redefine-keys option.

Everything here was worked out from a disassembly of the original tape. Herb and spell names, recipes and herb positions are read directly from the game's memory. The map was rendered from the game's tile data, and the Freeze effect was tested in an emulator. The "Code" column gives the address of each spell's routine, for anyone reading along in the disassembly.

Facts marked needs verification come from reading the code but haven't been confirmed in play.

Feud and its graphics belong to their original creators. This is an unofficial fan guide.

Still to explore

Parts of the game this guide hasn't worked out yet, with what is known so far. They're the next things to dig into in the code, and include the main facts marked "needs verification" elsewhere on the page.

AreaWhat we knowStill to find out
Reverse and TeleportRead from the code: Reverse scrambles Leanoric's directions, and Teleport is never cleared after casting.needs verificationConfirm both in play.
Where the double walksThe Doppleganger's double is moved by a variant of the villagers' wandering code (#B283); in a test it walked west along the road and back.Where it heads, and why its path differs from the pitchfork villagers'.
How Leanoric's spells landIn tests with Learic standing still at home, some of Leanoric's Lightning casts did no damage and later ones did.What decides whether Leanoric's attack spells hit.
The third hutThere is a third hut and cauldron in the south, but brewing only works at the two home cauldrons.Whether it has any purpose.
A tested winThe strategy tips come from the rules.A plan tested from start to finish in the emulator.
Sprites and animationWalk cycles and still projectile pictures.Animate the spells in flight, the zombie, and other effects.
SoundNot looked at yet.What sounds play, and when.