Skip to main content

Python prototype of the Wanty NPC cogitation-affordance decision process (CAFFO) simulation experiment

Project description

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.

©2026 Gustavo Ramos Rehermann (wallabra).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

proto_wanty-0.3.2.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

proto_wanty-0.3.2-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

Details for the file proto_wanty-0.3.2.tar.gz.

File metadata

  • Download URL: proto_wanty-0.3.2.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for proto_wanty-0.3.2.tar.gz
Algorithm Hash digest
SHA256 e18713759479ef58e1388d33ace7dbfe6f8e2511dd045ec12b64d94b04ce7f1a
MD5 85852c13b7afc6ea494b10b1a00936de
BLAKE2b-256 a1b2a6eba9ef8b6cade22336ba7b6ae4d2c5880c503962e0a3cbee2a612b10ff

See more details on using hashes here.

File details

Details for the file proto_wanty-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: proto_wanty-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 29.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for proto_wanty-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bd109f84eb9be0c1eb4bc8bb377016f00f783ccdbdc88aa3332ea3970013dbe6
MD5 d2b5c4f5547814c5bcb7b8f142ab5b9f
BLAKE2b-256 a6a56881ca76d7d5053456c73ed4fdf8dea4d2eeb182c05afb1ce811b8c93e06

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page