Pathfinding & decisions · 7 / 10

Finite State Machine / FSM

状態と遷移条件で行動を切り替える。

Compare in motion

敵の状態

Synchronized comparison
AReference
一つの状態を続ける

一つの状態を続ける

BFinite State Machine / FSM100%
状態ごとの動きを整理できる

状態ごとの動きを整理できる

Loading demo…

Scrub to pause and inspect. At 0%, B matches A; at 100%, B shows the effect. The scene repeats every 8 seconds.

Look for: 発見条件を満たす → 追跡へ遷移する。

This model simplifies the technique to show its use case and effect. Operation counts describe the model; they are not performance measurements.

Read the storyboard

例: 敵の状態

  1. 1. Start

    巡回している

  2. 2. Change

    発見条件を満たす

  3. 3. Result

    追跡へ遷移する

状態ごとの動きを整理できる。時間変化を示す模式図です。実際の描画結果や処理速度を再現したものではありません。

How it works

  1. 1. Input

    現在状態と遷移条件

  2. 2. Process

    条件で状態を切替

  3. 3. Result

    整理された振る舞い

A schematic of Finite State Machine / FSM. It shows the relationship between input, process, and result; exact values and rendering depend on the implementation.

Further reading

Red Blob Games — A* Introduction ↗

A general reference for this subcategory.