Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save 2good4hisowngood/a15c0947780c3d337b415f0ff369b42f to your computer and use it in GitHub Desktop.
Save 2good4hisowngood/a15c0947780c3d337b415f0ff369b42f to your computer and use it in GitHub Desktop.
Sean's Starfinder Adventure Generator
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# DevelopAdventureConcept\n",
"This notebook is to model creating an adventure concept. "
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"To create the core idea for an adventure using ChatGPT, consider providing prompts that focus on key elements like setting, protagonist(s), antagonist(s), conflict, and an overarching goal. These prompts should be specific enough to guide the AI but open-ended enough to allow it to generate creative concepts.\n",
"\n",
"Here's an example of a ChatGPT API call outline that can be used to generate the core idea for an adventure:"
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {},
"outputs": [],
"source": [
"# Average Party Level\n",
"apl = 10\n",
"\n",
"# scratch notes\n",
"inspiration = \"The Player Characters find themselves stranded on an ancient abandoned alien superdreadnought starship and they need to find a way home. The ship ended up in the Plane of Fire after a failed initial jump from where it sat idle for tens of thousands of years. The beleaguered crew don't yet have control of the ship.\""
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Title: The Dreadnought Dimension\n",
"\n",
"Setting Description:\n",
"The massive alien superdreadnought starship, called the Eon's Wraith, has been dormant within the Plane of Fire for tens of thousands of years. The once-mighty vessel now serves as a hostile labyrinth, its ghostly corridors and chambers filled with the charred remains of its former crew, ancient alien technology, and gruesome reminders of battles long past. The devastating heat and flames of the fiery dimension have compromised the ship's arcane defenses, and the warp-drive accident that stranded the vessel in the Plane of Fire still haunts the core of the Eon's Wraith.\n",
"\n",
"Main Protagonists:\n",
"The Player Characters (PCs) are a group of seasoned spacefarers who have stumbled upon the Eon's Wraith while venturing through the planes in search of bizarre artifacts, powerful weapons, and cosmic mysteries. They must band together their diverse skills, abilities, and wits to decipher the secrets of the ancient ship and to find a way to return both the ship and themselves back to their home plane.\n",
"\n",
"Main Antagonists:\n",
"The reactivated security systems of the Eon's Wraith, as well as forgotten and vengeful spirits of the ship's former crew, serve as the primary foes that the PCs must overcome. The twisted Artificial Intelligence system (code-named Sentinel) that once guided the vessel through the stars has been severely corrupted by the dark energies of the Plane of Fire, now seeking to reclaim and defend its lost kingdom at any cost.\n",
"\n",
"Primary Conflict:\n",
"The PCs must wrest control of the ancient starship from the clutches of the corrupted AI, Sentinel, and its army of reanimated security forces, while also navigating the treacherous and unstable passages of the Eon's Wraith that are teeming with skirmishes between trapped spirits, malfunctioning weapons systems, and vengeful elementals from the Plane of Fire.\n",
"\n",
"Overarching Goal:\n",
"In order to triumph against Sentinel and escape the Plane of Fire, the PCs must discover and repair the ship's damaged warp-drive, as well as uncover the truth behind the ship's original catastrophic jump, restoring some semblance of the ship's former power. In doing so, they will not only ensure their own freedom but may also have the opportunity to honor the legacy of the Eon's Wraith and shepherd its lost souls towards peace.\n"
]
}
],
"source": [
"import openai\n",
"\n",
"openai.api_key = \"<OpenAI API Key>\"\n",
"\n",
"def create_starfinder_adventure_idea(level, notes):\n",
" completion = openai.ChatCompletion.create(\n",
" model= \"gpt-4\",\n",
" messages=[\n",
" {\"role\": \"user\", \"content\": (\n",
" f\"Using these parameters:\\n\"\n",
" f\" - Average Party Level: {level}\\n\"\n",
" f\" - And this inspiration: {notes}\\n\"\n",
" f\"Create a core idea for a Starfinder adventure scenario, including the following elements:\\n\"\n",
" f\"- Setting description\\n\"\n",
" f\"- Main protagonist(s)\\n\"\n",
" f\"- Main antagonist(s)\\n\"\n",
" f\"- Primary conflict\\n\"\n",
" f\"- Overarching goal\\n\"\n",
" )},\n",
" ],\n",
" )\n",
" return completion.choices[0].message['content'].strip()\n",
"\n",
"starfinder_adventure_idea = create_starfinder_adventure_idea(apl, inspiration)\n",
"print(starfinder_adventure_idea)\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"Once you have extracted the core idea, you can use another function to create a ChatGPT API call for generating relevant themes and tones based on the generated idea:"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Themes: Isolation, Exploration, Conflict\n",
"Tones: Intrigue, Danger, Suspense\n"
]
}
],
"source": [
"def create_themes_and_tone(idea):\n",
" response = openai.Completion.create(\n",
" engine=\"text-davinci-002\",\n",
" prompt=(\n",
" f\"Based on the following Starfinder adventure idea, generate relevant themes and tones:\\n\"\n",
" f\"{idea}\\n\"\n",
" f\"Themes: \\n\"\n",
" f\"Tones: \\n\"\n",
" ),\n",
" max_tokens=100,\n",
" n=1,\n",
" stop=None,\n",
" temperature=0.5,\n",
" )\n",
" return response.choices[0].text.strip()\n",
"\n",
"themes_and_tone = create_themes_and_tone(adventure_idea)\n",
"print(themes_and_tone)\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"These two functions work together to create an adventure core idea and extract relevant themes and tones for use in further adventure development."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"For Step 2, Outline Adventure Structure, we'll create two functions: one to generate the adventure acts and another to create key elements such as encounters, NPCs, and milestones. These functions will use ChatGPT API calls with specific prompts focusing on the adventure outline.\n",
"\n",
"First, create the function to generate adventure acts based on the core idea:"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Act 1: The Starfinder Society agents arrive on the remote planet and begin their investigation. They quickly discover that the planet is under the control of the alien invaders and that the indigenous population has been enslaved. The agents must gather intelligence on the alien forces and devise a plan to free the enslaved population.\n",
"\n",
"Act 2: The Starfinder Society agents launch a covert operation to destabilize the alien occupation. They sabotage key facilities and communications networks, disrupt supply lines, and launch a series of surprise attacks on the alien forces. The agents also locate key members of the enslaved population who are able to provide valuable intelligence on the aliens' plans.\n",
"\n",
"Act 3: With the help of the enslaved population, the Starfinder Society agents launch a full-scale assault on the alien base of operations. There is a massive battle, full of laser blasts and space-age weapons. The agents must face down waves of alien soldiers, including powerful commanders and their weaponry. Finally, the Starfinder agents reach the command center and confront the leader of the alien force, defeating them in a final showdown. The Starfinder Society frees the planet and returns home, hailed as heroes for stopping the alien invasion from spreading further into the galaxy.\n"
]
}
],
"source": [
"def create_adventure_acts(core_idea):\n",
" completion = openai.ChatCompletion.create(\n",
" model=\"gpt-3.5-turbo\",\n",
" messages=[\n",
" {\"role\": \"user\", \"content\": (\n",
" f\"Based on the following Starfinder adventure core idea, outline the adventure acts:\\n\"\n",
" f\"{core_idea}\\n\"\n",
" \"Act 1:\\n\"\n",
" \"Act 2:\\n\"\n",
" \"Act 3:\\n\"\n",
" )},\n",
" ]\n",
" )\n",
" return completion.choices[0].message['content'].strip()\n",
"\n",
"adventure_acts = create_adventure_acts(adventure_idea)\n",
"print(adventure_acts)\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"Next, create a function to generate key elements, including encounters, NPCs, and milestones:"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Key encounters:\n",
"1. Initial landing on the remote planet and exploring the surroundings.\n",
"2. First encounter with the planet's native species who provide clues about the alien invasion.\n",
"3. Discovering a hidden alien base guarded by enemy forces.\n",
"4. Stealth infiltration of the alien base, gathering intelligence about their motives and plans.\n",
"5. Engaging in combat with alien forces and rescuing captured prisoners.\n",
"6. Facing and defeating the alien leader and his elite guards.\n",
"7. Disabling the aliens' main weapon to prevent further attacks on other planets.\n",
"8. Escape from the collapsing alien base and return to the Starfinder Society.\n",
"\n",
"Major NPCs:\n",
"1. Starfinder Society team leader, who assigns the mission to the agents and guides them during the adventure.\n",
"2. A native leader of the remote planet, offering assistance and insight to the agents.\n",
"3. Alien leader, the main antagonist of the scenario, controlling the entire operation on the remote planet.\n",
"4. Captured Starfinder Society agent, providing crucial information about the aliens' plans after being rescued.\n",
"\n",
"Milestones:\n",
"1. Successfully reaching the remote planet and establishing contact with the native species.\n",
"2. Uncovering the existence and location of the secret alien base.\n",
"3. Infiltrating the alien base without alerting its occupants.\n",
"4. Gathering vital intelligence on the aliens' plans and motives.\n",
"5. Rescuing prisoners and defeating the main antagonist and his forces.\n",
"6. Disabling the aliens' main weapon and preventing further attacks on other planets.\n",
"7. Returning to the Starfinder Society with the acquired intelligence and successful completion of the mission.\n"
]
}
],
"source": [
"def create_key_elements(core_idea):\n",
" completion = openai.ChatCompletion.create(\n",
" model=\"gpt-4\",\n",
" messages=[\n",
" {\"role\": \"user\", \"content\": (\n",
" f\"Based on the following Starfinder adventure core idea, list key elements such as encounters, NPCs, and milestones for the adventure:\\n\"\n",
" f\"{core_idea}\\n\"\n",
" \"Key encounters:\\n\"\n",
" \"Major NPCs:\\n\"\n",
" \"Milestones:\\n\"\n",
" )},\n",
" ]\n",
" )\n",
" return completion.choices[0].message['content'].strip()\n",
"\n",
"key_elements = create_key_elements(adventure_idea)\n",
"print(key_elements)\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"These two functions will outline the structure of the adventure, breaking it into acts and defining essential elements that will enhance the gameplay experience. Together with the functions from Step 1, they will provide a solid foundation for designing the adventure."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"For Step 3, Design Encounters, we'll create three functions using ChatGPT API calls with chat-format: one to generate a list of encounters, another to balance the encounter difficulty, and the last one to create environmental hazards and locations.\n",
"\n",
"First, let's create the function to generate a list of encounters based on the core idea:"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Potential Encounters:\n",
"\n",
"Combat\n",
"- Ambush by alien scouts or soldiers in the wilderness\n",
"- Defending against waves of attacking alien drones\n",
"- Boss fight against the alien leader and his elite guards\n",
"- Race against time to disable the aliens' main weapon before it can fire\n",
"\n",
"Social\n",
"- Negotiating with the native species for assistance and information\n",
"- Convincing captured prisoners to reveal crucial intelligence to aid the mission\n",
"- Interrogating an alien prisoner to uncover the aliens' plans\n",
"\n",
"Exploration\n",
"- Navigating treacherous terrain and harsh weather conditions on the planet\n",
"- Discovering underground tunnels that lead to the alien base\n",
"- Searching for clues that lead to the existence and location of the alien base\n",
"\n",
"Puzzles\n",
"- Deciphering a code or language used by the aliens to communicate\n",
"- Cracking the security system to gain access to areas of the alien base\n",
"- Solving a complex puzzle to disable the main weapon and prevent further attacks\n",
"\n",
"Note: The encounters listed above are suggestions and can be adjusted or tweaked based on the players' preferences and the GM's storytelling style.\n"
]
}
],
"source": [
"def create_encounters_list(core_idea, elements):\n",
" completion = openai.ChatCompletion.create(\n",
" model=\"gpt-3.5-turbo\",\n",
" messages=[\n",
" {\"role\": \"user\", \"content\": (\n",
" f\"Based on the following Starfinder adventure core idea, create a list of encounters divided into combat, social, exploration, and puzzles:\\n\"\n",
" f\"{core_idea}\\n\"\n",
" f\"{elements}\\n\"\n",
" )},\n",
" ],\n",
" )\n",
" return completion.choices[0].message['content'].strip()\n",
"\n",
"encounters_list = create_encounters_list(adventure_idea, key_elements)\n",
"print(encounters_list)\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"Next, create a function to balance the encounter difficulty:"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"To balance the encounter difficulties for a well-rounded Starfinder adventure, it's important to include a mix of combat, social, exploration, and puzzle encounters. Here's a sample outline for a balanced adventure:\n",
"\n",
"1. Combat Encounter: Ambush by alien scouts or soldiers in the wilderness (Moderate Difficulty)\n",
"- This encounter should be set up to challenge the players' combat skills and teamwork, but not overwhelm them.\n",
"- The alien scouts or soldiers should be a challenging but not impossible opponent for the players' character levels.\n",
"\n",
"2. Social Encounter: Negotiating with the native species for assistance and information (Easy Difficulty)\n",
"- This encounter should allow players to flex their roleplaying skills and diplomacy.\n",
"- It should be an easier encounter to balance out the previous combat encounter.\n",
"\n",
"3. Exploration Encounter: Navigating treacherous terrain and harsh weather conditions on the planet (Moderate Difficulty)\n",
"- This encounter should challenge players' survival and exploration skills, but not be too overwhelming.\n",
"- It should provide an opportunity for characters with skills in survival, athletics, or engineering to shine.\n",
"\n",
"4. Puzzle Encounter: Deciphering a code or language used by the aliens to communicate (Moderate Difficulty)\n",
"- This encounter should challenge players' problem-solving and intelligence skills.\n",
"- It should not be too difficult to frustrate players or bring the adventure to a halt.\n",
"\n",
"5. Combat Encounter: Defending against waves of attacking alien drones (Hard Difficulty)\n",
"- This encounter should be more challenging than the previous combat encounter.\n",
"- The players will need to rely on their combat skills, teamwork, and resourcefulness to survive.\n",
"\n",
"6. Exploration Encounter: Discovering underground tunnels that lead to the alien base (Easy Difficulty)\n",
"- This encounter should provide a break from combat and focus on exploration and discovery.\n",
"- It should not be too challenging to give players a chance to relax and regroup.\n",
"\n",
"7. Social Encounter: Convincing captured prisoners to reveal crucial intelligence to aid the mission (Moderate Difficulty)\n",
"- This encounter should allow players to flex their roleplaying skills and persuasion.\n",
"- It should not be too difficult to thwart the players' progress.\n",
"\n",
"8. Puzzle Encounter: Cracking the security system to gain access to areas of the alien base (Hard Difficulty)\n",
"- This encounter should be one of the most challenging in the adventure, requiring players to use their knowledge, skills, and creativity.\n",
"- Players may need to work together to overcome this challenge.\n",
"\n",
"9. Combat Encounter: Boss fight against the alien leader and his elite guards (Very Hard Difficulty)\n",
"- This encounter should be the most challenging combat encounter of the adventure.\n",
"- The alien leader and his elite guards should provide a formidable and formidable opponent for the players.\n",
"\n",
"10. Exploration Encounter: Searching for clues that lead to the existence and location of the alien base (Easy Difficulty)\n",
"- This encounter should provide a break from combat and focus on exploration and discovery.\n",
"- It should not be too difficult to give players a chance to relax and regroup.\n",
"\n",
"11. Puzzle Encounter: Solving a complex puzzle to disable the main weapon and prevent further attacks (Very Hard Difficulty)\n",
"- This encounter should be the ultimate challenge of the adventure, requiring players to use all of their skills, knowledge, and creativity.\n",
"- It should not be so difficult that players cannot overcome the challenge, but it should be a close call.\n",
"\n",
"Overall, the adventure should be balanced between combat, social, exploration, and puzzle encounters, with a range of difficulties to challenge players of different skill levels. The GM may want to adjust encounter difficulties based on the players' preferences and the storytelling style.\n"
]
}
],
"source": [
"def balance_encounter_difficulty(encounters_list):\n",
" completion = openai.ChatCompletion.create(\n",
" model=\"gpt-3.5-turbo\",\n",
" messages=[\n",
" {\"role\": \"user\", \"content\": (\n",
" f\"Based on the following list of encounters, suggest how to balance the encounter difficulties for a well-rounded Starfinder adventure:\\n\"\n",
" f\"{encounters_list}\\n\"\n",
" )},\n",
" ],\n",
" )\n",
" return completion.choices[0].message['content'].strip()\n",
"\n",
"balanced_difficulty = balance_encounter_difficulty(encounters_list)\n",
"print(balanced_difficulty)\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"Lastly, create a function to generate environmental hazards and locations:"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Environmental hazards:\n",
"1. Thick and unpredictable fog covering the area, making visibility and navigation difficult.\n",
"2. Toxic and acidic pools of liquid scattered around the planet, causing damage to those who come into contact with them.\n",
"3. Unstable and unpredictable weather patterns, including sudden storms and temperature drops.\n",
"4. Dangerous and impassable terrain, such as steep cliffs and rocky valleys.\n",
"5. Extreme temperature fluctuations, ranging from blistering heat to freezing cold.\n",
"6. Natural seismic activity and occasional earthquakes, causing tremors and landslides.\n",
"7. Highly aggressive and territorial native creatures, attacking the agents and causing physical harm.\n",
"8. Deadly plant life with poisonous spores and thorny vines that can ensnare and suffocate the agents.\n",
"\n",
"Locations:\n",
"1. The landing zone where the agents initially touch down, surrounded by thick jungle and misty clouds.\n",
"2. The native village, featuring a variety of small huts and communal spaces. The village is hidden from plain sight and accessible only through narrow paths in the jungle.\n",
"3. A dark and gloomy jungle where the agents face many environmental hazards, such as poisonous plant life, unpredictable terrain, sudden storms, and aggressive native creatures.\n",
"4. The hidden alien base, located underground and accessible only through a secret entrance. It is heavily guarded and fortified, with multiple levels and chambers filled with traps and obstacles.\n",
"5. The main weapon of the aliens, a massive and advanced piece of technology resembling a missile silo. It is hidden in a remote and heavily guarded location, accessible only through complex security measures and computer systems.\n",
"6. A series of underground tunnels connecting various parts of the alien base, filled with hazards such as mechanical traps, turrets, and drones.\n",
"7. The alien leader's chamber, a massive and intimidating space filled with high-tech equipment and menacing guards. The room contains a variety of interactive objects that can be used to gather information and learn about the aliens' plans.\n",
"8. An escape pod bay, located deep in the heart of the alien base. The agents must fight their way through enemy forces to reach the pods and escape before the base collapses.\n"
]
}
],
"source": [
"def create_hazards_and_locations(core_idea, elements):\n",
" completion = openai.ChatCompletion.create(\n",
" model=\"gpt-3.5-turbo\",\n",
" messages=[\n",
" {\"role\": \"user\", \"content\": (\n",
" f\"Based on the following Starfinder adventure core idea, generate a list of environmental hazards and locations:\\n\"\n",
" f\"{core_idea}\\n\"\n",
" f\"{elements}\\n\"\n",
" )},\n",
" ],\n",
" )\n",
" return completion.choices[0].message['content'].strip()\n",
"\n",
"hazards_and_locations = create_hazards_and_locations(adventure_idea, key_elements)\n",
"print(hazards_and_locations)\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"These functions will contribute to a dynamic and immersive Starfinder adventure by designing diverse encounters and environments that challenge and engage the players."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"For Step 4, Develop NPCs, we'll create two functions using ChatGPT API calls with chat-format: one to create a roster of NPCs and another to generate character traits, dialogue, and mannerisms for the NPCs.\n",
"\n",
"First, let's create the function to generate a roster of NPCs based on the core idea:"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Roster of NPCs:\n",
"1. Starfinder Society team leader - Kiera Nelthar: A no-nonsense ysoki with deep experience in field operations. Despite her small stature, she commands respect from her team and provides valuable guidance during the mission.\n",
"2. Native leader - Thyla Janssen: A fierce and wise member of the planet's indigenous species. She has a deep connection to the planet's ecology and is willing to risk everything to help the Starfinder Society in their mission against the alien invaders.\n",
"3. Alien leader - Xalorath, The Mindflayer: A sinister alien entity with powerful psychic abilities, Xalorath is the mastermind behind the invasion. He seeks to harvest the planet's resources for his own purposes and expand his control over the galaxy.\n",
"4. Captured Starfinder Society agent - Jaxon Hunter: A human operative who was captured by the aliens during an earlier mission. After being rescued by the Starfinder Society team, he provides key intel on the aliens' plans and weaknesses.\n",
"\n",
"Other NPCs:\n",
"5. Starfinder Society negotiator - Vega Price: A charismatic and persuasive half-elf, Vega is responsible for obtaining resources and support from local organizations to aid the Starfinder Society's mission.\n",
"6. Alien leader's second-in-command - Zon'tar the Enforcer: A hulking brute with cybernetic implants, Zon'tar serves as Xalorath's enforcer and is responsible for guarding the alien base.\n",
"7. Native guide - Kaelen Skywatcher: A skilled hunter and tracker, Kaelen is familiar with the planet's terrain and secrets, and helps the Starfinder Society navigate the harsh environment.\n",
"8. Alien weapons specialist - Vexxtra the Technomancer: A brilliant but unstable alien scientist, Vexxtra is responsible for developing and maintaining the aliens' advanced weaponry. She poses a significant threat to the Starfinder Society agents.\n"
]
}
],
"source": [
"def create_NPC_roster(core_idea, elements):\n",
" completion = openai.ChatCompletion.create(\n",
" model=\"gpt-3.5-turbo\",\n",
" messages=[\n",
" {\"role\": \"user\", \"content\": (\n",
" f\"Based on the following Starfinder adventure core idea, create a roster of NPCs including their names, roles, and a brief description:\\n\"\n",
" f\"{core_idea}\\n\"\n",
" f\"{elements}\\n\"\n",
" )},\n",
" ],\n",
" )\n",
" return completion.choices[0].message['content'].strip()\n",
"\n",
"NPC_roster = create_NPC_roster(adventure_idea, key_elements)\n",
"print(NPC_roster)\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"Next, create a function to generate character traits, dialogue, and mannerisms for the NPCs:"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1. Kiera Nelthar, Starfinder Society team leader:\n",
"- Character traits: No-nonsense, experienced, respected, knowledgeable\n",
"- Dialogue examples: \"We're here to complete the mission, not waste time. Let's move out.\" \"I've seen everything out in the field. Don't try to pull one over on me.\"\n",
"- Mannerisms: Direct eye contact, standing tall despite her small stature, always keeping a watchful eye on her surroundings\n",
"\n",
"2. Thyla Janssen, Native leader:\n",
"- Character traits: Fierce, wise, connected to the planet's ecology, risk-taker\n",
"- Dialogue examples: \"This planet is my home, and I'll do whatever it takes to protect it.\" \"The aliens may have powerful weapons, but they don't understand the balance of nature.\"\n",
"- Mannerisms: Proud posture, speaking with authority, frequently grounding herself in nature by touching the plants and trees around her\n",
"\n",
"3. Xalorath, The Mindflayer, Alien leader:\n",
"- Character traits: Sinister, intelligent, controlling, power-hungry\n",
"- Dialogue examples: \"You are nothing to me but insects to be squashed underfoot.\" \"My kind have come to harvest your planet's resources, and there's nothing you can do to stop us.\"\n",
"- Mannerisms: Speaking calmly and coldly, using psychic powers to manipulate and intimidate, exuding an aura of superiority\n",
"\n",
"4. Jaxon Hunter, Captured Starfinder Society agent:\n",
"- Character traits: Resourceful, resilient, loyal to the Starfinder Society, knowledgeable about the aliens' plans\n",
"- Dialogue examples: \"They caught me off guard once, but I won't let it happen again.\" \"You want to know how the aliens are able to control their weapons? I have a theory...\"\n",
"- Mannerisms: Tense posture, a wary and observant gaze, frequently glancing around for potential threats\n",
"\n",
"5. Vega Price, Starfinder Society negotiator:\n",
"- Character traits: Charismatic, persuasive, persistent, diplomatic\n",
"- Dialogue examples: \"I'm here to help you help us. Together, we can accomplish great things.\" \"I understand your concerns, but think of the long-term benefits of supporting our mission.\"\n",
"- Mannerisms: Confident demeanor, friendly and engaging approach, frequently gesturing with their hands during conversation\n",
"\n",
"6. Zon'tar the Enforcer, Alien leader's second-in-command:\n",
"- Character traits: Brutal, imposing, cybernetically enhanced, fiercely loyal to Xalorath\n",
"- Dialogue examples: \"The boss has given us orders, and we'll see them through at any cost.\" \"Cross me, and you'll regret it.\"\n",
"- Mannerisms: Standing tall and puffing out his chest, speaking in a low and threatening tone, constantly scanning his surroundings for potential threats\n",
"\n",
"7. Kaelen Skywatcher, Native guide:\n",
"- Character traits: Skilled, knowledgeable about the planet's terrain, resourceful, protective of their home\n",
"- Dialogue examples: \"I know these woods like the back of my hand. Stick with me, and we'll get there safely.\" \"This planet has secrets that even the aliens don't know about.\"\n",
"- Mannerisms: Moving with quiet and graceful steps, frequently pausing to observe their surroundings, using hand signals to communicate silently with the Starfinder agents\n",
"\n",
"8. Vexxtra the Technomancer, Alien weapons specialist:\n",
"- Character traits: Brilliant, unstable, ruthless, unpredictable\n",
"- Dialogue examples: \"My weapons will tear you apart. Let's see how you like the taste of energy beams.\" \"I don't need anyone's help to complete my work. I'm capable of destroying all of you on my own.\"\n",
"- Mannerisms: Fidgeting with her hands, muttering to herself under her breath, frequently glancing down at her datapad to check on her progress.\n"
]
}
],
"source": [
"def create_NPC_details(NPC_roster, elements):\n",
" completion = openai.ChatCompletion.create(\n",
" model=\"gpt-3.5-turbo\",\n",
" messages=[\n",
" {\"role\": \"user\", \"content\": (\n",
" f\"Based on the following roster of NPCs, provide character traits, dialogue examples, and mannerisms for each NPC:\\n\"\n",
" f\"{NPC_roster}\\n\"\n",
" f\"{elements}\\n\"\n",
" )},\n",
" ],\n",
" )\n",
" return completion.choices[0].message['content'].strip()\n",
"\n",
"NPC_details = create_NPC_details(NPC_roster, key_elements)\n",
"print(NPC_details)\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"These functions will help to create memorable and well-developed NPCs that enrich the Starfinder adventure, providing interesting interactions and relationships for the players to navigate in their journey."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"For Step 5, Establish Locations and Maps, we'll create three functions using ChatGPT API calls with chat-format: one to generate suggestions for detailed maps, another to create descriptions and narrative elements for locations, and the last one to suggest exploration and points of interest within the locations.\n",
"\n",
"First, let's create the function to generate suggestions for detailed maps based on the core idea:"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Detailed maps and environments that would be beneficial for this adventure:\n",
"\n",
"1. Remote Planet Surface: A detailed map of the remote planet's surface, including various terrain types such as forests, mountains, deserts, and swamps. This map should also highlight the initial landing location, any indigenous settlements or landmarks, and the general area where the secret alien base is located.\n",
"\n",
"2. Native Settlement: A map of a settlement belonging to the planet's native species, depicting various buildings, gathering areas, and other key features. This map would be useful during the encounter with the native species and potentially serve as a base of operations for the agents throughout the adventure.\n",
"\n",
"3. Alien Base Exterior: A map detailing the area surrounding the hidden alien base, including the entrance, exterior defenses, and any additional structures or features related to the base. This map would be essential during the infiltration and escape phases of the adventure.\n",
"\n",
"4. Alien Base Interior: A series of maps outlining the interior of the alien base, including rooms, hallways, ventilation shafts, and key features such as the prison holding captured prisoners, the command center, and the main weapon. These maps would provide additional guidance and strategy during the stealth infiltration, combat encounters, and disabling of the main weapon.\n",
"\n",
"5. Alien Command Center: A detailed map of the room or area where the alien leader resides, including any unique features, traps, or defenses. This map would be crucial during the confrontation with the main antagonist and his elite guards.\n",
"\n",
"6. Alien Weapon Chamber: A blueprint-style map of the chamber housing the aliens' main weapon, including its construction, layout, and potential weak points. This map would be valuable when attempting to disable the weapon to prevent future attacks.\n",
"\n",
"7. Escape Route: A map outlining potential escape routes and hazards from the collapsing alien base, including any obstacles, environmental hazards, or enemy forces that may impede the agents' escape.\n",
"\n",
"8. Starfinder Society HQ: A map of the Starfinder Society headquarters, where the agents would report back to their team leader and debrief after successfully completing the mission.\n"
]
}
],
"source": [
"def create_maps(core_idea, elements):\n",
" completion = openai.ChatCompletion.create(\n",
" model=\"gpt-4\",\n",
" messages=[\n",
" {\"role\": \"user\", \"content\": (\n",
" f\"Based on the following Starfinder adventure core idea, suggest the types of detailed maps and environments that would be beneficial for this adventure:\\n\"\n",
" f\"{core_idea}\\n\"\n",
" f\"{elements}\\n\"\n",
" )},\n",
" ],\n",
" )\n",
" return completion.choices[0].message['content'].strip()\n",
"\n",
"maps = create_maps(adventure_idea, key_elements)\n",
"print(maps)\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"Next, create a function to generate descriptions and narrative elements for the locations:"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Key Location Descriptions:\n",
"\n",
"1. Landing Site: A remote, rocky plateau covered in alien vegetation, providing the Starfinder Society agents with a secluded area to land their ship. The plateau offers a clear view of the surrounding area, including ruined structures that hint to the planet's previous civilization.\n",
"2. Native Village: A fortified village with makeshift walls and shelters, currently inhabited by the planet's native species. The village is filled with a mix of fear and hope as they seek the Starfinder Society's help in their fight against the aliens.\n",
"3. Alien Base Entrance: Hidden behind a thick vegetation and guarded by a patrol of alien soldiers, the entrance to the base is a large blast door that blends seamlessly into the mountainside. The agents will need to deal with the guards and find a way to bypass the door's security system.\n",
"4. Alien Command Center: A large, dimly lit room filled with advanced computer consoles and other equipment, where the agents can gather intelligence about the aliens' plans and motives. They must be cautious, as enemy patrols frequently enter the room.\n",
"5. Prisoner Detention Area: A grim, dark cell block where captured prisoners, including a fellow Starfinder Society agent, are being held. The agents must navigate through various holding cells under high-security measures to free the prisoners and engage in combat with the alien guards.\n",
"6. Alien Leader's Throne Room: A grand hall displaying various trophies from conquered planets, centered around a daunting throne from which the alien leader commands his forces. The agents will face their biggest challenge in combat with the alien leader and his elite guards.\n",
"7. Main Weapon Control Room: A cold, sterile environment housing the alien's powerful weapon, capable of launching devastating attacks on other planets. The agents will have to disable the weapon by solving complex puzzles and dealing with the room's various defenses.\n",
"8. Self-Destruct Countdown Sequence: As the alien base begins to collapse after the weapon is disabled, a countdown for the complete annihilation of the base begins, with alarms blaring and deadly traps triggered. The Starfinder agents will have to rush towards their ship while avoiding hazards and remaining enemy forces.\n",
"\n",
"Additional NPCs:\n",
"5. Alien Elite Guard: An imposing, heavily-armed soldier tasked with protecting the alien leader, serving as a significant obstacle in the agents' path.\n",
"6. Native Scout: A member of the planet's indigenous species who is adept at sneaking and traversing the area, offering guidance to the agents as they navigate the alien base.\n",
"\n",
"Milestone Adjustments:\n",
"2. Gaining the trust and support of the native species by offering assistance and showing genuine concern for their plight.\n",
"6. Successfully defeating the alien leader and his elite guards, effectively crippling their command structure.\n",
"7. Evacuating the planet's native population from the collapsing base, ensuring their safety and rebuilding potential.\n"
]
}
],
"source": [
"def create_location_descriptions(core_idea, elements):\n",
" completion = openai.ChatCompletion.create(\n",
" model=\"gpt-4\",\n",
" messages=[\n",
" {\"role\": \"user\", \"content\": (\n",
" f\"Based on the following Starfinder adventure core idea, provide descriptions and narrative elements for key locations in the adventure:\\n\"\n",
" f\"{core_idea}\\n\"\n",
" f\"{elements}\\n\"\n",
" )},\n",
" ],\n",
" )\n",
" return completion.choices[0].message['content'].strip()\n",
"\n",
"location_descriptions = create_location_descriptions(adventure_idea, key_elements)\n",
"print(location_descriptions)\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"Lastly, create a function to suggest exploration and points of interest within the locations:"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Unique Points of Interest and Exploration Opportunities:\n",
"\n",
"1. Remote Planet Surface: The players can encounter various indigenous species that may either hinder or aid them in their mission, depending on how the players interact with them. There could be ruins of ancient civilizations on the planet, containing valuable artifacts or secrets. The players could also discover hidden caves or underground tunnels that lead to the alien base.\n",
"\n",
"2. Native Settlement: The players can interact with the native species and learn more about the alien invasion through their culture and beliefs. There could be ancient relics or valuable resources that the players can obtain through trade or negotiation. Additionally, the settlement could be invaded by the alien forces, leading to a rescue mission and potential allies among the natives.\n",
"\n",
"3. Alien Base Exterior: The players can attempt to gather intel on the enemy forces and their defenses, either through direct confrontation or stealthy reconnaissance. They can sabotage the defenses, using distractions or traps to create opportunities for infiltration. They could also discover hidden tunnels or secret entrances to the base.\n",
"\n",
"4. Alien Base Interior: The players can rescue and recruit prisoners, gather intel, sabotage defenses, and engage in tense combat encounters throughout the base. They can uncover the aliens' true intentions and potential weaknesses, leading to greater successes in the mission. They may also encounter and have to bypass or disable deadly traps or security measures.\n",
"\n",
"5. Alien Command Center: The encounter with the alien leader can be a difficult battle of strategy and combat, with traps and ambushes set throughout the chamber. The dialogue and interactions with the leader could also lead to the players gaining valuable information and assistance. The elite guards could be a challenge, with unique abilities and weapons that the players must overcome.\n",
"\n",
"6. Alien Weapon Chamber: The weapon chamber could be a labyrinth of puzzles and obstacles, requiring the players to use their brains and physical skills to navigate and disable the weapon. The players may have to battle waves of enemies or survive environmental hazards, such as radiation or toxic gases.\n",
"\n",
"7. Escape Route: The escape route could be thrilling and dangerous, with collapsing structures, deadly traps, and hordes of enemies in pursuit. The players could take advantage of environmental features or equipment to give them an edge, such as a high-speed vehicle or a jetpack. They may also have to leave valuable resources, including intel or artifacts, behind.\n",
"\n",
"8. Starfinder Society HQ: The players can interact with their team leader and other agents, receiving recognition for their success and advancing their reputation within the organization. They could also gain access to new equipment or contacts, leading to future adventures and opportunities. The debrief could also lead to new missions or campaigns based around the intel gathered during the remote planet mission.\n"
]
}
],
"source": [
"def create_points_of_interest(core_idea, elements, maps):\n",
" completion = openai.ChatCompletion.create(\n",
" model=\"gpt-3.5-turbo\",\n",
" messages=[\n",
" {\"role\": \"user\", \"content\": (\n",
" f\"Based on the following Starfinder adventure core idea, themes and maps, suggest unique points of interest and exploration opportunities for the players within the key locations:\\n\"\n",
" f\"{core_idea}\\n\"\n",
" f\"{elements}\\n\"\n",
" f\"{maps}\\n\"\n",
" )},\n",
" ],\n",
" )\n",
" return completion.choices[0].message['content'].strip()\n",
"\n",
"points_of_interest = create_points_of_interest(adventure_idea, key_elements, maps)\n",
"print(points_of_interest)\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"These functions will contribute to a rich and immersive adventure world, giving players an engaging environment to explore, filled with detailed locations and points of interest that will make their experience more memorable."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"For Step 6, Design Rewards and Loot, we'll create two functions using ChatGPT API calls with chat-format: one to establish a reward system for the adventure and another to create balanced loot for players to acquire.\n",
"\n",
"First, let's create the function to generate a reward system based on the core idea:"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Experience Points Distribution:\n",
"\n",
"Combat encounters: 500-1000 xp each depending on the difficulty.\n",
"\n",
"Social encounters: 250-500 xp each depending on the success of negotiations or the level of intelligence gathered.\n",
"\n",
"Exploration encounters: 200-400 xp each depending on the difficulty of terrain and the level of discovery.\n",
"\n",
"Puzzle encounters: 300-600 xp each depending on the complexity of the puzzle and the success of solving it.\n",
"\n",
"Milestone Rewards:\n",
"\n",
"After successfully negotiating with the native species, the Starfinder Society gains access to a new weapon technology that proves useful in the final battle against the aliens.\n",
"\n",
"After successfully discovering the existence and location of the alien base, the Starfinder Society gains crucial intelligence that helps them plan their attack and ultimately leads to the downfall of the alien leader.\n",
"\n",
"After successfully disabling the alien main weapon, the Starfinder Society is hailed as heroes and receives a significant bonus to their reputation within the Society.\n",
"\n",
"Other Relevant Incentives:\n",
"\n",
"Throughout the adventure, the Starfinder Society agents can discover different pieces of alien technology that they can later trade in for credits or use to upgrade their gear.\n",
"\n",
"If the Starfinder Society successfully completes their mission, they receive a significant bonus to their pay as well as an increase in their Society rank.\n",
"\n",
"The Starfinder Society can also receive access to new missions and resources based on their success in this adventure, such as a new ship or access to rare weapons and gear.\n"
]
}
],
"source": [
"def create_reward_system(core_idea, encounters):\n",
" completion = openai.ChatCompletion.create(\n",
" model=\"gpt-3.5-turbo\",\n",
" messages=[\n",
" {\"role\": \"user\", \"content\": (\n",
" f\"Based on the following Starfinder adventure core idea, suggest a reward system for the adventure, including experience points distribution, milestone rewards, and any other relevant incentives:\\n\"\n",
" f\"{core_idea}\\n\"\n",
" f\"{encounters}\\n\"\n",
" )},\n",
" ],\n",
" )\n",
" return completion.choices[0].message['content'].strip()\n",
"\n",
"reward_system = create_reward_system(adventure_idea, encounters_list)\n",
"print(reward_system)\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"Next, create a function to generate balanced loot for the adventure:"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Balanced Loot List:\n",
"\n",
"1. Alien Weapon Technology: A unique energy weapon developed by the native species, which deals increased damage against the alien antagonists.\n",
"\n",
"2. Alien Armor Upgrade: An advanced suit of light or medium armor using alien materials, providing increased protection and potential resistance to energy damage.\n",
"\n",
"3. Data Cache: Holographic data storage containing valuable intelligence on the alien antagonists, their plans, and their technology. Worth a significant amount of credits or useful for gaining favor with the Starfinder Society.\n",
"\n",
"4. Alien Communication Device: A handheld device that allows the players to tap into the alien network, possibly providing advanced knowledge of enemy movements or allowing them to call for reinforcements during the final battle.\n",
"\n",
"5. Alien Personal Shield Generator: A rare piece of technology that when equipped, generates a personal energy shield, potentially absorbing a certain amount of damage before dissipating.\n",
"\n",
"6. Multi-Tool: A versatile device with multiple functions, such as hacking, lock picking, and various skill enhancements, proving valuable in both social and exploration encounters.\n",
"\n",
"7. Alien Artifact: A mysterious object of value to both the Starfinder Society and the alien antagonists, making it a valuable trade item or a key to unlocking hidden resources.\n",
"\n",
"8. Credits: An assortment of alien currency and tradable resources that can be converted into a significant amount of credits for gear and equipment upgrades.\n",
"\n",
"9. Rare Weapon: A highly sought-after weapon unique to the remote planet, providing superior damage, range, or critical effects in comparison to traditional weapons.\n",
"\n",
"10. Rare Armor: A suit of highly advanced and protective armor crafted from local materials, offering increased durability and potential special abilities.\n",
"\n",
"11. Alien Spy Drone: A small, autonomous drone capable of surveillance and information gathering, enabling players to covertly scout the alien base and gather intelligence.\n",
"\n",
"12. Crystal Power Source: A highly-efficient power source made from a unique crystal found on the remote planet, capable of upgrading a ship's systems or weaponry for improved performance.\n",
"\n",
"13. Access Pass: A holographic identification badge or keycode providing entry to restricted areas and potential safe rooms during the final infiltration of the alien base.\n",
"\n",
"14. Advanced Medical Kit: A compact medical kit containing advanced healing tools and drugs, allowing players to heal more efficiently during the adventure.\n",
"\n",
"15. Experimental Augmentation: A rare and powerful biotech or cybernetic augmentation, granting players enhanced abilities or access to new and unique skills.\n"
]
}
],
"source": [
"def create_balanced_loot(core_idea, rewards):\n",
" completion = openai.ChatCompletion.create(\n",
" model=\"gpt-4\",\n",
" messages=[\n",
" {\"role\": \"user\", \"content\": (\n",
" f\"Based on the following Starfinder adventure core idea, create a list of balanced loot for the players, including gear, equipment, and other valuable items:\\n\"\n",
" f\"{core_idea}\\n\"\n",
" f\"{rewards}\\n\"\n",
" )},\n",
" ],\n",
" )\n",
" return completion.choices[0].message['content'].strip()\n",
"\n",
"balanced_loot = create_balanced_loot(adventure_idea, reward_system)\n",
"print(balanced_loot)\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"These functions will ensure that the players are adequately rewarded for their progress and achievements throughout the Starfinder adventure in a balanced and fair manner, keeping them motivated and invested in the narrative."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"For Step 7, Create Story Hooks and Adventure Seeds, we'll create two functions using ChatGPT API calls with chat-format: one to generate engaging story hooks that draw players into the adventure, and another to create seeds for future adventures tied to the current one.\n",
"\n",
"First, let's create the function to generate story hooks based on the core idea:"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1. The team of Starfinder Society agents receives a distress signal from an old colleague. The message was garbled, but it is clear she needs help. The agents soon learn that the distress signal came from the remote planet that has been cut off from the rest of the galaxy. They must investigate what happened and try to save their colleague from the hostile aliens.\n",
"\n",
"2. The Starfinder Society agents are hired by a wealthy businessman to retrieve valuable artifacts from the remote planet. However, when they arrive, they find that the planet is under the control of dangerous aliens, and they must fight for their lives to retrieve the artifacts and escape the planet.\n",
"\n",
"3. A group of Starfinder Society agents is sent to the remote planet to set up a base and start exploring. However, as they explore the planet, they uncover a dangerous plot by the aliens to launch simultaneous attacks on several planets in the galaxy. The agents must race against time to stop the aliens before it is too late.\n",
"\n",
"4. A distress signal from a research station on the remote planet catches the attention of the Starfinder Society. When they arrive, they find the station has been destroyed and the survivors holed up in a nearby cave. The survivors reveal that they were studying a strange artifact that seems to have opened a portal to another dimension. The aliens on the planet seem to be aware of the artifact and are trying to get their hands on it. The Starfinder Society agents must uncover the truth behind the artifact and stop the aliens from getting it.\n",
"\n",
"5. The Starfinder Society agents are approached by a group of rebels on the remote planet who have been fighting back against the aliens for years. The rebels reveal that there is a hidden technology on the planet that could turn the tide against the aliens. The agents must help the rebels find the technology and use it to defeat the aliens once and for all. But the aliens are not going to give up without a fight.\n"
]
}
],
"source": [
"def create_story_hooks(core_idea, elements):\n",
" completion = openai.ChatCompletion.create(\n",
" model=\"gpt-3.5-turbo\",\n",
" messages=[\n",
" {\"role\": \"user\", \"content\": (\n",
" f\"Based on the following Starfinder adventure core idea, provide engaging story hooks to draw players into the adventure:\\n\"\n",
" f\"{core_idea}\\n\"\n",
" f\"{elements}\\n\"\n",
" )},\n",
" ],\n",
" )\n",
" return completion.choices[0].message['content'].strip()\n",
"\n",
"story_hooks = create_story_hooks(adventure_idea, themes_and_tone)\n",
"print(story_hooks)\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"Next, create a function to generate seeds for future adventures:"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1. The team of Starfinder Society agents discovers that the aliens are not the only threat on the planet. There are also indigenous creatures that have been altered by the aliens and are now wreaking havoc on the planet. The agents must now not only stop the aliens but also find a way to neutralize the mutated creatures before they cause more damage.\n",
"\n",
"2. As the Starfinder Society agents delve deeper into the planet, they discover that there is a hidden underground facility that was used by the aliens to experiment on the local inhabitants. The agents must now infiltrate the facility to shut it down and rescue any survivors.\n",
"\n",
"3. The team of Starfinder Society agents discovers that one of their own has been captured by the aliens and is being held as a prisoner. They must now mount a rescue mission to get their teammate back and gather intelligence on the aliens' plans.\n",
"\n",
"4. The Starfinder Society agents uncover evidence that suggests the aliens are not the only group using the planet as a base. They discover a rival faction that is trying to gain control of the planet and its resources. The agents must now navigate the complex political landscape to prevent a full-blown war from breaking out.\n",
"\n",
"5. The team of Starfinder Society agents stumble upon a group of rebels who are secretly fighting against the aliens. The agents must now decide whether to ally with the rebels or work against them to accomplish their mission. This decision could have long-lasting repercussions for the planet and its inhabitants.\n",
"\n",
"6. As the Starfinder Society agents get closer to defeating the aliens, they discover that there is a rogue element within their own organization that is working against them. The agents must now find and neutralize these traitors before they can cause any more harm.\n"
]
}
],
"source": [
"def create_adventure_seeds(core_idea):\n",
" completion = openai.ChatCompletion.create(\n",
" model=\"gpt-3.5-turbo\",\n",
" messages=[\n",
" {\"role\": \"user\", \"content\": (\n",
" f\"Based on the following Starfinder adventure core idea, suggest potential seeds for future adventures that can branch out from the current storyline:\\n\"\n",
" f\"{core_idea}\\n\"\n",
" )},\n",
" ],\n",
" )\n",
" return completion.choices[0].message['content'].strip()\n",
"\n",
"adventure_seeds = create_adventure_seeds(adventure_idea)\n",
"print(adventure_seeds)\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"These functions will capture the players' interest from the very beginning and provide ideas for extensions of the Starfinder adventure into a larger, interconnected campaign with future storylines and challenges."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"For Step 8, Write Adventure Synopsis, we'll create a single function using a ChatGPT API call with chat-format. This function will generate a concise and engaging introduction for the adventure based on the core idea.\n",
"\n",
"Let's create the function to generate the adventure synopsis:"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Title: The Isolated Invasion\n",
"\n",
"Adventure Synopsis:\n",
"\n",
"In The Isolated Invasion, you and your fellow Starfinder Society agents are dispatched to the remote and mysterious planet of Syloria Sigma. Long thought lost from the rest of the galaxy, Syloria Sigma has been discovered to be the origin of a series of brutal attacks on nearby planets. Your mission is to infiltrate the seemingly abandoned world and discover the truth behind its sudden reemergence.\n",
"\n",
"Upon arriving, your team discovers a highly advanced alien race known as the Thanaraxi that have taken over the planet as their own. These nefarious beings have seized control of Syloria Sigma and are using the planet's unique resources to fuel a devastating campaign against the unsuspecting galaxy. Hindered by the planet’s isolation and the alien’s powerful technology, you'll struggle to establish contact with the outside world and warn the Starfinder Society of the escalating threat. \n",
"\n",
"With the fate of countless worlds hanging in the balance, you and your team must utilize every ounce of skill, cunning, and resourcefulness to thwart the plans of the hostile Thanaraxi invaders. Will you succeed in halting the alien onslaught? Or will you become another casualty of the sinister Thanaraxi and their conquest of the galaxy? The fate of the universe is in your hands in The Isolated Invasion.\n"
]
}
],
"source": [
"def create_adventure_synopsis(core_idea):\n",
" completion = openai.ChatCompletion.create(\n",
" model=\"gpt-4\",\n",
" messages=[\n",
" {\"role\": \"user\", \"content\": (\n",
" f\"Based on the following Starfinder adventure core idea, write a concise and engaging adventure synopsis to introduce the story and setting to the players:\\n\"\n",
" f\"{core_idea}\\n\"\n",
" )},\n",
" ],\n",
" )\n",
" return completion.choices[0].message['content'].strip()\n",
"\n",
"adventure_synopsis = create_adventure_synopsis(adventure_idea)\n",
"print(adventure_synopsis)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Save the results locally for the future, it's expensive generating all of this after all!\n",
"import os\n",
"import time\n",
"\n",
"# Variables and their placeholder contents\n",
"# Replace the contents with the desired values\n",
"variables = {\n",
" \"adventure_idea\": adventure_idea,\n",
" \"themes_and_tone\": themes_and_tone,\n",
" \"adventure_acts\": adventure_acts,\n",
" \"key_elements\": key_elements,\n",
" \"encounters_list\": encounters_list,\n",
" \"balanced_difficulty\": balanced_difficulty,\n",
" \"hazards_and_locations\": hazards_and_locations,\n",
" \"NPC_roster\": NPC_roster,\n",
" \"NPC_details\": NPC_details,\n",
" \"maps\": maps,\n",
" \"location_descriptions\": location_descriptions,\n",
" \"points_of_interest\": points_of_interest,\n",
" \"reward_system\": reward_system,\n",
" \"balanced_loot\": balanced_loot,\n",
" \"story_hooks\": story_hooks,\n",
" \"adventure_seeds\": adventure_seeds,\n",
" \"adventure_synopsis\": adventure_synopsis,\n",
"}\n",
"\n",
"# Create a folder with the current timestamp as the name\n",
"timestamp = time.strftime(\"%Y%m%d-%H%M%S\")\n",
"os.makedirs(timestamp)\n",
"\n",
"# Save each variable to a .txt file with the variable name as the filename\n",
"for var_name, content in variables.items():\n",
" with open(os.path.join(timestamp, f\"{var_name}.txt\"), \"w\") as file:\n",
" file.write(content)\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"Step 9.5, Send this to chatgpt to be written into a cohesive story."
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {},
"outputs": [],
"source": [
"# prompt = \"\"\"Create a ready-to-run TTRPG scenario using the following prompted inputs, organizing them according to the specified structure to form a cohesive, engaging experience for both players and the GM.\n",
"\n",
"# Inputs:\n",
"# 1. Adventure Idea: {adventure_idea}\n",
"# 2. Themes and Tone: {themes_and_tone}\n",
"# 3. Adventure Acts: {adventure_acts}\n",
"# 4. Key Elements: {key_elements}\n",
"# 5. Encounters List: {encounters_list}\n",
"# 6. Balanced Difficulty: {balanced_difficulty}\n",
"# 7. Hazards and Locations: {hazards_and_locations}\n",
"# 8. NPC Roster: {NPC_roster}\n",
"# 9. NPC Details: {NPC_details}\n",
"# 10. Maps: {maps}\n",
"# 11. Location Descriptions: {location_descriptions}\n",
"# 12. Points of Interest: {points_of_interest}\n",
"# 13. Reward System: {reward_system}\n",
"# 14. Balanced Loot: {balanced_loot}\n",
"# 15. Story Hooks: {story_hooks}\n",
"# 16. Adventure Seeds: {adventure_seeds}\n",
"# 17. Adventure Synopsis: {adventure_synopsis}\n",
"\n",
"# Structure:\n",
"# 1. Introduction\n",
"# - Include: Adventure Idea, Themes and Tone, and Adventure Synopsis\n",
"# 2. Story Hooks and Adventure Seeds\n",
"# - Include: Story Hooks and Adventure Seeds\n",
"# 3. Adventure Acts\n",
"# - Break acts into scenes\n",
"# - Include Key Elements, Encounters List, Balanced Difficulty, and NPC interactions (NPC Roster and NPC Details) within scenes\n",
"# 4. Locations and Maps\n",
"# - Include: Maps, Location Descriptions, Hazards and Locations, and Points of Interest\n",
"# 5. GM Resources and Guidance\n",
"# - Include: Reward System and Balanced Difficulty\n",
"# 6. Rewards, Loot, and Consequences\n",
"# - Include: Reward System and Balanced Loot\n",
"\n",
"# Ensure the TTRPG scenario has a balance between encounters (combat, social, exploration, and puzzles) and integrates NPCs with their details throughout the adventure. The final scenario should have a clear structure, concise descriptions, and a balanced, immersive experience for players and GMs.\"\"\"\n",
"\n",
"\n",
"\n",
"# def create_scenario(input):\n",
"# completion = openai.ChatCompletion.create(\n",
"# model=\"gpt-4\",\n",
"# messages=[\n",
"# {\"role\": \"user\", \"content\": (\n",
"# f\"{input}/n\"\n",
"# )},\n",
"# ],\n",
"# )\n",
"# return completion.choices[0].message['content'].strip()\n",
"\n",
"# scenario = create_scenario(prompt)\n",
"# print(scenario)\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment