[[quoteright:350:[[VideoGame/FinalFantasyV http://static.tvtropes.org/pmwiki/pub/images/Ambush.jpg]]]]
->''"Defeat enemies to unlock doors."''
-->-- ''VideoGame/MetroidPrime'' ([[http://www.metroid2002.com/version_differences_suit_voice.php PAL version]])

A specific type of enemy encounter common in a variety of video game genres. When the player enters a specific area, some type of barrier is closed around the player character (even one as simple as a [[GhostButler door that mysteriously shuts and locks itself]]), and they cannot leave these narrow confines until all the available enemies are defeated.

This is commonly used as a way to set up a BossBattle (though not all Boss Battles are Inescapable Ambushes).

In some games, if your characters gain enough experience in a certain trait, such as awareness or agility, they may be able to detect potential ambushes and/or evade them entirely.

A huge cause of UselessUsefulStealth.

Longer or more plot-involved examples may extend into an InvoluntaryGroupSplit.
----
!!Examples:

* In ''Franchise/TheLegendOfZelda'' series, these often take the form of a dungeon room that seals itself when Link enters, and unseals when all the enemies are gone.
** In ''VideoGame/TheLegendOfZeldaTwilightPrincess'', the [[WarpWhistle portal locations]] are a side effect of Link being ambushed by shadow beasts, who show up in a group and erect a force barrier similar to a boxing ring around themselves. When Link defeats them, the portal becomes available.
*** Also in ''Twilight Princess'', at several points in [[TheVeryDefinitelyFinalDungeon Hyrule Castle]], Link gets sealed inside magic barrier rings and attacked by enemies (that for some reason can walk straight through them).
*** [[AWizardDidIt Because their boss wants them to and doesn't want Link to, of course.]]
** Though in many of the earlier games, it was possible to remain in the doorway of the ambush room and check out the situation, allowing you a quick retreat if necessary.
* In all the ''{{Pokemon}}'' [=RPGs=], when the main character enters the Elite Four's rooms, he cannot go outside until he defeats or is defeated by the Elite Four and the Champion.
** Done most cleverly in the Gen IV games (D/P/Pl), where a platform takes you from each trainer to the next, and returns to its original position after you step off.
* In ''[[SeikenDensetsu3 Seiken Densetsu 3]]'', there are certain rooms in dungeons that will trap the player until all of the enemies are defeated. Of course, every single boss battle is like this as well.
* ''VideoGame/{{Fable}}'' had the nasty habit of erecting forcefields around the room you are in whenever you fight certain monsters or during ambushes.
* ''[[LegacyOfKain Soul Reaver 2]]'' had similar forcefields generated by certain types of time demons when you faced them. You didn't have to kill all the monsters, just the one casting the barrier.
* ''DevilMayCry'' has barriers that flare into life when you walk into certain rooms, whereupon the enemies usually arrive via {{Cutscene}}. Interestingly, if you get too close to a barrier, it briefly forms into a hand and takes a swipe at you.
* In the ''KingdomHearts'' games, not only do these lock Sora in, but they often lock Goofy and DonaldDuck ''out'', forcing you to [[DuelBoss battle one-on-one with the boss]].
** In a humorous aversion of GameplayAndStorySegregation, Goofy slams right into one of the invisible walls, and Donald is [[PunchedAcrossTheRoom knocked out]] of the area by the boss, leaving Sora to fight him alone.
*** some bosses however avert this trope in the first game. In neverland the bossfight against Captain hook can be left via the captains quarters. and in the second fight against Oogie Boogie you can leave via the area you're standing on after the cutscene plays or by the cave in the side of the wall of the area.
** Some boss fights in ''358/2 Days'' avert this trope by creating no barriers after you enter the area where the boss resides. This is oftentimes ''more'' annoying than if the game had prevented you from exiting, as it is painfully easy to accidentally exit and when you re-enter, ''the boss is at full HP again.''
* ''VideoGame/GodOfWar'' essentially swiped the barriers from ''DevilMayCry''; the only difference is that the barriers in this game turn into a fate's head instead of a hand.
* ''Franchise/{{Castlevania}}''
** Nearly ''every single room'' in ''VideoGame/CastlevaniaLamentOfInnocence'' acts this way the first time you visit it.
*** And on "Crazy" difficulty this happens ''every time'' you enter a room.
** The other 3D ''Castlevania'', ''VideoGame/CastlevaniaCurseOfDarkness'', tones this down considerably. There's actually a separate theme for the inescapable ambushes: "Followers of Darkness - The First".
* Of course, the ''{{Metroid}}'' series, which erected grey barriers in front of the doors during any major boss battle.
** An interesting variation happens early in Super Metroid where one obtains the bomb ability. In this case, the door locks ''after'' obtaining it, contrary to all other such rooms. This has provided a way for tool-assisted speedrunners to [[SequenceBreaking skip the fight]], though [[http://tasvideos.org/1073M.html just barely]].
** ''VideoGame/SuperMetroid'' has an interesting variation, in that the door to Tourian only opens when you defeat the main bosses. One wonders why they would set up the door to their main computer system only when those charged with the defending it are dead: the ''exact opposite'' would be more secure.
* Exception: ''VideoGame/ChronoCross'', where ''every'' battle could be escaped, including the final boss. While you won't gain any real advantages (most will just [[YouWillNotEvadeMe draw you back in]], and none of them are skippable), it is useful to be able to infinitely reset your elements and try again.
* Near the end of the first level in the first mission of ''MedalOfHonor: Allied Assault'', the ambush in question loops endlessly until you accomplish your given objectives. You could waste your ammo on German soldiers, hide near the locked exit door, etc. until you pick up that machinegun and shoot!
** At the end of the second mission, after blowing your cover, you have to push your way through several respawning ambushes.
* ''VideoGame/{{Sonic Rush|Series}}'' has several of these in three of its zones.
* ''VideoGame/{{Okami}}'' conjures up a barrier decorated with ''kanji'' around every battle. In all but a few of these fights, you can run from battle by breaking through the barrier in a certain spot.
* Justified in ''VideoGame/PhantasyStarOnline'', which explains that this is a security feature that locks the doors when wild creatures are nearby.
** Although generally it left the doors already opened unlocked allowing you to escape, some cases however did lock you in a room leaving you only with the ability to warp out to heal and then come back full equipped (not true boss fights).
* Happens in ''VideoGame/{{Half-Life 2}}'', Episode 2, during the "White Forest Inn Siege". While the player and sidekick are driving down a seemingly deserted street, force-fields activate at either end of the road and Combine soldiers pour out of the woodwork. The player is forced to retreat into a hotel in which, for some reason, all the exits are locked except for those inside the force-fields.
** Partially subverted at the end of the siege, as the force-fields don't magically disappear when the last enemy dies. Instead, the final wave of enemies break down the previously locked doors while storming the hotel.
* ''VideoGame/TheElderScrollsIVOblivion'' includes several ambushes with inexplicably locking doors. Two optional side quests end in rooms (for example, a farmhouse and a family tomb) where the door suddenly locks behind you, with no suggestion of minions waiting outside to trap you. This is actually inconsistent with most of the gameplay, because as fantastic as ''Oblivion'' may be, the storylines usually adhere to common sense. In one example this is justified: the BigBad of that particular sidequest is one of the two that ambushes you, and he carries the key you need to get out. The implication is (naturally) that he closed and locked you in with himself and his ally after they entered behind you (granted, they entered almost instantaneously, but...).
** ''VideoGame/TheElderScrollsVSkyrim'': The only way to avoid Karliah's ambush at Snow Veil Sanctum is to simply refuse to go through the door, leave the sanctum and do other quests. But this leaves the Thieves Guild questline frozen at that point. You can at this point potentially have the ability to turn yourself invisible and intangible and to invoke BulletTime which normally slows down arrows to a crawl but Karliah will hit you if you move through that doorway.
* All boss fights in ''VideoGame/{{Drakengard}}'' take this form due to GameplayAndStorySegregation: one would think being on a dragon would let one just fly away if they wanted to. Also happens and played straight when in the Forest, as the FogOfWar tends to obscure enemy positions until it is too late.
* Averted in ''VideoGame/CityOfHeroes'', where you can easily outrun your would-be ambushers. Of course, this can lead to high-level ambush groups wandering around a low-level zone, with predictable results.
** Some high-level players do this on purpose, for laughs.
** Also played straight with ambushes that know exactly where you are. Even if you're stealthed. Even if you're a Stalker [[TheComputerIsACheatingBastard and the enemies who ambush can't normally see you.]]
* Multiple ''VideoGame/{{Kirby}}'' adventure games have these. There is a common ambush song across the series (sometimes remixed).
* ''VideoGame/PrinceOfPersiaWarriorWithin'' has a annoying version. There are rooms that can only be escaped with the prince's LeParkour skills, which can't be used with your sword drawn. The Prince will not sheath his sword until all the enemies are defeated, even if the enemies are below you and you can simply jump over them a few times.
* ''VideoGame/NoMoreHeroes'' does this during most boss fights, and in some Mook Fights as well. The most annoying one being [[spoiler:during the 1st-ranked Assassin fight, where the border is a glowing serpent-like dragon]], that ''shrinks the arena'' during the fight twice. As your opponent is [[spoiler:a martial-arts master with a lot of very fast dash moves]], this makes the fight a frustrating experience to say the least.
* ''VideoGame/FinalFantasyX'' 's [[ChestMonster Mimics]] shut off your Escape and Flee commands if you steal from them while they're in chest form (thereby exposing their true forms).
** Which is why you always Mug chests. Although in most areas with Mimics, there are no real chests in battle.
* At one point in ''VideoGame/ChronoTrigger'', you can talk to some random mook that tells you to be quiet without looking at you because... [[LampshadeHanging he's planning to ambush a group of adventurers and doesn't want to be overheard.]]
* Welcome to ''VideoGame/WarioWorld''! There's an enemy in this game that only shows up on your first playthrough. There's an inescapable barrier around him for a small part of the level, and Wario will only be able to continue when he's smashed his puny crystal in.
* ''VideoGame/SuperSmashBros'': Both the Adventure Mode in ''Melee'' and the Subspace Emissary in ''Brawl'' often have these. Neither game bothers with barriers (after all, that wouldn't work with the "getting knocked out of bounds'' element) but simply won't allow you to move any further in the level until all enemies are defeated.
* In one episode of ''Series/{{Buffy the Vampire Slayer}}'', Buffy ends up in an inescapable ambush when [[spoiler: someone from the Initiative sets her up.]]
** That happened several times in season 4, including [[spoiler: the Haunted House that sealed everyone inside]] and [[spoiler: the ghosts who sealed Buffy and Riley inside a dorm room so they would keep having sex]]. Also [[spoiler: the characters who had their hearts cut out were technically in an inescapable ambush; but they didn't escape.]]
* Happens a lot in the ''Franchise/ResidentEvil'' series. Usually hand waved as some sort of security mechanism to keep in whatever viral beastie you are fighting. Sometimes it is triggered [[TeleportingKeycardSquad when you grab a key item]]. About half the time it's played entirely straight (the door opens when the enemies die), sometimes there's a variation (the door opens when you've done enough damage to the unkillable enemy), and sometimes it's subverted (you can--and have to--escape; you just have to survive long enough to do so).
* ''Franchise/DeadSpace'' does this repeatedly. The computer warns you that infected entities are in your sector, all doors lock and you have to kill all the baddies to get them to unlock again. The justification is that the computer is futilely trying to stop the spreading of the infection, but you gotta wonder if a computer that traps everyone involved in an accident right where it happened, when "the accident" means "horrible possession by FaceFullOfAlienWingWong", didn't turn a moderately serious infection into a shipwide disaster all by itself.
* They have a few of these on one specific planet in ''RatchetAndClankGoingCommando''. Notably, one of them only triggers if you open the health box.
* This pretty much ''defines'' the enemy battles in ''Vivisector: Beast Inside''; not only are you forced to trip an InescapableAmbush each time you activate a checkpoint, during the first half of the game, but said checkpoint is usually situated in ''another'' cage that springs up, usually much smaller so you're literally a sitting duck for the enemies you're supposed to clear out to be released.
* A side quest in ''VideoGame/FalloutNewVegas'' has [[PlayerCharacter the Courier]] exploring a Vault that had a "sacrificial chamber." Upon activating it, numerous robots literally come out of the walls and seal the chamber until they're all defeated.
** Once you gain infamy with either of the major factions, they will summon hit squads as scripted encounters at various locations. Once you enter their spawning area, either by normal or fast travel, they will always find you, even if you have a Stealth Boy on.
** At the end of ''Dead Money'', if you try to take the shortcut when sneaking out of the casino's vault, Elijah will [[TheAllSeeingAI detect you without fail]] and reactivate the force fields, forcing you to fight him and the {{sentry gun}}s.
** ''Lonesome Road'' does it a number of times as well, with [[DemonicSpiders Tunnelers and Deathclaws]].
* The ''Franchise/MetalGear'' series have these where a group of enemy soldiers corner you and you cannot escape, thus you're forced to fight them due to the plot.
* In ''VideoGame/VampireTheMasqueradeBloodlines'' you [[spoiler: are trapped at the top of a ski lift and must hide from a savage werewolf until the timer runs out or you kill it.]]
** There's also an optional mission where [[spoiler: you are trapped in a cemetery fighting an endless stream of zombies until the timer runs out.]]
* ''VideoGame/DeusEx'''s Alex Jacobson will not give you the key to [[spoiler:escape UNATCO]] until you have killed [[spoiler:[[AxCrazy Anna Navarre]]]], if you have not done so already. It's a tough fight if you don't [[spoiler:know her [[WhyAmITicking killphrase]]]]. However, the {{Mooks}} in the building can be avoided, the [[spoiler:killphrase]] is an instant win, and sequence breaking minded players can use the old "enemies have master keys" trick to avoid needing to kill her entirely.
* Certain quests in ''VideoGame/DungeonsAndDragonsOnline: Eberron Unlimited'' have rooms with portcullises that slam down when a player enters and don't open until the monsters (or players) inside are slain or a timer runs out. These are particularly annoying to anyone outside the room when this occurs.
* In the ''VideoGame/Left4Dead'' series, the standard HoldTheLine type finale works a bit like this- your rescuer will often say over the radio that they're X minutes away, but the vehicle won't actually arrive until you've killed all the necessary enemies (a wave of common infected, followed by a Tank, then more commons, then a second Tank. Then a ****load more commons and multiple Tanks, but at this point you need to stop killing and run like hell)
* Occurs frequently in the ''VideoGame/{{Descent}}'' games, where doors lock or walls appear upon entering a room or [[TeleportingKeycardSquad taking a key]], and {{Mook Maker}}s or {{monster closet}}s activate.
* Also happens with many bosses in the ''Franchise/SilentHill'' series. The most memorable example comes from [[VideoGame/SilentHill2 the second game]] - [[spoiler:the first battle with Pyramid Head begins when]] the door suddenly closes behind James in the preceding cutscene, [[spoiler:leaving him stuck in a narrow hallway with the executioner.]] Obviously, he immediately tries to open it and run to the hills, but to no avail.
* ''VideoGame/KnightsOfTheChalice'' is very fond of this trope, you can barely enter a room without the door slamming shut and spawning a bunch of monsters right on top of you, and if you try to hug the walls or head for a corner the game will teleport you right into the middle of the room so you're always surrounded no matter what.
* In some of the ''VideoGame/{{Ys}}'' games, you are locked into boss battles. Which means that if you're underleveled, you can [[{{Unwinnable}} kiss your ass goodbye]]. Hope you saved beforehand. (Alternatively, learn to fight the boss without taking a hit. This is usually possible, unless you're too low a level to damage it.)
* ''VideoGame/DragonBuster'' did this with every single room.
* VideoGame/TheDarkness and VideoGame/TheDarknessII do this sometimes. It helps that your enemies use locked doors and [[WeaksauceWeakness LOTS of lightbulbs]] to trap Jackie, thus turning a PhysicalGod into an underprepared hitman. Sadly, the cops DidntThinkThisThrough because they end up getting slaughtered over trivial mistakes (Eddie Shrote forgot where he put his flashbangs, the cops who use [[NoKillLikeOverkill a giant stadium lighter]] forgot to put bulletproof glass over the lightbulbs). As for the Brotherhood, they're smarter but insane, so they make their fair share of mistakes after Jackie gets captured in the ambush.
* Used all the time in ''VideoGame/DragonAgeOrigins'' map random encounters, but a special mention must go to the [[spoiler: ambush by Zevran, which ends in a chance to recruit him to your party]].
* ''HenryHatsworthInThePuzzlingAdventure'' uses these ''viciously'', with nearly every level having one or two of these. The game usually uses these to introduce new types of enemies, or to just make the stages that much harder.
* In ''VideoGame/KidIcarusUprising'', every now and then Pit will get locked in a room and will be required to take on an onslaught of enemies in before progressing any further.
* ''Videogame/ResidentEvilOperationRaccoonCity'' does this several times however other times it also complete averts this expecting the player to run away too. Leading to the occasional confusing moment when you rush to the objective marker and are informed you have to clear the room to proceed.
* One room in ''VideoGame/ResidentEvil4'' contains a treasure chest; as you approach, a cage drops around you, surrounded by Zealots, then a Garrador jumps in. You can either take down the Garrador and Zealots from in here, or if you have enough firepower, you can ShootOutTheLock and fight them outside. In a later room, taking the King's Grail seals the exit and deploys two waves of {{Animated Armor}}s against you. At the end of Chapter 4-1, activating the elevator power closes the door to the room, attempting to re-open it summons Verdugo. After scoring a few hits on him, it re-opens. Then you can either wait it out for 4 minutes, or kill Verdugo and summon the elevator sooner.
* It's not a bad idea to save often in the ''VideoGame/MegaManBattleNetwork'' series, lest you accidentally stumble across an inescapable boss rematch (They're invisible PreExistingEncounters) while you're not prepared for it.
** This is exemplified in the fourth game of the series, where if you manage to win said rematch, you'll unleash the ridiculously strong Omega version of the boss upon that part of the net as an inescapable random encounter. It's possible to eventually have ''every single area'' on the net occupied by one of them, which makes getting around interesting to say in the least.
* ''VideoGame/{{Bayonetta}}'' has this in spades. Almost every fight in the game is inescapable due to a magical barrier. When you are done with a battle, Bayonetta destroys the magical barrier... [[MundaneMadeAwesome by blowing a kiss at it.]]
* ''VideoGame/PAYDAYTheHeist'' has a random chance of the crew being ambushed by the local gang in the Panic Room level. Instead of making the deal inside the apartment, the gang may appear in the alley instead and will quickly pull their guns on you in a pincer attack.
* In ''[[AdventuresOfLolo The Adventures Of Lolo III]]'', Level 13's boss battle plays like this. It's the Eggerland King, and at first it looks like a normal boss battle...until you realize that he won't die no matter how many times you hit him. Thus, your character is forced to die, leaving the other one outside of the castle. This then takes you to the Underworld Level 14, where the remaining character must trudge through four levels to rescue the character lost in Level 13.
* In the ''Film/{{Total Recall|1990}}'' LicensedGame for the NintendoEntertainmentSystem, you could be pulled into alleys and forced to fight midgets in purple suits.
* Done all the time in LuigisMansion and LuigisMansionDarkMoon, with areas that immediately have ghosts show up, then lock Luigi in until all of them are caught. Or in the case of latter, it's not a door being blocked, but a magical gate popping out the floor and barricading anything from an opening to a set of stairs until all nearby ghosts are caught. In the latter, this is also marked by the lights immediately going off whenever an ambush occurs.
* Act II of ''VideoGame/TheWitcher'' ends in an ambush that, if you've solved the mystery correctly, you should see coming a mile away. Since by this point in the game you'd be familiar enough with the area to retreat, the BigBad conjures a RingOfFire to keep you hemmed in, then summons his [[TheDragon sidekick]]. Of course this [[GetBackHereBoss didn't prevent him from escaping]]...
* Largely averted in ''VideoGame/MirrorsEdge'' - you're able to simply run past every single police ambush, bar cutscenes and a single scripted fight, if you're skilled enough.
----