Using Google Gemini to Write a Screenplay

Leon Nicholls
11 min readNov 21, 2024

--

I’ve been geeking out about the potential of large language models (LLMs) for creative content creation, especially those mind-blowing advancements in AI video generation. Imagine: in the future, anyone could create a movie! But let’s be honest: Nobody wants to watch a two-hour tech demo, no matter how shiny the CGI is. A good movie needs a solid story, compelling characters, and that classic Hollywood structure.

I’m no Tarantino (yet!), but I’m primarily techy and have some writing skills. But the screenwriting bug bit me, so I dove headfirst into the world of Blake Snyder’s beat sheets and Viki King’s rapid-fire writing techniques by reading their books. With newfound knowledge (and a healthy dose of skepticism), I tested Google Gemini: could this AI help me write an actual, full-length movie script?

Spoiler alert: the results were… interesting. Join me as I break down my step-by-step process, from brainstorming crazy plot twists with Gemini to wrestling with API calls in the dead of night. We’ll explore the power of prompt engineering, the joys (and frustrations) of collaborating with an AI, and whether this technology can truly unlock the screenwriter within us all. It’s showtime!

Note: This article spotlights techniques for the Google Gemini Advanced chatbot (a paid service). While these concepts also apply to the free version, we’ll focus on the enhanced capabilities offered by the Advanced subscription.

Getting Started with Gemini for Screenwriting

Let’s explore how I used Google Gemini to create a screenplay. But first, you might wonder…

Why Gemini?

Look, many LLMs are out there vying for our attention. But for this project, Gemini had a few key advantages that made it my AI muse of choice:

  • It’s a creative powerhouse. Gemini’s ability to generate creative content is impressive. You can give feedback, refine prompts, and watch it churn out increasingly nuanced text. Perfect for those endless rewrites every screenwriter loves (or loathes?).
  • It gets “role-play.” This is huge. Giving Gemini a specific persona, like a “seasoned Hollywood screenwriter,” taps into a new level of creativity and domain expertise. More on this later…
  • Structured outputs are its jam. Need a list of ideas? A character bio with specific details? Gemini can handle it, spitting out information in a way that’s easy to work with and integrate into your workflow. You can also ask Gemini to structure the responses in formats like JSON, so it’s easy for the code to understand (see my previous post on JSON).

Plus, let’s not forget the practical stuff:

  • AI Studio is your accessible playground. You can experiment with all the Gemini models in Google’s AI Studio without dropping a dime. Before committing to the paid API, I needed to prototype prompts and find what worked best.
  • Node.js makes things happen. Once I was ready for prime time, I used Node.js to access the Gemini API and automate more of the process. (Don’t worry, you don’t need to be a coding whiz to follow along!)

Crafting Your AI Screenwriter

Now, here’s where the magic starts. Remember how I mentioned role-play? This is where the “power prompt” technique comes in (read my previous post about this technique). It’s all about setting the stage for Gemini to act as your creative partner.

Here’s the exact prompt I used to summon my AI screenwriter:

“You are a seasoned Hollywood screenwriter with decades of experience crafting compelling narratives. You have a deep understanding of story structure, character arcs, and what makes a scene visually captivating.”

Think of this as your screenwriter’s core identity. It informs every subsequent interaction and helps Gemini generate responses that align with your creative goals.

Pro Tip: Feel free to get specific! Do you want a screenwriter with a knack for witty dialogue? Or one who specializes in gritty crime thrillers? Tailor the role to your needs. The more context you provide, the better the results.

By establishing this clear persona, you’re not just getting a random text from an AI but collaborating with a virtual screenwriter who understands the craft and can contribute meaningfully to your project. That’s pretty cool.

From Idea to Story

Okay, so we’ve got our AI screenwriter ready to roll. But what kind of movie are we making? Time to unleash the brainstorming power of Gemini!

Generating Movie Ideas

I’m a big fan of “Whydunit” movies — think thrillers that uncover hidden motives and conspiracies. So, I fed Gemini a prompt with some specific inspiration:

“You are a seasoned Hollywood screenwriter with decades of experience crafting compelling narratives…

Generate a list of 10 Whydunit movie concepts. For inspiration use:

Techno-thrillers

Generative AI, LLMs, and deepfakes

The movie ‘All the President’s Men’”

And boy, did it deliver! (You can check out the complete list of ideas). We’re discussing conspiracies involving AI-generated deepfakes, political scandals fueled by misinformation, and murder mysteries. The creativity was flowing!

Actionable Tip: Don’t just throw random keywords at Gemini. Think about the kind of story you want to tell, the genres you love, and any specific themes or motifs that intrigue you. The more focused your prompt, the more targeted and usable the ideas will be.

Developing Your Story

Once I had a pool of potential concepts, it was time to narrow it down and flesh out the winner. Here’s where Gemini’s structured output capabilities shine. I used a prompt that guided the AI to analyze each idea based on criteria like originality, commercial appeal, and emotional resonance.

But it didn’t stop there. I also had Gemini dive deeper into the chosen concept, generating detailed information about:

  • Characters: Backstories, motivations, relationships — the whole shebang.
  • Plot elements: Key events, twists, and turning points.
  • Themes and motifs: The underlying messages and recurring symbols give the story depth.

(Check out the full breakdown)

Practical Tip: Keep track of your prompts and outputs! It’s easy to get lost in the creative whirlwind. A clear record helps you maintain consistency and build upon previous ideas as you develop your story.

By the end of this stage, I had a solid foundation for my screenplay: a compelling concept, well-defined characters, and a clear narrative direction. Now, it was time to bring this story to life… with a bit of help from some code. (Don’t worry, it’s not as scary as it sounds!)

Building Your Screenplay with Gemini

Alright, we’ve got our story, our characters, and our trusty AI screenwriter. Now, let’s get this show on the road!

Structuring Your Story

Remember those screenwriting books I devoured? Well, they all emphasized the importance of structure. Enter the Blake Snyder Beat Sheet. It’s a blueprint for a successful screenplay, outlining key plot points and their placement throughout the story. (There are many other beat sheets, but this one was super easy to comprehend.)

I adapted the beat sheet to fit my Whydunit narrative and used it as a guide for Gemini. Here’s the gist of my prompt:

“You are a seasoned Hollywood screenwriter…

Consider this movie idea: [insert movie idea]

Here’s background info on the protagonist and antagonist: [insert character details]

Study this Beat Sheet for a 120-page Screenplay:

- Opening Image (1% of the script)

- Theme Stated (5%)

- Set-Up (1–10%)

- Catalyst (10%)

- Debate (10–20%)

- Break into Two (20%)

- B Story (22%)

- Fun and Games (20–50%)

- Midpoint (50%)

- Bad Guys Close In (50–75%)

- All is Lost (75%)

- Dark Night of the Soul (75–80%)

- Break into Three (80%)

- Finale (80–99%)

- Final Image (99–100%)

You are tasked with creating an outline for this movie based on the beat sheet. A screenplay outline is a detailed breakdown of a movie story into beats. It is a structural map that guides the writer in crafting a well-paced and engaging narrative.”

Gemini then churned out a detailed outline, hitting all the major beats and providing a solid framework for my screenplay. But I didn’t stop there. I wanted a more granular structure, so I asked Gemini further to break down the outline into 40 individual scenes. This gave me a manageable roadmap for the actual writing process.

Technical Tip: Remember Gemini’s context window when working with longer narratives. It can only handle a certain amount of text at once. Breaking down your story into smaller chunks helps you manage this limitation and maintain coherence across multiple API calls.

The Writing and Revision Process

Now, for the main event: writing the screenplay! I built a Node.js script that fed Gemini one scene at a time, along with relevant context from the outline and character bios. It was like having an AI co-writer who never got tired (or complained about writer’s block).

Note: The screenplay was written in Fountain Markdown, a syntax for writing screenplays in plain, human-readable text.

But here’s the thing: the first draft is rarely perfect, even with a fantastic AI. That’s where the real screenwriting magic happens — the revision process.

I created a series of scripts to automate different aspects of revision:

  • screenplay.js: Generated the first draft of the screenplay scene by scene.
  • rewrite.js: Evaluated each scene against a checklist for well-crafted screenplays and suggested improvements.
  • expand.js: Added new scenes and expanded existing ones to reach the desired page count.
  • continuity.js: Checked for plot holes and inconsistencies.
  • dialog.js: Polished the dialogue to ensure it was snappy character-driven, and moved the story forward.
  • feedback.js: Put on different hats (screenwriter, director, producer) to provide feedback from various perspectives.

Practical Tip: Feel free to iterate! The beauty of working with an AI is the ability to generate and refine text quickly. Experiment with different prompts, feedback loops, and revision strategies to find the best.

By the end of this process, I had a complete screenplay — a far cry from the initial concept I started with. It was time to see how this AI-powered creation compared to the real deal.

Advanced Prompt Engineering Techniques

Okay, we’ve covered the basics of writing a screenplay with Gemini. But to level up your AI game, let’s dive into some advanced prompt engineering techniques.

Prompting Best Practices

Think of prompts as the steering wheel for your AI journey. The better your prompts, the smoother the ride (and the fewer plot holes you’ll encounter!). Here are a few key things to keep in mind:

  • Context is King: Gemini has a memory (2 million tokens for the 1.5 Pro version) but is not infinite. Provide relevant context in your prompts to keep the AI on track and maintain consistency throughout your screenplay. This might include character bios, plot summaries, or specific details about the scene you’re working on.
  • Model Matchmaking: Gemini offers different models with varying capabilities and costs. The free AI Studio with Gemini 1.5 Pro was my go-to for initial brainstorming and creative exploration. However, I switched to the Gemini API with the Pro model for heavier lifting and more complex tasks. (And hey, if you’re on a budget, experiment with the Flash model for testing and debugging your code first)
  • Cost Optimization: Tokens are money, my friend! Be mindful of how much text you feed Gemini and how many API calls you make. Experiment with different prompt structures and context lengths to balance quality and cost.
  • Error Handling: Let’s be honest, AI isn’t perfect. Sometimes, Gemini throws a curveball or generates something entirely off the mark. Build error handling into your scripts to catch these issues and either regenerate the response or provide more specific instructions.

Quality Control and Iteration

Remember, writing is rewriting! Even with AI assistance, you’ll need to go through multiple rounds of revisions to polish your screenplay. Here are a few tips to make the process smoother:

  • Automated Feedback Loops: Create scripts that automatically check for common issues like pacing, dialogue flow, and character consistency. This helps you catch problems early on and saves you time in the long run.
  • Multiple Perspectives: Use role-based prompting to get feedback from different viewpoints. Ask Gemini to analyze your screenplay as a screenwriter, director, and producer. This can reveal blind spots and highlight areas for improvement.
  • Consistency is Key: As you revise and expand your screenplay, maintain a consistent tone, style, and character voice. Gemini can help you track these elements and ensure your story remains cohesive.
  • Managing Expansion: Adding new scenes or expanding existing ones can be tricky. Use clear prompts and sufficient context to ensure the new material seamlessly integrates with the existing narrative.

By mastering these advanced techniques, you’ll be well on your way to becoming a prompt engineering pro and crafting AI-powered screenplays that truly shine. But remember, the human touch is still essential. Use your creativity, intuition, and storytelling instincts to guide the AI and shape your unique vision.

Results and Future Directions

After all that prompting, coding, and revising, I finally had a finished screenplay! I titled it “Deep/Fake.” Here’s the logline:

“A technophobic detective, haunted by the loss of his wife, unearths a sinister plot where AI-generated deepfakes of deceased loved ones are deployed to blackmail the powerful, forcing him to confront his beliefs as he questions where memory ends, and manipulation begins.”

Noir-ish thriller with a touch of sci-fi? Check. Exploration of grief and technology? Double check. I even got some feedback from Gemini, playing the roles of seasoned screenwriters, directors, and producers.

Here’s the gist of what they said:

  • Strengths: Strong core theme, well-suited tone, believable protagonist.
  • Weaknesses: Pacing issues in the second act, some characters needed more depth, and a few scenes could be more visually impactful.

(You can check out the full screenplay)

Overall, okay for an AI-assisted project! But let’s be honest, it wasn’t all sunshine and roses. Here’s a quick reality check:

  • Cost: Generating the screenplay costs me about $50 for 130 pages using the Gemini 1.5 Pro model. It’s not exactly breaking the bank, but it’s something to consider if you’re on a tight budget.
  • Efficiency: While Gemini sped up certain parts of the process, it still took time to craft effective prompts, manage the code for making the API calls, and review the output. It’s not a magic “write-me-a-screenplay” button!

The Future of AI in Screenwriting

So, is AI the future of filmmaking? Well, it’s shaking things up! Here are some thoughts on where we’re headed:

  • Gemini is Evolving: With new and improved models on the horizon, we can expect even more impressive creative capabilities and potentially lower costs.
  • Automation is Key: Imagine a future where AI can automate even more of the screenwriting process, from generating detailed character backstories to creating shot lists and storyboards. The possibilities are mind-boggling!
  • Beyond Screenplays: This technology isn’t limited to movies. Think novels, plays, and interactive narratives — AI could revolutionize storytelling.

But here’s the thing: AI is a tool, not a replacement for human creativity. It’s about collaboration, pushing boundaries, and exploring new ways to tell stories. So, grab your laptop, fire up Gemini, and see what cinematic magic you can create!

Conclusion

So, what’s the verdict? Can AI help you write a movie script? After this wild ride with Google Gemini, absolutely!

It’s not about replacing human creativity but amplifying it. Think of Gemini as your brainstorming buddy, tireless editor, and virtual film crew all rolled into one. It can help you generate ideas, structure your story, refine your dialogue, and provide feedback from different perspectives.

Sure, there are still some kinks to iron out. Cost can be a factor, and it’s not exactly a “set it and forget it” solution. You must still actively participate in crafting effective prompts and guiding the AI toward your creative vision.

But the potential is undeniable. We’re on the cusp of a storytelling revolution as AI models evolve. Imagine a world where anyone can bring their cinematic dreams to life, regardless of their technical skills or writing experience.

This is just the beginning, folks. You should dive in, experiment with Gemini, and see what amazing stories you can create. Who knows, the next Hollywood blockbuster will be born from an AI-powered collaboration!

Check out my reading list of other Google Gemini articles.

This post was created with the help of AI writing tools, carefully reviewed, and polished by the human author.

--

--

Responses (2)