Making a city in a video game can be difficult. After all, it's a big place — if the creators were to allow the player to explore, they would have to map the whole city, which would require a huge amount of work and boost technical requirements.
Therefore, most games usually resort to dumping the player in the middle of an enclosed area that is indeed full of buildings and streets, but is walled off from the rest of the city. You cannot see anything that would be outside the area. Often it also has no visible connection to the outside area: no doors, gates, tunnels — whatever.
Sometimes, it is instead done with the help of Insurmountable Waist Height Fences, Invisible Walls, permanently Locked Doors, or with rubble, ruins, etc.
A defining feature of a Dungeon Town. Might be escaped with The Great Repair.
On a Sliding Scale of Video Game World Size and Scale, games that use a Gateless Ghetto are usually somewhere between "symbolic representation" and "realistic scale, most of world in background".
Currently, the authors of games have Skyboxes at their disposal, which allows them to make this a little more realistic.
Myst: The underground city of D'ni can be like this at times in Uru - most of your access to it is on the island of Aegura, which is logically not directly connected to the rest of the city. The original game had extremely limited access to the majority of the city, and while the accessible area was greatly expanded in the first expansion, where the city became the center of action, Rezeero and the docks are both locked off from the main area by collapsed passages and immovable barricades, respectively. The one neighborhood on the other shore that you can reach - Bevin - is similarly sealed off from the rest of the capital. The result is an accessible area that covers approximately a square mile of world space in a city dozens of miles on each side.
The Quest for Glory series has used this a few times, most notably in III, where most of the city of Tarna is forbidden to humans. Somewhat averted in II, though, in which you can pretty much go anywhere in the labyrinthine city of Shapeir. The anonymous and uninspired nature of most of the default city streets and how easy it is to get lost, though it's done on purpose because the Feelies that came with the game included a map of the city in a form of Copy Protection.
Banjo-Kazooie: Nuts and Bolts averts this. The Hub World, Showdown Town, is the largest in the entire series (and quite large, by game standards.)
In Vette, only certain parts of San Francisco are accessible; the rest are blocked off by insurmountable fences, "because of the vast amounts of information needed to recreate the city". Also, since the game was released right after the 1989 earthquake, the manual lampshaded it as being due to earthquake damage.
The Mario Kart series's traffic courses are set on public roads with no visible way in or out (there are some exceptions, but the kart gets dragged back onto the track).
In Midnight Club 2 the cities of LA, Paris and Tokyo are modelled after real-life cities with exception that there are no roads leading out of them.
The N64 port of the game averts it slightly, as the areas "beyond the walls" (which are simply blank in the PC game) instead have entirely new streets added to them, expressly for the purpose of making the levels look a little bit less like isolated ghettos. Sure, most of these new areas can't actually be accessed. But at least you can see more city beyond the bits you're walking around in!
Half-Life 2 uses a variant of Invisible Walls (which are actually visible forcefields), and - in one city - also the rubble and ruins approach. Also, in the Ravenholm level the maps are hedged in by wooden barriers presumably built to keep the zombies at bay or in one area (though some of them could probably just jump over them anyways).
Simply using the 'noclip' cheat reveals there are invisible walls everywhere, most of which are in places that the player shouldn't normally be able to reach anyhow. Although some could be easily reached on foot, were the invisible walls not there.
In Left 4 Dead, Valve uses a similar technique as the Ravenholm level. Rubble, fires, and makeshift barricades keep the action moving in one direction. Subverted in that, when the players join the Zombie team, they gain access to much more of the level.
Deus Ex makes use of literal concrete barriers erected around parts of New York City by the US government in order to block off areas of civil unrest or disease outbreak. A newspaper the player can find and read contains an article about the Supreme Court upholding the legality of said barricades.
Yet despite the justification, the trope still applies. The road you saw blocked off during an earlier mission? It's the express road to your next objective, without so much as an alleyway deviating from the path.
2027 has Moscow under curfew, blocking off major roads.
Most of Deus Ex: Human Revolution's plot happens right before or during the anti-augmentation riots, so roads have been cordoned off and public transport severely limited.
In Perfect Dark, one mission in Chicago takes up one small street and a couple of alleys. There's no way to access any other part of the city; there isn't any traffic, gates, or doors leading out of the enclosed space.
There are flying cars, though, so there doesn't seem to be much need for gates into the area.
The Darkness' New York isn't much better- the subway areas are lampshaded to a point by trains only running on one line between two stations (unless you try and walk up the tracks) but the streets less so.
Multiplayer maps in the Call of Duty games are like this. Invisible walls block you from exiting the map via wide open spaces, whereas highly urban areas (like in Modern Warfare and Modern Warfare 2's "Karachi") have fences, brick walls, and railings that keep you from exiting the map space.
The Bioshock games restrict you to certain sections of the city and, to a lesser extent, certain areas within those sections. Many establishments are closed up or blocked by malfunctioning doors or rubble. Even the bathyspheres can only take you to the next level, or to levels you've already visited; this is never really explained.
Lampshaded in Blood 2. The incredibly snarky journal has a few things to say about Cabalco's engineers, who are apparently responsible for every single instance of absurd architecture in the game.
Medal of Honor does this with locked doors, invisible walls, and insurmountable waist-height barriers.
City of Heroes plays with this. At first glance, most of Paragon City's neighborhoods are sealed off by the War Walls—massive concrete-and-forcefield barriers erected during the Rikti War, and still used to keep hazardous, wrecked areas of city isolated from the populated areas—from which the only way in or out is through security checkpoints guarded by the PPD SWAT (with the exception of the Sewer Networks, that is). However, most of the populated areas have tunnels between the War Walls that let traffic and pedestrians move freely between neighboring zones, and the Paragon Transit Authority has several metrorail lines that serve all of the populated areas.
Averted in Champions Online. Millennium City is positively HUGE, with regions that include rundown warehouse districts, apartment buildings, a somewhat bohemian city center, an industrial center, and more, with what appear to be the suburbs visible and also visibly NOT simply a skybox in the distance. However, when one begins to go outside arbitrary boundaries, the screen fades to black and white. If one goes TOO far, the character simply can't go any further.
Averted in World of Warcraft after Cataclysm. The developers re-modeled the world to take account of the decision to allow players to use flying mounts in all areas of the Eastern Kingdoms and Kalimdor, though still not the areas which were bundled with the first expansion pack The Burning Crusade. This involved particularly remodeling Stormwind, which was originally a Potemkin village of sorts with the polygons representing the taller buildings flat and two-dimensional. The zones are still bordered with mountains impassable on foot; however, enterprising players did find one route from Dun Morogh to Thorium Point, so they were never total barriers.
Angband, a Roguelike, starts the player off in a 'town' consisting of several businesses, the player's house and the entrance to the titular dungeon. These locations are surrounded by a gateless, unbreakable wall.
Lampshaded when, in order to inhibit your progress, the police set up roadblocks, claiming that they are famous for their roadblocks and are going for a record.
Along similar lines, both Earthbound and Earthbound Zero explain, in their usual conspicuous style, how to pick out the doors which can be entered from those which cannot. Earthbound often trades entering useless houses for hearing unusual conversations behind doors.
While this is a non-issue in 8- and 16-bit Final Fantasy games, where towns and cities were composed of a dozen buildings at most, it becomes noticeable to the point of frustration in PlayStation-era games. Most egregious of all:
Final Fantasy VII: Midgar, a sprawling megalopolis built on two levels (ground level, and a plate built above it.) You only visit three sections of the former, and a couple of alleyways of the latter. Other games in the Compilation of Final Fantasy VII would allow you to explore a bit more, but still never the whole shebang.
Nearly this exact scenario played out in Final Fantasy VI with the city of Vector.
Deling City and Esthar, capital cities of opposing nations. More noticable in Esthar because it's large enough to take up a huge chunk of the World Map (the player can run across its pathways and get into random encounters later on.)
Lindblum, Treno, and Alexandria, all rather large cities with innumerable neighborhoods, alleyways, plazas, and markets. All are reduced to isolated corridors in the actual game.
Zanarkand, Luca, and Bevelle. They're extremely linear corridors. Literally, in the case of Bevelle —you never actually visit the city, just the Temple's atrium.
Hence why Mass Effect 2 disabled weapons-firing outside of explicit combat situations anyway. Both games have plenty of unusable doors presumably leading to other areas of the Citadel. That may not very well apply to Tuchanka or Illium (and maybe not even Omega), though.
Fallout 3 takes place in the ruins of Washington, DC, and the surrounding wasteland of Virginia/Maryland. Since everything in the city is in ruins, the only way you are allowed to enter and move between sections is via the underground Metro tunnels. Gigantic piles of unclimbable debris and sealed buildings prevent you from doing much surface travel, at least directly. Outside of the city it's pretty much wide open though, until your Pipboy tells you that you can't go any further when you reach the map boundaries.
Some debris piles are unclimbable, but a few very similar looking ones actually can be climbed, which is kind of annoying: "Okay, this 45 degree slope I can scamper up just fine, but this ready-made staircase is completely impassible."
The various districts of Las Vegas in Fallout: New Vegas are cordoned off by makeshift junk barricades and accessed through gates (or the sewers), making these more of gated ghettoes. The only area where access is actually restricted is the Strip, where you need to be carrying at least 2000 caps to pass the security checkpoint without being shot at. The Sierra Madre Villa from Dead Money plays this trope straight, being completely self-contained. Ditto the Big Empty, which is surrounded by a radar fence (force field).
Deconstructed in Devil Survivor — the players are trapped inside the Yamamote line (a section of Tokyo) by the JSDF, who have standing orders to shoot anyone trying to escape. Everyone trapped inside starts going crazier and crazier as time drags on with no power, very little food and water, and demons and the lunatics summoning them running around.
This is actually pretty common in Shin Megami Tensei games, dating back to the first one, where thanks to a coup d'etat instituting martial law and an invasion by the American army, most of Tokyo is out of bounds to you until After the End.
Planescape: Torment made heavy use of this trope: Sigil consists of six-seven areas you can move between and explore, with the implication that most of the places between are of no particular interest to you. The total amount of Sigil accessible to The Nameless One and crew through these areas is less than a single percent of its total size and population, given its tabletop stats.
In addition, you're prevented from leaving the Hive into other areas until a certain plot development, because the Dabus have changed the streets around too much to allow a clear path.
Dragon Age II only shows you a fraction of the great city of Kirkwall, despite of most of the game being set within its walls.
Summoner 2, Munari City. You can only visit the docks, market, university and arena. Justified in that the remainder of the city is underwater.
Knights of the Old Republic plays this straight with Taris. It's somewhat justified in the second game on Telos: the only inhabitable area is the Citadel Station, which pretty much consists of standalone modules, that can only be reached via shuttles, or Nar Shaddaa, which actually makes this a plot point.
The Elder Scrolls III: Morrowind's Tribunal expansion features the mainland city of Mournhold, in which levitation is disabled (Because the city is technically in an enclosed cell), and the main gate is impassable (for no in-game reason). The only way to get from Vvardenfell to Mournhold and vice versa is via a teleport service.
Sensory Overload: There's only one entrance to the building, and the terrorists have welded it shut.
Animal Crossing: Wild World takes place within a square Gated Ghetto, 256 meters on a side. West and east are solid walls, south is impassable water, and north is a solid wall interrupted by a small gate. But in order to pass through this gate, you must first be invited by another player with another DS and another copy of the game. This can get difficult if your real-life friends (mistakenly) think AC isn't appropriate for their age group. City Folk's eponymous city and the town in New Leaf also fit this trope.
The Silent Hill games are an interesting example. In the firsttwo games the town is fairly wide open, but parts of it are blocked off by large crevasses and, later, construction sites. While still a Gateless Ghetto, this gave the town a more open and organic feel than, say, the Raccoon City of the early Resident Evil titles.
The Building World and other otherworlds in Silent Hill 4. All are either completely isolated from the outside, have permanently locked doors, or the exits are blocked by debris.
In Shattered Memories, the inaccessible areas are blocked off by massive snowbanks.
Often, there don't seem to be any roads leading into the city, blocked or not. However, there is a tunnel in Shoreside Vale in the third game that's permanently blocked by an Insurmountable Waist-Height Fence. Apparently, this is the only road into the city. The later games each have their cities built on islands in the middle of the ocean.
The reason for this is that after GTA 3, Rockstar decided they did not like having land that the player could not reach. So while in-game the Cities are portrayed as islands, in actuality they are meant to be connected to land. Also, on GTAIV's website, the picture of the city is much larger than the in-game city, confirming this.
Prototype actually has all the bridges in and out of the city, they're just Border Patrolled and blocked with Invisible Walls. The game forces you back to shore if you try to go across the water; the virus allegedly has an aversion to water, the only effect of which is apparently that your character is incapable of jumping out of the water in a direction away from the designated game area.
Attempting to fly out in a helicopter will result in being shot down (read: spontaneously exploding) — the military takes the island's viral infection seriously: no one who goes in comes back out without proper clearance in an attempt to prevent the virus breaking quarantine.
Happens in the sequel as well. It's turned up to eleven in the Dead Zone area, where if you try going out that way and ignore the warnings, you get an instakilled with an airstrike.
Done in both True Crime games when the scale of Los Angeles and Manhattan are almost identical to real life. Buildings and road blockades prevent you from leaving LA and Manhattan.
Neatly dodged in Sleeping Dogs, which was originally intended as an entry in the True Crime series, by setting the game in Hong Kong.
Ryu Ga Gotoku only lets you enter a restricted part of Tokyo or Okinawa. The rest is sealed off by invisible walls.
Averted in the Saints Row games. Once you're out of the first mission, you can go anywhere in the city. Played straight in that there doesn't seem to be any way to drive to or from Stilwater, however. The city has no standing bridges other than those that connect the two main islands, meaning the only way into the city is by plane or boat. Steelport in The Third is much the same. There is a single collapsed railroad bridge on one of the islands, but beyond that there is no evidence of a bridge in the distance.
Semi-averted in Assassin's Creed-games. The Medieval cities are rendered in their full glory and you can go anywhere you want within them, but their gates remain permanently closed except for special missions.
Batman: Arkham City seems to make it a point to provide in-universe justification for this trope, where the titular Arkham City is a large chunk of Gotham that's been completely walled off to serve as a radical, experimental prison; all of Gotham's criminal's are simply dumped into the "city" and left to their own devices, provided they keep the hell away from the heavily guarded walls. Out-of-universe, this seems to be their way of finally giving players the chance to patrol the streets of Gotham itself, as opposed to Batman: Arkham Asylum which was entirely confined to the asylum.
Jak 2 suffers from this: you can't get to various parts of Haven City before you get the appropriate permit.
A rare film version of this appears in Dark City. The residents are all certain that the world outside of the city, Shell Beach in particular, is real and will tell you about them if asked, but anyone attempting to actually leave will find themselves blocked one way or another. This is because, like a video game, those areas do not actually exist.
In The Hunger Games, the arena where the Tributes compete is one of these, as Katniss finds out when using some Genre Savvy to avoid combat.
The Thirteenth Floor features this in the simulated world. Everyone inside is programmed to never choose to leave the city. One way to prove the artificial nature of the world they are living in was to pick a far away destination they would never think to actually visit and try to get there; eventually the person will come to the edge of the simulation and see how it starts to break down into crude line drawings and then just nothingness. The protagonist thinks these instructions apply to people living in the simulated world he helped create, but eventually discovers they were meant for the world he lives in, which is also a simulation (running under the same rules as the one he built).