There are two main styles of presentation used for visual novels. ADV-style games present dialogue and narration one line at a time, generally in a window at the bottom of the screen. NVL-style games present multiple lines on the screen at a time, in a window that takes up the entire screen.
In this tutorial, we will explain how to make an NVL-mode game using Ren'Py. This tutorial assumes that you are already familiar with the basics of Ren'Py, as explained in the Quickstart manual.
NVL-mode can be added to a Ren'Py script in two steps. The first is to declare the characters to use NVL-mode, and the second is to add nvl clear statements at the end of each page.
Characters can be declared to use NVL-mode by adding a kind=nvl parameter to each of the Character declarations. For example, if we the character declarations from the Quickstart manual are:
define s = Character('Sylvie', color="#c8ffc8")
define m = Character('Me', color="#c8c8ff")
Changed to use NVL-mode, those declarations become:
define s = Character('Sylvie', kind=nvl, color="#c8ffc8")
define m = Character('Me', kind=nvl, color="#c8c8ff")
define narrator = Character(None, kind=nvl)
Note that we have also added an NVL-mode declaration of narrator. The narrator character is used to speak lines that do not have another character name associated with it.
If we ran the game like this, the first few lines would display normally, but after a while, lines would begin displaying below the bottom of the screen. To break the script into pages, include an nvl clear statement after each page.
The following is an example script with pagination:
label start:
"I'll ask her..."
m "Um... will you..."
m "Will you be my artist for a visual novel?"
nvl clear
"Silence."
"She is shocked, and then..."
s "Sure, but what is a \"visual novel?\""
nvl clear
While nvl-mode games generally have more text per paragraph, this example demonstrates a basic NVL-mode script. (Suitable for use in a kinetic novel that does not have transitions.)
The NVL-mode window can be controlled with the standard window show and window hide statements. To enable this, add the following code to your game:
init python:
config.empty_window = nvl_show_core
config.window_hide_transition = dissolve
config.window_show_transition = dissolve
Setting config.empty_window to nvl_show_core will cause the NVL-mode window to be displayed during a transition. (The last two lines select the default transitions to be used for showing and hiding the window.)
An example of using the window commands to show and hide the window is:
label meadow:
nvl clear
window hide
scene bg meadow
with fade
window show
"We reached the meadows just outside our hometown. Autumn was so
beautiful here."
"When we were children, we often played here."
m "Hey... ummm..."
window hide
show sylvie smile
with dissolve
window show
"She turned to me and smiled."
"I'll ask her..."
m "Ummm... will you..."
m "Will you be my artist for a visual novel?"
NVL-mode characters can be customized to have several looks, hopefully allowing you to pick the one that is most appropriate to the game you are creating.
The default look has a character's name to the left, and dialogue indented to the right of the name. The color of the name is controlled by the ''color'' parameter.
define s = Character('Sylvie', kind=nvl, color="#c8ffc8")
A second look has the character's name embedded in with the text. Dialogue spoken by the character is enclosed in quotes. Note that here, the character's name is placed in the ''what_prefix'' parameter, along with the open quote. (The close quote is placed in the ''what_suffix'' parameter.)
define s = Character(None, kind=nvl, what_prefix="Sylvie: \"",
what_suffix="\"")
A third look dispenses with the character name entirely, while putting the dialogue in quotes.
define s = Character(None, kind=nvl, what_prefix="\"", what_suffix="\"")
Since the third look might make it hard to distinguish who's speaking, we can tint the dialogue using the ''what_color'' parameter.
define s = Character(None, kind=nvl, what_prefix="\"", what_suffix="\"",
what_color="#c8ffc8")
Of course, a completely uncustomized NVL-mode character can be used, if you want to take total control of what is shown. (This is often used for the narrator.)
define s = Character(None, kind=nvl)
The following config variables control nvl-related functionality.
The layer the nvl screens are shown on.
If not None, this is the click-to-continue indicator that is used for NVL mode characters that are at the end of a page. (That is, immediately followed by an nvl clear statement.) This replaces the ctc parameter of Character().
If not None, this is the click-to-continue indicator position that is used for NVL mode characters that are at the end of a page. (That is, immediately followed by an nvl clear statement.) This replaces the ctc_position parameter of Character().
If true, NVL-mode rollback will occur a full page at a time.
There are a few styles that control the NVL window; here's some code showing how to customize them. See Styles for more information about styles.
init python:
# Set the background of the NVL window; this image should be the
# same size as the screen.
style.nvl_window.background = "nvl_window.png"
# Add some additional padding around the contents of the NVL window.
# This keeps the text inside the borders of our image.
style.nvl_window.xpadding = 55
style.nvl_window.ypadding = 55
# Set the spacing between each block of text on the page.
# The default is 10 pixels.
style.nvl_vbox.box_spacing = 10
You can also completely customize the screen used to display NVL text, which is named nvl; see NVL.
Paged rollback causes Ren'Py to rollback one NVL-mode page at a time, rather than one block of text at a time. It can be enabled by including the following code in your script.
init python:
config.nvl_paged_rollback = True