NPC, which also stands for a non-player character, is a game character that is not controlled by the player. The idea was first introduced in tabletop role-playing games. In the game, it applied to characters that were controlled by the referee and not the player itself.
NPC in a video game is usually the character that is controlled by the computer using specific algorithms. Game development teams often create these actions which are predetermined, and are responsive to the surrounding environments. This behavior, however, is not set by artificial intelligence.
In more traditional role-playing games (RPGs) the NPC is set by the gamemaster. It is good to look at a role play game as a story with a plot in which the NPC is the main protagonist. NPC characters can be seen as the supporting cast and extras that make up the rest of the scenes. NPCs can be found throughout the game world, and take up any role that is not occupied by the set player. Looking at most cases, the NPCs are regular bystanders, allies, or even enemies to the playable character.
In general, the NPC can be programmed to take up any role in the game that helps the storyline, and sets the environment. Some RPG games that are set in fantasy related, and historical contexts, the non-playable game character can even be traders that trade goods, currencies, and gear that the player can benefit from. Depending on the game, some characters can be brief characters, and others may have complete backstories that affect the game itself.