# Non-Player Character (NPC)

> A character run by the game, not the player. A guard or a shopkeeper is one.

**Field:** Software Development  
**Category:** Game Development  
**Also known as:** NPC, NPCs, Non-Playable Character

## Think of it like

Think of it like an actor in a play who is not you. They follow the script you wrote for them.

## Definition

A non-player character, or NPC, is any character in a game that the player does not control. Shopkeepers, guards, monsters and talking animals are all NPCs. The game's code decides what each one does. Simple rules can make them seem smart, like chasing the player when they get close.

## Example

In Emma's game, a guard walks back and forth until he sees the player. Then he gives chase.

## Why it matters

NPCs make a world feel alive. Their rules decide if a game is fun or frustrating.

## Common mistake

Making them too smart. An enemy that never misses is no fun to play against.

## Three principles

- **Not the player.** The game's code controls them.
- **Simple rules.** Small rules can look like thinking.
- **Fun first.** Good game AI is beatable.

## Related terms

- [Finite State Machine (FSM)](https://learn.benibix.com/term/development/finite-state-machine)
- [Pathfinding](https://learn.benibix.com/term/development/pathfinding)
- [Game Object](https://learn.benibix.com/term/development/game-object)

![Two panels. On the left, a finite state machine has three states: Patrol, Chase (lit up) and Attack. Patrol goes to Chase when the guard sees the player, Chase goes to Attack when close, and Chase goes back to Patrol when the guard loses sight. A note says one state at a time, with a rule for each change. On the right, a grid with a dark wall in the middle shows a path from G, the guard, up, across the top and down to P, the player, going round the wall.](https://learn.benibix.com/diagrams/dev2-npc-brain.svg)

---

Source: https://learn.benibix.com/term/development/non-player-character
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
