Skip to content
BENIBIX Learn

Non-Player Character (NPC)

Development🎮 Game DevelopmentGame AI

Also known as NPC, NPCs, Non-Playable Character

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

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.

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.

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.
A guard is an NPC: it picks a state, then finds a path.

Common mistake

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

Key takeaways

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