One-Page Adventure Crafter & Interpreter
A Python desktop application that automates the narrative generation rules from the One-Page Adventure Crafter system and seamlessly integrates with local Large Language Models (LLMs) via Ollama to interpret your dice rolls into rich, contextual storylines.
๐ฒ Features
Automated Dice Rolling: Replicates the 1d100 and 1d10 table lookups for Plot Points and Themes without needing to manually cross-reference PDFs.
Turning Point Generation: Automatically structures a 5-element "Turning Point" where the first element matches your Main Theme and the subsequent four are dynamically randomized.
Local LLM Integration: Directly connects to your local Ollama instance. No API keys, no cloud subscriptions, and full privacy.
Auto-Discovery of Models: Automatically fetches and lists all the LLM models you currently have installed in Ollama.
Dynamic Story Interpretation: Feeds your generated Plot Points along with your chosen Genre and Main Theme to the LLM to write a cohesive, creative narrative event.
Asynchronous GUI: Built with Tkinter and threading, ensuring the application remains responsive while the LLM streams its creative output.
๐ ๏ธ Prerequisites
Before you can run this application, you will need:
Python 3.7+: Make sure Python is installed on your system.
Ollama: You must have Ollama installed and running locally on your machine.
An Ollama Model: You need to pull at least one model to generate text. For example, open your terminal and run:
ollama run llama3
๐ฆ Installation
Clone or Download the Script: Save the application code as adventure_crafter.py.
Install Dependencies: The application requires the requests library to communicate with the Ollama API. Install it using pip:
pip install requests
(Note: tkinter is included in standard Python distributions, but Linux users may need to install it via their package manager, e.g., sudo apt-get install python3-tk).
๐ Usage
Start Ollama: Ensure your Ollama application is running in the background (it typically runs on http://localhost:11434).
Run the App:
python adventure_crafter.py
Configure your Adventure:
Genre: Enter the genre of your campaign (e.g., Cyberpunk, Dark Fantasy, Space Opera).
Main Theme: Select the overarching theme of your adventure from the dropdown (ACTION, TENSION, MYSTERY, SOCIAL, or PERSONAL).
Ollama Model: Select the AI model you want to use from the auto-populated dropdown. If you don't see your models, click Refresh Models.
Generate: Click the Generate Turning Point & Interpret button.
Read the Results: The app will display the exact dice rolls and mapped Plot Points, followed by a streamed narrative interpretation from the AI!
๐ง How it Works
The application faithfully maps the rules of the One-Page Adventure Crafter:
First Plot Point: Inherits the "Main Theme" chosen by the user and rolls a 1d100 to determine the specific element (e.g., Ambush, Betrayal, Clue).
Plot Points 2-5: Rolls a 1d10 to randomly determine the theme (Action, Tension, Mystery, Social, Personal), and then rolls a 1d100 to determine the specific element within that newly rolled theme.
Interpretation: The 5 plot points are bundled into a prompt that instructs the LLM to treat them as a single, cohesive narrative shift, applying the specific rules of the system (e.g., handling "Conclusion" and "None" elements correctly).
๐ License
This software is provided for personal use. The prompt tables and rules are based on the One-Page Adventure Crafter.