Ren'Py Choices and Branching Story Tutorial: How to Create Multiple Routes

One of the things that makes visual novels so interesting is that players don't always have to follow the exact same story.
Maybe they get to choose what the mc says, decide which character to spend time with, or make decisions that lead to completely different endings.
These are called choices and branching stories and they're a pretty important part of many visual novels.
Luckily, Ren'Py makes it relatively easy to create these kinds of interactions.
In this post, we'll go through how to create dialogue choices, use conditional story branches, build multiple character routes and even create different endings depending on the player's decisions.
If you've been following our previous tutorials, you should already know how to create characters, write dialogue and add images to your scenes.
If not, you can check them out here:
- Ren'Py Tutorial: How to Create Characters and Write Dialogue
- Ren'Py Tutorial: How to Add Backgrounds, Character Sprites and Images
- Ren'Py Tutorial: How to Add Transitions and Character Animations
Let's get started!
1. Creating Your First Dialogue Choices
Let's start with the most basic type of player interaction: dialogue choices.
In Ren'Py, you can create choices using the menu statement.
For example, imagine your mc is talking to a character named Eileen.
We want the player to choose how to respond.
define e = Character("Eileen")
define mc = Character("You")
label start:
e "Hey! Do you want to hang out with me today?"
menu:
"Sure! I'd love to.":
mc "Sure! I'd love to."
"Sorry, maybe another time.":
mc "Sorry, maybe another time."
e "I see! Well, let me know if you change your mind."
returnWhen the game reaches the menu statement, Ren'Py will display two choices on the screen.
The player can select either option, and the corresponding block of dialogue will be executed.
Once that block finishes, the game continues with the next line after the menu.
You can add as many choices as you want:
menu:
"What should I do?"
"Go to the library":
"You decided to spend the afternoon reading."
"Visit the park":
"You decided to take a walk outside."
"Go home":
"You decided to head home."You don't have to limit yourself to two options. Just remember that giving players too many choices at once can sometimes make things a little overwhelming.
2. Making Different Choices Lead to Different Scenes
So far, our choices only change a few lines of dialogue.
But what if we want each choice to lead to a completely different scene?
This is where jump becomes useful.
The jump statement allows you to move the game to another label.
Let's create two different scenes:
define e = Character("Eileen")
define mc = Character("You")
label start:
e "Where would you like to go today?"
menu:
"Go to the park":
jump park_scene
"Visit the library":
jump library_scene
label park_scene:
scene bg park
e "It's really nice outside today!"
mc "I'm glad we came here."
return
label library_scene:
scene bg library
e "I love how quiet it is here."
mc "It's a good place to relax."
returnNow choosing the park takes the player to park_scene, while choosing the library takes them to library_scene.
Each label contains its own dialogue and can even have completely different backgrounds, characters and events.
This is one of the basic building blocks of a branching visual novel.
You can create as many labels as you need and connect them using jump.
One thing worth remembering: jump does not return to the line after the statement. It moves the game directly to the specified label.
That's why we use return at the end of each example route to finish the game.
3. Using Variables to Remember Player Choices
Now let's say we want the game to remember what the player selected.
For example, perhaps the protagonist can spend time with Eileen or Mika, and we want to keep track of which character the player prefers.
For this, we can use variables.
Let's create two variables:
default eileen_points = 0
default mika_points = 0The default statement creates variables with their initial values when the game starts.
Now, let's give the player a choice:
define e = Character("Eileen")
define m = Character("Mika")
default eileen_points = 0
default mika_points = 0
label start:
e "Would you like to go somewhere together?"
menu:
"Spend time with Eileen":
$ eileen_points += 1
jump eileen_scene
"Spend time with Mika":
$ mika_points += 1
jump mika_sceneHere's what's happening:
default eileen_points = 0creates a variable starting at zero.$ eileen_points += 1increases Eileen's points by one.$ mika_points += 1increases Mika's points by one.- The game remembers the updated values as the story progresses.
You can use these variables later to decide which route or ending the player gets.
For example, if the player keeps choosing Eileen's options, her affection points will gradually increase.
This is especially useful for otome games and dating sims where players build relationships with different characters.
We'll explore variables and conditions in more detail in a later tutorial.
4. Creating Conditional Dialogue
Sometimes you don't need to send players to a completely different scene. You might simply want certain dialogue to appear depending on what they've done previously.
This is where if and else statements come in.
Let's use the affection points from the previous example.
default eileen_points = 0
label start:
$ eileen_points += 1
if eileen_points >= 3:
e "You've been spending a lot of time with me lately!"
else:
e "It's nice seeing you again."
returnThe game checks the value of eileen_points.
If the value is three or higher, the first dialogue appears.
Otherwise, Ren'Py displays the alternative dialogue.
You can also create multiple conditions using elif:
if eileen_points >= 5:
e "You're my favorite person!"
elif eileen_points >= 3:
e "I really enjoy spending time with you."
else:
e "It's nice seeing you."Ren'Py checks the conditions from top to bottom and executes the first matching block.
This is useful when you want to create different character reactions based on the player's previous decisions.
For example:
- Low affection: The character acts distant.
- Medium affection: The character becomes friendlier.
- High affection: The character starts showing romantic interest.
You can use the same approach for story flags, unlocked scenes and other gameplay mechanics.
5. Creating Multiple Character Routes
Now let's put these features together and create something that looks more like an actual visual novel.
Imagine we're making an otome game with two romanceable characters: Eileen and Mika.
Depending on the player's choices, they can enter one of two character routes.
First, let's define our characters and variables:
define e = Character("Eileen")
define m = Character("Mika")
define mc = Character("You")
default eileen_points = 0
default mika_points = 0Next, let's create the beginning of the story:
label start:
scene bg classroom
"It was the first day of a new semester."
"I didn't know many people yet, but two students had already caught my attention."
e "Hey! Do you want to sit with me?"
m "Actually, I was going to ask them first."
"Both of them looked at me, waiting for an answer."
menu:
"Sit with Eileen":
$ eileen_points += 1
jump eileen_route
"Sit with Mika":
$ mika_points += 1
jump mika_routeNow we can create the two character routes:
label eileen_route:
scene bg classroom
e "I'm glad you decided to sit with me."
mc "Of course! Why wouldn't I?"
e "Well, I was a little worried you'd choose Mika instead."
"She smiled and moved her chair a little closer."
return
label mika_route:
scene bg classroom
m "So, you chose to sit with me."
mc "Was that a problem?"
m "Not at all. I was actually hoping you would."
"Mika gave me a small smile."
returnNow the game has two completely separate routes.
Of course, this is still a very basic example. In a full visual novel, each route could contain multiple scenes, character events and different endings.
You can also add more choices within each route to make the story even more interactive.
6. Creating Different Endings
A visual novel doesn't necessarily need to have only one ending.
You might want to create a good ending, a normal ending and a bad ending depending on the player's decisions.
Let's use Eileen's affection points as an example.
label eileen_route:
e "I'm really happy we got to spend so much time together."
menu:
"Tell her how you feel":
$ eileen_points += 2
"Change the subject":
$ eileen_points += 0
jump eileen_endingNow let's create a separate label to check the player's points:
label eileen_ending:
if eileen_points >= 3:
jump eileen_good_ending
elif eileen_points >= 1:
jump eileen_normal_ending
else:
jump eileen_bad_endingAnd finally, let's write the endings:
label eileen_good_ending:
scene bg park
e "I think I've fallen in love with you."
mc "I've felt the same way for a long time."
"The two of us smiled as the sun slowly set."
"Good Ending: Together Forever"
return
label eileen_normal_ending:
scene bg classroom
e "I'm glad we became friends."
mc "Me too. I hope we can spend more time together."
"Normal Ending: A New Friendship"
return
label eileen_bad_ending:
scene bg classroom
e "I guess things just didn't work out."
"We slowly drifted apart."
"Bad Ending: Missed Chances"
returnNow the ending depends on the number of affection points the player has collected.
You can use this same system for other characters and routes.
One important thing: make sure your point thresholds actually match the choices available in your game. Otherwise, players might accidentally end up with an ending you didn't intend them to reach.
7. Using Story Flags to Remember Important Decisions
Not every decision needs to be represented by affection points.
Sometimes you simply want the game to remember whether the player made a particular decision.
For example, maybe the protagonist discovered a secret letter earlier in the story.
You can create a Boolean variable for this:
default found_letter = FalseThen update it when the player finds the letter:
label library_scene:
"You noticed a small letter hidden inside a book."
menu:
"Read the letter":
$ found_letter = True
"You carefully unfolded the letter."
"Leave it alone":
"You decided not to touch it."
jump later_sceneLater in the story, you can check whether the player found it:
label later_scene:
if found_letter:
e "Wait... you found that letter?"
"Eileen looked surprised."
else:
e "There's something I haven't told you yet."
returnThis is called a story flag.
It's a simple way to track important events without needing to use a numerical affection system for everything.
You can create flags for things like:
- Whether the player discovered a secret.
- Whether they met a certain character.
- Whether they completed a side event.
- Whether they made a particular promise.
- Whether they unlocked a hidden scene.
As your story gets bigger, story flags can become really useful for managing different narrative possibilities.
8. Using Call and Return for Reusable Scenes
Here's another useful feature that you might not need immediately, but it's worth knowing about.
So far, we've been using jump to move between labels.
However, Ren'Py also has call and return.
The difference is that call temporarily moves the game to another label and remembers where it came from.
When that label reaches return, the game goes back to the original location.
For example:
label start:
"It was a quiet afternoon."
call character_introduction
"After introducing ourselves, we started talking."
return
label character_introduction:
e "By the way, I'm Eileen!"
mc "Nice to meet you."
returnWhen Ren'Py reaches call character_introduction, it runs that label first.
After the second return, the game continues from the next line in start.
This is particularly useful for scenes or interactions you want to reuse in different parts of your game.
For example, you might have a reusable character introduction, a small side event or a common conversation that appears in multiple routes.
Just remember:
jumpmoves to another label without keeping the original return location.callremembers where it came from.returnends the current called section and returns to its caller, or ends the game when there is no active call.
9. Putting Everything Together: A Small Branching Story
Let's put everything we've learned into one example.
We'll create a short story with two characters, player choices, affection points and different endings.
You can copy the following code into your script.rpy file.
define e = Character("Eileen", color="#E8A0BF")
define m = Character("Mika", color="#9DBCE8")
define mc = Character("You")
default eileen_points = 0
default mika_points = 0
label start:
scene bg classroom
"It was the first day of a new semester."
"I was sitting alone when two students approached me."
e "Hey! Is this seat taken?"
m "I was actually going to ask that."
"They both looked at me."
menu:
"Sit with Eileen":
$ eileen_points += 1
jump eileen_route
"Sit with Mika":
$ mika_points += 1
jump mika_route
label eileen_route:
scene bg park
e "I'm glad you chose to spend time with me."
mc "Of course! You're really easy to talk to."
e "Really? That makes me happy."
menu:
"Invite her to hang out again":
$ eileen_points += 2
"Say goodbye":
$ eileen_points += 0
jump eileen_ending
label mika_route:
scene bg classroom
m "So, you decided to sit with me."
mc "I hope that's okay."
m "Of course. I was hoping you'd say yes."
menu:
"Ask about her hobbies":
$ mika_points += 2
"Talk about school":
$ mika_points += 1
jump mika_ending
label eileen_ending:
if eileen_points >= 3:
scene bg park
e "I really enjoy spending time with you."
"Good Ending: A New Beginning"
else:
scene bg classroom
e "It was nice getting to know you."
"Normal Ending: Just Friends"
return
label mika_ending:
if mika_points >= 3:
scene bg classroom
m "I think I'd like to get to know you better."
"Good Ending: Closer Than Before"
else:
scene bg classroom
m "See you around!"
"Normal Ending: First Impressions"
returnThis example is still quite short, but it already contains several important Ren'Py features:
- Dialogue choices using
menu. - Different story paths using
jump. - Affection points using variables.
- Conditional endings using
ifandelse. - Separate labels for each character route.
Try changing the dialogue, adding more choices or introducing another character.
You can also expand the routes with more scenes and additional decisions as your story develops.
What's Next?
We've now covered the basics of creating dialogue choices, branching story paths, character routes, affection points and multiple endings.
This is already enough to start building a simple interactive visual novel!
In the next tutorial, we'll take a closer look at Ren'Py variables and conditions, including how to use Python expressions, story flags, affection systems and more advanced conditional logic.
If you're planning to create an otome game or dating sim, these features will be especially useful once your story starts getting bigger.
Happy developing!
Need Help With Your Visual Novel?
Creating multiple routes and interactive story systems can take quite a bit of planning and scripting.
At YoruBox, we work on indie visual novels and can help with Ren'Py scripting, implementing game mechanics and custom UI design.
Whether you need help setting up a branching story system, creating a custom interface or implementing a specific game feature, feel free to check out our services.

