6 Commits

Author SHA1 Message Date
seppedl 19d2721ff2 [add] Load voice parameters from .env file
Configure Piper TTS synthesis via environment variables (speaker_id,
length_scale, noise_scale, noise_w_scale, volume) loaded from .env
with python-dotenv. Includes .env.example as reference template.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 07:36:22 +02:00
seppedl 81e9760e5c [add] Speech to text feature. 2026-04-05 16:07:03 +02:00
seppedl 049d4f2a18 Add text-to-speech via Piper with --audio flag and replay verb
Enable TTS with `h2g2 --audio` to hear game text spoken aloud using
the Piper en_GB-alan-medium voice. Audio plays in a background thread
while text displays normally. The new `replay` in-game verb replays
the last spoken audio. Voice model path is configurable via --voice.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 17:19:49 +02:00
seppedl 679639df9f Wire game transitions end-to-end, add Guide lookup, add 79 tests
Transitions:
- Add I-HOUSEWRECK (tick 20) and I-VOGONS (tick 50) timed events to
  earth.py, queued at startup in main.py
- I-VOGONS demolishes Earth and moves player to Vogon Hold
- Fix airlock→Dark transition to call Dark room M-ENTER handler
- Fix dream-restore to support multiple callbacks (list instead of single)
- Add state.finish() call to RAMP for endgame victory

Guide system:
- Add 16-entry lookup database to GUIDE object (space, towel, vogons,
  poetry, beast, babel fish, earth, magrathea, marvin, etc.)
- "consult guide about X" now returns relevant entry text

Tests (79 passing):
- test_engine.py (14): containment, flags, articles, clock mechanics
- test_parser.py (20): directions, compound verbs, prepositions, synonyms
- test_earth.py (21): full opening sequence, puzzles, navigation
- test_vogon.py (4): room existence, Hold first-visit sequence
- test_dark.py (7): inventory clearing, dream dispatch, probabilities
- conftest.py: shared game fixture and send() helper

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 22:04:22 +02:00
seppedl a6fe624c5e Add README with uv install instructions, fix pyproject.toml
- Add README.md with install/run instructions using uv
- Add build-system and script entry point to pyproject.toml
- Add .gitignore for __pycache__ and save files
- Remove placeholder main.py (entry point is h2g2.main:main)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 20:50:47 +02:00
seppedl f55286db8e Initial commit: ZIL source + Python game engine
Original ZIL source code for The Hitchhiker's Guide to the Galaxy (Infocom, 1984)
plus a native Python text adventure engine with the Earth opening sequence playable
(Bedroom → Front Porch → Front of House → Country Lane → Pub).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 20:46:54 +02:00