Logic puzzles and mazes Hat

Logic puzzles and mazes

Richard Bartle considers some of the problems
in the land of Mud

THERE ARE two particular kinds of problem commonly encountered in adventure programs which typically cause tempers to become frayed and arguments to develop the moment they are discussed. The spread of opinion regarding them is almost binary - you either love 'em or you hate 'em - and liking one has no influence on whether or not you'll like the other. I'm referring to the notions of mazes and logic puzzles. Augh! See what I mean?

What is the sort of problem you normally get in an adventure game? Well even in a multi-player one like MUD, the basic arrangement is that you have a collection of objects, the presence and properties of which either allow or disallow the execution of commands (which I'll call actions). Actions, once carried out, alter certain objects in predefined ways, and so create a different set of restrictions which determine what actions can be performed afterwards.

So a closed door might restrict you from performing the "GO WEST" action, say. In order to GO WEST you need to perform some action which changes the state of the door such that it is no longer closed, and the obvious one is something like UNLOCK DOOR WITH KEY (don't say I never give you hints!). Once you have performed this action, the property of the door is changed such that a modified set of actions are now executable, including some new ones (GO WEST is now OK) but excluding some old ones (UNLOCK DOOR WITH KEY won't work this time!).

So you can look on actions as having preconditions, which are tests on the objects required for the action to be satisfactorily carried out. One precondition of opening the door with the keys is that you have to have the keys, for example, and if they weren't on you then you'd have to give some command which made it so you did have them (GET KEYS FROM BAG, perhaps).

This is a very basic outline of what the mechanism is behind adventures, and put this way (in terms borrowed from the Artificial Intelligence subfield of "planning", which just happens to be my specialisation) it sounds pretty mundane! The skill and fun in playing comes from imposing an interesting structure on the actions and objects, so that you're not mindlessly trying out all possible commands but can use your intelligence to find the right thing to do. Without this logical structure binding the universe together, there's no guarantee that ANY command might do something. Common sense might dictate that INVENTORY isn't likely to open a door for you, so you probably wouldn't try it (unless you were absolutely desperate!), but if you treat it like any other action then why shouldn't it? It's just another command. Why shouldn't something like CLOSE DOOR WITH KEYS open the door either, come to that?

It's because of this logical structure, of course. You assume that the players have a certain collection of common commands at their disposal, and you try to mimic these commands so the results are what players expect. So making the command to open a door be CLOSE is generally regarded as the result of not having been to sleep the previous four nights! Things like having INVENTORY open a door had better be accompanied by generous clues; not so basic as a scroll reading "DO AN INVENTORY IN ROOM X AND IT'LL OPEN THE DOOR" perhaps, but certainly it would be OK to have something which noted the remarkable similarity between the body movements needed to do an inventory and those needed for an OPEN DOOR spell. Even CLOSE for OPEN might be acceptable in an "inverted" world, as in through a mirror.

So what's this got to do with mazes and logic puzzles? Well these two ideas stretch the definition of what people do in adventures to the limit, and for some people it's just too far! And what has it to do with MUD? Well in multi-user games the limits change (your patience goes, for a start!) and it's interesting to see how the extremes carry over, to see the extent of the shift in what is or isn't a good thing to include.

Take puzzles, for example. By these I don't mean finding novel uses for ordinary items (like "LIGHT BRAND FROM DRAGON", then "BURN DOOR WITH BRAND") but genuine, straight puzzles. It won't let you through the door unless you can solve the problem "2+2=?". Well that's easy enough, it's. er, 4, but what if they were much harder? What about the square root of 6023921858319047472771692203936249? It might take some time to figure out it's 77613928249503307... Or what about naming the 142812th prime number? Or cracking a substitution code?

These are problems which have occurred in MUD. Since I don't actually LIKE the idea of anyone having to go away for an hour then coming back with the answers, I make sure that solving them is not essential to the game. MUD has a room, the mausoleum, with around six or seven other rooms off it. Each of these rooms (tombs) is accessible only through one door (unless you're a wiz, when you can fly there of course!), and on the door is a puzzle. Solve the puzzle, the door opens, and in you rush to claim your reward.

Not all the puzzles are pure computation, of course; some of them are "armchair" ones which you can solve on the spot if you're quick (or never if you're not!). These can be things like the roman numeral substitution of "104, 49, be polite" or involve well known sequences scrumpled up in some way ("AnEbArPrAyUnUl??" - months of the year). I won't list them all because you'll probably find them as boring as I do, even though it would give the Micro Adventurer editors something they could use to illustrate this article! The mausoleum has gone through several generations of problems (all of which were/are original), because it turns out that this kind of thing is NOT suitable in multi-user games.

Put bluntly, people exchange answers with each other so readily that it's only a couple of days after one of them has been cracked before everyone knows! Even if you don't tell people, the chances are that someone will snoop on you while you're in the mausoleum typing in the fruits of your hard-earned labour, and then distribute the answers to whoever wants to know!

There are constraints on what the answers may be, too. Numeric answers must be pretty big or people will just type in all the likely integers until they get the one which is right. So although I thought MUD's sequence of lengths of sides of right-angled triangles problem was pretty nifty - "4, 11, 60; 3, 5, 11; 5, 13, ??" - it took less than a minute for someone to count from 0 to 61 and get the answer! Groan! I do occasionally relent and have lowish numbers as answers, but not often! Also, "clever" hints like making substitution code questions always start off with a ""wh-" word ("what", "which", "where" etc) soon get around too, and before you know it even the thickies can solve your problems. Grr!

Apart from the mausoleum, MUD has no other problems of this kind. I like to keep them in their place, where they can't interfere with the rest of play, but some players love them! Especially since what is in each room behind the doors varies between games and you never know quite what to expect there.

But why is it most people DO prefer to give away these solutions, when they keep the usual kind of answer to the "how you get to room X" problems to themselves? It is, of course, because the majority of them fnd it intensely irritating not to be able to get some treasure just because of a smarmy problem which they KNOW how to solve but which takes them ages to do, or which they can't "see" instantaneously and there's no clue anywhere which would hint at the answer.

Their objection is the same as mine, in that you need "outside" knowledge to solve the wretched things. "Outside knowledge" is needed anyway, but it's one thing to assume people know that it's keys that open doors and not bottles of medicine, and another to assume they can solve second-order differential equations. At least with normal problems you CAN try every possible combination of objects until you get the one which opens the door, but unless you twigged maybe that the number sequence was treble scores on a dartboard, or that the letters were initials of streets on a monopoly board, you'd never solve a logic puzzle.


By popular demand, we reprint this panoramic view of the Land, which appeared in the first of Richard's articles
Image size: approx. 18K.

So, as you can probably tell by now, I'm not too keen on this kind of problem, and in multi-user games it's certainly NOT a very good idea! The only reason MUD still has the mausoleum is because I like setting them! However, you can have raging arguments with people who adore this IQ stuff, as it breaks up the monotony of "find it and try it" play. Oh well, what you win on the swings...

What about mazes, then? In normal adventure games the reaction is something like "aww no, not ANOTHER one!". There's no problem-solving to be done; you see, it's a cinch to solve mazes once you know how, but it takes ages. The situation is similar to having two objects which need to be in a certain room together positioned as far away from that room and each other as possible. It's just trekking time to get them to the same place, and there's no intellectual difficulty in that! Some mazes might be tricky, like they spell out a magic word or something, but they still need to be mapped. The standard technique of dropping objects to disambiguate rooms and then trying all directions is a pretty boring occupation, especially if you just KNOW there's a pirate or a magpie or something that's going to pick up some stuff and muck you up, secreting their booty away somewhere for you to seek out later.

In comparison with the dismal translation of logic problems into MUD, which (if you can comprehend such an idea!) are even WORSE here than in normal adventures, the translation of mazes works quite well! MUD has two major mazes and two minor ones. The minor ones are small, four or five rooms, and stop people from dropping objects in them to make maps by the simple expedient of not letting them take any in with them! Including a light source! They're fairly easy to solve, and they ought to be because in general you want to get back quick because you left a pile of essential items outside before entering!

The major maze which is entered the most in MUD is the graveyard, which isn't really a maze at all because you can never get lost in it, it's just confusing (you THINK you're lost!). It comprises around 10 rooms, but there are no loops. That means that if you're in, say, the third room then seven directions will take you back to the third room and one will take you to the fourth room, and so on. So by trying random directions you'll eventually get through (it takes about three goes "round the clock" - n, ne, e, se, ... - to work through). There's even a magical item to help you, a statuette of a lion with "drop me in the garden of death to find the path" written on it. So why's it confusing? Because although you're in the same room, the description changes. If you give a dud direction and wind up back where you were, it's hard to tell because the gravestone has changed (gravestones, you'll recall from an earlier article, bear the names and epitaphs of wizs). The description even changes if you LOOK! So it's hard to find out what room you're in unless you take a whole sackful of goodies in with you so you can tell the rooms apart.

And this, of course, is where MUD's multi-user aspect comes in! As there are no loops it's pretty easy to follow someone without their knowing you're there, and hence you can clear up after them, collecting their objects. They're not going to get back to pick them up for some time, so it's quite easy - especially if you know the way already! This was a design decision for the graveyard, to exploit MUD's multi-user capabilities - the maze is easy to solve, but risky! There's no mindless, animated pirate to nick your treasure and hide it away, but instead the awful possibility af a real person grabbing hold of it and putting it where you'll never find it ever again!

The graveyard was put to great use by Gwyn the Wizard in his mortal days while he was working his way up to that exalted rank. It's quite easy for novices to wander in accidentally, and it takes them a while to find how to get out (you type the direction OUT!). So Gwyn would wait at the start of the maze, slaughter anyone who wandered in, then run deeper in and go to sleep. Going to sleep gets you back lost stamina points from fights, and is usually very dangerous in case anyone stumbles across you. But who's going to find you in a maze?!

MUD's other major maze is not so easy. though. It's possibly the most devious, cunning part of the whole game which exploits to the full the fact that there is more than one person playing at once. Most people don't even realise it's a maze, it's well disguised, although some regulars have heard rumours of the incredibly valuable crown said to lie in the centre. Of those who know its true meaning, only a handful have ever made it to the middle except by sheer accident, but the reward has been worth it. This maze is the swamp.

The swamp in MUD, in case you've forgotten (or were unwise enough not to buy the copy of the Micro Adventurer which explained it all to you!) is where you drop treasure to score points. If you have something valuable, worth 80 points say, then you don't score for it until you drop it in the swamp (yes, it's also a good place for ambushes!). It then sinks to the bottom and is out of play for everyone. Now the swamp is a maze, right? So how do you map a maze? Easy, drop stuff in so when you return to a room you know you've been there before. Only what happens to things you drop in the swamp? Yes, they sink! There are absolutely NO objects in MUD which you can let go off in the swamp and be able to see them, they ALL sink. Good, eh?

Well yes, but now it's pretty well impossible to solve isn't it? Well no, as not quite everything sinks in the swamp: players don't. If you want to map the swamp you have to use real people as markers. You can't do that in a normal adventure game!

Just to make it harder, the route through the swamp changes every game... I've snooped on people discussing it and stating they've heard it changes every 90 seconds, but it's not quite THAT cruel! There are scores of possible ways through, though, but only one of which is the one for the particular garne you're in at any instant. So mapping in one game to get through again in the next is infeasible.

What's the reward for your efforts, then? Well in a drier part of the swamp, some seven or eight rooms in (it varies) is the crown. Unless some wiz watching your pioneering progress was wicked enough to substitute it with the dummy crown from the wiz's STORE, you now have the most valuable treasure in MUD! The people who acted as markers have nothing for their pains, though, and will need bribing with lesser treasures to stop their lynching you (unless you quit pretty soon after you drop it, but then they'll rip you to pieces next game!).

Mazes, then, transfer over to multi-user games quite well. In ordinary games they're boring at the best of time, but multi-user aspects make them actually quite enjoyable! Contrast this with the case for logic puzzles, which are much worse in MUDs than single-user games. It is interesting to speculate on the effects of porting other single-user features into multi-user garnes. This is a side-effect of the shift in perspective which MUD's unique multi-user capabilities provide - if things are to be solved by individuals then they don't work as well as things to be solved in teams. It's as if the players WANT to help each other, but are thwarted in single-user games by the fact there's no-one else there!

I wonder what the effects of graphics would be? No, on second thoughts, having seen Egor the Wizard in real life, perhaps it's a bad idea!

For those readers with a Commodore 64 and modem, MUD is now running on Compunet.

Readers witbout access to Compunet can get details of how to access MUD from Ricbard Bartle, Department of Computer Science, Essex University, Colchester, Essex C04 3SQ. Remember to endose an SAE.

Copyright © Richard A. Bartle (richard@mud.co.uk)
21st January 1999: majan85.htm