Is it possible to write a VN as a play with acts, scenes and dialog then having it interpreted in an game engine?

Marzepain

Newbie
May 4, 2019
61
49
I stumbled over King Lear by Shakespeare and was intrigued by the simplicity of the format


Using Markdown with some extra rules would setting up the story very easy and make it reusable across multiple engines.
The engine would need additional programming and data to make it into a VN just like a play would need a production to have it interpret.
Doing the story and coding in separate files would make it easier to focus the story.
This in turn would make VN development more efficient because developers would have a more overarching idea where the story would go and witch assets would be needed.
The story would become become an asset onto itself because it would be reusable just like pictures.

I like Markdown for it's simplicity and it has support for (ordered) lists, links, images and code blocks.
The code blocks and images aren't need if the file only contains the story of the game and would possibly thigh it to an implementation like gif's and javascript.
Some flow of control may be convenient though like showLocation("Bedroom") and setHealthMax()
And some may be essential for understanding the flow of the play being able to set a triggers on a scene and guard conditions on certain choices represented by list items.
I would also like to have some support for play commands for characters like Enter, Exit, Exeunt, beat, asside, stage right, stage left, etc and strike for props .

There are very many viewers for Markdown out there and I have found some interpreters for Python and C#, but could not find a VN engine that has something like this.
Has anybody seen the play format being used in a game engine or even being used to sketch out a game?
Does writing a story for a VN this way as completely impractical and if so why?
Or do you think such a simple format could be use full?
 

Perverteer

Peddler of Unspeakable Goods
Game Developer
Nov 19, 2017
515
2,970
I do it for my current game, Tales From The Unending Void, using a modified version of the BBC Radio Play format in Scrivener. After writing an episode I transfer all the content to Ren'Py, my VN engine of choice, by hand.
Before, developing Sisterly Lust, I just wrote the story as a Ren'Py script directly, but it's easy to lose your sense of structure doing it like that. The new method means more work, but it's worth it, makes for a more structured narrative and better code organization in the engine.
 

Marzepain

Newbie
May 4, 2019
61
49
I do it for my current game, Tales From The Unending Void, using a modified version of the BBC Radio Play format in Scrivener. After writing an episode I transfer all the content to Ren'Py, my VN engine of choice, by hand.
Before, developing Sisterly Lust, I just wrote the story as a Ren'Py script directly, but it's easy to lose your sense of structure doing it like that. The new method means more work, but it's worth it, makes for a more structured narrative and better code organization in the engine.
Thanks for mentioning the Radio Play format and Scrivener they seem promising. This links are the correct ones is it not?




Scrivener seems to have some pro features for writers. I currently manage my games in MS OneNote. The extra features of Scrivener either seem trivial or overkill on first glance. I'm not a professional writer so I can't possibly know. Maybe I'll give it a go, just to find out.

The BBC Radio Play format seems to have done away with Acts and replaced it with Sequence. I wonder why that is?
The splitting of pages would not be relevant for a text file on a computer, but understandable when actor are holding print pages in there hands. I like the pointers (BEAT) (PAUSE) (OFF) (V.O.) (D) (LOW) (CLOSE) END. They seem to be voice specific and quite logical for radio. It may be wort our while to develop a pointer vocabulary specific for VN's. After all, the BBC has a swat off specialized formats even once for sub genres like Drama and Sitcom derived for the standard Screenplay. The Sitcom format mentions the (SMILES) pointer, probably because emotions for a Sitcom are important. Having emotional pointers in the text does liven it up, but it opens up a can of worms for a game engine interpreter. For a game engine interpreter having a character names/id's on a separate line is easier to parse than the one before a line. As for pointers in the text, just like an actor, the engine would have to know how to interpret those, so that implies some extra coding in some pluming file.

Pointers in the text don't seem to take away focus from what is being said, but all kinds of programming variables etc do. That why I'm NOT going for Ink by Inkle of 80 Days fame. (TIME Magazine Game of the Year 2014, winner of IGF for Excellence in Narrative 2015, four BAFTA nominations in 2015)

AdvX 2018 - Jon Ingold - Sparkling Dialogue: A Masterclass


It's very powerfull, and there are some thing I would like to have like conditions and smart replies with [ angle brackets ], but variables and math should not be in there.

Looking at the example scripts it just ends up looking like a mess.

Production code is always a bit messy, but as far as I'm concerned the story should not be cluttered by it.


Looking at the description of Tales From The Unending Void, for the part of "sinister plans machinated by powerful intrigants" a sense of structure seems essential. Your new method may even turn out as less work, because you have less wasted effort.

On another note do you use Storyboarding as an intermediate step from going from story to game?
You seem quite advanced and the wiki mentions better planning as one of the benefits, but if your development stage isn't expensive you might skip the whole step.

The distinction between type of events in your game may make easier to change, rearange and be creative.
 
Last edited:

Perverteer

Peddler of Unspeakable Goods
Game Developer
Nov 19, 2017
515
2,970
Thanks for mentioning the Radio Play format and Scrivener they seem promising. This links are the correct ones is it not?




Scrivener seems to have some pro features for writers. I currently manage my games in MS OneNote. The extra features of Scrivener either seem trivial or overkill on first glance. I'm not a professional writer so I can't possibly know. Maybe I'll give it a go, just to find out.
I don't use half of Scrivener's features either, but it's really good writing software. The distraction-free mode is nice, the various templates and the fact that it syncs via Dropbox to several devices. I use the iPad app for writing when I'm on the go, from time to time.


Looking at the description of Tales From The Unending Void, for the part of "sinister plans machinated by powerful intrigants" a sense of structure seems essential. Your new method may even turn out as less work, because you have less wasted effort.

On another note do you use Storyboarding as an intermediate step from going from story to game?
You seem quite advanced and the wiki mentions better planning as one of the benefits, but if your development stage isn't expensive you might skip the whole step.

The distinction between type of events in your game may make easier to change, rearange and be creative.
I don't storyboard to be honest. Most of the visuals I have in my head or they come into being when I work in DAZ on a general idea of the setting and scenes I want.
 

Egglock

Member
Oct 17, 2017
196
110
To answer your topic, absolutely. At some point during the development phase, any heavy dialogue has some sort of screenplay written. Is it setup like the link you mention probably not, considering there's so many different ways one can accomplish this.

In my case, I do a lot of my dialogue in spreadsheets. Reason being is it's easily transferable over to UE4 as a csv file. I can parse those data as I need at any given time, and if I need to make changes, those changes imports easily over to UE4 and vice versa. As for action sequences or events that happen, I use Libra Office flow chart features to map out what happens in the scenes. Mapping out general ideas that come to mind goes down on text editors, in this case Notepad++.

Has anybody seen the play format being used in a game engine or even being used to sketch out a game?
What do you mean exactly? Most vn if broken down to it's basic form is just screenplay. Obviously as the readers we don't see this because it's formatted in a way that looks more appealing. But if you remove all the visuals, you basically end up with a screenplay.

Does writing a story for a VN this way as completely impractical and if so why?
Are you asking if using Markdown as a middleware? If so I'd say it's impractical. Reason being is the amount of work needed to import export, if changes are needed. Not only does the dev need to find plug-ins or make one themselves which slows down development process. Now if they're creating an html game I can see Markdown as a viable tool, considering it seems to cater to that area.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,583
2,225
I'm not aware of any sort of tool to automatically convert the script format above into a VN engine format.

As someone who focuses on RenPy, I do see ways I could write things in that script style and then automate a lot of the drudge work.

It it were me, doing this for RenPy...
  • I'd export the whole script into a simple text file (to remove all formatting).
  • It'd import that text file into a spreadsheet (Microsoft Excel or Google's Sheets).
  • I'd create a list of my character's names and their "VN" identifer (King Lear = "kl" for example).
  • For lines that start with the word "SCENE", I'd populate cell #1 with the word "scene" and leave cell #2 blank.
  • For lines that start with the word "Enter" or "ACT", I'd leave cell #1 blank and cell #2 with the whole line within double quotes.
  • I'd compare the first and first+second words of each sentence, using my list of characters as a lookup
    • For matches, I'd populate 2 cells. Cell #1 = VN identifer, cell #2 = rest of line, within double quotes.
    • For mismatches, I'd populate cell #1 with cell #1 from the line above and cell #2 with the whole sentence in double quotes.
  • I'd then concatenate 4 spaces to the cell#1 and cell#2 for each line and then export/cut-and-paste the combined cells as a new text file.
It wouldn't be perfect, but I'd end up with something like:

Python:
    "ACT I"
    scene
    "Enter KENT, GLOUCESTER, and EDMUND"
    k "I thought the king had more affected the Duke of"
    k "Albany than Cornwall."
    g "It did always seem so to us: but now, in the"
    g "division of the kingdom, it appears not which of"
    g "the dukes he values most; for equalities are so"
    g "weighed, that curiosity in neither can make choice"
    g "of either's moiety."
    k "Is not this your son, my lord?"
    g "His breeding, sir, hath been at my charge: I have"
    g "so often blushed to acknowledge him, that now I am"
    g "brazed to it."
    k "I cannot conceive you."
You could improve the matches/mismatches by making the checks case sensitive.

I might even do a second pass to add a blank line in front of any line which only contains the word "scene" to make things a little more readable.

I'm sure it wouldn't take much extra effort to say that instead of copying the name from the line above, merge the current text into the text from the line above instead (or nearest non-blank line above). Which would improve things to look like:

Python:
    "ACT I"

    scene
    "Enter KENT, GLOUCESTER, and EDMUND"
    k "I thought the king had more affected the Duke of Albany than Cornwall."
    g "It did always seem so to us: but now, in the division of the kingdom, it appears not which of the dukes he values most; for equalities are so weighed, that curiosity in neither can make choice of either's moiety."
    k "Is not this your son, my lord?"
    g "His breeding, sir, hath been at my charge: I have so often blushed to acknowledge him, that now I am brazed to it."
    k "I cannot conceive you."
Which is almost working RenPy code.

Beyond that, it would be a case of manually adding the name of an image to your incomplete scene statements, deciding what you want to do about lines like "Enter KENT, GLOUCESTER, and EDMUND" and "ACT I" and cleaning up any sentences that have been converted wrongly (imagine lines where one character starts their dialogue with the name of another character and you haven't been doing case sensitive checks or a character says something like "Enter Kent....." or the dialogue already contains double quotes).

... then a whole lot of further checking and proof reading.

Which I'd still think of as being easier than reformatting 5,000+ lines of text to add indentation, a character identifier, double quotes and merge lines together manually.

I suggest MSExcel and Google Sheets, since both are relatively accessible and lots of people already have some skills writing spreadsheet formulas.

I don't see a way that you could fully automate things without some very specialized middleware or middleware style plugins. Without that complete faith in the conversion process, you're still left with a lot of checks. Not least, because scripts don't have image files - so some manual efforts seem to me to always be required.
 
Last edited:

Marzepain

Newbie
May 4, 2019
61
49
What a great resource. Thanks a million.
Story-boarding is a bit of an unexplored dimension for me and this helps a lot.

The price of some of the tools are a bit steep, but that's to be expected from pro tools. Some like Moviestorm/FirstStage and FrameForge advertise being able to create a VN by twiddling some sliders. I doubt that those have the full range of possibilities that 3D tools have. I think designing a set with a lighting plan and dolly camera movement, or even doing an animatic, is better left to the 3D tool too.

Having build in characters, props and backgrounds, Power Production Software and Storyboard Composer have, might make a script more clear to what is intended. Using build in props might actually lead people into believing it's the finished product. In my professional live I've seen this happen with WPF and HTML projects. The solution for it was using a squiggly lines temple for the mock-ups. I think the shade characters solve it in the same way making it clear what is wanted, but leaving it open for interpretation.

The video from Indy Mogul at the bottom is also quite helpful for the basics of story-boarding. I think I can do that with my trusty Wacom Bamboo or scrible on paper and scan, then add the images to the scenes in the script. A shot list, although easy to write, does not jell with a script. A shot list reminds me of a work breakdown structure (WBS) in PRINCE2 witch is project engagement and I'm more interested in the creative aspect.

On the technical side Markdown has the ability to incorporate images.

Although it's support is disputed

The game engine interpreter can ignore the storyboard images, but it would make the story more clear for human readers, while still retaining dialog changes immediately being show in the game dialog.

Scripts are generally divide up into ACT's/SEQUENCE's containing SCENE's. A scene in a play is actually a location as well as length of time. If the scene is in the bedroom I can link to the bedroom image in the asset directory.
Moments are only length's of time in scripts. They are less used, but adding MOMENT's to a SCENE with every moment having a scribbled image of a frame would make it close to a storyboard, don't you think?
 

polywog

Forum Fanatic
May 19, 2017
4,062
6,264
What a great resource. Thanks a million.
Story-boarding is a bit of an unexplored dimension for me and this helps a lot.

The price of some of the tools are a bit steep, but that's to be expected from pro tools. Some like Moviestorm/FirstStage and FrameForge advertise being able to create a VN by twiddling some sliders. I doubt that those have the full range of possibilities that 3D tools have. I think designing a set with a lighting plan and dolly camera movement, or even doing an animatic, is better left to the 3D tool too.

Having build in characters, props and backgrounds, Power Production Software and Storyboard Composer have, might make a script more clear to what is intended. Using build in props might actually lead people into believing it's the finished product. In my professional live I've seen this happen with WPF and HTML projects. The solution for it was using a squiggly lines temple for the mock-ups. I think the shade characters solve it in the same way making it clear what is wanted, but leaving it open for interpretation.

The video from Indy Mogul at the bottom is also quite helpful for the basics of story-boarding. I think I can do that with my trusty Wacom Bamboo or scrible on paper and scan, then add the images to the scenes in the script. A shot list, although easy to write, does not jell with a script. A shot list reminds me of a work breakdown structure (WBS) in PRINCE2 witch is project engagement and I'm more interested in the creative aspect.

On the technical side Markdown has the ability to incorporate images.

Although it's support is disputed

The game engine interpreter can ignore the storyboard images, but it would make the story more clear for human readers, while still retaining dialog changes immediately being show in the game dialog.

Scripts are generally divide up into ACT's/SEQUENCE's containing SCENE's. A scene in a play is actually a location as well as length of time. If the scene is in the bedroom I can link to the bedroom image in the asset directory.
Moments are only length's of time in scripts. They are less used, but adding MOMENT's to a SCENE with every moment having a scribbled image of a frame would make it close to a storyboard, don't you think?
 
  • Like
Reactions: Marzepain

Marzepain

Newbie
May 4, 2019
61
49
>>>Has anybody seen the play format being used in a game engine or even being used to sketch out a game?

What do you mean exactly? Most vn if broken down to it's basic form is just screenplay. Obviously as the readers we don't see this because it's formatted in a way that looks more appealing. But if you remove all the visuals, you basically end up with a screenplay.
I totally agree a VN is a screenplay. I was wondering if people where using a format focused on the dialog, instead of game script that is garbled together with all sorts of variables etc. Apparently you do as you have created your own process going from pre production spreadsheets, flow charts and notes, then moving dialog to production automatically. I just wonder how much overview those spreadsheets give. Working with CSV file is ok as a transport medium, but doesn't make for pleasant reading. I guess the spreadsheets could work if you add seperate columns that are in the screenplay format like scene id, Character id, location, dialog, extensions, transitions, shots, props etc. I'm thinking of a very wide spreadsheet her, but I might be complete wrong if you don't need all those extra pointers.

>>>Does writing a story for a VN this way as completely impractical and if so why?

Are you asking if using Markdown as a middleware? If so I'd say it's impractical. Reason being is the amount of work needed to import export, if changes are needed. Not only does the dev need to find plug-ins or make one themselves which slows down development process. Now if they're creating an html game I can see Markdown as a viable tool, considering it seems to cater to that area.
Interesting point you are making here. The need to integrate a Markdown component into renpy pyton or Unity C# might be a lot of work, so that's why I'm asking. A happen to be one of those programmers who likes to create tooling. I can spend huge amounts of time, so I can be a little more lazy later ...uh, efficient ;) Although, it is kind of a bummer if it's unusable.

As of Markdown for Html, that is absolutely a match, but it could be used for other things too. It's very popular in the programmer community for documentation. So much so that it has it's own github flavor. It also has critique and standardization is a problem.

Markdown may be ambiguous and thus hard to parse. At the same time it all these features like tables etc. that are very rally found in a VN. What I really like is that it is a standard, so multiple game engines could use the same text as a data source.

Ideally I like to be able to switch game engines and not having to adapt the screenplay to that new engine. It's been ages ago when text has been standardized with ASCI and Unicode, so that should be possible.
I think switching engine should be done more often, because I see advanced VN's in renpy sprawling multiple versions of the same shot only differing in the clothes a person wears, or the state she's in like pregnant or hurt or depending on the player having drank a giant growth potion. When a game gets to that state it should be an option to move it to a full 3D engine like Unity or Unreal, because those are better at handling variety. Just imagine what the install would be if World of Warcraft had to pretender every character with all the gear available.
 

Marzepain

Newbie
May 4, 2019
61
49
I'm not aware of any sort of tool to automatically convert the script format above into a VN engine format.

As someone who focuses on RenPy, I do see ways I could write things in that script style and then automate a lot of the drudge work.

// snip

Which is almost working RenPy code.

Beyond that, it would be a case of manually adding the name of an image to your incomplete scene statements, deciding what you want to do about lines like "Enter KENT, GLOUCESTER, and EDMUND" and "ACT I" and cleaning up any sentences that have been converted wrongly (imagine lines where one character starts their dialogue with the name of another character and you haven't been doing case sensitive checks or a character says something like "Enter Kent....." or the dialogue already contains double quotes).

... then a whole lot of further checking and proof reading.

Which I'd still think of as being easier than reformatting 5,000+ lines of text to add indentation, a character identifier, double quotes and merge lines together manually.

I suggest MSExcel and Google Sheets, since both are relatively accessible and lots of people already have some skills writing spreadsheet formulas.

I don't see a way that you could fully automate things without some very specialized middleware or middleware style plugins. Without that complete faith in the conversion process, you're still left with a lot of checks. Not least, because scripts don't have image files - so some manual efforts seem to me to always be required.
I was thinking about creating some specialized middleware or middleware style plugins, but your "Which is almost working RenPy code." makes me doubt that it's worth it. Is renpy really that simple? Python has been on my todo list for about 20 years and has been growing massively, but I'm a bit skeptical. I've been with .Net C# from the beginning and have strayed into T-SQL, Powershell and Javascript/Typescript among others. Maybe it's time for this old dog to learn a new trick?

I'm well aware that there will be some manual effort to go from screenplay/storyboard to production game. As I see it the screenplay is a data source for the game specifically for dialog and some pointers. The game game would have to add lots of missing pieces to make it something playable, but the text stands as the base the rest springs from.

You're point of checking and proofreading is interesting as making a mistake in the screenplay is easy, but may not show up until the end of the game. Using a separate formatted file makes it possible to make more mistakes, because the syntax may be wrong and thus wrongly read.
A checking/linting tool may help with syntax errors, but I doubt that would be helpful. A reporting tool showing warnings like "character 25 only has 1 line" may help if the character 25 should have been character 2.
 

ririmudev

Member
Dec 15, 2018
304
303
It is written: thou who wonders it doable, is to seek out spare parchment. And upon that parchment, he shall scribe a P.O.C in the language of his choice (other than php - so says the gods). And that P.O.C. shall answer the questions.

But be wary, for it is known that the fickle P.O.C. may ask more questions than it answers...
 

Marzepain

Newbie
May 4, 2019
61
49
I like the history of Disney. It makes a ton of sense to do a storyboard for a hand animated movie since it's a ton of work.

Nice breakdown of an asset creation process. That it clearly states that pre-production and production are to very different states with different goals and different behaviors is enlightening. There is some overlap with "normal" software development, but the accents are different.

Great info on the screenplay format that's used in Hollywood. It has loads of pointers to make thinks more clear. It seems a bit ambiguous at times and that may make it hard to parse with software. It of course meant to be interpreted by humans and they can interpret plenty, especially actors.
 

Marzepain

Newbie
May 4, 2019
61
49
It is written: thou who wonders it doable, is to seek out spare parchment. And upon that parchment, he shall scribe a P.O.C in the language of his choice (other than php - so says the gods). And that P.O.C. shall answer the questions.

But be wary, for it is known that the fickle P.O.C. may ask more questions than it answers...
True words. I recently ended a project where after 2 years we knew the questions we should have asked when creating the P.O.C. Did land us an investor, so it kind of did the job. Just would have like some more technical resolution, possibly avoiding barking up the wrong three for a long time.

As for raising questions, your never too old to learn. It does however need to go from the study phase to production to be useful.
 

Marzepain

Newbie
May 4, 2019
61
49
You have a point that translation agencies/localizers always have used generic formats to shovel text around. That is almost the same problem I'm trying to address. I want something that is well readable so it's a format that lets you be creative like with a screenplay. Also I prefer interpretation instead of translation. Making it possible to instantly view changes in the output, instead of having to run a translator.

The .Resx resources files with are 4 column spreadsheets does come to mind. Some localizers needed to add extra columns and couldn't because Visual Studio didn't approve and sniped it off. Localizing gets more then translating when dealing with Chinese, Japanese and Arabic. Makes you look very differently at menu's and windows.

Technically a Markdown screenplay could be translated and still work if the Id's and the keywords for pointers didn't changed.
 

Perverteer

Peddler of Unspeakable Goods
Game Developer
Nov 19, 2017
515
2,970
I was thinking about creating some specialized middleware or middleware style plugins, but your "Which is almost working RenPy code." makes me doubt that it's worth it. Is renpy really that simple? Python has been on my todo list for about 20 years and has been growing massively, but I'm a bit skeptical. I've been with .Net C# from the beginning and have strayed into T-SQL, Powershell and Javascript/Typescript among others. Maybe it's time for this old dog to learn a new trick?
Yes, it's that simple, it's even easier to pick up if you have some prior knowledge of programming languages.

Ren'Py's syntax is pretty simple, but if you want to do some more complex stuff (like creating an inventory or a character levelling system) you'll have to dive into the documentation and probably write some plain Python too. Ren'Py offers a lot of basic and robus features (saving, loading, rollback), which are tried and tested. For a Visual Novel it's the obvious choice.

As for a basic script in Ren'Py, this would be an example:

Python:
# Define two characters

define player = Character("Max", color="#ffffff")
define npc = Character("Landlady", color="#ff0000")

# My awesome visual novel/literary jewel
label start:
    scene landlady_naked with dissolve
    player "My landlady is trying on a new bra in the vaguely familiar clothing store."
    npc "Are you looking at my breasts, Max?"
    
    menu:
        "Yes":
            player "Yes, they're so juicy."
            
            scene landlady_naked_smile with dissolve
            npc "Let's have sex."
            player "Okay"
            
            jump landlady_sex
        "No":
            player "No, something got caught in my eye."
            
            scene landlady_naked_sad with dissolve
            npc "I'm very lonely."
            
            jump go_home
            
label landlady_sex:
    scene landlady_fuck with dissolve
    player "(Outstanding! I'm fucking my landlady with my very big penis!)"
    npc "Yes, Max, fuck me hard with your very large and erect male appendage!"
    
label go_home:
    scene landlady_home with dissolve
    npc "That was fun."
    player "Yes."
The scene statements refer to images (like landlady_naked.jpg and landlady_home.jpg). Jumping or calling labels allows you to branch your narrative.
 

Deleted member 167032

Alternate Existence
Donor
Game Developer
Aug 16, 2017
2,719
4,933
Making a VN or any game really is hard work.

If i can simplify it without having to do extra work every update then that works. Im not lazy, just do not have the time.
There's been a few discussions regarding how we devs make our VN's. Each have their method.

Honestly above what you guys are talking about seems like a lot of extra work that to me would not benefit anything but serve up extra time I do not have. If it works for you then do it for sure.

and Perverteer i like this dialogue part...

"Yes":
player "Yes, they're so juicy."

scene landlady_naked_smile with dissolve
npc "Let's have sex."
player "Okay"