AI Fantasy World Generator

An AI-powered text adventure game generator using the LIGHT dataset from Facebook AI Research. Fine-tuned OpenAI models to create immersive fantasy worlds with dynamic room descriptions and object properties.

Python OpenAI API Jupyter Machine Learning NLP Text Generation
AI Fantasy World Generator

Project Overview

This project explores the intersection of artificial intelligence and interactive storytelling by leveraging Facebook AI Research's LIGHT dataset to create dynamic, AI-generated fantasy text adventure games. The system fine-tunes OpenAI's language models to generate immersive room descriptions and object properties, enabling the creation of endless, procedurally generated fantasy worlds.

What It Does

  • Analyzes the LIGHT dataset containing 663 locations, 3,462 objects, and 1,755 characters from fantasy text adventures
  • Fine-tunes OpenAI's babbage-002 model to generate contextual room descriptions based on category and setting
  • Creates object property classifiers that determine if items are gettable, weapons, surfaces, containers, wearable, drinkable, or food
  • Implements few-shot prompting with GPT-4o-mini for generating new fantasy items with proper attributes
  • Evaluates model performance using precision and recall metrics on development data

Core Components

LIGHT Dataset Analysis

Comprehensive exploration of the Facebook AI Research dataset, including room categories, character types, object properties, and spatial relationships between locations.

Fine-tuning Pipeline

Structured data preparation and fine-tuning process for OpenAI's babbage-002 model, including prompt-completion pair generation and model training workflow.

Object Property Classification

Machine learning models trained to classify fantasy objects across multiple dimensions: gettable, weapon, surface, container, wearable, drink, food, and plural properties.

Few-Shot Generation

Advanced prompting techniques using GPT-4o-mini to generate new fantasy items with consistent property structures, including zero-shot, one-shot, and five-shot approaches.

Key Features

  • Comprehensive dataset analysis of 663 fantasy locations across 28 categories including Forest, Graveyard, Dungeon, and Castle
  • Fine-tuned OpenAI models for generating contextual room descriptions based on category and setting prompts
  • Multi-property object classification system with 8 different attribute types for fantasy items
  • Advanced few-shot prompting techniques for generating new fantasy items with consistent data structures
  • Model evaluation framework with precision and recall metrics on development data
  • Interactive Jupyter notebook with step-by-step implementation and real-time model testing

Technologies Used

Python (pandas, json, collections)
OpenAI API (GPT-4o-mini, babbage-002)
Jupyter Notebook
scikit-learn (evaluation)
JSONL (data format)

Dataset Statistics

Locations:663
Objects:3,462
Characters:1,755
Categories:28
Character Types:3