Use this skill for game AI: "enemy AI", "state machine", "FSM", "patrol", "pathfinding", "NPC behavior", "chase", "flee", "behavior tree", "A*", "steering". **Load references when:** - Hierarchical FSM, behavior trees → `references/advanced-fsm.md` - A*, waypoint graphs, nav mesh → `references/pathfinding-algorithms.md`
/plugin marketplace add nethercore-systems/nethercore-ai-plugins/plugin install zx-game-design@nethercore-ai-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/advanced-fsm.mdreferences/pathfinding-algorithms.mdDeterministic AI patterns for rollback netcode compatibility.
| Correct | Incorrect |
|---|---|
tick_count() | System clock |
random(), random_range() | rand() unseeded |
| Arrays, Vec | HashMap (non-deterministic) |
| Frame-based timers | Real-time delays |
Foundation of game AI. Each entity has current state with defined transitions.
#[derive(Clone, Copy, PartialEq)]
enum EnemyState { Idle, Patrol, Chase, Attack, Flee }
struct Enemy {
state: EnemyState,
x: f32, y: f32,
state_timer: u32,
}
fn update(e: &mut Enemy, player: (f32,f32)) {
match e.state {
EnemyState::Idle => update_idle(e, player),
EnemyState::Chase => update_chase(e, player),
// ...
}
if e.state_timer > 0 { e.state_timer -= 1; }
}
Define clear conditions:
Idle → Chase: Player in sight range AND line of sight clearChase → Attack: Player in attack rangeAny → Flee: Health below thresholdChase → Idle: Lost sight for N framesfn move_toward(e: &mut Enemy, tx: f32, ty: f32, speed: f32) {
let dx = tx - e.x; let dy = ty - e.y;
let dist = (dx*dx + dy*dy).sqrt();
if dist > 0.1 { e.x += dx/dist * speed; e.y += dy/dist * speed; }
}
Move in opposite direction from threat. Check safe distance to transition out.
Cycle through waypoint array. Wait at each point (use timer). Check for player detection during patrol.
Pick random direction every N frames using random(). Move toward that point.
Raycast from enemy to player. Check for wall intersections. See physics-collision for raycast implementation.
Simple distance check. Optionally increase range if player is running.
Track last known player position. Decay memory over time (timer countdown). Move to last known position when player not visible.
struct Memory { last_x: f32, last_y: f32, timer: u32 }
// Update when player visible, countdown when not
Move directly toward target at max speed.
Seek but slow down when approaching target (within arrival radius).
fn arrive(current: [f32;2], target: [f32;2], radius: f32) -> [f32;2] {
let d = distance(current, target);
let speed = if d < radius { MAX_SPEED * d/radius } else { MAX_SPEED };
// Return normalized direction * speed
}
Predict target's future position, flee from that point.
struct AttackState { cooldown: u32, windup: u32, active: u32 }
// Phases: Cooldown → Windup (telegraph) → Active (hitbox) → Cooldown
| Level | Behavior |
|---|---|
| Passive | Only attacks if damaged |
| Defensive | Attacks if player close |
| Aggressive | Actively hunts player |
Pre-placed waypoints with connections. Use A* on graph. Cheaper than grid for large levels.
See references/pathfinding-algorithms.md for implementations.
physics-collision — Raycasting for line of sightgameplay-mechanics — Combat hitboxesmultiplayer-patterns — Determinism requirementsCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.