Git Product home page Git Product logo

temporal-traverse's Introduction

Overview

This repository contains code for an interactive text-based adventure game called "Temporal Traverse." Players will navigate a character named Alex through various time periods, making choices that determine the narrative's path and, ultimately, Alex's fate. The game is powered by Cassandra for chat history and AI-based language model from OpenAI to generate responses.

Requirements

  • Python 3.x
  • A Cassandra cluster (or use AstraDB) to store chat history
  • OpenAI API key for language generation

Setup

  1. Cassandra Configuration

    • Ensure you have a Cassandra cluster or AstraDB set up. Update the cloud_config variable with the appropriate credentials in the code.
    • Replace secure-connect-choose-your-adventure.zip with the bundle corresponding to your Cassandra or AstraDB setup.
  2. Environment Variables

    • Store your Cassandra and OpenAI credentials in a file named token.json.
    • Set up a .env file and add the OPENAI_API_KEY variable.
  3. OpenAI API Key

    • To provision an OpenAI API key, visit OpenAI's website and create an API key. Insert this key as the value for OPENAI_API_KEY in your .env file.
  4. Vector Database Provisioning

    • This game uses Cassandra for chat history storage, but you can also integrate a Vector Database for advanced functionalities. Provision a Vector Database for an additional data layer to support complex data queries and analysis.
  5. Game Rules and Narrative

    • The game's narrative and rules are defined within the Python script. Players will guide Alex through the Temporal Traverse, making decisions that impact the storyline. The game ends when a path leads to "The End."

How to Play

  1. Execution

    • Run the Python script to start the game.

    bashCopy code

    python connect-database.py

  2. Gameplay

    • The game initiates by choosing a time-travel device for transportation.
    • Players will encounter decision points where they must make choices, each affecting the story's direction.
    • After three decision points, paths leading to potential character death are presented, and the game ends upon encountering "The End."

Chat History and AI Model

The game utilizes a chat history stored in Cassandra through CassandraChatMessageHistory. This context aids the AI model (LLMChain) from OpenAI to generate responses based on the player's input and the established narrative template.

Contribution

Contributions are welcome! If you wish to enhance the game, feel free to fork the repository and submit a pull request with your changes.

Licensing

This project is licensed under MIT License. Feel free to modify and distribute it as per the license terms.

Disclaimer

This game is a demonstration and should be used responsibly. The AI-generated content might not always follow a predictable or desired path due to its learning nature.

Thank you for checking out the Temporal Traverse Adventure Game repository. Enjoy your journey through time and storytelling! If you have any queries or suggestions, feel free to reach out or create an issue in the repository.

temporal-traverse's People

Contributors

phukon avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.