Due to The Law of Conservation of Detail, towns and cities in RPGs rarely have an observable population measuring more than a single digit (or, at most, the 'teens); this is far smaller than any realistic level of basic economic sustainability.
The average small country town may have a population of a dozen or so people — a big city, like the capital of a continent-spanning empire, may have as many as thirty. Generally, these towns consist of fewer than ten distinct buildings, all of particular interest to the players; no sign of an agricultural economy or professional tradesmen is outwardly visible. Similarly, approximately 90% of a city's observable population will interact with the player in some way relevant to the plot of the game.
A typical town the heroes find themselves in usually consists of the following; a Trauma Inn, a weapons/armor shop (the true metropolis may have a separate shop for each), an "item" shop, a specialty shop relating to the game's magic system, and no more than three houses. In extreme examples, only one shop of any kind is seen. With the exception of those NPCs living in those houses, the entire remainder of the population is apparently homeless; some NPCs seem to exist for the sole purpose of standing in a specific location and talking to passers-by.
In the earliest computer and console RPGs, this was a matter of economy; every kilobyte was precious and couldn't be wasted on extraneous houses or people. The tradition has continued into the modern day for several reasons, with The Law of Conservation of Detail being paramount among them. It does make it more feasible to Talk to Everyone. Especially with Random Encounters, one aversion to this is that there's often More Criminals Than Targets… Who love to Gang Up on the Human. It's often an Acceptable Break from Reality because, really, as large as towns would be in real life, think of how long it'd take to render it, and how much space it'd take on your drive. Ouch.
Some games handwave this by implying the town is much larger via expansive background images; our heroes, for whatever reason, are only visiting a small portion of it. Modern games tend to slightly avert this by adding numbers of non-interactable pedestrians into city scenes, giving the illusion of a larger populace.
Related to Space Compression. See Ghost Town for towns that are actually abandoned.
The Legend Of Zelda Twilight Princess has several Thriving Ghost Town locations as well as several not-so-thriving towns which are nearly deserted. Castle Town, however, includes many random passersby who will ignore you. You can interact with them... if watching them scream, cower, and brandish weapons at Link's wolf form counts as interaction.
Also, while Clock Town in The Legend Of Zelda Majoras Mask was relatively small, every character had a place to go at night, and you could in fact watch them walk home. This was largely done because of the Groundhog Day Loop mechanic. Justified in that aside from some stubborn business owners and government officials, most of the townsfolk have fled because the moon is falling.
Continued in The Legend of Zelda: Skyward Sword with Skyloft. Despite being the sole town in the game and the only remnant of Hylian civilization, it has fewer than three dozen residents and half as many buildings all together. And even without performing any sidequests, the player will meet nearly every single character during the course of the game.
Mimiga Village in Cave Story. The small population is justified in that the Big Bad had already kidnapped most of the Mimigas before the start of the game, but there's also a noticeably small number of houses, meaning either most of the Mimigas were homeless or their houses were perfectly destroyed.
In Terraria, a world can have a maximum of ten friendly NPCs (eleven during the Christmas season). Although Terraria requires each of these NPCs to have a home to live in (and thus would constitute a small Thriving Ghost Town if a player built an actual house for each NPC), a "home" can be as simple as a room in a much larger structure, so it's more commonplace for players to construct a base or fortress instead of a town.
The old freeware adventure game Omega had a starting town that was pretty huge by the standards of the time, but the only people you saw on the streets were guards; everyone else was apparently on permanent house arrest.
Though most of the Quest For Glory games are victims of this trope, the second game manages to avoid it by constantly having townspeople stream in and out of the plazas. You can't talk to them, however; you don't speak their language.
World of Warcraft cleverly plays with this trope. Towns are nearly always too small, but cities have plenty of buildings. It's just that the developers didn't model the insides of a great many of those buildings and locked the doors shut. This has the added bonus of creating walls where the players aren't supposed to go, and giving Blizzard a place to add buildings—Stormwind's Auction House, or the barber shops, for example, were originally just those empty shell-buildings.
Those empty buildings make cities look bigger than they actually are, but they're still quite a bit smaller than the lore or storyline would suggest. A census by counting NPCs would suggest that the population of Stormwind - the largest human city in the world - is probably around one to two hundred people, eighty percent of whom are guards. A census by counting houses and extrapolating from there, even assuming medieval population density, would suggest that the population is probably around two to four thousand, maybe as much as 10,000. But according to the RPG sourcebook, there are about 140,000 people in Stormwind.
Many cities have bars in them, and the bars are always packed with drinkers - some provide quests but most are just patrons who also respawn.
Blizzard have also improved on this in the later expansions. Vanilla towns tend to only contain quest givers and merchants whereas towns in BC and WOTLK contain tons of flavor characters, sometimes named, just to give the appearance of a populated town. Heading back from Northrend to the old world can make players very aware of this trope. Until, however, Cataclysm came out and upgraded the towns.
It also becomes obvious when looking at towns used as quest hubs and towns used as killing fields. Southshore, for example, is nearly empty compared to the nearby Hillsbrad Fields and Dun Garok, both of which contain quest mobs for horde players.
Highlighted by a particular quest late in Cataclysm. By this point, you're pretty used to the idea that the population you see is only representative of those who are working in the background and who aren't present due to the Law of Conservation of Detail . Then you get a quest to kill 1000 gnomes, probably more than all of the gnomes who exist anywhere else in the world combined.
Sometimes quests are removed from the game. However the characters that GIVE the quests or are in some way a part of the quest are not removed. Some of them are still shopkeepers and others have other quests to offer, but many become empty, but still named individuals wandering around or even just standing aimlessly outside empty buildings. Generally, a character that becomes "useless" in this manner isn't actually removed without good reason (i.e. for story purposes), or at least without a Lampshade Hanging or Hand Wave. If a character goes missing and it isn't explained, chances are that character will show up somewhere else.
Guild Wars Zig-zags this. A couple places that are implied to be capitals or important towns actually look really really small. (Lion's Arch in particular) However, many of them have backgrounds that the player can't really access. Factions is probably the biggest aversion ever - Kaineng City takes up half the continent. While the Kurzick locations play this straight, it's actually a little more justified with the Luxon areas (Luxons are a bit more nomadic.)
Guild Wars 2 averts this, there are hundreds of NPCs just wandering the city streets that serve no purpose other than ambience, making it feel like it's truly alive.
Most of the Phantasy Star MMORPGs (namely Phantasy Star Online, Phantasy Star Universe, and Phantasy Star Online 2 play with the trope through the design of populated areas. While the accessible areas of a city, space station, or colony ship—and the number of NPCs to interact with—are comparable to that of a Thriving Ghost Town played straight, the skyline and other background scenery afforded clearly shows that players only have access to part of a much larger place. Special mention goes to Pioneer 2 in PSO, Clyez City and Holtes City in PSU, where airborne traffic regularly flies by overhead or in the distance.
Phantasy Star Universe averts the Gateless Ghetto with metrorail stations in a number of the visitable cities, even though players can only use them to get to areas of interest. PSU also attempted to give the impression of many more people walking through the accessible (and background) areas of visitable cities with generic NPCs wandering aimlessly. However, they were transparent, tinted a random color, and would disappear when approached.
Real Time Strategy
Unusual for a real time strategy game, Star Wars: Empire at War features small to sizable civilian populations and are interactive in that they'll either side with you and be controllable by the player, or side with the enemy, depending on that planet's pre-determined allegiance. Not only that but, when used in a large enough group, they were actually pretty powerful units (capable of taking down enemy walkers and tanks even!) and if nothing else they were strong enough to make for very useful distractions or at minimum scouts (they respawn).
Likewise, in Command & Conquer: Red Alert 2, large cities usually had a (sparse) civilian population spread throughout the city, which for the most part the player couldn't interact with beyond using them as target practice. In multiplayer, Soviets could mind control them Yuri, and wrap them in explosives with Ivan—-this even worked on cattle. The expansion pack Yuri's Revenge expanded the set of mind control units and provided a "grinder" building you could feed them to for resources. Soylent Tank is people.
Universe At War has a strange example. Most of the maps are fought in urban areas, but there are no civilians on the field. If you start to collect resources (buildings and stuff), people will start to run out. So they hide in houses, makes sense, but for some strange reason around 10-15 people live in one suburb house.
Total War plays this straight and averts it in some installments. During siege battles, there are no civilians to be seen, even in massive cities like Rome or London. It is later averted when Rome allowed the player to view cities in the battle map. They were filled with thousands of peasants milling around.
Played straight, however, in that while city sizes are at least above the threshold of sustainability (unlike most games), they're still ridiculously small for the cities in question, to provide better game balance and the possibility of a player actually upgrading a city within a reasonable amount of time. This is most notable in Rome, where the practical upper limit on population is ~36000; whereas in Real Life one of Rome's many advantages was its effectively infinite manpower compared to its rivals (the city itself having a population in the millions. In the ancient world.).
Fallout 3 justifies this in that all of the towns you find are, in fact, ghost towns. They're just abandoned ruins of old decaying buildings that a handful of people manage to scrape by in. Usually only being about one or two houses, as with only a few limited guards and resources, there can only be so many capable of living in the area.
Role Playing Game
Several of the later Ultima games, Ultima VII in particular, had towns larger than the norm, where every NPC had a home they returned to at night. Still, even the capital city of Britain has a population of fifty or so. The entire game clocks in at slightly over 100.
The Elder Scrolls started out with solid aversions of this trope, but later titles played it straight. This goes hand in hand with the switch to Space Compression; the examples there have more information on that. As for the towns themselves—
The Elder Scrolls Arena thoroughly averts this, as noted. Numerous villages, towns, and cities all across the continent of Tamriel are visitable, and all of them have the size and population to justify their local economy.
The Elder Scrolls II Daggerfall also averts this, with full-sized populated areas. The larger cities have hundreds of buildings and thousands of people. However, many of these houses can't be entered, even by the most skilled and determined lockpicks. "This house contains nothing of interest." Further, shops closed at night, at which time an enterprising burglar could break in to strip the shelves bare. Players who loitered in the shop until after closing could also clear the shelves free of charge, at no risk to their criminal record.
The Elder Scrolls III Morrowind was the point where the series played the trope straight, along with having Space Compression. Bethesda did this on purpose to address criticisms of Daggerfall that, despite the sheer size of locations and cities, they didn't have a whole lot of individuality or character to them.
The Elder Scrolls V Skyrim also continues to play this straight; towns with a believable population were reduced to shadows of their former selves thanks to the Space Compression. The way the world has shrunken down stands out when comparing locations featured in Arena to Skyrim, such as the town of Riverwood. In Arena it's a bustling town that contains 200 or 300 buildings, but in Skyrim it's a hamlet with seven houses.
In Kingdom Hearts, Traverse Town and Twilight Town (both First Towns) had large numbers of random citizens irrelevant to the story; the other cities, however, are populated almost entirely by Disney licensed characters. But then again, the other cities are essentially town-shaped dungeons.
In Twilight Town, this makes sense, since they're replicas of the people in the real Twilight Town; when the simulation is interrupted, the literal NPCs disappear.
Although, by nature of them being large Dungeon Towns, this trope is handled slightly more tastefully - Twilight Town, Radiant Garden/Hollow Bastion and Traverse Town both have multiple districts, plenty of houses and (for Twilight Town only) modes of public transportation. There are enough homes (most of them unenterable) to qualify them as small settlements (with the population ranging in the hundreds or so), although the conspicuous lack of citizens is rather jarring. Perhaps they're all hiding from the Heartless and Nobodies?
EarthBound has quite large towns (though some buildings have no door), except for the "largest" one, Fourside, which appeared quite small compared to what it's supposed to be. It can be assumed that only the south corner of the town is visible, however.
While Baldur's Gate definitely has less citizens than you'd expect, there are still a lot of people hanging around, a lot of houses are inhabited, and there are always a lot of people at the local pub.
It's about a fiftieth the size of the pen-and-paper game's map of the city, but it's about the same shape and the landmarks are roughly in the right places.
Also, there are many houses and doors around Athkatla that you can see, but not go in; those are handwaved by saying there's nothing of interest within.
This actually works out in many cases. Numerous Mods creating new shops or locations can take the 'useless' doors and tag them to the new custom content. With enough mods on deck, Athkatla can go from a busy place, something that would be time-consuming to fully explore, to downright overwhelming.
In Gothic, you visit the 3 prison camps rather than actual cities. The smallest one is the Swamp Camp with over 80 people inside it, and the biggest one is the Old Camp with over 130 people, not counting over 60 people working in the Old Mine but also belonging to the Old Camp. Gothic II isn't as realistic with the actual city not being much more populated than the camps, and Gothic III is a good example of this trope.
The Dragonriders Of Pern game for the Dreamcast has an example that can only be attributable to actual ghosts: at one town, you enter a vast chamber with thick stone walls, and few entrances or exits. There are perhaps a half dozen people or so milling around a space the size of a convention center, and to judge by the soundtrack, those people are able to completely fill the space with the sound of hustle and bustle and conversation. If you revisit the chamber later on, you'll discover it's still filled with the sounds of countless people shuffling about and chatting together, even though the room is now completely empty.
Assassin's Creed averts this in a big way with teeming cities, not many different faces but lots of people.
Zig-zagged in Dragon Age: Origins. Denerim and Amaranthine are implied to be much larger than you actually show. It also helps that Denerim is so big that it requires its own map screen, and you don't explore every inch of the city, only the parts that are relevant. Likewise, Orzrammar does not have a map screen like Denerim, but it's implied that the action is just that close together, plus it looks a bit like they might have been tiered. Justified with the Dalish "towns" because it's a nomadic camp. However played entirely straight with Redcliffe and Lothering.
Vampire: The Masquerade - Bloodlines is rather obvious about this. True, there are substantial numbers of buildings in all the main hubs (a large proportion of which can be entered) and numerous NPCs walking around, but the game is still asking you to believe that Santa Monica consists of three streets.
Traffic Giant gives you cities with many buildings and thousands of inhabitants, and individually keeps track of each one.
Most of the games in both the Harvest Moon and Spin-OffRune Factory series tend to have the player settle into one of these. Island of Happiness and Rune Factory 3 are major exceptions: IoH has multiple NPCs move to the island and RF3 has NPCs moving in and out of Sharance Village all the time; visiting, shopping or just travelling through.
It almost goes without saying that Dwarf Fortress averts this one pretty thoroughly.
Ed Edd N Eddy is usually justified in having such a small cast by being set in a single neighborhood, but the episodes set in school feature no more than the same cast of a dozen characters.
A good way to see this trope in action is to compare the cities and towns in the Pokémon anime to those in the video games. For example, Viridian City in the games is just five or six buildings, but in the anime, it looks like a proper big city◊.
Deconstructed in Erfworld. All non plot important buildings in the city are completely empty, and seemingly serve merely to “be the city”; though they get occupied and used based on what they resemble. For example the slaughterhouse somehow feeds the troops through its mere existence, as there are no workers, and no slaughtering going on. Of course, the world they're in is based on Turn Based Strategy tropes, where abstractions of this sort are commonplace.
Not to mention other odd things; Farms “pop” piglets/calves/chicks, which get progressively older and fatter over the course of a few turns, until eventually they disappear and are replaced by pork/beef/chicken food items teleported directly to the consumer. Seriously.
Many North American cities experienced a massive flight of working class residents in the 1950's and 60's as the government subsidized suburban housing and roads to connect the urban cores where the jobs were with the suburbs where people lived. The result was cities that continued to thrive (to some extent), but after 5pm on weeknights were almost completely devoid of people creating an environment that closely resembled a newly minted Zombie Apocalypse.
Parts of central London can be like this as well, which is how 28 Days Later managed to film there on location.
Niagara Falls on the American side of the border. The most you would see in that area are a few hotels and maybe some residents.
China's ghost cities. Large cities with full infrastructure and lots of construction, but very few people. They are built during the construction boom of the 2010s, but real estate speculation rapidly pushed the cost of the house out of the reach of regular Chinese citizens, which forces the government to build more housing with the hope that this time, they will be affordable. Inevitably, the speculators descend and this vicious cycle restarts.
Adamstown, which serves as the capital of the Pitcairn Islands in the South Pacific. It has a population of around 50.
In a few of America's university towns (such as Durham, New Hampshire) the local economy is entirely devoted to catering to the student population. The town becomes this during the summer months, with the students gone and most of the town's services shutting down for the summer, leaving only a skeleton crew to take care of the remaining faculty..
The riverside area of Dublin can appear as this as well, with many a towering, half-finished construction site and almost no actual people around.