Combinatorial Explosion

">TAKE FLAG

>You pick up the flag.

>WEAR FLAG

>Who do you think you are, Abbie Hoffman?

--Sorcerer"

Perhaps the hardest part about writing an Adventure Game.

It's like this: Suppose you're writing a Noir-styled game, and you decide that a good puzzle would be to have our hero offer his lighter to the classy dame as a way to break the ice. The puzzle hinges on the player picking up clues from the genre and environment to determine that this would be a wise course of action, and that he actually find his lighter, which could, in turn, require that he find the key to his desk drawer, where he keeps it, and so on and so forth. Reasonable puzzle.

But here's the problem: you've just put a lighter in the game. A device that makes fire. You are pretty much guaranteed that the player, instead of just offering the lighter to the classy dame as they are intended, is instead going to run around the game world trying to set the world on fire. This would be bad enough if you could class all other uses of the lighter as "silly" and disallow them - but what if there are places where starting a fire is, if not optimal, a not-entirely-unreasonable solution? If you can't think of a good reason why the player can't dispose of the incriminating documents by immolating them, the player is going to feel cheated when he receives a default failure message on trying. And, worse still, odds are that your enterprising player will think of one or two other reasonable uses for the lighter that never even occurred to you when you wrote the game.

And this applies to everything. That crowbar you wrote in so the hero could open the crate where The Maltese Falcon is hidden? Why can't he use that to bludgeon the crooks? And don't even get us started on that rope you wanted him to use to tie up the thugs. The player is going to try tying everything to everything else. And heaven help you if he gets it in his head to set the rope on fire.

The interconnectedness of all things in the model world opens great potential for providing players with alternate solutions, but this requires that the author think of every single combination that could validly apply, which is not a reasonable thing to expect from a human writer: A game with 100 objects provides almost five thousand (4,950) potential one-on-one object interactions. If the player wants to try using four of those objects together, the number of combinations jumps to nearly four million (3,921,225). And let's not get started on using objects to interact with furniture or scenery, such as "tie the rope to the tree."

This is one of the traditional draws of Tabletop RPGs, and remains so even as computers become capable of handling more and more detail. If the player comes up with some combination the rules don't cover, there's a flesh-and-blood Game Master on hand to ad-lib a result or give a suitably snarky excuse for why it's not allowed.

Game designers have come up with many ways to treat the Combinatorial Explosion problem, each of which has its advantages and disadvantages. Constraining the user interface can also help, but in many genres this is considered undesirable. Realistic physics modeling can also be helpful: If puzzles are solved by the application of physics rather than by explicitly defined object interactions, then the game engine can sort out whether or not what the player has done qualifies as a solution without the author needing to separately consider each combination. However, this sort of modeling is only applicable to a certain class of puzzle, and can result in a highly mechanistic style of play. Physics modeling works well in games which are already heavily mechanical, such as action-adventure, but feels less natural in more traditional adventures.

This problem is one of the major reasons that recent adventure games have placed a greater emphasis on the Set Piece Puzzle. It still plagues Interactive Fiction, though the masters of that genre have become very good at anticipating such potential problems.

For the equivalent in skills, spells or crafting, see Exponential Potential.

"I'm sorry if you're feeling frustrated. If you like, you can type SAVE to store your progress to a file (in most interpreters), then RESTORE to come back to it later. In the meantime, you might try searching the web to see if there are hints available."
 * Nethack is noted as a game where the combinatoric explosion is particularly well handled; it is said that The Dev Team Thinks of Everything. Of course, they've been working on the game for decades.
 * It also helps that Nethack is fairly abstract. It's fairly simple to define how one thing can affect other things when the list of things is enumerable and the interface is well-defined.
 * The graphical IF game Timequest reacted to this several times in amusing ways, with witty reasons why you couldn't pick things up, often Breaking the Fourth Wall in the process. For example, early on in the game you end up in Cloaca Maxima, the large sewer in Rome. If you try to pick up the brown sludge flowing past, it replies with "Okay look - I know adventurers are supposed to take everything that isn't nailed down. And I know that this stuff probably isn't nailed down (although I don't want to be the one to check). And I know that Meretzky [a coworker] made you dive naked into a pile of it when you played his game. But there is just no way I'm going to let you walk around with your pockets stuffed full of caca just so you can see what happens when you launch great gobs of number two at major figures of western civilization."
 * Legend had so much fun making Timequest that they extended such replies to become puzzles in their own kind. Just try to duplicate an item by using the time machine and a safe spot -- or keep feeding a certain NPC dates.
 * In Portal, there is a puzzle in which the player must use portals to send a rocket towards some glass and shatter it to get to a box, which can be used to climb into a vent to continue the game. However, most players used the physics to their advantage and just stacked a few computers on top of each other or used an office chair to get out.
 * In a similar manner, an earlier puzzle let the player skip nearly all of the level by simply flinging themselves through a portal up onto the exit platform. The developers intentionally left that option in because they felt OK with the creativity involved in finding alternate solutions.
 * It is also possible to skip most of the Companion Cube level by detaching cameras from the walls/taking the ones from the behind-the-scenes section, making a pile of them under the ledge that blocks your path, placing the Companion Cube on top, and climbing up this makeshift staircase to the exit area.
 * In the first essay ever written about adventure games, The Craft of Adventure, Interactive Fiction pioneer Graham Nelson points out that this applies to all the classical elements (earth, air, fire, water) as well as a huge variety of other things.
 * The Simon the Sorcerer series is notable for having Simon comment on the sillier combinations.
 * The second Discworld adventure game had a box of matches, which actually did have multiple uses. When you tried to use them directly, Rincewind would remark "Strike a light? I'd only set fire to the Inventory window."
 * Similarly, in Discworld Noir, attempting to use a crowbar to smash a glass case elicits the response "Great idea. Shame it'll only work if you're a beta-tester or you've hacked the game", since you're supposed to have lost the crowbar by that point. A glitch causes the item to reappear in the spot where you found it, though. For shame, Mr Beta Tester.
 * In Resident Evil Code Veronica X, one of the puzzle items you obtain is a Halberd. It is not a weapon, even though it would be not only awesome but quite practical to use it above, say, a knife. Capcom didn't seem to figure out until the release of Dead Rising that having an awesome melee weapon in a world full of zombies is something we've always wanted in videogames.
 * The Resident Evil series is fairly notorious for this. More that one player has been frustrated when blocked by a rickety wooden door that requires "the spade key" while toting a shotgun and wearing combat boots.
 * Or a broken door that requires you to get a block of C4 and a detonator to open it.
 * Blazing Dragons only had about four phrases for why you shouldn't be do what you're trying to do. The most annoying one was "No, that's not safe" which is really annoying when you end up doing unsafe things all the time like giving hedge trimmers to a psychotic Rapunzel to cut her hair.
 * One of the most annoying flaws of Limbo of the Lost is that the game's designer had ignored this issue and given very little leeway for the game's inventory-based puzzles. As an example, early on the player is expected to use a container to store water for a later puzzle. Heaven help you if you wanted to use the pot instead of a flask though (and had no idea where you could get one), since while a pot would work perfectly well for the purpose, it can only be used to store snot, and the character only gives you a blunt I Can't Use These Things Together should you try the pot.
 * Zack and Wiki handles this rather well by having items be held only one at a time. Though, of course, this makes the extremely long stages where you need several items over the level take unnaturally long as you go back and forth for the correct items.
 * Kingdom of Loathing pulls this off with style in the Strange Leaflet quest, which itself is a reference to a lot of text-based games like Zork. A lot of interesting messages can be found by typing seemingly useless things. For example, while in the beginning spot (right outside a house), typing "Take House" will result in the message, "Look, I realize that the usual M.O. of these sorts of games includes picking up every object possible, but give me a break." There's also hidden messages that have nothing to do with the leaflet itself. For example, typing "Consult Guide" gets you the message, "You don't have a copy of the Guide with you. You also forgot your towel. Some adventurer you are." in reference to the The Hitchhiker's Guide to the Galaxy game.
 * Kingdom of Loathing suffers, however, on its implementation of item crafting and cooking. A new player may think they can cook any two food items together, but in fact each item can only be cooked with two or three other items at best, and it's anyone's guess as to which combinations work. It's not even guaranteed that a given item's companion ingredients are other types of food--one recipe even calls for pixels.
 * Particularly jarring are the occasions when something should work, because it's a simplified version of the real-life method, but either doesn't, or works as a means of doing something else. One example that springs readily to mind: By mixing a banana and a bottle of rum, you get a banana daquiri. Okay, logical. So let's combine the rum with a lime (which is a much more common fruit in the game anyway). Regular old daquiri, right? Nope. Grog (aka watered down rum). And that's beside the fact that, by the "alcoholic slushie" definition of daquiri, you should be able to mix rum with just about any fruit the game gives you.
 * The same also applies to RPGs where you get a lot of different spells. Often using two or three specific spells together will result in epic win scenarios, the most famous being from Final Fantasy VI where casting X-Zone would cause any character affected by the Vanish spell to die instantly. Even BOSSES. And you CAN cast Vanish on bosses (if they weren't already kind enough to vanish on their own).
 * That was admittedly a bug. The game basically decides whether a spell hits or not with the following process (as far as steps involved go): 1) If target has Clear status, spell hits and skip all steps hereafter. 2) If target has a special flag that blocks Death and Gravity-based attacks and the spell checks for the flag, spell misses. See the problem with that? One can also combine Clear with Life2 for an instant full restore or something even to living targets, though that is quite arcane and more easily accomplished by just using Cure3 for the most part.
 * One Pokémon example is getting a Smeargle (the only Pokémon besides Mew who is capable of learning every move in the game), and teaching it both Lock-On (a move which insures that the next attack will not miss) and Horn Drill (a one-hit K.O. attack which almost always misses). As a kicker, teach it a sleep-inducing move as well and use that first.
 * It should be noted, however, that these OHKO moves are generally banned from tournament play, so this strategy is useless in such a case. Also, Articuno can do the same thing thanks to its naturally-acquired Mind Reader and Sheer Cold moves, which do the same thing.
 * Also could be accomplished in Gen. II with a Poliwrath that had been traded over from a Gen. I game with the TM move Fissure and then taught Mind Reader.
 * World of Warcraft once had a minor instance of this that has since been nerfed. Two engineering-made items, when used together, allow a character to leap huge distances. For a good stretch of time many players used this to effortlessly win Capture the Flag matches, but the developers eventually caught on and attempting this now will cause the player to drop the flag.
 * There also was a combination of items and abilities that allowed feral druids and rogues to have the dodge percentage of more than 100%. This turned the wearer completely invulnerable to physical attacks, allowing them to defeat certain bosses (like Gruul and Illidan) with ease.
 * In the Callahans Crosstime Saloon videogame, most objects in the environment had unique descriptions for all of the hotspots. Also, interacting with them with any possible inventory item would produce a unique spot. The game's designer, Josh Mandel, has said that stock responses in these games always bugged him, and tried to write his games to avoid this as much as possible. Also see Freddy Pharkas, Frontier Pharmacist, and certain parts of Space Quest 6.
 * In My Sims, you, by default, have an ax. However, you can only use it to chop down live trees. You cannot use it to chop down the boards blocking your way to the old power station, or chop up the fallen tree barring your way to the forest to the west. For those, you need to earn the "appropriate" tools. (You also can't use it on Sims you don't like, but if you could, it wouldn't be rated E, now would it?)
 * Even Shannara, which usually handles this pretty well, wasn't completely safe from this. If you've tried to tie a rope to ANYTHING apart from your dagger or something useful, it gave the same scripted response. Hilarity ensues when you get "you tie the rope around a river and give it a few tugs".
 * Strong Bad's Cool Game for Attractive People has the Lighter example, except in this case it's actually an optional achievement to go around setting fire to all the flammable things you can find after using the lighter for quest purposes. When it appears in the next episode, Strong Bad throws the whole lighter into what you have to light, apparently destroying it. Ironically, you can take the lighter to one of the things you could set on fire in the last episode, but be told that it isn't flammable if you try to burn it again.
 * Scribblenauts seems to exist solely to use this trope- the player can make pretty much any object they want appear in the game world by writing it, and anything that can conceivably be used in conjuction with anything else can be. At least, according to the developers (As an example, to cut down a tree the player can create a saw or an axe..... or a beaver. Or they can make a torch and set the axe handle on fire and put it next to the tree).
 * And that's not even scratching the suface.
 * It also fell victim to this trope when players found that they couldn't solve certain puzzles the way they thought they could because the dev team didn't program the items to do what it seemed like they should do (on at least a couple of occasions I tried to summon items and got completely different and situationally useless items because of the way they were identified).
 * And then the sequel, with the puzzles where you have two objects and have to make an object that has qualities of both. One of the first is a snail and a turtle. For some reason, the legless-like-a-snail reptile-like-a-turtle snake doesn't work.
 * A snail has a foot.
 * In Colossal Cave Adventure, you have to try using random items to defeat some of the obstacles that stand in your way.
 * One obvious problem was providing the player with an axe in King's Quest IV, which you are only allowed to use to threaten the trees with. Why can't I use the axe on that troll that's chasing me, game? I'm "not a violent girl"? I'm being chased by a freaking troll!
 * You actually CAN eat the pie instead of the meat in King's Quest V when you're hungry. It's just that doing so will make your game Unwinnable without warning.
 * The worst part of this is, it's an adventure game. Choosing the pie is a natural result of having had players throw meat at hungry ravenous beasts to get by them since the dawn of the genre. Naturally, nobody EVER chooses to eat the meat the first time, unless they read wikis. Never mind the fact that eating the meat will only eat half of it, with no indication. The natural deduction is that eating it will eat all of it.
 * Ironically, the reason you need the pie in the first place, is to throw at, well, a hungry ravenous beast that falls off a cliff and dies when blinded by the awesome might of your cream pie.
 * A -huge- part of the Grand Theft Auto series. Careful placement of cars -before- activating the missions will cause utterly delightful crackups and smashups allowing the player to then pull out a weapon and win. Explosion part is often literal, to boot!
 * Commonly occurs in the Silent Hill series, eg using rubbing alcohol and a lighter to burn vines, using the red liquid on the possessed Cybil, combining a horseshoe, lighter, and wax doll to open a trapdoor, or getting a light bulb from a tin can so you can unlock a Door to Before from the inside.
 * A non-video game example is provided in the Transformers franchise's "Power Core Combiners" sub-line. The line consists of three types of figures: "Commanders", which can transform into robots, vehicles, or a torso-like "power up" mode to enable the line's main gimmick (three guesses as to what that is), "Drones", which each transform from a vehicle into either an arm or a leg when attached to a Commander in the aforementioned "power up" mode, and "Mini-Cons", which can attach to Commanders or Drones as armor or weapon power-ups. Assuming you form a combined robot out of one Commander, two arm Drones, two leg Drones, and one Mini-Con, within the first "wave" of figures alone (which is all that's widely available in the US at the time of this writing) there are 540 possible combinations (or over 9000! 2000 permutations, if you count reversing right and left arms/legs). And there are at least three more waves planned and prototyped.
 * And that's assuming you play strictly by the rules. Most Commanders can use more than one Mini-Con at a time (typical is one mounting point for armor and two hands that can hold weapons), and usually Drones can use them as well (though sometimes the design leaves kibble in the way). Searchlight combined with the Combaticons can manage ten if you're clever. And some Mini-Cons can attach to other Mini-Cons.
 * Fortunately, Homestuck is run by a human as a webcomic, or the alchemy system, which weighs in at some 280 trillion combinations, would never be finished. On the other hand, 280 trillion doesn't seem so big when you realize it's supposed to represent nearly every item in the universe. Or maybe the developers knew what items the children would alchemize together before the game was even designed in the first place...
 * This is why another MS Paint Adventure, Bard Quest, was abandoned. It was originally intended as a branching Choose Your Own Adventure-style tale, but the Combinatorial Explosion quickly became too big to handle.
 * An Inform extension detects words that might mean that the player was frustrated and responds with this message:

"The floor has half-collapsed near one corner, revealing a hole criss-crossed with cobwebs.
 * But clearly didn't anticipate this situation:

blow cobwebs

I'm sorry if you're feeling frustrated. If you like, you can type SAVE to store your progress to a file (in most interpreters), then RESTORE to come back to it later. In the meantime, you might try searching the web to see if there are hints available."


 * La Tale has an interesting example. There exists a weapon (that curiously lacks a class restriction) that gives anywhere from 500% to 950% extra critical damage when it activates for five seconds. There exists an item that gives 1000% critical rate for three seconds. Combine them with your most powerful attack, and you can wipe out almost half of a high-end boss's health in one attack. The only thing that stops it from tearing through every boss in the game is the weapon's rarity and it's low rate of activation, but when it works, stuff dies.
 * Touched on in the first Doom novel. The characters want to use a rocket launcher on the red-key door. They decide to get the red key anyway in case they need to save the rocket ammo for something horrible.
 * Back to The Future: The Game gets a bad example of this in its third episode. Marty is carrying two newspapers. When he tries to use one of them for anything other than a puzzle designed for its use, he remarks that "If I'm doing anything with this, I'm recycling it." That would be an okay remark if the episode didn't contain a trio of big, obvious recycling bins that can be interacted with (that cause Marty to give the exact same response if you try to use the newspaper on them. Whoops!)
 * The Ringworld game has the character carrying around a space suit for most of the game. An area of poison gas blocks your progress until you figure out how to remove it. Putting on the air tight space suit is not an option. Its only use is as a diving suit near the end.

(You know what? Just have the dame take the lighter. Problem solved!)