What if you could produce a 10-minute animated sitcom episode just by typing text into a box? No drawing, no voice acting, no keyframing. Just a script and a button.
Welcome to Flatopia, an open-source animation engine built on Python.
Using the power of Manim (the math animation library) and Streamlit, Flatopia generates fully voiced, 2D animated episodes where geometric shapes argue about life, the universe, and office politics.
This project is open source. That means you can make the next episode. Here is how to use the engine and the “Legend of Colors” to build your own Flatopia story.
How It Works
Flatopia uses a custom script parser. You paste a script into the web interface, and the engine:
- Casts the actors: Generates shapes (Stars, Circles, Squares) based on your config.
- Records the audio: Uses Text-to-Speech (TTS) to generate dialogue for every line.
- Animates the scene: Uses Manim to lip-sync (sort of) and move the characters.
- Compiles the video: Stitches it all into an MP4.
How to Write a Flatopia Script
The engine parses a specific syntax. You can write your script in Notepad or generate it with ChatGPT, then paste it into the Flatopia UI.
1. Configuring Your Cast
At the very top of your script, you define who is in the scene using the [CONFIG] tag.
- Syntax:
[CONFIG: NAME, SHAPE, COLOR] - Available Shapes: SQUARE, CIRCLE, TRIANGLE, STAR, HEXAGON.
- Available Colors: RED, BLUE, GREEN, YELLOW, PURPLE, ORANGE, WHITE.
Example:
Plaintext
[CONFIG: BARRY, SQUARE, RED]
[CONFIG: CARL, STAR, YELLOW]
2. Dialogue
Standard script format applies. The name must be in caps, followed by a colon.
Plaintext
BARRY: I don't think we should eat that.
CARL: But it glows, Barry. Glowing food is the future.
3. Sound Effects (SFX)
Flatopia has a built-in library of sitcom tropes. Put these in brackets on their own line to trigger the audio and a pause in animation.
[LAUGH]– Standard sitcom laughter.[CLAP]– Applause.[BOO]– Disapproval.[CRICKET]– Awkward silence.
4. Setting the Scene (The Legend of Colors)
In Flatopia, the background defines the reality. Because the world is 2D, we don’t use complex images; we use Color Codes.
Use the [SCENE: NAME] tag to instantly change the background.
The Legend of Colors
Scene TagColorContext[SCENE: OFFICE]GreyThe soul-crushing void of corporate life.[SCENE: PARK]Dark GreenNature, or at least a flat approximation of it.[SCENE: FOREST]Deep GreenDeeper nature, where triangles get lost.[SCENE: HOUSE]Light GreyDomestic bliss. (Not white, so eyes remain visible).[SCENE: SKY]Light BlueHigh altitude conversations.[SCENE: HELL]Deep RedFor when things go terribly wrong.[SCENE: SPACE]BlackThe final frontier.[SCENE: VOID]BlackExistential dread.
A Complete Example Script
Want to test it out? Copy and paste this into the Flatopia generator:
Plaintext
[CONFIG: BARRY, HEXAGON, PURPLE]
[CONFIG: CARL, CIRCLE, BLUE]
[SCENE: OFFICE]
BARRY: Carl, why are you round?
CARL: Aerodynamics, Barry. I am built for speed.
[LAUGH][SCENE: PARK]
BARRY: We are in the park now. Look at the green void.
CARL: It is beautiful. I want to roll on it.
[CRICKET][SCENE: HELL]
BARRY: Now we are in the bad place.
CARL: It is surprisingly warm!
[LAUGH]
Running the Code Locally
If you have a decent GPU (or a patient CPU), you can run Flatopia on your own machine.
Prerequisites:
- Python 3.10+
- FFMPEG (Installed and added to PATH)
- Manim Community Edition
Installation:
Bash
pip install streamlit manim pyttsx3
streamlit run app.py
Tips for Feature-Length Episodes
Because Flatopia renders everything locally, a 10-minute episode takes significant computing power.
- RAM is King: You need at least 16GB of RAM to render long episodes without crashing.
- Batching: If you are making a 20-minute special, render it in 5-minute chunks (Scenes) and stitch them together later.
- Pacing: Use the
[SILENCE]tag to let jokes breathe. A script without pauses feels like an auctioneer contest.
Join the Flatopia Project
Flatopia is designed to be forked. Add your own shapes, import your own custom sound effects, or map new colors to the Scene Palette.
The world is flat, but your stories don’t have to be. Happy rendering!
I only ask though that if you upload to YouTUbe please use/create a #Flatopia hashtag. So I can easily see everything people create.
Here is the full code on Github: n https://github.com/damianwgriggs/Flattopia-Show-Maker/tree/main
