Materials v

Shadow Tactics: Blades of the Shogun GDD

AI Behavior

Shadow Tactics: Blades of the Shogun cover

Shadow Tactics: Blades of the Shogun

Status
Released
Year
2016
Genre
Indie, Strategy
Platforms
Windows, macOS, Linux

Enemy AI is a readable stealth-state machine built around patrols, vision cones, noise investigation, body discovery, environmental traces, and persistent alarm escalation. Normal Guards are the baseline, Straw Hat Guards add stronger observation and distraction resistance, Samurai act as armored elite counters, and civilians detect suspicious activity but panic/flee instead of directly raising the alarm. The design goal is not combat improvisation but predictable tactical pressure: players observe patrol logic, manipulate perception, hide evidence, and reload or recover when detection cascades.

8 min read

Design Intent

Enemy and NPC AI in Shadow Tactics should behave like a legible tactical puzzle rather than an unpredictable combat sandbox. Guards follow authored patrols and facing rules, expose their perception through vision cones and icons, react to sound and evidence, and escalate into persistent alarm behavior when the player makes a confirmed mistake. The player-facing promise is: if the player carefully observes patrol timing, enemy type, vision overlap, noise radii, bodies, and environmental traces, they can predict and manipulate the AI.

Core AI Perception Model

Perception Channel What AI Detects Typical AI Response Player-Facing Feedback Evidence Status
Vision cone Player characters, bodies, suspicious actions, projectiles for Straw Hats Detection buildup, suspicion, alert, body-discovery alarm, or projectile alarm Green/yellow/red cone state, question/exclamation icons Supported by mechanics
Noise Footsteps, body handling, whistles, stones, combat, firearms, grenades, environmental sounds Turn toward source, leave post, investigate point, or chain into body/player discovery Blue sound radius during targeting for many actions Supported by sources/mechanics
Body evidence Slain, unconscious, dying, or exposed bodies in line of sight Immediate alarm when discovered by guards; civilian panic when discovered by civilians Body visible in world; alarm/search reaction Supported by mechanics
Environmental traces Snow footprints, extinguished torches, darkness/torchlight visibility Follow footprint trail, relight torch, adjust effective vision in light/dark areas Footprints, torchlight zones, reduced/enhanced vision Supported by mechanics/sources
Last known position Player position at full detection or alarm trigger Search/investigation around last known area and concealment spots Search movement; alarm state Supported by mechanics

Exact vision angles, ranges, detection buildup timers, hearing radii, search durations, torchlight values, and footprint fade times are not supported precisely by available evidence and should remain implementation tuning values.

Default Guard State Flow

stateDiagram-v2
    [*] --> PatrolIdle
    PatrolIdle --> Suspicious: sees player partially / hears sound / sees footprint
    PatrolIdle --> BodyFound: sees exposed body
    Suspicious --> Investigate: moves or turns toward stimulus
    Investigate --> PatrolIdle: stimulus unresolved and cooldown completes
    Investigate --> Alert: confirms player / catches suspicious action
    Investigate --> BodyFound: finds exposed body
    Alert --> Alarm: player fully detected and not immediately caught
    Alert --> MissionFail: player caught in melee reach
    BodyFound --> Alarm
    Alarm --> Search: alarm propagates mission-wide
    Search --> Search: persistent alarm state
    Search --> [*]: mission complete or save reloaded

Enemy Archetype Behavior

Archetype Baseline Role Perception / Reaction Differences Weaknesses / Counters Design Use
Normal Guard Standard patrol and vision-cone enemy Baseline sight, hearing, distraction response, body discovery, and alarm behavior Vulnerable to most stealth kills, lures, traps, projectiles, firearms, environmental kills, and coordinated Shadow Mode actions Teaches and reinforces core stealth rules
Straw Hat Guard Higher-alert area denial enemy Wider/more vigilant observation; can spot thrown projectiles in flight; resistant to standard lures and noise-makers compared with Normal Guards Can still be eliminated by valid attacks, timing, approach from blind angles, simultaneous action, environmental opportunities, or by manipulating a patrol companion Forces players to solve positioning and timing rather than relying on simple distraction loops
Samurai Armored elite counter Sees through Aiko’s disguise; resists many instant-kill and firearm approaches; matchlock pistols stun rather than kill Mugen’s hand cannon, Takuma’s rifle/grenades where available, environmental kills, or coordinated stun/finish tactics Creates hard gates that require specialist tools, avoidance, or authored accident setups
Torch / light carrier Visibility modifier layered onto another guard type Carries a light source that restores or extends visibility in dark missions; nearby guard may relight an extinguished torch Extinguishing a torch can temporarily pull a guard off-route, but the light can return Turns lighting into an AI-controlled patrol resource

Important nuance: existing evidence describes Straw Hats and Samurai as resistant to standard distractions such as whistles and sake, while one source notes a Straw Hat may still briefly turn from a rock. Treat advanced enemies as distraction-resistant rather than fully inert to every stimulus; final behavior should be verified per ability and difficulty.

Civilian AI

Civilians are non-combatant NPCs and should not be merged with Straw Hat behavior. They have perception and can compromise the player’s plan, but their response is panic rather than combat.

stateDiagram-v2
    [*] --> IdleWander
    IdleWander --> PanicFlee: sees player / suspicious action / body
    PanicFlee --> PanicFlee: runs away, may cross guard routes
    PanicFlee --> KnockedOut: player incapacitates civilian
    KnockedOut --> WakeRisk: timer expires and body was not secured
    WakeRisk --> PanicFlee: wakes and reacts
    PanicFlee --> [*]: leaves relevant area / mission state resolves
Civilian Behavior Design Meaning Evidence Status
Has vision and can notice suspicious activity or bodies Civilians add social stealth pressure even though they are not guards Supported by mechanics
Panics and flees instead of directly raising alarm Civilian detection is disruptive but not equivalent to guard detection Supported by mechanics/source evidence
May indirectly compromise the player by running toward guards or crossing key routes Panic can create messy secondary consequences without violating the no-direct-alarm rule Supported by mechanics
Can be knocked out, killed, moved, hidden, or used as disguise source where authored Civilians interact with body/disguise systems and badge constraints Supported by mechanics
Unconscious civilians can wake if not secured Knockout is temporary unless the body is hidden or made inaccessible Supported by mechanics; exact wake timer unknown

Alarm Response Behavior

Alarm is a persistent mission-state consequence, not a short local cooldown.

Trigger Result
Player reaches full detection in an enemy vision cone Alarm activates unless the character is immediately caught in melee, which causes mission failure
Guard discovers an exposed body Alarm activates immediately
Straw Hat spots a thrown projectile in flight Alarm can activate even if the player was not directly seen
Civilian detects player/body Civilian panics/flees; does not directly activate alarm
Reload from a pre-alarm save Alarm state and AI positions/states restore to saved snapshot

Once alarm is active, existing guards shift into search/investigation behavior, reinforcement patrols can spawn from authored points, and the alarm persists until mission completion or reload. Reinforcements are described as mostly Normal Guards, with rare Samurai in later missions. The exact number of reinforcements, spawn cooldowns, and mission-specific composition are unknown.

Search And Investigation Rules

Stimulus Expected AI Search Behavior Edge Cases To Preserve
Sound at a point Guards within the relevant hearing radius investigate the sound source A lure can pull too many guards if the player ignores the blue noise radius
Footprints in snow Guards who spot prints can follow the trail toward its endpoint Footprints can be used as bait, but can also lead enemies toward hiding spots
Missing or disturbed patrol context Nearby patrols may search locally rather than walking far from their authored area Avoid global omniscience; search should remain spatially legible
Exposed body Guard raises alarm; civilian panics A guard investigating another stimulus may discover a body en route
Concealment during alarm Searchers may inspect bushes and hiding spots Hidden bodies/characters should not be automatically revealed unless search behavior reaches them under supported rules
Torch extinguished A guard can leave position to relight it Relighting should create a temporary timing window, not permanently remove light pressure unless level rules support it

Interaction With Player Tools

Player Tool / Action AI Response Requirement
Stones, whistles, sake, Kuma, and other lures Eligible NPCs turn, investigate, or move according to enemy type; advanced enemies may resist direct lures but can still be manipulated through patrol companions or authored exceptions
Shadow Mode simultaneous kills Mutually-watching enemies should only alarm if a witness survives or sees the action/body before simultaneous resolution completes
Shuriken and other projectiles Normal enemies follow standard projectile/impact rules; Straw Hats can notice projectiles in flight and raise alarm
Firearms / grenades Create loud, high-risk events that can pull nearby AI or trigger alarm if witnessed/heard under the rules
Body carrying/dragging Generates noise and visual exposure according to body profile; exposed bodies remain discoverable until hidden
Environmental kills Treated as accidents where supported, avoiding direct alarm even against armored enemies
Disguise Lets Aiko bypass many normal social/vision checks, but breaks on hostile actions and is ignored by Samurai

Implementation And QA Priorities

Priority What To Verify
Perception consistency Vision-cone colors, detection icons, and actual AI detection must match; no hidden detection rules should surprise the player
Archetype rules Normal Guards, Straw Hats, Samurai, civilians, and torch carriers must respond differently to the same stimuli where documented
Alarm persistence Once raised, alarm should remain until reload or mission completion and should invalidate no-alarm badge conditions
Civilian separation Civilian panic must not directly trigger the guard alarm, even if it creates indirect tactical problems
Search legibility Investigations should clearly relate to a sound, body, footprint, last known position, or light interaction
Save/load integrity Reload must restore AI state, alarm state, positions, detection progress, bodies, footprints, and patrol timing to the saved snapshot
Unknown tuning values Do not hard-code unsupported exact timings/ranges from this GDD; measure or define them during implementation tuning