Squirrel · C++ · Godot · PPO

NPC behavior that stays portable.

A deterministic finite-state machine for game characters, separated from the engine by one small world adapter.

6behavior states
0engine dependencies
1world boundary
sq demo.nut

=== SQUIRREL NPC BEHAVIOR DEMO ===

[t= 0.0] Guard PATROL

[t= 3.0] suspicion rising... ██████░░░░

[t= 5.0] Guard CHASE

[t= 8.0] Guard ATTACK

[t=12.0] target escaped

[t=12.5] Guard SEARCH

[t=17.0] Guard RETURN

▸ deterministic behavior, engine-independent

See it in motion

From patrol to pursuit.

Animated terminal showing the NPC guard finite-state machine demo

The real Squirrel demo runs the guard through patrol, detection, chase, attack, search, and return.

The idea

Keep decisions separate from the world.

The guard decides what to do. Your engine decides how the world responds.

01

Game engine

Physics, raycasts, navmesh, animation, combat, and rendering stay in your engine.

raycast()navigate()play_animation()
↔
02

World adapter

One small seam translates engine services into a stable contract.

world.canSee()world.moveToward()world.emit()
↔
03

Guard FSM

Predictable, testable decisions that run anywhere Squirrel can run.

PATROLCHASEATTACKSEARCH

Experimental ML

Learn tactics. Keep control.

The deterministic FSM remains the safety layer. A PyTorch PPO policy learns tactical recommendations in a synthetic Gymnasium world, ready for evaluation in Kaggle.

Run training on Kaggle →
01Simulated world
→
02PyTorch PPO
→
03FSM validation
→
04Engine action

Open source · v0.2.0

Build behavior, not a black box.

Read the code, run the demos, and bring the adapter to your game.

Explore the repository ↗