Zarf Updates: To fight a troll


Everybody knows that you KILL TROLL WITH SWORD until he vanishes in a greasy black fog. If he kills you first, big deal; RESTORE and try again. It’s too random to be a real obstacle. But do you know the math behind the randomness?

I didn’t! But some folks got to talking about it on the Discord, and I realized there was room to add some visualization. So Visible Zork 1 now has a “Combat” tab. You can try it now, or just read it right here.


(The Visible version is dynamic. It shows how enemy strength decreases as you fight them. Also exciting details like the “enemy wakes up” timer.)

The villain table describes the three enemies you can fight. (Although the cyclops does not follow regular combat rules, so his entries are never used.)

The table shows what weapon the monster is weak again, the weakness penalty, the awakening probability (if it is unconscious), and the table of melee outcome messages. Also STRENGTH, which is really a property rather than a table entry, but I’m including it here anyway.

A table showing three columns: the troll (strength 2), the thief (strength 5), and the cyclops (strength 10000). The troll is weak against the sword (-1 penalty); the thief is weak against the knife. The cyclops has no weakness.

The combat table is used for all attacks, player and monster. Select a row based on the defender’s combat strength and the attacker’s advantage over the defender. That is, if the defender has strength 2 and the attacker has strength 3, use line “2/D+1”.

(For the computation of combat strength, see FIGHT-STRENGTH and VILLAIN-STRENGTH.)

Then roll a nine-sided die. Outcomes (for the defender) are: miss, staggered, light wound, serious wound, unconscious, killed.

A table showing various outcomes depending on the defender and attacker strength and a random number from 1 to 9.

If you are staggered, you have a 25% chance of being disarmed. If you are knocked out, your opponent gets 1-3 free shots at you, and most of the results are “killed”. (The dungeon is unkind to the unconscious.)

A few observations and questions:

Why a nine-sided die? Who knows. Maybe they didn’t trust the low bit of the primitive RNGs of the day. (Even the “modern” IF interpreters of the 1990s had that sort of problem.)

The troll, who starts with strength 2, can be killed in one blow. The thief can’t; you have to wear him down a bit.

Note that the cyclops is fully set up for combat, even though you can’t hurt him (strength 10000!) and he won’t fight you. He can kill you; if you annoy him, it starts a timer that ends with your ignominious death. But that’s not handled through the combat system — no die rolls.

In early versions of MIT Zork, you could fight the cyclops, but that was disabled in favor of sneaky solutions. The real question is, why did they leave the cyclops combat responses in the game? That’s about 500 bytes they could have saved. Usually Infocom treated every byte as precious — particularly for these early titles which had to run on the Atari 400, etc.


Finally, a combat bug — newly discovered on our Discord, as far as I know.

Let me summarize the HERO-BLOW routine, which handles your attacks:

  • Set ATT to FIGHT-STRENGTH (your adjusted combat strength);
  • Set DEF to VILLAIN-STRENGTH (the opponent’s adjusted combat strength);
  • If the opponent is disarmed or unconscious, you kill them automatically;
  • Otherwise roll on the combat table;
  • Decrease DEF if you rolled a hit;
  • Call VILLAIN-RESULT, which stores DEF as the opponent’s STRENGTH and kills them if that’s zero.

What do we mean by “adjusted combat strength”? Well, the VILLAIN-STRENGTH routine checks whether PRSI (the parsed indirect object) matches the villain’s weakness. This is a crude way of checking whether you typed KILL TROLL WITH SWORD or KILL THIEF WITH KNIFE, as distinct from any other weapon. If the weapon matches, VILLAIN-STRENGTH returns a value decreased by one (but not to zero).

(I think this decrease would also happen if you typed PUT LAMP IN SWORD on the same turn that the troll attacks you. Possible additional bug! But not the one I’m talking about.)

Notice that the weapon penalty makes its way from VILLAIN-STRENGTH to the DEF variable to the opponent’s STRENGTH — regardless of your roll! So if you attack the troll with the sword and miss, the troll’s strength goes down by one anyway. (Unless it’s already at one.) A light wound does two damage, and a serious wound does three.

The same goes for attacking the thief with the knife, of course. A miss will cause damage.

(To be clear, this only happens when you attack. The converse VILLAIN-BLOW routine does call VILLAIN-STRENGTH, but it doesn’t call VILLAIN-RESULT. The decreased enemy strength value is discarded and doesn’t affect future turns.)

Is this a bug? It sure doesn’t look intentional. You wouldn’t expect that a miss would cause damage. On the other hand, every commercial version of Zork behaved this way (as far as I know). If you “fixed the bug”, combat would get significantly harder — particularly the thief fight, which necessarily goes several rounds. Would anybody want that?

If the combat was playtested at all — and Infocom was assiduous about user testing, both before and after release — it was tested with these odds. The mechanics may be illogical, but we have to assume that the outcome is what Infocom wanted. Or at least, they were satisfied with it.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *