Releases: mmacy/osrlib-python
Releases · mmacy/osrlib-python
Release list
osrlib 1.2.1
Fixed
- The player view's explored cells now include what the party sees by its own light from its current cell — the lit room it stands in and open passages out to the light source's radius (a torch's 30 feet, the light spell's 15) — rather than only the cells it has physically entered. A front end drawing
PlayerView.exploredrenders the torchlit room at once instead of leaving it dark until the party steps onto each square. The reveal is sight, not exploration: it never enters the persisted explored set (so movement cost and map memory are unchanged), it stops at walls and shut or undiscovered doors, and it never reaches the referee view.
osrlib 1.2.0
Added
Adventure.monsters— an adventure document can bundle its own customMonsterTemplates, which join the shipped catalog for that adventure's sessions everywhere the engine resolves template ids: keyed encounters,SpawnMonsters, inline wandering tables, listen checks, andGameSession.spawn. Downstream of spawn nothing changes — combat, XP, treasure, persistence, and replay carry bundled monsters unmodified. Bundled ids must not collide with the shipped catalog or each other; collisions failvalidate_adventure(and, for doctored saves,load_game) withContentValidationError. The session exposes the union as the read-onlyGameSession.effective_monstersproperty.
Changed
validate_adventurenow checks inline wandering-table monster ids: an adventure whose level wandering table names a dangling monster id — previously accepted by the gate and left to crash at play time — fails validation up front.
osrlib 1.1.0
Added
RollDice, an authorial command that rolls an arbitrary dice expression through the seeded session for freeform referee adjudication. It draws from a dedicatedadjudicationRNG stream and emits a referee-visibilityDiceRolledEvent, so an ad-hoc roll is accepted, logged, and replayable without ever perturbing a keyed mechanic's draw sequence.
osrlib 1.0.0
Added
- The determinism contract: every random draw flows through named PCG64 streams forked from a master seed, so the same seed and the same commands always replay the same game — a public API guarantee.
- Character creation, the seven B/X classes, equipment and encumbrance, and XP-driven leveling, all sourced from the compiled OSE SRD data that ships inside the package.
- The combat kernel: initiative, attacks, damage, saving throws, morale, and death, resolved as pure functions over explicit state.
- Magic: arcane and divine spell books, memorization, casting with disruption, spell effects, and turning undead.
- The crawl: town, travel, and turn-based dungeon exploration — movement, doors, light, listening, searching, traps, rest, and wandering monsters — plus the battle state machine for declared rounds.
- The
GameSessioncommand/event API: typed commands in, structured events with message codes out, player/referee visibility, views, listeners, and session flags. - Treasure types A–V, magic items with identification, NPC adventurer parties, and the end-of-adventure XP award.
- Save, load, and replay: stamped JSON documents with schema versioning and forward migrations; a loaded game is bit-for-bit the game you saved.
- Two example front ends — a terminal TUI crawler and a FastAPI HTTP service — proving the engine presentation-agnostic.
- The documentation site: quickstart, guides, front-end walk-throughs, and a full reference for every command, event, rejection code, message code, RNG stream, and content id.
- The typed surface: complete type hints under
py.typed, checked in CI.