14 Commits

Author SHA1 Message Date
seppedl e851ab18c4 [add] Reference to Infocom game engine 2026-04-07 06:30:31 +02:00
seppedl 5979eb0604 Update settings.json and README with speech-to-text dependencies info 2026-04-07 06:27:06 +02:00
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 fc18af576e [add] Openwolf 2026-04-05 20:16:35 +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 2e97bb1a29 Add save/load game with named save files
Serialize full game state (objects, flags, containment, clocks) to
JSON files in ~/.h2g2_saves/. Players can name saves, list existing
ones, and restore by name or number.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 09:56:03 +02:00
seppedl 91a02fda8e Add up/down arrow command history to game input
Replace bare input() with a custom terminal reader that supports
arrow-key history navigation, cursor movement, and line editing.
History buffer grows dynamically with no fixed limit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 09:55:55 +02:00
seppedl 04fa5cbab7 Move ZIL source and walkthrough to docs/
Move original ZIL source files (.zil, .xzap, .errors) and
walkthrough.md into docs/ to keep the project root clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 22:30:41 +02:00
seppedl 397e70ba03 Add complete game walkthrough
Step-by-step guide covering the critical path from bedroom to
Magrathea, all puzzle solutions, scoring opportunities (370 pts
critical path, 420 max), timing windows, and death conditions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 22:18:20 +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 a1bb4cbf02 Add complete game content: Vogon ship, Heart of Gold, off-Earth, dream system
Engine refactoring:
- Replace hardcoded state attributes with generic state.flags dict
- Add death system (jigs_up/finish) with dream-restore callbacks
- Add inventory extras hook system (removes hardcoded headache/tea lines)
- Add 16 new verb handlers (consult, say, carve, plug, repair, kick, etc.)
- Add verb synonyms to parser

New content modules (25 rooms, 107 objects total):
- vogon.py: Hold, Captain's Quarters, Airlock; babel fish puzzle, poetry
  scene, airlock ejection sequence with timed events
- heart.py: 10 Heart of Gold rooms; Marvin tool quest, tea/no-tea paradox,
  Nutrimat overload, Infinite Improbability Drive puzzle, victory sequence
- unearth.py: Traal (Beast lair with towel/name/carve puzzle), War Chamber,
  Inside Whale, Maze with random exits and particle
- dark.py: Dream dispatch room with probabilistic destination selection,
  sensory discovery mechanic, dream-restore callback

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 21:52:57 +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