Skip to main content

Deterministic TTRPG simulation core for AI-run games - the Python surface of loom-engine. Engine-is-truth: seeded, replay-safe rules the AI narrates but cannot invent.

Project description

loom-engine (Python)

The Python surface of loom-engine - a deterministic rules core for AI-run tabletop and RPG games.

pip install loom-engine-rpg   # the bare 'loom-engine' name is taken on PyPI
import loom_engine            # the import name is loom_engine

The design principle: the engine is truth. Dice, action economy, initiative, range, conditions, reactions, and validation are resolved by pure, replay-safe code. An AI narrator can describe the outcome, but it never gets to invent the roll, change the numbers, or rewrite what happened.

This package is a byte-parity port of the TypeScript engine: the same inputs produce identical results in Python (your server/backend) and TypeScript (the browser), so a server-authoritative resolution and a client one can never disagree. That parity is enforced by a shared cross-language golden-vector suite.

Modules (v2.3.0)

  • loom_engine.range_bands - grid-free Engaged/Near/Far positioning.
  • loom_engine.reaction_economy - the per-round "1 reaction per combatant" ceiling.
  • loom_engine.narration_contract - find_invented_number: reject prose that states a mechanics number the engine never produced (numerals and number-words).
  • loom_engine.ruleset - 5e + PF2e action economy, initiative ordering, conditions.

Pure stdlib, zero runtime dependencies. Compatible with the D&D 5e SRD (CC-BY-4.0) and the Pathfinder 2e Remaster ruleset (ORC License); see ../NOTICE.md. Not affiliated with or endorsed by Wizards of the Coast or Paizo.

Determinism

These modules use ordered dicts + explicit sorts for all logic (never hash() ordering). For any cross-language hashing, serialize with json.dumps(obj, sort_keys=True, separators=(',', ':')) and run with PYTHONHASHSEED=0. Floats are banned in deterministic paths.

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

loom_engine_rpg-3.0.0.tar.gz (28.9 kB view details)

Uploaded Source

Built Distribution

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

loom_engine_rpg-3.0.0-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file loom_engine_rpg-3.0.0.tar.gz.

File metadata

  • Download URL: loom_engine_rpg-3.0.0.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for loom_engine_rpg-3.0.0.tar.gz
Algorithm Hash digest
SHA256 5e9376ab9f776a745c84503103d9fe9acea5a5f7e382a90822da58f113b9cad1
MD5 b0fec40786af59d59c8ba674e49befdf
BLAKE2b-256 e7902fe1714f88cd4ff493c81ed758f43b716382491af12a92567643d22ed2fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for loom_engine_rpg-3.0.0.tar.gz:

Publisher: release-pypi.yml on sadhaka/loom-engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file loom_engine_rpg-3.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for loom_engine_rpg-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1eb03affcdf72ce5153fc7601b8e0c4bdc01035f169db08f4980fe8d83789cd1
MD5 f1e2e6b7638cbeeca490ba7d376fc27c
BLAKE2b-256 97bd3b786fedf48815cfb58e7f60d0a7d2c5c7752757d9c7b306ab8b3af4d7fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for loom_engine_rpg-3.0.0-py3-none-any.whl:

Publisher: release-pypi.yml on sadhaka/loom-engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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