Writing a Branching Story



Writing is key aspect of a visual novel--it's kind of the defining feature of the genre. Visual Novels may not be much graphically or gameplay-wise, but what you're ultimately here for is a story you can interact with. But every story has to be written by someone, and there's only a finite amount of content written for any one game.  As a game dev, how do you reconcile the desire to give players freedom with the amount of added work that each new choice represents?

I've written regular, linear novels before, and you can believe me when I say it's quite an undertaking. A storyline needs characters, who all need their own backstories and motivations for being involved in the plot. Then it needs a plot, which has to flow logically from one plot point to another in order to be believable. Stories also have to have a setting, somewhere to take place, and if that's a fantastical setting, then everything in it needs to be decided. Characters then need to have arcs over the course of that plotline too, showing how the experience has caused them to change and grow... it's a lot. But writing a visual novel? You don't just have to do all of that once. You have to do it all dozens of times, and each of them needs to make sense individually and in the context of the greater whole. For example, you might have a character open an orphanage at the end of their own storyline, but that same character can't turn into an axe murderer in a different storyline in the same game (or can they..?). Characterization and the setting need to be consistent across all storylines in a branching narrative, and that's where writing it gets really tricky.

Branches Result From Reacting to Decisions

In approaching Elven Revenue Service, my starting point was to come up with the characters. They're the stars of the show, after all, and in a romance game, that makes them the most important thing. That meant defining their personalities clearly from the get-go. Let's use Sonya's bit from the demo for an example:

Sonya

Sonya was conceived of as "the troublemaker." Whatever caused the player's tax problems was always going to be at least partially her fault. The initial idea was that she'd be a punky ne'er-do-well with lots of criminal connections, but that didn't quite feel right as the story got started. For one, it plays into old, dull tropes about Dark Elf types, and for two, if she's to be romanceable, there has to be a reason for the player to WANT to pursue her. Since she had that role in the story to fill, I still needed her to be outside the law in some way, but it had to be a relatable, understandable way.  Selling a drug-like potion seemed like a great idea: it has legitimate applications, but might still be illegal, the way some are in real life. Instead of deliberately breaking the law, it also felt better if Sonya didn't even know it was illegal. After all, she's an immigrant to the Kingdom, so of course she's not familiar with every law. Suddenly, she was relatable--everyone's made a big mistake before without even knowing it. It also offers the player a choice: they can get mad at her for creating this tax situation, or they can sympathize with her, and start pursuing her path in the story. 

Of course, giving the player a chance to react means that Sonya also gets to react to their decision, and THAT is how you start to branch your narrative out. If you get mad at Sonya, she'll get mad right back. If you keep approaching conversations with her like that, she'll even run away and start to avoid you. If you sympathize, then she'll feel a bit guilty and be more likely to listen to your requests.  It might not seem like a big choice at the time, but how you react to Sonya's confession instantly shapes what paths are available to you. Feel free to try that out for yourself in the demo--if you tell Lilith you'd like to work together on the audit and then yell at Sonya, then visiting her won't be an option afterward, whereas it is if you sympathize with her.


When I'm doing the actual writing, I use a program called Scrivener, which allows you to save scenes in separate documents that are all grouped together, so that you can move whole scenes around, have subscenes under scenes, and so on. This is great for writing a novel, but it's even better for writing a visual novel with a branching story. I can even test out the progression myself by creating hyperlinks to represent the decisions, jumping straight to the scene that corresponds to the choice. I usually only write one "path" at a time. If a decision takes place mid-scene, I might write out both endings of the scene, but then only continue one of them onward to the next scene. Eventually, I'll go back to each branch and continue it, but sticking to one plotline at a time helps to keep the details consistent throughout.

Flags are a Visual Novel's Best Friend

There is one thing that I can't replicate outside a game, however, and it's one of the most unique things Visual Novels (and games in general) have going for them: Event Flags. Using flags, you can set up a decision that isn't consequential at the time, but may come back later. For example, Elven Revenue Service has a hidden "karma" system to it--if you are consistently mean to everyone, your karma goes down. Certain decisions are gated by karma, so paths start to close off if you're too mean, funneling you inevitably towards the bad end.  There are also some bonus scenes which are only available to players with positive karma, often those required for the best ending. Not every decision affects the karma system, nor should they all. You can also use flags to have characters "remember" a previous conversation. If you take Lilith for coffee in the demo, you'll see that in action, as the player is presented with several choices, which disappear as you choose them until it's time to end the scene. Flags can really add to the sense that you're talking to a real person, but because of how they can be used, they don't necessarily slot into a manuscript easily. I usually write these scenes off on their own, or as an extension of another scene that's simply omitted if you don't have the flag. This can also help to vary up people's experiences, as unless you make ALL of the choices exactly the same, it's going to be at least a little different each time.

No dodging Vivi. 

You're also likely to have some scenes which logically must happen regardless--the player's choices shouldn't have an impact on things outside the main character's control, like the weather or the behavior of strangers. These often become critical scenes, since they're in every route, and it's important to weave the story around them. As another example, there's always the issue of the audit in Elven Revenue Service. Vivi is the auditor, so you will HAVE to talk to her at certain points. But even these scenes can differ a bit depending on the route, if you wanted them to. While I can't elaborate (spoilers!), there are scenes where a character may fall ill; the character is still present for scenes where they need to be, but their behavior in those scenes is just slightly different, even though the dialog is mostly the same.  And, if you really want, you can always "butterfly effect" certain events if you really just don't want them on this route. Who knew making that one decision long ago would cause such-and-such customer to go to a different bar that night, skipping their event entirely?

It's no minor undertaking to write a branching story like you'd find in a Visual Novel, but I can say without a doubt that doing it has given me a much greater appreciation for my characters. I've seen what they're like when things go well, and how they react when nothing seems to work out. It makes them feel more real to me, and I hope that's the case for players, too. If as a dev you place your characters first, and have them behave in a logical manner consistent with how they've been portrayed, then your story will branch out just fine. If you want to see how I did it, then please, check out the demo of Elven Revenue Service!

Get Elven Revenue Service

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.