A non-player character (NPC), sometimes known as a non-person character or non-playable character, in a game is any character that is not controlled by a player. In video games, this usually means a character controlled by the computer through artificial intelligence. In traditional tabletop role-playing games the term applies to characters controlled by the gamemaster or referee, rather than another player.
In a traditional tabletop role-playing game such as Dungeons & Dragons, an NPC is a fictional character portrayed by the gamemaster. If player characters form the narrative's protagonists, non-player characters can be thought of as the "supporting cast" or "extras" of a roleplaying narrative. Non-player characters populate the fictional world of the game, and can fill any role not occupied by a player character (PC). Non-player characters might be allies, bystanders or competitors to the PCs. NPCs can also be traders that trade currency for things such as equipment or gear. NPCs thus vary in their level of detail. Some may be only a brief description ("You see a man in a corner of the tavern"), while others may have complete game statistics and backstories of their own.
There is some debate about how much work a gamemaster should put into an important NPC's statistics; some players prefer to have every NPC completely defined with stats, skills, and gear, while others define only what is immediately necessary and fill in the rest as the game proceeds. There is also some discussion as to just how important fully defined NPCs are in any given RPG, but it is general consensus that the more "real" the NPCs feel, the more fun players will have interacting with them in character.
In some games and in some circumstances, a player who is without a player character of their own can temporarily take control of an NPC. Reasons for this vary, but often arise from the player not maintaining a PC within the group and playing the NPC for a session or from the player's PC being unable to act for some time (for example, because they are injured or in another location). Although these characters are still designed and normally controlled by the gamemaster, when players are given the opportunity to temporarily control these non-player characters it gives them another perspective on the plot of the game. Some systems, such as Nobilis, encourage this in their rules.