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-2.3.0.tar.gz (13.8 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-2.3.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: loom_engine_rpg-2.3.0.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for loom_engine_rpg-2.3.0.tar.gz
Algorithm Hash digest
SHA256 d40fcfb2195ac62367f73d994840108f15ea523253e5ee1bb5fae9695eb7566b
MD5 f0f2074c07e1e44aa59ef79f69d6a9ef
BLAKE2b-256 1f8c5ef91c798fdf99a11a5bcef26faf0d28f3a127d046c452051eed2297b697

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loom_engine_rpg-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ed63d6987aca78035e3a791a3cb2b66e05f30b70cd6f64f34d6cecf1de33863
MD5 ae40185b0c1ab05859298447d5218598
BLAKE2b-256 4f84dbc6705837e3485f3cd5058a513ffaa58611c9f62e3d97759c0e2785507f

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