---
key: path/npc-behavior
type: path
id: npc-behavior
lang: en
title: NPC behavior
summary: >-
  What a character knows, how it selects an action and how it reaches a
  destination.
updatedAt: '2026-10-20'
status: active
url: 'https://gamemechanics.pro/en/learn/npc-behavior/'
jsonUrl: 'https://gamemechanics.pro/api/v1/knowledge/en/path/npc-behavior.json'
markdownUrl: 'https://gamemechanics.pro/content/knowledge/en/path/npc-behavior.md'
aliases: []
tags: []
sourceIds: []
sources: []
relations:
  - type: contains
    direction: outgoing
    label: Path materials
    key: lesson/npc-perception
    title: NPC perception and target memory
    url: 'https://gamemechanics.pro/en/lessons/npc-perception/'
    jsonUrl: 'https://gamemechanics.pro/api/v1/knowledge/en/lesson/npc-perception.json'
    markdownUrl: 'https://gamemechanics.pro/content/knowledge/en/lesson/npc-perception.md'
  - type: contains
    direction: outgoing
    label: Path materials
    key: lesson/npc-action-selection
    title: How an NPC selects an action
    url: 'https://gamemechanics.pro/en/lessons/npc-action-selection/'
    jsonUrl: >-
      https://gamemechanics.pro/api/v1/knowledge/en/lesson/npc-action-selection.json
    markdownUrl: >-
      https://gamemechanics.pro/content/knowledge/en/lesson/npc-action-selection.md
  - type: contains
    direction: outgoing
    label: Path materials
    key: lesson/npc-pathfinding
    title: Pathfinding and following a route
    url: 'https://gamemechanics.pro/en/lessons/npc-pathfinding/'
    jsonUrl: 'https://gamemechanics.pro/api/v1/knowledge/en/lesson/npc-pathfinding.json'
    markdownUrl: 'https://gamemechanics.pro/content/knowledge/en/lesson/npc-pathfinding.md'
  - type: requires
    direction: outgoing
    label: Before you start
    key: lesson/game-loop
    title: The game loop and time
    url: 'https://gamemechanics.pro/en/lessons/game-loop/'
    jsonUrl: 'https://gamemechanics.pro/api/v1/knowledge/en/lesson/game-loop.json'
    markdownUrl: 'https://gamemechanics.pro/content/knowledge/en/lesson/game-loop.md'
  - type: requires
    direction: outgoing
    label: Before you start
    key: lesson/state-machines
    title: States and transitions
    url: 'https://gamemechanics.pro/en/lessons/state-machines/'
    jsonUrl: 'https://gamemechanics.pro/api/v1/knowledge/en/lesson/state-machines.json'
    markdownUrl: 'https://gamemechanics.pro/content/knowledge/en/lesson/state-machines.md'
  - type: requires
    direction: outgoing
    label: Before you start
    key: lesson/collision-basics
    title: Collision fundamentals
    url: 'https://gamemechanics.pro/en/lessons/collision-basics/'
    jsonUrl: 'https://gamemechanics.pro/api/v1/knowledge/en/lesson/collision-basics.json'
    markdownUrl: 'https://gamemechanics.pro/content/knowledge/en/lesson/collision-basics.md'
  - type: practices
    direction: outgoing
    label: Put it into practice
    key: practice/shared-workshop
    title: The shared workshop
    url: 'https://gamemechanics.pro/en/knowledge/practice/shared-workshop/'
    jsonUrl: >-
      https://gamemechanics.pro/api/v1/knowledge/en/practice/shared-workshop.json
    markdownUrl: 'https://gamemechanics.pro/content/knowledge/en/practice/shared-workshop.md'
  - type: practices
    direction: outgoing
    label: Put it into practice
    key: practice/maintenance-patrol
    title: Maintenance patrol
    url: 'https://gamemechanics.pro/en/knowledge/practice/maintenance-patrol/'
    jsonUrl: >-
      https://gamemechanics.pro/api/v1/knowledge/en/practice/maintenance-patrol.json
    markdownUrl: >-
      https://gamemechanics.pro/content/knowledge/en/practice/maintenance-patrol.md
  - type: reviews
    direction: outgoing
    label: Review through a lens
    key: lens/schell-028
    title: The State Machine
    url: 'https://gamemechanics.pro/en/knowledge/lens/schell-028/'
    jsonUrl: 'https://gamemechanics.pro/api/v1/knowledge/en/lens/schell-028.json'
    markdownUrl: 'https://gamemechanics.pro/content/knowledge/en/lens/schell-028.md'
  - type: reviews
    direction: outgoing
    label: Review through a lens
    key: lens/schell-031
    title: Action
    url: 'https://gamemechanics.pro/en/knowledge/lens/schell-031/'
    jsonUrl: 'https://gamemechanics.pro/api/v1/knowledge/en/lens/schell-031.json'
    markdownUrl: 'https://gamemechanics.pro/content/knowledge/en/lens/schell-031.md'
  - type: reviews
    direction: outgoing
    label: Review through a lens
    key: lens/schell-062
    title: Transparency
    url: 'https://gamemechanics.pro/en/knowledge/lens/schell-062/'
    jsonUrl: 'https://gamemechanics.pro/api/v1/knowledge/en/lens/schell-062.json'
    markdownUrl: 'https://gamemechanics.pro/content/knowledge/en/lens/schell-062.md'
placements: []
supersededBy: []
attributes:
  lessons:
    - id: npc-perception
      url: 'https://gamemechanics.pro/en/lessons/npc-perception/'
      markdownUrl: 'https://gamemechanics.pro/content/en/npc-perception.md'
    - id: npc-action-selection
      url: 'https://gamemechanics.pro/en/lessons/npc-action-selection/'
      markdownUrl: 'https://gamemechanics.pro/content/en/npc-action-selection.md'
    - id: npc-pathfinding
      url: 'https://gamemechanics.pro/en/lessons/npc-pathfinding/'
      markdownUrl: 'https://gamemechanics.pro/content/en/npc-pathfinding.md'
  prerequisites:
    - id: game-loop
      url: 'https://gamemechanics.pro/en/lessons/game-loop/'
      markdownUrl: 'https://gamemechanics.pro/content/en/game-loop.md'
    - id: state-machines
      url: 'https://gamemechanics.pro/en/lessons/state-machines/'
      markdownUrl: 'https://gamemechanics.pro/content/en/state-machines.md'
    - id: collision-basics
      url: 'https://gamemechanics.pro/en/lessons/collision-basics/'
      markdownUrl: 'https://gamemechanics.pro/content/en/collision-basics.md'
  practice:
    - id: shared-workshop
      url: 'https://gamemechanics.pro/en/practice/#shared-workshop'
    - id: maintenance-patrol
      url: 'https://gamemechanics.pro/en/practice/#maintenance-patrol'
  lenses:
    - id: schell-028
      url: 'https://gamemechanics.pro/en/lenses/#schell-028'
    - id: schell-031
      url: 'https://gamemechanics.pro/en/lenses/#schell-031'
    - id: schell-062
      url: 'https://gamemechanics.pro/en/lenses/#schell-062'
endsAt: null
provenance: >-
  Original gamemechanics.pro material. Check illustrative examples in your own
  project.
license: CC-BY-4.0
codeLicense: MIT
attribution: gamemechanics.pro contributors
---
# NPC behavior

id: npc-behavior
type: path
key: path/npc-behavior
lang: en
status: active
url: https://gamemechanics.pro/en/learn/npc-behavior/

What a character knows, how it selects an action and how it reaches a destination.

## Before you start

- [The game loop and time](https://gamemechanics.pro/en/lessons/game-loop/)
- [States and transitions](https://gamemechanics.pro/en/lessons/state-machines/)
- [Collision fundamentals](https://gamemechanics.pro/en/lessons/collision-basics/)

## Lesson sequence

1. [NPC perception and target memory](https://gamemechanics.pro/en/lessons/npc-perception/)
2. [How an NPC selects an action](https://gamemechanics.pro/en/lessons/npc-action-selection/)
3. [Pathfinding and following a route](https://gamemechanics.pro/en/lessons/npc-pathfinding/)

## Put it into practice

Shared Workshop helps define roles and resource conflicts. Maintenance Patrol connects perception, selection and route following into a verifiable system.

- [The shared workshop](https://gamemechanics.pro/en/practice/#shared-workshop)
- [Maintenance patrol](https://gamemechanics.pro/en/practice/#maintenance-patrol)

## Outcome

A robot with observations, memory, action selection and verified route following.

## Completion checks

- The log explains every decision.
- Lost targets and closing doors are handled explicitly.

## Connected materials

- Path materials: [NPC perception and target memory](https://gamemechanics.pro/en/lessons/npc-perception/) (key: lesson/npc-perception)
- Path materials: [How an NPC selects an action](https://gamemechanics.pro/en/lessons/npc-action-selection/) (key: lesson/npc-action-selection)
- Path materials: [Pathfinding and following a route](https://gamemechanics.pro/en/lessons/npc-pathfinding/) (key: lesson/npc-pathfinding)
- Before you start: [The game loop and time](https://gamemechanics.pro/en/lessons/game-loop/) (key: lesson/game-loop)
- Before you start: [States and transitions](https://gamemechanics.pro/en/lessons/state-machines/) (key: lesson/state-machines)
- Before you start: [Collision fundamentals](https://gamemechanics.pro/en/lessons/collision-basics/) (key: lesson/collision-basics)
- Put it into practice: [The shared workshop](https://gamemechanics.pro/en/knowledge/practice/shared-workshop/) (key: practice/shared-workshop)
- Put it into practice: [Maintenance patrol](https://gamemechanics.pro/en/knowledge/practice/maintenance-patrol/) (key: practice/maintenance-patrol)
- Review through a lens: [The State Machine](https://gamemechanics.pro/en/knowledge/lens/schell-028/) (key: lens/schell-028)
- Review through a lens: [Action](https://gamemechanics.pro/en/knowledge/lens/schell-031/) (key: lens/schell-031)
- Review through a lens: [Transparency](https://gamemechanics.pro/en/knowledge/lens/schell-062/) (key: lens/schell-062)

## Sources and provenance

Original gamemechanics.pro material. Check illustrative examples in your own project.


CC-BY-4.0 · gamemechanics.pro contributors
