PamukAI – Lightweight AI library
PamukAI is an extremely lightweight AI system designed for programmers. Includes Behavior Trees, FSM, sFSM, Utility AI and Flow-like logic in a unified and consistent style.
by Star Twinkle
Price History +
PamukAI (PAI) is an extremely lightweight, low-level AI system designed for simple imperative code and maximum performance. It is not a framework, but a flexible code-first library that allows you to build AI systems using Behavior Trees, FSMs, Utility AI and Flow-like logic - in any combination and all in a unified and consistent style.
⚠️Note: This is a toolkit for programmers. No GUI, no tree editors! Please do not use this if you are not ready to program :)
Features:
🧠 Imperative-first design
Write AI as clean, linear, imperative code. Write code naturally, using if, return, loops, and PAI.Step where needed. No visual scripting, no special macros, no domain-specific language.
🪶 Ultra-lightweight
Allocates only one MethodData per method. No runtime memory allocations, no GC pressure, no hidden update loops — everything is explicit.
🔁 Zero-GC Coroutine-like behavior
Methods naturally support step-by-step logic via PAI.Step, PAI.Wait, PAI.DoOnce — no yield return, no IEnumerator boxing.
🧩 Multi-paradigm support
Combines the strengths of Behavior Trees, FSM, Utility AI and Stack FSM in one unified system. You can mix them freely, even within the same method.
🧰 No lambdas or closures
All logic is written as named methods. This eliminates allocations, makes behavior explicit, and dramatically improves readability and debugging.
🧪 Debuggable by default
Since it's just imperative code, you can debug using breakpoints, logs, and stack traces — no opaque graphs or runtime visualizers needed.
🔀 Flexible control flow
Write composite nodes like SelectorTick, ParallelTick, or MaxUtilityTick with any number of sub-methods. Supports nesting and reusability.
🔧 State is automatic and transparent
Each method is automatically assigned a persistent MethodData object — no need to manage state by hand.
🧱 Not a framework, but a toolkit
PamukAI doesn’t impose an architecture. It’s a modular library that integrates easily into your game codebase.
👨💻 Programmer-focused, GUI-free
No visual editors, inspectors, or graphs. Pure code — readable, diffable, and refactorable with your usual tools.
Supported AI Paradigms:
Behavior Tree (BT) Supports Sequence, Selector, and Parallel nodes as composable method groups. Methods are ticked in classic BT fashion.
Finite State Machine (FSM) Each Method can act as a state. Use SwitchState() to switch and track state transitions. OnEnter / OnExit supported.
Stack-based FSM (Pushdown Automaton) Built-in support for nested states with a stack (PushState, Pop, etc). Automatically handles re-entry and exit logic.
Utility AI Assign Utility values to methods and execute the one with maximum score using MaxUtilityTick or fallback-style UtilitySelectorTick.
Flow-based execution Each Method can encapsulate a multi-step behavior using Step logic — enabling coroutine-like flows without yield or state machines.
Scheduled Methods — methods can be scheduled to run after a delay and are executed when ticked explicitly via a scheduler function.