Twisty little passages

I’m doing the “twisty little passages” thing for when Robin travels through Sherwood Forest, and I think I’m going to have to implement a counter to keep tracks of the times he goes in a certain direction. But I’m having trouble trying to figure out how to implement the counter.
Any ideas?

Can you please explain what you mean by the “twisty little passages” thing?

You can find techniques for executing both mazes from Adventure at

Sounds like you want to create a grid with x and y coordinates. Directions adjust coordinates, then when the player is at 2,3 you move a stump into the room. At 6,4 they are teleported to the forest exit?

Sounds like you’d create one forest room, then redirect "instead of going east in forest: increase x by one. "

Repeat for each direction. Then check coordinates after this rule to add or remove landmarks or move the player out of the forest.

Hanon’s guess is reasonable, based on the original question … but I have to say, this is not a good way to implement a maze. Given the nearly unlimited memory of a modern computer, if you want a maze with 50 identical rooms, just create 50 identical rooms. Trying to do a complex maze layout with only one room will be extra work to code, and the likelihood of bugs is very high.

On top of which, modern IF players tend not to like mazes. Including a maze in a game can be fun for the author. (I have been known to indulge in this bad habit.) But for the player, a maze is tedious.

And for that, check out Trizbort (on PC) to greatly reduce the hassle of building maps with lots of rooms.

Thanks all. I may have to think about this.
Just how popular are mazes with y’all?

The “popular” opinion is to avoid mazes at all costs. Unless you can turn the idea on its head in some way. That is, perhaps, making a trick out of figuring it out so that future traversals of the maze are easier. Some people like the challenge of mazes, so its not the opinion of every single IFer.

I like them! I wrote a PHP script (don’t judge me, it’s what I know) to randomly generate mazes and spit out valid I7 code. I was working on randomised room descriptions also, to provide some variety when moving around. I think (I’ve not used it for a while) it randomly places the PC somewhere and an exit of sorts randomly somewhere else, ending the game when you get there. It’s fun to mess around with, and my 10yo enjoys finding the exit in the shortest possible time.

I thought I put this code on my website, purely for reference, but now I can’t locate it.

Mazes are totally not fun to play.

…unless they have a gimmick. Infocom was great at gimmicking mazes. They’re still not fun, mostly, but they’re not as mind-numbingly seen-it-a-million-times-before tedious.

One thing you can do, if you’re providing a menu-based hint system in your game (which I do recommend), is making the very last hint in the “How do I find my way through the forest?” hints a cheat code. “Just enter the command ‘xpftnlg’ and the maze will disappear.” This is a nice courtesy.

Speaking of mazes with gimmicks, I think the only really good maze I’ve ever written is the one in the temple in “Lydia’s Heart.” It’s not twisty, and the number of rooms isn’t large. The rooms all look quite a lot alike, of course, except for the placement of the exits. You can use the classic method of dropping things in various rooms to create a map, and that will work – but it won’t solve the maze. In a couple of rooms there are objects that you have to manipulate in a certain way, which will cause stone blocks elsewhere in the maze to move, opening or closing certain pathways. To map it, you not only have to draw a map, you have to figure out how the layout changes when you manipulate those objects.

Whether anybody ever actually worked their way through that maze, I don’t know.

Regarding the cheat, Infocom used that method on Leather Goddesses of Phobos, a really really really tedious maze. I never traversed it, I always cheated on all my playthroughs, and I think actually traversing that maze willfully is an act of masochism.

Thanks for all the input. I’m dumping the maze idea.