Haunted Terminal AI:AI 驅動的文字解謎冒險遊戲
👻 Haunted Terminal AI — The Forgotten Signal | An AI-Powered Mystery Game
Haunted Terminal AI 是一款以 Python 和 Google FLAN-T5 Small 開發的開源 AI 文字解謎冒險遊戲。玩家可探索五個相連地點、尋找線索,並與 AI 角色 ECHO 交流,遊戲設有三種結局。遊戲可在 Google Colab 直接遊玩,無需本機安裝,但載入模型需要網絡連線。
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine.
👻 What I Built
Haunted Terminal AI — The Forgotten Signal is an open-source, AI-powered, text-based mystery adventure built with Python and Google FLAN-T5 Small.
What if an abandoned computer suddenly started talking to you?
The year is 2026. A forgotten computer wakes up with a mysterious message:
Find my memories before the signal fades.
Players enter an abandoned building, explore five interconnected locations, discover hidden clues, and communicate with a mysterious AI called ECHO.
The challenge theme, Ghost in the Machine, inspired me to create a story about technology, forgotten memories, and an AI whose past has become a mystery.
🎮 Demo — Play the Game
You can play the game directly in Google Colab:
To get started:
- Open the Google Colab notebook.
- Review the source code.
- Select Runtime → Run all.
- Wait for the AI model to load.
- Type
helpto see the available commands. - Explore rooms, collect clues, and uncover ECHO's story.
No local installation is required. An internet connection is needed to load the model.
💻 Code
The complete project is publicly available on GitHub:
The repository includes the Python game in a Jupyter notebook and a README with gameplay instructions.
The project is open for exploration, feedback, and improvements.
🛠️ How I Built It
I used the following technologies:
- Python — Game logic, commands, navigation, and progress tracking
- Google Colab — Running and testing the game
- Hugging Face Transformers — Loading and using the AI model
- Google FLAN-T5 Small — Generating responses for ECHO
- PyTorch — Running the language model
The game combines traditional Python programming with AI-generated dialogue.
Python handles the game structure, including locations, hidden clues, player commands, and endings. The AI model is used to generate responses when the player asks ECHO questions.
This approach allowed me to experiment with AI storytelling while keeping the main gameplay logic predictable.
✨ Game Features
- Five interconnected mystery locations
- Hidden clues to discover
- An AI character named ECHO
- Text-based exploration and navigation
- Progress tracking
- Three possible endings
- Direct gameplay through Google Colab
Players can use commands such as look, explore, go ROOM, ask QUESTION, clues, map, status, and unlock ECHO.
🧪 Testing the Game
I tested the game in Google Colab and successfully reached:
GOOD ENDING — THE AWAKENING
My test results were:
- Rooms visited: 5/5
- Clues collected: 4/5
- Commands used: 15
The game handled room navigation, clue discovery, and the final terminal interaction.
One limitation I discovered was that the small language model sometimes generated responses that did not fit the mystery's storyline.
This was an important lesson: integrating an AI model is only the beginning. Creating consistent and meaningful AI dialogue requires careful prompting, testing, and improvements.
🌍 Why Does Open Innovation Matter?
Using an openly available AI model allowed me to experiment with AI-powered storytelling without depending on a paid proprietary API.
I could inspect the code, modify the prompts, test the model, and understand how the different parts worked together.
Open-source tools also make learning more accessible. Other developers can study the project, experiment with the game, and suggest improvements.
For me, open innovation is about learning through experimentation and sharing what we create.
🚀 What's Next?
I would like to improve Haunted Terminal AI by:
- Making ECHO's responses more consistent with the story
- Adding more meaningful player decisions
- Improving the mystery and exploration experience
- Testing all possible endings
- Making the game more engaging and beginner-friendly
Building this project helped me learn more about Python, open-weight language models, debugging, and interactive storytelling.
Sometimes, the most interesting stories begin with a forgotten signal. 👻
Thanks for checking out my project! Feedback and suggestions are welcome.
來源:DEV Community · dev.to