Metadata-Version: 2.4
Name: proto-wanty
Version: 0.3.2
Summary: Python prototype of the Wanty NPC cogitation-affordance decision process (CAFFO) simulation experiment
Author-email: "Gustavo Ramos Rehermann (wallabra)" <gr.wallabra@proton.me>
License-Expression: MIT
Keywords: npc,game ai,decision making,caffo
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: attrs>=26.1.0
Requires-Dist: pytest>=9.0.3
Dynamic: license-file

# Wanty (Python prototype)

> [!WARNING]
> This is a somewhat academic reference implementation. Not production ready.

This is a proof of concept for the **CAFFO: Capability-Affordance Decision Process**, a game NPC AI architecture inspired by utility maximizers, which lets entities do things in the world according to their own ability, scoring them by their needs.

In nerd terms, it solves the dialectic between

* **Capabilities** - what an entity can actually do intrinsically (walk, fly, swim)
* **Affordances** - what an environment tells an entity it can do extrinsically (hunt _a person_, forage _a bush_, leap _a ledge_)

This is because CAFFO entities:

1. _sense_ affordances in the environment
2. _cogitate_ possible plans from those affordances and _commit_ intention to one
3. _sequence_ tasks based on the intent
4. _execute_ a task by deriving a task-oriented action (TOA) object every timestep.

The TOA is something generic like "move towards point in space" or "eat from object reference", but each entity can process it its own way. Birds "move" by flying, land animals "move" on the ground at different speeds, so on.

## Example

The example shows a simple 2D roguelike-esque grid world, where agents can move around, eat food to not starve to death, and greet each other to not feel lonely. Which actions they prioritize is dynamically weighted based on their needs, which you can observe in real time through the cogitation scoring part of the observation panel in the example.

```
python -m pwanty
```

> [!NOTE]
> The demo uses ANSI escape codes to provide a text interface view of the world. Make sure your terminal supports those.

## Licensing

Uses the MIT License.

&copy;2026 Gustavo Ramos Rehermann (wallabra).
