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

Egglock

Member
Oct 17, 2017
196
110
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.
Pardon me, but I don't quite understand what you mean by this. The dev still needs variables to hold these text. Or are you trying to say the process of transferring that dialogue into the engine without having to setup variables? I'm by no means am a knowledgeable programmer, but don't you need variables to hold that text? How else are you going to display that dialogue?

I might be missing something here, maybe because I don't use Ren'py so I don't know how people are setting up their dialogue. In UE4 reading text is pretty straight forward. One being the form of csv or json file, the other is creating a C++ plugin to read from a .txt file. A bit more cumbersome, but in theory the dev could write their entire dialogue in a text editor and parase the entire dialogue from that.

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.
Maybe there is a better of doing it, but to me that's what I feel most comfortable with. Every person has their own way of doing things. My use of csv files for this particular instances are dialogue, there's nothing fancy happening in my csv files. The first column is for UE4 unique ID, a column for the speakers ID, and the dialogue. I don't really need to have their names in there because I'm the only one working on it, but If there were team members, the few rows at the top would be dev notes letting them know which id is tie to which character, along with other documentation referring to them.

Csv files doesn't have to hold dialogue, one can create character stats, character names, character moods, the list can go on. All I'm saying is my use of csv to UE4 is comfortable for me. I can easily manipulate the data from source and know that my changes are reflected inside UE4 without having to worry about using plug-ins that can be outupdated, have gone legacy or some how breaks with engine updates.

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.
You can, there's nothing to stop you from doing it. Do whatever you feel will make your development process easier.
The question here is what does Markdown offer that isn't already part of Ren'py or Unity? In terms of functionality. If you can do a 1:1 conversion from Markdown to Python and C# go for it, don't let someone stop you.

I only mention that because that's how I see it, I don't use Markdown so what do I know? That was purely based on the few seconds of watching videos and documentations. If you feel that the conversion from Markdown to Python/C# is worth it go for it. If it makes your workflow easier why not?

Now on the other hand, you say you're a programmer who likes to create tools, why not just create one yourself instead of using Markdown? For example, it could be something along the lines of a GUI the user can input their data in, like scene, name, character, image and dialogue. Select what engine they want to export into Python/C# and just parse a code snippet you can copy/paste into those engine?

Why rely on another software when you can create the tools yourself? If I was knowledgeable enough in C++, I would be creating my own tools. Especially Blender to UE4, but I digress.

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.
I don't doubt it's usability. I mean if I get to a point where I need to do web design, I'm sure this will be more convenient than trying to write html. All I'm saying is I personally wouldn't use it as a middleware to the game engines out there. Or write a plug-in for that matter. To me it just seems like unnecessary work and the time spent could be some where else.

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
Ah. Took me a bit to make the connection. Well the thing is, the entire problem can be eliminated if the dev had a well thought out plan. I'm not talking about just the present, but the future. If the dev planned ahead, they wouldn't need to worry about switching over to an engine that can do what they wanted if the previous engine couldn't. It's not rocket science. Like the saying goes, "Failing to plan is planning to fail."

I understand what you're saying. To bridge that transition from Ren'py to Unity/UE4 or any engine if the previous one isn't capable of achieving one's needs, but I strongly believe that there's no need for that if one dedicates themselves to the engine of choice in the first place. There isn't any hidden message behind each engine. It's clear as to what each one does and what they are capable of. If a dev needs to switch to another engine to achieve what they want, that is poor planning on their part.
 

Marzepain

Newbie
May 4, 2019
61
49
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.
I totally agree on making any game being hard work. You have to create a believable world. Not only with words, but also UI, sounds, animation etc. You can't make it completely lifelike, so you have to choose what to put in and what to leave out. Board games are generally great examples of what to leave out and still make it believable.

If you have a detailed understanding of what you want, you can be very efficient with what you do. Those efficiently gains probably outweighs the investment of planning, because games are so much work.

Personally, it hurts to throw stuff away, although rationally I know it would be better to remove it. Especially when it look a lot of time and effort. So to protect myself I analyse and I plan, but some things just can't be predicted.

Maybe the difference between On Discovery Writing vs. Outlining may be of interest here, generally called Planners and Pantsers.
The term “pantsers” is a shortening of the phrase “By the seat of your pants.” Ergo, Pantsers sit down and write or in your case, go ahead and make a game. This makes creating more interesting, but you have to be prepared to chop things from your brainchild or start over.

For instance this article "Two Types of Writers: Plotters and Pantsers"

has under "How to go from Pantser to Plotter" that looks like a simplified form of story-boarding.

This article "Pantser or Planner? What Your Writing Style Says About You"

has J.K. Rowling as an example of a Planner organizing plot points and characters for her epic Harry Potter series.
While it has Stephen King as an example of a Pantser who says stories are like fossils you unearth while doing.
Both are successful, just different.
One could argue that Stephen King is better at writing than J.K. Rowling and thus doesn't need to plan, but as long as you get to your destination, any road is fine.

Generally when people when people get more experienced they tend to plan more, but some things are too complex too plan.
The Cynefin sensemaking Framework can help to make sense what strategy applies.

Question is, in what complexity space VN creation is located, chaotic, complex, complicated or simple?
This may be a bit too meta for all here, but maybe it may help some.
 

Marzepain

Newbie
May 4, 2019
61
49
Ah. Took me a bit to make the connection. Well the thing is, the entire problem can be eliminated if the dev had a well thought out plan. I'm not talking about just the present, but the future. If the dev planned ahead, they wouldn't need to worry about switching over to an engine that can do what they wanted if the previous engine couldn't. It's not rocket science. Like the saying goes, "Failing to plan is planning to fail."

I understand what you're saying. To bridge that transition from Ren'py to Unity/UE4 or any engine if the previous one isn't capable of achieving one's needs, but I strongly believe that there's no need for that if one dedicates themselves to the engine of choice in the first place. There isn't any hidden message behind each engine. It's clear as to what each one does and what they are capable of. If a dev needs to switch to another engine to achieve what they want, that is poor planning on their part.
Yes, having a comprehensive vision and a laid out plan should avoid later stage trouble.

Unfortunately depending on the complexity planning does not always help. The Cynefin framework gives some theoretical underpinnings for this.

When stating, we don't exactly know how complex the game is, how skilled are etc. so we are in the disorder domain and we do what we naturally gravitate to like planning things. In my understanding planning falls under "good practice" matching the complicated domain with "known unknowns" or "best practice" matching the obvious/simple/clear domain if your very experience.
Planning doesn't do you any good if your in the Complex or Chaos domains. A first time game develop is probably in the Chaos domain and is probably best doing act-sense-response or in other words "Try sh*t, test it, fix it".
Writing for (visual) Novel is inherently in the Complex domain with "unknown unknowns" as you don't know how the story will turn out completely. The characters write themselves in a way, because you're tied to the limits what is believable and interesting. The best way to handle this is probe-sense-respond or in other words "conducts experiments that are safe to fail".

I've mentioned in a previous reply Planners and Pantsers types of writers. The Pantsers going at it by the seat of their pants and just let the story develop. They probably run in some trouble, but the solution is doing a (partial) rewrite. With planning writers it's more filling in the blanks and they get much less stuck, but occasionally do, because characters should do believable things according to their character personality and then some plot point may be out of reach, making some rewriting inevitable. I think it's save to save to say that some rewriting is always involved and that the tools we use should support that.

My idea of a screenplay/storyboard is that it's a vehicle for 2 things:
  1. Dialog, being the data/text spoken
  2. Description, being the metadata when something is said identified by the scene and how by the pointers.
    A screenplay's Act/Sequence, Scene, Moment are akin to programming Libary/Modules, Namespaces/Classes, Functions/Methods. They are management of code. They don't actually do anything, but if you mess it up...
  3. Communication
    This one gets overlook, because many her go at game making alone, but it does a lot for a team when there is an outlined goal. When you add some images and make a storyboard out of it, it even easier to get everybody on the same page.
My idea of using some standardized format is that it can be used by multiple engines as a data source for the dialog they want to display. So it should be a well know format that has components for it in many languages, so it can be incorporated in multiple engines.

Markup languages have an added benefit in that they have a 2 modes of operating. A normal view for the consumer and a under the hood view for the writer. This makes it possible to recognize certain aspects of the text automatically without compromising the readability.

The obvious choose would be HTML, as it's everywhere. I would love to hear what you think of it, as it may be better suited to stuff implementation details under the covers, but I think a lightweight markup language is better for writing dialog.

There are actually many lightweight markup languages.

I don't think Markdown is technically the best, but it enjoys broad support.

I found a markdown parser for .NET that might be integratable with Unity and Unreal.

Markdig is a fast, powerful, compliant, extensible Markdown processor for .NET.

I also found a markdown parser for Python that might be integratable with Ren'py and Gamemaker.

Python-Markdown implementation of John Gruber's

Not sure if these would work. The quality of the components is unclear and C# and Python are used as scripting languages. That could mean they are be running in a tightly sealed sandbox. Depends on the engine really.
 

Egglock

Member
Oct 17, 2017
196
110
Planning doesn't do you any good if your in the Complex or Chaos domains. A first time game develop is probably in the Chaos domain and is probably best doing act-sense-response or in other words "Try sh*t, test it, fix it".
Plans will tend to fail when drastic changes are introduced. I don't dispute that, I'm not saying that a plan is the end all be all, but it sets in motion for what is to be expected. In the scope of game development I'll have to disagree, that first time game developers fall into this category. Game engines don't have some secret message or hide what they are capable of. Game developer knows exactly what they are getting by choosing their choice of engine. A story may change, but the functionality of the engine does not, except in the event that something unfortunate happens then would the devs fall into that chaos category. Though maybe I might be giving new dev's too much credit for their intelligence. Maybe there are some who have no clue what they are doing. In that case then yes I would agree with you.

I've mentioned in a previous reply Planners and Pantsers types of writers. The Pantsers going at it by the seat of their pants and just let the story develop.
Writing is sporadic, a story will go through many forms of changes during the course of productions. But the specifications to and what an engine can and can't do will always be constant. The point I'm making here isn't about how one should write, but what one should consider when implementing that writing. If the dev doesn't know how they are going to implement their story then considering a game engine shouldn't even be up for discussion. But I suppose, asking for that is too much isn't it?


The obvious choose would be HTML, as it's everywhere. I would love to hear what you think of it, as it may be better suited to stuff implementation details under the covers, but I think a lightweight markup language is better for writing dialog.
It would, but the problem here is that the devs would have to spend time learning two languages instead of one. Going straight into Ren'py would only require them to know Python thus removing the need to complicated their workflow. On the other hand, if the tool provides enough functionality to the point where they can basically do a 1:1 conversion and compile their project I can see the benefit. Otherwise it's just introducing another variable that isn't needed.
 

Marzepain

Newbie
May 4, 2019
61
49
Translation and Localization are much easier if you have a standardized format.
The RESX files of .Net come to mind. Those are XML files, but behave as a 4 column spreadsheet.
Compiled down to resource files they are very efficient and handled by a ResourceManager object. The ResouceManager reacts to the Culture and Language set in the .Net runtime and pics the corresponding resource or fals back on the language or default language.
They columns of the spreadsheet are name, type, mimetype, value so they are similar to a CSV files.

Translators will generally want to add a Description column, among others. They need to know the situation the text is spoken, because that effects the translation.
Something in screenplay format has loads of indicators around the dialog lines, so a translator would have an easier job.


I have to look into it, but "Fade in" seems like Notepad++ clone with some extra features. I wonder if the format they save in is proprietary or open.
If it's open it could be used to import dialog into a game engine.

If they where ambitious they would save in HTML and then use CSS either make it look like a BCC, Holywood or any other format of screenplay. They would have been able to open it in any browser. They probably would have mentioned it in the video if they where doing that.


I completely agree with this video. Luckily a VN has little need for instructional text and has much more word then 16 a minute. Transitions needing a throwaway line are also relatively rare.

It would be great if VN writers would check if every line says something about the world, the character, the other characters or moves the plot forward. Might make the stories a bit shorter.

What you are actually doing in this video is something between unseeing a CSV file and writing a parser and tokenizer.
Parsing is part of the compiler course at and any higher computer science education and is generally perceived as the hardest course there is, because it's so abstract.
The language he creates is not very expressive, meaning that is has no operators or any other fancy stuff a programming language has, but he can do a little programming in it.

A gripe I have is that he uses comparative programming functions like setBackground(forest) instead of more declarative functional functions like setLocationForest(). The difference is that he tells engine what to do instead of declaring what he wants and having the engine interpret it.
The setLocationForest() function is more logical in line with the story and could do multiple thing to set up the forest like showing image X, play sound Y and highlight UI Z. When time comes to change or embellish the forest, there would only be 1 place to do that instead of checking all the places in the file image X, sound Y and UI Z is used.

If he would develop this further, he would reinvent all the compiler theory himself, although in a concrete/practical, instead of abstract/mathematical way.


The last of us makes me a bit emotional, because the quality of the writing is so good and I'm in awe of the implementation. The amount of work that must have went into this to make it this good is massive. The amount of stuff the redone or trew away is also unheard off. Their publisher must have had deep pockets and unwavering believe in them.

The key takeaway from this video is that games can do everything a movie can and by giving the player control in some situations something extra.
 

Marzepain

Newbie
May 4, 2019
61
49
I like Notepad++, although I use Visual Studio as my main IDE. It doesn't surprise me that it can handle markdown, but I doubt it has the "Fade in" feature of jumping to the correct position when writing text.

I did some searching for screenplay support in Notepad++ and initially found this

A writer asking for Fountain screenplay format support on the Notepad++ forum.

That was 2018 there was no reply, but later I found a Notepad++ Fountain definition.

and this for Libre Office


Turns out the Fountain screenplay format is inspired by Markdown.
Fountain files are UTF-8 text files with the extension.fountain, .txt, or .spmd.

and there is wide support of apps. Among them are Fade in (of your video), Slugline, Amazon Storywriter, Atom, Scrivener, Emacs, vim etc. and even MediaWiki so it could be incorporated in the forum.


Using a Fountain file as a datasource could be on the .Net side for Unity and Unreal

That's actually an F# library but thanks to .Net running on intermediate language it can be used in a C# project too.

For Python there is a fountain reader

witch is based on the objective-C (Apple) version


I do see some trouble for using Fountain for visual novels though.
Fountain seems to have no support for lists, links and code. Although it does have a comment block /* */ to hide text in the output.
Markdown uses numbers for lists like this
1. First item.
2. Second item.
3. Third item.
for anchor link [Link to a heading in the page](#link-to-a-heading-in-the-page)
for images ![Bedroom](./bedroom.jpg)
for inline code quote (`)
and for code blocks ```

Maybe it's possible to incorporated these features in to the Fountain parser or if it conflict in the viewers, invent new keywords for them. It opens the possibility of adding Ink by Inkle features like partial repeat with [ ].

Alternatively Fountain could be converted to HTML using Screenplain

This would enable further editing with added ID's or function call's that would detract from the readability otherwise.
(Just use a source control system like Git of SVN to check in and diff/compare your changes when doing a fresh convert after screenplay changes and undo if things went wrong.)

Then using that HTML file as a datasource in Unity and Unreal by using the HTML Agility Pack (HAP)


or using that HTML file as a datasource for Python

 

Marzepain

Newbie
May 4, 2019
61
49
I created the thread "Game Assets folder structuring approaches and dimension. Introducing the Theatrical approach."
Not completely on topic, but related to the acts and scenes part of this thread. Also having a screenplay for your game is beneficial to set up the Theatrical approach to Game Asset Folder Structure.

The "Story Development" and "Core Knowledge" dimension are created as a direct result of considering the impact of a story on the assets of a game. Core Knowledge is based on Developmental Psychology, but it takes it's names like Characters, Locations and Props from standards in movie and theatre production.

Anyway, keep on writing, keep on gaming, keep on making games!
 

ririmudev

Member
Dec 15, 2018
304
303
Anyway, keep on writing, keep on gaming, keep on making games!
Nice thread bump. I was wondering why I hadn't stopped watching this thread, but then I scrolled up and saw all the good posts here. I'll check out the other one, as I'm a big fan of folder structuring, and I'm interested to see what I'd learn in a context that's outside my comfort zone.
 
  • Like
Reactions: Marzepain

Precox

Newbie
Mar 13, 2019
76
109
Funny I was just coming to this board to look for information on how to write for Ren'py. This has been a good resource for me and helped a lot with how I'm going to do things for my game.
 
  • Like
Reactions: Marzepain