Monday, November 28, 2022

FF2: The Citadel of Chaos

Here is the complete graph for The Citadel of Chaos.

Tl;dr: The idea here is to use directed graphs to provide optimal walkthroughs of Fighting Fantasy gamebooks; in this case, The Citadel of Chaos.  Check out the beginning of the Deathtrap Dungeon post for tips on how to read the graph.  Citadel's is similar but required more annotations since there is more going on.


Overall Impressions

This is the second book I've graphed, after Deathtrap, but Citadel is clearly more sophisticated even though it's earlier in the series.  It's less linear and has fewer bottlenecks, though it still has enough that I was able to split the story into a sequence of unavoidable episodes.  However, Citadel's graph splits enough that it's easy to miss whole chunks of the book, bypassing required items without warning.  This is where the "replay value" comes in, I suppose.

The average Deathtrap section had just two options (Go left or right?  Fight this thing or run?).  The average Citadel section offers more options due to the magic system (Which of these spells do you want to use?) and the sheer number of artifacts (Give them the ointment, the pocket myriad, or the spider in a jar?).  In graph theory, a vertex's degree is the number of edges incident to it.  A directed graph like ours distinguishes the degree of incoming and outgoing edges into indegree and outdegree.  So, the average outdegree in Citadel is higher than in Deathtrap because there are more choices.  A section with a high indegree is a bottleneck of sorts since it ties many story threads together, so having a high average indegree is an indicator of how bottlenecked a story is.

Citadel has fewer instant death sections than Deathtrap, which isn't much of a surprise:  18 (4.5%) compared to Deathtrap's 31 (7.8%).  Most of them occur in the final boss fight against Balthus Dire.


Required Spells

You'll need an Illusion spell to get out of jail, a Shield spell to protect yourself from Balthus Dire's trident trap, a Weakness spell for the CLAWBEAST, and E.S.P. and Levitation spells for the final battle with Balthus Dire.  Other spells are optional.


Episode 1:  The Entry (1) to the Courtyard (251)

The first encounter is with the guards:  The iconic APE-DOG and DOG-APE.  The goal here is to avoid combat, which you can do through four paths.  You can either bluff your way in by posing as a herbalist (261) or trick them with fool's gold (96).  The herbalist route has a number of complicating factors.  The easiest thing to do is say you came to treat "Kylltrog" (81), evidently a pal of theirs.


Episode 2:  The Courtyard (251) to the Citadel Door (218)


This bit immediately splits into three threads.  You have the most to gain by approaching one of the groups (321) and sitting down with them (134).  They'll immediately tell you the password to the Citadel.  After you fight them you'll get their gold coins, brass key (later referred to as a copper key), jar of ointment, and Potion of Magick, which boosts your MAGIC points.  The ointment is essential if you want to succeed along the shortest path.

If you then approach the two men talking (269) and say that the dagger is worth eight gold pieces (186), you'll get the opportunity to buy it without a fight (15).

If you say you want to use magic against the WHIRLWIND LADY (47), you'll get an opportunity to run to the central fountain (209).  This effectively switches you to the thread that you would have followed by walking boldly across the courtyard, but now with the items gained from fighting various folks.  Drinking the clear liquid in the fountain gives you a clue to defeating the CALACORM.



There are a few more encounters in this episode (dealing with an injured man, avoiding an unseen archer, and falling in a pit) but you have nothing to gain from them.


Episode 3:  The Citadel Door (218) to the Narrow Hallway (177)

This is a brief episode.  The only way to not fight the RHINO-MAN guard is to give the correct password (371) or to bluff your way in by Testing Your Luck (198).


Episode 4:  The Narrow Hallway (177) to the Grand Dining Hall (169)

This episode takes up about half the book and is fairly interconnected.  The one essential thing to get is the combination to Balthus Dire's quarters (obtained in 238, from a library book), which is cleverly just the number of the section that opens his door.  It's presented in the text as, "Do you know the combination?  If so, turn to the section of the book with that same number."  Without it, you're doomed to a non-failure outcome of "trying again" (164).

From the Narrow Hallway (177), take the door (5) and ring for the butler (40).  Trust the butler's advice and take the left fork to the GARK (243).  This bypasses the useless encounter with the WHEELIES and puts you on the path to the combination.  You'll need to fight the GARK to get his hairbrush, so prepare to use a spell (11) and either cast Creature Copy (262) or fight him yourself (16).  Either way, you must kill him (180) and not just run away.  Why this guy has a hairbrush with only a tiny little ponytail is anyone's guess - maybe he has a girlfriend.


Proceed to the T-Junction (99).  Take the right-hand door (38) and enter as instructed (132).  You're now in the library.  Ask the librarian for the secrets of the Black Tower and you'll learn the combination (238).  If you then go to the section about Balthus Dire himself (18), you'll learn how to defeat him without combat.  Counter-intuitively, you'll want to press your luck and read another book (84) only for the librarian to get suspicious and sic some guards on you.  They'll give you some roofies and throw you in jail (234).



The only way out of jail is to use an Illusion spell and convince the CALACORM guard that he's being attacked by an enemy (a mouse).


This course takes you inevitably to the LEPRECHAUN (210), which is an emotional rollercoaster but relatively benign.  Playing it cool with the LEPRECHAUN makes him friendly enough to grant you a silver mirror and a magic battlesword (323).

The mini-episode to the next bottleneck diverges into three paths:  One to the wine cellar (the copper door, 144), where you can get a pocket myriad from the BLACK ELF, one to the sewers (the brass door, 386), and one to the LAUNDRY LADY (the bronze door, 338), which is really just a short cut past the sewers.  The LAUNDRY LADY can give you a hint about needing a golden fleece.  It's arguable which path is simpler since both involve combat and/or Testing Your Luck.  You'll need either the myriad or fleece to get past the HYDRA later.

Section 275 describes the pocket myriad as "an enchanted gadget that can become any one of a number of weapons or useful artifacts."  The ELF turns it into a knife, but of course it's damaged in the fight and merely becomes another inert object for you to barter with.

Whichever way you go, you wind up in the GOLEM room (257).  The only thing to be gained here is the SPIDER-MAN in a jar (a critter the GANGEES identify in section 39 as "Racknee").  Since he's not very useful, it's best to run for the door (200 to 237), which opens to the Grand Dining Hall (169).

Interestingly, taking the left route after the GARK takes you to a game room where you can play three different games to earn power-ups:  Six Pick (171), Knifey-Knifey (365), and Runestones (278).  Each are pretty inventive games-within-a-game.  I definitely remember playing these as a kid.  Visiting the game room will bypass the library though, so will prevent you from learning the combination.



Episode 5: The Grand Dining Hall (169) to the Tower Staircase (140)

You'll inevitably wind up at the balcony (363), but the quickest and safest path is to go up the right-hand staircase (197).

If you opted to go to the sewers in the last episode, you won't have the pocket myriad so will need to get the golden fleece.  Take the left door (228) and either smash it down (88) or use the copper key (296).  It leads to the bed chamber (292).  You must give the lady the GARK's hairbrush and successfully Test Your Luck in order to pull the golden fleece off her bed.

The bed chamber unfortunately skips the most interesting encounter in the book:  The nursery (64).  It's an incongruous room with three small orc-children, their beds, and a bunch of stuffed animals.  This section used to puzzle me as a kid, when I identified somewhat with the little guys.  I wondered what their life must be like hanging out in that room.  Did someone bring them food?  Did they ever leave?  If so, did the MIKS or the GARGOYLE or the BED LADY give them any trouble?  This being FF, you are given the option to kill them.  The result is pathetic and somewhat troubling.

This episode also contains the only "bug" in the book:  an orphaned section, 258, which isn't accessible from any other section.  It appears to let you offer something general to the orc-children.  It must have been replaced by section 3, which lets you offer something specific.


Regardless, you proceed to the spiral staircase that leads to the upper tower (140).


Episode 6:  The Tower Staircase (140) to the Combination Lock (229)

This is the home stretch to Balthus Dire, and the only episode where you have nothing to gain.  The best you can do is get through it as quickly as possible.

Take the left hand door to the island room (25).  This bypasses the useless encounter with the MIKS.  The trunk is a trap, so simply walk around the trench to the door on the other side (206).  This leads to the dreaded GANJEES room (182), which is infamous among FF adventurers as a likely place to die.  In fact, you will die here unless you present them with either the ointment or the charmed amulet.  You can only get the amulet from the SCOUTS in Episode 2 if you forego the combination to Balthus Dire's quarters, so give them the ointment (291) and proceed to the HYDRA (328).


You'll want to "use something from your backpack" (226); specifically, the golden fleece (37), which lets you pass the HYDRA without combat or penalty and proceed to the locked door to Balthus Dire's quarters (229).



Episode 7:  The Combination Lock (229) to the End (400).

It's interesting that this endgame episode has a whopping 64 entries (16% of the book!).  Navigating through it in the simplest way either requires hard-won foreknowledge, absurd luck, or the god-mode provided by an annotated graph.

Turns out you only need the proper combination and four spells to get through it, no combat required.

First, enter the combination (217) to open the door.  You'll want to immediately cast your Shield spell (293) to avoid the trident trap, then proceed to the gentleman himself (374).

If you do get sucked into fighting him, you'll find him a tough opponent with SKILL 12 and STAMINA 19.  Fortunately, there's an easier way.

Cast a Weakness spell to quickly dispatch the CLAWBEAST (158) and an E.S.P. spell (187) to read Dire's mind.  Follow that with a Levitation spell (279) to avoid his earthquake spell, then run over the window (78) to pull the drapes over his head (124).  This has the unintended side effect of exposing him to sunlight, which kills him and makes you wonder why his room had a window at all.

Congrats, you've won (400).




Final Thoughts

Though not as difficult as Deathtrap Dungeon, Citadel is plenty tough and offers a number of alternate routes to victory.  You can succeed with minimal combat, though it's essential to fight the group in the courtyard to get the ointment.  Again, you can get past the GANJEES with the charmed amulet instead, which the SCOUTS give you freely, but doing that means not finding the lock combination.

Then again, what ten year old is going to insist in starting from zero knowledge each play through?  Clearly, you're supposed to build up knowledge through trial and error and not be an insufferable (middle-aged, knuckleheaded) purist who insists on starting from scratch each time.  A perfect run-through with zero assumptions would require an astronomical amount of luck.

Citadel was my first FF book and is probably my favorite for that reason.  I liked that the monsters included animals with swapped heads, which you'd expect from a chaos wizard.  The orc-kids and gambling games were especially memorable.


Sunday, November 20, 2022

FF8: Deathtrap Dungeon

Here is the complete graph for Deathtrap Dungeon.

You might want to open it in a separate tab or window for handy reference as you read this.  Yes, it's very tall and narrow.  You'll have to zoom in and scroll.  This article does include some snapshots of the more interesting bits.

A word about how to read the graph:  The vertices are story sections, which I colored as follows:

  • Yellow:  Combat, with the enemy named
  • Blue:  Obtaining an item or relevant experience, with it named
  • Red:  Death, or failure
  • Orange:  Not death, but an end to the story
  • Green:  A choice dependent on having an item or a relevant experience, with that thing named, as in "needs key" or "needs to have spoken to the old man"

The first section (1) is at the top, obviously.  The victory section (400) is at the bottom.

I didn't mark sections that Test Your Luck or otherwise manipulate your statistics, because frankly that's most of them.

The green and blue vertices are particularly interesting since it's well known that Ian Livingstone enjoyed peppering his books with plot coupons.  Simply put, bad things will happen if you hit a green vertex without being downstream of the corresponding blue one.  For example, a green section might ask if you have a dagger.  You'd only have it if you hit the previous blue section that granted the dagger.  This game mechanic effectively lengthens the shortest path to success, which we might have naively found by using Dijkstra's algorithm.  The Graphviz software does implement Dijkstra's algorithm but it's not much use thanks to the plot coupons.


Spoiler Warning


If you don't want the story spoiled, stop reading this blog.  But seriously, do you need a spoiler warning for a book that's almost 40 years old?


Overall Impressions

Overall, it's more linear than I expected.  Never having done this before, my intuition was that it would be wider, more tree-like.  At the very least, I thought the initial T-junction would split the majority of the graph in two.  What I found instead was that the story was episodic and routinely funneled the reader down into bottlenecks, sections that can't be avoided.  The first bottleneck happens fairly quickly when the reader reaches the gem-eyed idol (37).

The next thing I noticed was the sheer number of instant death sections:  31 of 400, or 7.8%.  So on average, you're likely to die on every 13th section.  I suppose that makes sense for a book with "death" right in the title.

I've split the "episodes" that follow on the story's bottlenecks, so the story will force you to proceed from one episode to the next, in order, and you can't skip them.

The following synopsis is the fastest path to victory, or one of them.  There are a bunch of encounters in the book that aren't described here (the MIRROR DEMON, the MEDUSA, etc.) because they aren't on the fastest path.


Episode 1:  The Entry (1) to the Idol (37)

The only thing of consequence here is obtaining the rope, the gold piece, and the hollow tube, which you can only do if you go east at the initial T-junction.  This rewards the character who's willing to be a rebel, since most of the other characters appear to have gone west.

So go east (56), scramble over the puffball (373), and drink the liquid in the bamboo pipe (147) to protect yourself against the upcoming heat trap (182 > 25).  At 197, you must open the door (171) to get the rope.  You'll fall into a pit and lose 4 STAMINA, but you need the rope to get the emerald.  You can get 3 of those STAMINA back by eating the dried meat found on the first barbarian's corpse, which is coming up.

Next is the ORC encounter.  There's no way to avoid fighting them, but at section 326 you obviously want to roll a high number to fight them without a penalty (380).

After killing the ORCS and taking their gold and hollow tube (a straw?), proceed to the wet corridor (164).  Open the door (299) into the room with the dead barbarian.  Walk over to search him (126), then eat the meat to replenish your STAMINA (226).  At this point you can return to the alcove (41) to get the goblet, though it will involve Testing Your Luck, but the goblet does not appear to be useful.  Eventually, you'll be herded off to the idol room.


Episode 2:  The Idol (37) to the Closed Door (239)

The gem-eyed idol is the first bottleneck:  You can't avoid reaching this point.  The story immediately asks you if you have the rope.  If you do you can get the emerald, which is good since you can't win without it.  Otherwise you'll have another attempt at getting a gold piece.  You'll have to fight the two FLYING GUARDIANS either way, a difficult battle.

Use your rope (396) to climb the idol, then you must only try removing the left eye (151).  Removing the right one (34) will release poison gas, killing you instantly.  You can Test Your Luck after climbing down (89) to see if you can pull the rope down, but I haven't seen that it's used again.



Episode 3:  Closed Door (239) to T-Junction (267)

It's possible to pick up three things along here:

  • A gold ring that grants wishes (251)
  • A poem read by a spirit girl (229)
  • A dagger (94)
All three are used later.  To get the dagger you'll have to fight the GIANT FLY.

First, open the closed door (102) and insult Baron Sukumvit (251) to get the ring.  Proceed down the hall (344) and walk through the shaft of blue light (229) to hear the poem.  At the arched doorway (107), open the door (168) to find the dagger stuck in a pit of worms.  The worms are harmless, so pull the dagger out (94).  Proceed to the GIANT FLY (174).  You'll have to successfully Test Your Luck to fight it without penalty.  After killing it, proceed to 267.


Episode 4:  T-Junction (267) to SKELETON WARRIOR (381)


Obviously, it's ideal to head east (68) from the T-junction to skip the pointless ROCK GRUB battle.

The trip from 68 to the bottleneck at 237 is inconsequential except that you don't want to lose your shield at 271 since it helps defend you from the MANTICORE later.  Oddly, I haven't found where you received that shield.  It's not mentioned in the intro and I haven't seen where you pick it up prior to this.  There is another chance to find a shield in Episode 8, though.

The ruby orb gained at 285 has no further use that I've found.



Episode 5:  SKELETON WARRIOR (381) to ORC Bodies (338)


It's not worth tangling with the SKELETON WARRIOR since you'll only pick up a warning about the MANTICORE (a shield will help you beat it), so just tiptoe over to the alcove (128).  Don't eat the mushrooms; go down the steps (35) and jump through the door while waving your sword around like the psychopath you are (124).  You'll scare the hell out of the GOBLINS at 124, giving you an advantage.  You have no choice but to fight them.



At 81 or 307, you want to go north (136) so that you can obtain the sapphire, the second essential gem.

If you go in the door with the hand nailed to it (210) you'll see Ian Livingstone himself chained to the wall.  If you let him go he'll tip you off to having to collect gems to get through the dungeon before he suddenly exits stage left.

You'll inevitably come to an open pipe (78).  Go inside to get the iron key and the sapphire (162), but beware of going too far!



Episode 6:  ORC Bodies (338) to the DWARF (60)


This is an especially linear bit of the tale in which you're given the opportunity to team up with Throm, another competitor.  The book rewards the reader who gives Throm the benefit of the doubt, because doing so is the only way to get forewarned of the BLOODBEAST (via an article in a book) and to find another book containing a health potion.


First, put on the necklace (123) which is really a strength amulet.  Your stats will get updoots and then you'll go to 282 to meet Throm.  Go west with him (22) and accept his offer to lower you into the pit (63).  He'll join you and you'll find some books on a stone ledge (194).  Open the red leather book (52) to read about the BLOODBEAST and the black leather book (138) to get a potion.

Next, you encounter CAVE TROLLS (369).  You fight one and Throm fights (and always kills) the other.  You find a bone ring necklace on one.  You can either put it on or not; if you do, whether it helps or hurts you depends on your current SKILL score (64).

Regardless, you wind up in the stalactite room (221).  There's nothing to gain here, so proceed through the archway (60) to find the DWARF.

Episode 7:  The DWARF (60) to the Tunnel (213)

This next bit is a beautifully symmetric bit of the graph.



First, persuade Throm to not kill the DWARF (365).  You'll shoot some craps and either win (152) or lose (121).  If you win, he'll make you grab a cobra bare-handed (some reward!).  You have to continue trying to grab it, losing 5 STAMINA each time you fail.  If you lose, he'll produce two pills:  one with an S and one with an L.  They'll sap your STRENGTH or LUCK, respectively, and then you'll have to grab the cobra.  So either way, you're cobra grabbin'.

Next, this fun-loving DWARF gives you some lame anagrams and the situation boils down to three options:
  • Fight a MINOTAUR (40)
  • Fight a GIANT SCORPION (143)
  • Not die, but end the story as the DWARF's lackey (347)
If you fight and survive, you'll have no choice but to fight a (drugged and/or out of it) THROM, and if you're feeling vengeful, the DWARF as well.  Beating the DWARF will earn you a coat of chain mail.



Episode 8:  Tunnel (213) to the BLOODBEAST (90)


This is the most complicated episode since it splits into three, and sometimes four, threads that interlink.  Unfortunately, there is a single correct path that you must follow to have any hope of succeeding.  The critical junctures are as follows:

Go west at either 108 or 394 so you end up at the sound of approaching footsteps at 59.  This winds up being another poor sucker who's stuck in the tunnels.  If you quiz him (367) and give him some gold (244), he'll tell you there's a doppelganger potion in the bird-of-prey chair.


Go north at 109 to end up at the bird-of-prey chair at 24.  Sit in it (256) to get the doppelganger potion.

At 188, you need to have heard the spirit girl's poem from Episode 3 in order to proceed to 155.  Her words will encourage you to dive into the water, taking you to 378.  After Testing Your Luck, you'll hear a girl's voice crying for help (356).  Enter the room (170) to find the Elf locked in battle with a BOA CONSTRICTOR.  Kill it (170) and with her dying breath she'll reward you by telling you to find some gems, including a diamond.  Her stash includes some bread (+ STAMINA), two daggers (useful for defending against the BLOODBEAST), and a monkey charm (saves you from the PIT FIEND).  Not bad!

Walking along the tunnel (192), you'll come across an iron grille in the floor.  Lift it (120) to reveal the grappling iron and leather pouch.  Reaching down for them (228) means you'll have to Test Your Luck, but either way you'll wind up with them. 

At 292 you come to a door.  You have nothing to gain from opening it, so continue to 230, where you'll encounter some TROGLODYTES dancing around a "large golden effigy."  Drink your doppelganger (aka polyjuice) potion (385) and run across the bridge (318).  You'll come to a locked door, but fortunately you have the iron key you found in the pipe with the sapphire.  Use it to unlock the door (86) to the four-way intersection.  You'll hear the voice of the author beckoning you forward to 187. 

And there he is, Ian Livingstone, once again, but now with a regrown hand!  (For those without the book, the joke is that the illustrator keeps drawing Ian Livingstone as prisoners.)  He'll reward you for bribing him (360), naturally, by putting you on the path to getting the diamond.  You get in a basket that he raises off the ground by pulling a rope.  This bit reminds me somewhat of the Shaft Room in Zork I.  Let's hope he's using multiple pullies for maximum mechanical advantage -- ol' Ian doesn't have much upper body strength.  

Unfortunately, Ivy, who happens to be a TROLL, is in the room above.  She demands a bribe too.  Try to talk your way out of giving her anything (328).  She'll namedrop Port Blacksand, aka the City of Thieves (FF5!) and get understandably distracted.  Continue the conversation (99) long enough to smack her over the head with a stool.  Searching the room (266) reveals an old bone, which you take.  What sort of creatures might want an old bone?

Walking downstairs (305), you conveniently hear the sound of barking dogs.  Throw them the bone (253) and run past (315).  You reach a high wall with a door, but inexplicably decide to use your grappling iron and rope to scale it (129) and catch your first glimpse of the PIT FIEND, which is really a tarted-up T-Rex.  Throw him your bone monkey charm (361), which he'll chomp on, as T-Rexes do.  It'll oddly expand to fill his mouth, which will distract him enough for you to Test Your Luck.


This is a consequential Luck Test, since if you fail (377) you'll have to fight the PIT FIEND, a murderous SKILL 12 STAMINA 15.  The one upside to being unlucky is that you get a replacement shield (95) if you lost yours in Episode 4.  As stated repeatedly, a shield is handy when fighting the MANTICORE.

At 214, you're asked to relinquish your weapons.  Ignore that and proceed to 181, where you'll overtake another competitor, the NINJA.  You'll have to Test Your Luck again to see if you can fight him without penalty; in this case, the penalty is a shuriken in the back that not only takes 4 STAMINA but also 1 SKILL.  The fight is difficult since he's SKILL 11 STAMINA 9, no slouch compared to the PIT FIEND, but defeating him is the only way to get the diamond, the third gem required to succeed.

It's a bit silly that the only route out of this space is to take a chute (127) down to the BLOODBEAST's room.


Episode 9:  The BLOODBEAST (90) to the End (400)


Fighting the BLOODBEAST  will go as well as possible if you were forewarned by the book in Episode 6.  At least then it's a straight battle (172), albeit against a SKILL 12, STAMINA 10 opponent coming off fights against a NINJA and possibly a PIT FIEND.

It is technically possible to pass without fighting it, but it requires a lot of luck.  You'll have to first claim to not have the forewarning (357) then either throw in a gem (332, but not the essential emerald, sapphire, or diamond!) or take a swing at it with your sword (180).  Either way, it'll respond with toxic gas and you'll have to Test Your Luck to avoid getting killed.  If you live (53), it'll be pawing (tentacling?) at you.  Make a run for the door (370) and roll two dice.  If you roll lower than your SKILL score, you'll jump away from it and escape without a fight (104).  Otherwise, you'll need a dagger to fight it (294).  If you don't have a dagger, you die (334).


There's enough luck needed for the non-combat path that it might be easier to just fight it straight up (172).

The option to throw an unspecified gem into the BLOODBEAST's slime pit is interesting.  One would hope you'd throw in something other than the essential diamond, sapphire, or emerald, but would a 10 year old kid playing this game make such a distinction?  Doubtful.  The book is littered with other non-essential gems, to be fair:  A couple topazes, a pearl, and a ruby orb, at least, none of which have any purpose except to possibly be thrown into this slime pit.

A dagger is essential if the BLOODBEAST grabs you (159 or 234).

The next and final unavoidable battle is the MANTICORE, another SKILL 11, STAMINA 11 bruiser, though it helps if you have a shield, in which case you can at least fight it without suffering a penalty (196). 




This book really is ridiculously difficult and probably not at all possible without memorizing the one correct path after countless attempts (or using a graph!) as well as having tremendous luck with the dice.

Finally, the endgame:  You have to have the emerald, sapphire, and diamond.  If you don't, you become a slave in the dungeon (3).


If you are lucky enough to have them, you have to arrange them in the correct order.  Of course, there are 6 ways (3 factorial, or 3 times 2 times 1) to order three items, so the graph enters an interesting section where five vertices are mutually-connected, allowing you to keep choosing different orders, though you're taking a penalty each time you get it wrong.



Graph theorists call this sort of mutually-connected subgraph a clique.  They're interesting because they're so tightly coupled.  Finding a graph's large cliques, or the largest clique, is computationally difficult, meaning even the best known algorithms take a number of steps that scale exponentially with the number of vertices.  However, it's often useful to find large cliques.  Consider a graph in which vertices are phone users and edges are calls made between them.  A service provider might want to identify large cliques to offer them special deals or discounts.

It's frustrating to think a player might have come this far throughout the book only to fail by having to guess which of the six possible orders are correct.  Each failure costs 2-7 STAMINA points from a player who was just weakened by two unavoidable and difficult battles.  You are given hints when you fail, Mastermind-style, telling you how many gems were in the wrong place, but with a legit shot at just one or two guesses it still feels pretty cheap.  Might've been more sporting to offer the player a hint at the order earlier in the book.

Even if you guess the order, you'll have to Test Your Luck a final time to avoid losing 3 STAMINA to poison gas.

Otherwise, you win.


Final Thoughts


Deathtrap Dungeon is arguably the most popular FF title, and for good reason:  It provides the purest dungeon crawl in a way that's more sophisticated than earlier books like The Warlock of Firetop Mountain or The Citadel of Chaos.  It's also incredibly difficult, which rewards replays.  The player can try it over and over, building up an arsenal of strategies that didn't work and exploring new ones, until they finally succeed.

Of course, having an annotated graph can help.

Welcome

Welcome to this blog.  Who starts a blog in 2022, anyway?  Someone with a very specific idea, that's who.  The specific idea for this blog is to post graph-theoretical analyses of Fighting Fantasy gamebooks.

I'd assume you know what a gamebook is and what Fighting Fantasy (FF) is or you wouldn't be reading this.  But for the sake of completeness I'll explain that FF is a series of trade paperback books, each of which contains a game (hence, gamebook) played by reading, making choices, rolling dice, and keeping track of the game state on a piece of paper.  It falls somewhere on the nerd literature continuum between the elementary school gimmick of Choose Your Own Adventure and the junior high-to-rest-of-your-life gimmick of Dungeons & Dragons.

I was but a wee lad when I got my first FF book back in the '80s.  I had three or four of them by the time I grew up, stuffed my kid junk in a box, and embarked on more sophisticated kinds of fun like higher education, having a career, and raising my own kids.  I still have them though. I generally don't throw out books, and I have a soft spot for nerdy, game-type books.  Somewhere in my crawlspace is a big box stuffed with first-edition D&D hardbacks and modules.  These things aren't necessarily accessible in my more-or-less mature, sensible middle-aged world, but I still have them, and revisiting them from time to time is another way, along with listening to Motorhead CDs, that I revisit the carefree joys of my youth.

A few years ago I had the pleasure of Googling "fighting fantasy" and stumbling across Murray's excellent blog, Turn to 400.  It led me into a small community of FF enthusiasts who mostly communicate in the blogosphere which, like FF, is quaintly outdated.  But it got me thinking about FF again.  I dug out my old books and had another look.

I'm a bit of a collector, so it wasn't long before I had collected a bundle of vintage FF books to supplement the meager few I had growing up.  Seemed like everyone with an FF blog was bequeathed a wine box full of books by a friend.  Having the wrong kind of friends, I was forced to hunt for mine on eBay.  I opted to collect the UK volumes (having better cover art than the US versions) with the lime-green spines and the zig-zag banner at the top.  I picked up most of these from a guy in Canada.  No wine box, though.  I don't have the entire series, just the first couple dozen volumes, which are more than enough for my purposes.

When I was a kid, I found my FF books in carts at the grocery store with the front covers and first few pages torn off.  I didn't realize it then, but I now understand that someone at the store had ripped off the publisher by intentionally damaging the books and selling them anyway -- an old trick, and one fortunately not seen as much these days.

I can't say I've ever played much FF, at least not playing in the sense of rolling dice and keeping track of stats.  I more or less just read through them.  Most of the other FF blogs focus on what would happen if one did play the books as intended.  I thought it might be fun to make my own blog but I didn't want to simply follow that format.

What interests me most is the nonlinearity of the storytelling.  I'm a fan of nonlinear books like House of Leaves by Mark Z. Danielewski and Dhalgren by Samuel R. Delany.  I'm also a fan of interactive fiction (IF) like Zork and the other titles that Infocom produced in the '80s.  I'd argue that gamebooks are IF, albeit the kind written on paper rather than served up by a computer program.  Imagine if a contemporary author like Stephen King or Neal Stephenson made an adult-oriented gamebook with a couple thousand entries.  It wouldn't be "fighting fantasy," no dungeon-crawling combat, but might involve navigating corporate intrigue or solving a murder.  Infocom had success with IF across different genres.  I think there's a lot of untapped potential there.  Regardless, I'm interested in the idea of a gamebook as being somehow more complex that an ordinary narrative.  It's that complexity, the nonlinearity, the hypertext-ness, that makes the format interesting.  Any book is its own portable world but a gamebook is a portable world that's interactive.

Years ago I went to grad school for computer science.  My thesis had to do with finding efficient algorithms to solve computationally-difficult problems in graph theory.  So as an adult, FF appealed to me in the sense that each book could be represented by a graph:  Each entry was a vertex, and each choice to move to another section was a directed (one way) edge.  It's clear to anyone playing FF that some books are more linear than others.  For instance, The Warlock of Firetop Mountain (FF1) pushes the reader smartly along a string of fairly fixed encounters, while Scorpion Swamp (FF8) offers a richer world in which the reader can revisit locations with different results.  Sometimes books had obvious bottlenecks, sections you'd arrive at no matter what prior choices you made.   So I started to wonder about the shapes of these stories.  If one could see the graph, it would obviously be a map of sorts, an opportunity to cheat, or at least a way to determine the shortest path to the winning section (typically 400, hence the name of Murray's blog), but it might also offer insight into how the authors made these books and how they implemented game mechanics.  It might be an interesting, new angle on gamebook appreciation and analysis.

I hunted for free graph visualization software and came across Graphviz.  A couple hours later I had modeled Deathtrap Dungeon as an adjacency list in the .dot file format and was looking at a beautiful 400-vertex directed graph that did, in fact, offer some insight into the story structure.  I'll post the graph and my thoughts on it shortly.

Today, the Internet offers a variety of cost-free tools to help aspiring gamebook authors keep track of their stories.  I wonder how Ian Livingstone, Steve Jackson, and the other FF authors did it back in the day.  Seems to me there is quite a bit of bookkeeping that would have had to take place, minor details that aren't evident until you really dig into the mechanics of gamebook creation.  For instance, was there a rule that no two linked sections could appear on the same page or on facing pages, to preserve an element of surprise?  If so, how did they ensure that in the pre-digital era?  Were the sections randomized in some way?  In other words, did they have a scheme to shuffle the sections while preserving the links?  Was there a way to identify and prevent orphaned sections?  Did they employ play testers?  Were there standards in place for these things, or did each author handle them in their own way?  This is the stuff I wonder about.

So, that's why we're here:  To study the FF books using graph theory.  In the spirit of nonlinear narrative, I'll study them in no particular order, starting with Deathtrap Dungeon, for which I've already produced a graph.  I'll write up my thoughts on it shortly.  More to come!