Welcome to Group Hot Dogs' story generation project.
- If you do not have the OpenAI library installed, create a virtual environment and run:
pip install -r requirements.txt- To run the original story generator (typical runtime - 20 minutes, cost - $1):
python3 story_generation.py- To run the Phase II interactive text game (typical runtime - 1-5 minutes, cost - <$1):
python3 phase2_game.py- To run the Phase II demo without typing actions:
python3 phase2_game.py --demo- To make a different generated story interactive, pass in a story text file. This uses the OpenAI API to extract interactive plot points and classify player actions:
python3 phase2_game.py --story exemplar_story_1.txtNote: if the API key does not work, replace the key in story_generation.py with your own key.
Group Hot Dogs
Crime Story Generation: Phase II Interactive Detective Game
Intervention and Accommodation.
The user plays as the detective. The system classifies each user action as:
- constituent: the action advances the intended story
- consistent: the action is allowed but does not advance the main plot
- exceptional: the action threatens to break the story
When an exceptional action happens, the drama manager either blocks the action and redirects the player, or allows failure if the player triggers a major trap.
story_generation.py: runs the original story generation pipelineworld_generation.py: creates the detective, victim, suspects, clues, and perpetratorworld_model.py: generates plot events and checks consistencystory_model.py: stores generated events and retells the final storyphase2_game.py: playable Phase II text game and drama manager. It can use the LLM to convert a story text file into interactive plot points.exemplar_story_1.txtandexemplar_story_2.txt: generated example stories used for testing and demonstration
The original story generator usually takes 10-20 minutes because it calls the OpenAI API many times. It may cost money depending on the API account and model pricing.
The Phase II demo runs immediately. The --demo mode does not call the API, so it has no API cost.
Running phase2_game.py --story some_story.txt calls the OpenAI API to build interactive plot points from that story and to classify user actions during play. This adds API cost, but it allows the Phase II layer to work on a newly generated story instead of only one hardcoded story.
USER ACTION: inspect the camera bag and recover the usb
DRAMA MANAGER ACTION: classifies the action as constituent and gives the USB clue.
USER ACTION: search Basement 3 for the second shelf tag
DRAMA MANAGER ACTION: classifies the action as constituent and advances to the Basement 3 clue.
USER ACTION: go to the hotel and inspect the hard case framing Nadia
DRAMA MANAGER ACTION: classifies the action as constituent and marks Nadia as a red herring.
USER ACTION: check the donor ramp parking list and CCTV
DRAMA MANAGER ACTION: classifies the action as constituent and shows that the kidnapper is steering the detective.
USER ACTION: protect Isla at the apartment and collect the black fiber
DRAMA MANAGER ACTION: classifies the action as constituent and preserves the rescue path.
USER ACTION: use the freight Car 2 machine room records to find Malik
DRAMA MANAGER ACTION: classifies the action as constituent and completes the rescue.
USER ACTION: destroy the usb evidence DRAMA MANAGER ACTION: Accommodation. That action would break an active story condition, so the drama manager blocks it and redirects you toward Convention Center Alley.
USER ACTION: open fire stair door
DRAMA MANAGER ACTION: classifies the action as exceptional. This was the trap Aria warned about, so the story fails.