-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the Tensor Planner wiki. This wiki explains what the library is, how it works internally, which bindings are available, and how to use it from C, C++, C#, Unity, and Jai.
Tensor Planner is a compact C++20 planning library. It solves problems where you know:
- the objects in a world,
- the facts currently true about those objects,
- the actions that can change those facts,
- and the goal facts you want to make true.
The planner searches for an ordered action sequence that transforms the initial state into a goal state.
In application terms, you do not hard-code every possible sequence. You describe the rules of the world and the desired outcome. Tensor Planner searches the available action space and returns a valid sequence for the current state.
Use Tensor Planner when behavior is easier to describe as rules and goals than as hand-written step-by-step scripts.
Good fits:
- NPC goal planning,
- dependency-heavy gameplay systems,
- simulation and design-validation tools,
- tactical, scheduling, or logistics-style sequencing,
- AI/model experiments that need tensor-shaped planning data.
Avoid it for one-off behaviors where a direct script is simpler.
- Typed objects, predicates, action parameters, facts, and goals.
- STRIPS-like actions: preconditions, add effects, delete effects.
- Numeric functions, numeric preconditions, and numeric effects for scalar state.
- Guided search with bounded candidate grounding.
- Optional external candidate scorer callback.
- Tensor exports for schema, problem state, candidates, and action graph.
- C ABI with explicit ownership.
- C++ fluent wrapper.
- C# wrapper and Unity package.
- Jai module with generated C bindings and type-first wrapper.
| Page | What it covers |
|---|---|
| Getting Started | Build, test, package, and run the included checks. |
| Core Concepts | Domains, objects, predicates, actions, states, goals, and plans. |
| How the Planner Works | Grounding, guided search, scoring, tensors, and limits. |
| C API | Native ABI handles, solve flow, tensors, ownership. |
| C++ Fluent API | Type-safe C++ wrapper with code snippets. |
| C# and Unity | Managed wrapper, Unity package, async API, and runtime notes. |
| Jai Bindings | Generated C bindings and Jai typed-domain wrapper. |
| Planning Patterns | Small code snippets that show how to model tasks. |
| Memory Ownership | Lifetime rules for C, C++, C#, Unity, and Jai. |
| Packaging |
build.sh, build.ps1, output layout, Linux/Windows artifacts. |
| FAQ and Limitations | Common questions, constraints, and current limitations. |
| Binding | Best for | Main file |
|---|---|---|
| C API | Engines, FFI, language bindings | include/tensor_planner.h |
| C++ fluent API | Native gameplay/simulation code | include/tensor_planner.hpp |
| C# / Unity | Unity and .NET code | dev.nick.tensor-planner/Runtime/TensorPlanner.cs |
| Jai | Jai projects and compile-time schemas | modules/Tensor_Planner/module.jai |
Tensor Planner answers this question:
Given the facts that are true now, which actions can make my goal facts true?
You provide:
- Domain: the rules of the world.
- State: the current world instance.
- Goals: facts that must become true.
- Limits: search and memory bounds.
The result is:
-
solvedflag, - solve metrics,
- ordered plan steps,
- action arguments mapped back to object IDs or real wrapper objects.
Main repository: https://github.com/NickTsaizer/tensor_planner
Key folders:
include/ C API and C++ fluent wrapper
src/ native implementation
tests/ native smoke tests
csharp/ .NET wrapper project and smoke test
dev.nick.tensor-planner/ Unity package
modules/Tensor_Planner/ Jai module
Start with Getting Started if you want to build and run it.