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.1.1.tar.gz (96.7 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.1.1-py3-none-any.whl (65.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: loom_engine_rpg-3.1.1.tar.gz
  • Upload date:
  • Size: 96.7 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.1.1.tar.gz
Algorithm Hash digest
SHA256 f4bb494903602bf4ab4b7bc1a817df74b764c64eafee0b131adce14b4bd4621c
MD5 009e81e5d072115f545b6575c5009c08
BLAKE2b-256 2dfb281663d2ad65d144c98721c3a95e8ae2a75ff61e1429a12b7f4c453170db

See more details on using hashes here.

Provenance

The following attestation bundles were made for loom_engine_rpg-3.1.1.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.1.1-py3-none-any.whl.

File metadata

  • Download URL: loom_engine_rpg-3.1.1-py3-none-any.whl
  • Upload date:
  • Size: 65.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for loom_engine_rpg-3.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 37737dea60fc8afedd5ba2c5843a0d774fc25018ac6a50372b0047b214fee24b
MD5 bd896db4e63f99af488c2813810e937a
BLAKE2b-256 538cfd5d02b5542bdb8f8e25e6db522039380ef0d48acb00d55b544ae4a17b7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for loom_engine_rpg-3.1.1-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