https://github.com/mscrnt/textadventure
A texted based gaming using PySide and OpenAI
https://github.com/mscrnt/textadventure
gamedev json openai pyside6 python3
Last synced: about 2 months ago
JSON representation
A texted based gaming using PySide and OpenAI
- Host: GitHub
- URL: https://github.com/mscrnt/textadventure
- Owner: mscrnt
- Created: 2023-11-23T18:19:24.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-10T19:44:00.000Z (over 2 years ago)
- Last Synced: 2025-02-25T13:50:45.576Z (over 1 year ago)
- Topics: gamedev, json, openai, pyside6, python3
- Language: Python
- Homepage:
- Size: 14 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
---
# Text Adventure Game - Project README
## Introduction
### Warning!!!
This project is in early alpha. Quests have not been implemented. Player can move around and interact with environment in limited ways.
Welcome to my Text-Based Adventure Game, an engaging and interactive experience where your choices shape the narrative. Enhanced with AI, this game offers a unique journey through a world of mystery and challenges, featuring exploration, interaction with objects and NPCs, and solving puzzles or completing quests.
## Features
- **AI-Enhanced Gameplay:** Dynamic storylines and reactive game environments powered by OpenAI's GPT model, allowing for natural language understanding and creative storytelling.
- **Customizable Worlds:** Explore a variety of worlds, each with its unique set of challenges and story elements.
- **Dynamic Characters:** Interact with a cast of evolving characters and engage with NPCs within the game world.
## Technologies Used
- **Programming Language:** Python
- **User Interface:** PySide
- **Data Handling:** JSON for efficient game data management
- **AI Integration:** Advanced AI algorithms for an adaptive game experience
## Installation
1. Clone the repository and ensure Python 3.7+ is installed.
2. Create a virtual environment using `python -m venv venv`.
3. Install PySide and other dependencies using `pip install -r requirements.txt`.
4. Run the game using `python main.py`.
5. To use the AI assistant, you will need to create an OpenAI account and set the `OPENAI_API_KEY` environment variable to your API key.
- You can use the flag --use-ai to enable the AI assistant.
## How to Play
Begin by creating your character, select a world to start in, and navigate the game using intuitive text commands. Engage with the game using text commands, with the AI assistant interpreting your inputs for immersive interactions.
## Game Components
## data/docs/
- Contains documentation for the game's data files, including JSON references and AI Assist class reference.
### main.py
- Entry point of the application, initializing the game and managing the main loop.
### game_ui.py
- Manages the game's user interface, handling game output, user inputs, and UI updates.
### main_window.py
- Creates the main application window, integrating UI components and managing events.
### game_manager.py
- Core game logic controller, managing game states, player interactions, and progression.
### player_sheet.py
- Manages player data, tracking inventory, stats, and characteristics.
### quest_tracker.py
- Quest management system for monitoring progress, triggers, and completions.
### world_builder.py
- Constructs and manages the game world, generating locations, NPCs, events, and handling interactions.
### ai_assist.py
- Integrates AI for enhanced interaction, processing player commands and providing dynamic responses.
### utilities.py
- Provides utility functions, including JSON file handling for loading and saving game data.
## Game Mechanics
- **Exploration:** Travel through various locations within the game world.
- **Inventory Management:** Collect, use, and manage items.
- **Quests:** Complete quests for rewards and story progression.
- **Interactions:** Engage with NPCs and objects within the game world.
## Data Structure
- The game's world and player data are stored in JSON format, facilitating easy modification and expansion.
## Contribution
- **Adding Content:** Modify JSON files to add new items, locations, or quests.
- **Customization:** Adjust game mechanics or AI responses in the Python files as needed.
## Support
For any issues or suggestions, please open an issue on the project's GitHub page.
## Acknowledgements
---