VNS (Visual Novel Script), a universal scripting language for creating scripts for visual novel games.
Project description
Visual Novel Script
Visual Novel Script, short for VNS, is a universal scripting language created with the goal of creating a language that allows visual novel developers to write once and compile everywhere, across different platforms, game libraries, and programming languages.
VNS provides a number of features that make it easy to create visual novels, such as:
- A simple and easy-to-learn syntax
- Support for branching dialogue and choices
- Support for music and sound effects
Unlike Ren'py, writing visual novel script is more like writing a story instead of a program, and the developers also have the choice to create their own implementation.
How it started:
The development of the VNS can be traced all the way back to the initial stages of Linpg's development. During this period, the team faced the challenge of finding an efficient method to store the dialogue. Each conversation required the storage of multiple variables, including the narrator, the actual dialogue content, associated character images, ambient background music, and various other components:
Ultimately, the team opted for a design inspired by doubly linked list, but implemented using dictionary (HashMap for Java forks). This approach not only facilitated easier access to the data but also streamlined the saving process, enabling compatibility with formats like JSON or YAML. This method preserved readability while efficiently managing the dialogue. Today, the current system closely resembles our initial design, with only a few subtle refinements:
compiledAt: ...
dialogs:
dialog1:
head:
background_image: bg1.jpg
background_music: bgm1.mp3
character_images:
- alice.png
contents:
- Hello
narrator: Alice
next:
target: ~01
type: default
previous: null
~01:
background_image: bg1.jpg
background_music: bgm1.mp3
character_images:
- alice.png
contents:
- Can you hear me?
narrator: Alice
next:
target: ~02
type: default
previous: head
~02:
...
dialog2:
...
...
id: 1
language: English
Although the overall data is easy to read, it is somewhat inconvenient to write. We came up with a dedicated dialogue editor to resolve the issue, but it's still a bit of a hassle. That is the reason why we begin to inquire about the possibility of simplifying the process.
Would it be possible to make it feel like we're writing the dialogue in a Microsoft Word document? Thus, VNS is born.
Tutorials:
VNS are written in a plain text file with the .vns
extension. The script file contains a series of tags, which are used to specify the different elements of the visual novel, such as the characters, backgrounds, dialogue, music, and so on.
Tags with value
[tag]value
The [tag]
represents the kind of value you are trying to represent, and the value is, well, the value.
ID:
[id]str
, ex: [id]1
Specifies a (unique) ID for the current dialogue file. Every script file must have an ID.
Language:
[language]str
, ex: [language]English
Specifies the language of the current dialogue. Every script file must specifies a language.
Section:
[section]str
, ex: [section]dialog_example
Specifies the section of all the following dialogues.
Background image:
[bgi]str
, ex: [bgi]bg1.png
Specifies the background image for the current and following dialogues.
Background music:
[bgm]str
, ex: [bgm]bgm1.ogg
Specifies the background music for the current and following dialogues.
Display character(s)
[display]*str
, ex: [display]character1.png character2.png
Displays the character(s) for the current and following dialogues.
Hide character(s)
[hide]*str
, ex: [hide]character1.png character2.png
or [hide]*
for hiding all.
Hides the character(s) for the current and following dialogues.
New scene
[scene]str
, ex: [scene]bg2.png
Enters a new scene and displays the specified background image.
Option(s)
[option]message->label
, ex: [scene]Can you hear me?->yes_reply
Adding option(s) to current dialogues, and branch to the specified label according to the option chosen by the player.
Label
[label]str
, ex: [label]jump_point1
Creates a label for the branch command. The value will be used as the key for the subsequent conversation.
Tags without value
End
[end]
Marks the end of the script.
Block
[block]
The player can't go back to the previous conversation.
Comments:
# this is a comment
Commenting the script to make it easier to understand.
Notes:
// this is a note
Notes are very similar to comments. It's used to make a note for a specific conversation and is saved to the file that is compiled.
Dialogue:
Conversations are written in the form of this:
Character name:
- Dialogue text
- More dialogue text
The character name is followed by a colon and then one or more lines of dialogue text. Each line of dialogue text must start with a hyphen and a space.
Example:
Here is a simple example of a VNS script:
[id]1
[language]English
[section]dialog_example
[bgi]bg1.png
[display]character1.png character2.png
Mabel:
- Hello my name is Mabel!
- How are you doing today!
[hide]character1.png
Dipper:
- Hi Mabel! I'm doing well, thanks for asking.
This script would display the background image bg1.png
and the character images character1.png
and character2.png
. Mabel would then say "Hello my name is Mabel!" and "How are you doing today!". Next, character1.png
would be hidden and Dipper would say "Hi Mabel! I'm doing well, thanks for asking." Finally, the script would end.
License:
VNS is licensed under LGPL(GNU Lesser General Public License)-2.1-or-later.
See LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for pyvns-2.1-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57f2c4431347b62dceccb053e1bf1b90ee7b57de0f3d869e7721fa6146029a35 |
|
MD5 | be862c28e2d9953bfed854799e4f2ee4 |
|
BLAKE2b-256 | d4421d3e3d4e89d11c677b806c824e5737f94c78087f982f22ab5c7153204aeb |
Hashes for pyvns-2.1-cp312-cp312-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1eefa655463818493972016776479d00dc96e41438a65fe6ad7f814950927dc3 |
|
MD5 | 03849f6ce9b25118fbdbab3ef29d5e29 |
|
BLAKE2b-256 | 0928a7abf5af72841a07f85a76b51fc9d4169751ed648956d6234ad5744f50c4 |
Hashes for pyvns-2.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b6e46c0bb85d37e95a0d17ca4bf67d44a4043b2123fde692e5366b2b0367d06 |
|
MD5 | 99657d563db4c53d422613242d230e61 |
|
BLAKE2b-256 | f4c52036b55fcf7a737734ae73e56af0bfb4d80e1c2ed7e9ff6212290dafa7b6 |
Hashes for pyvns-2.1-cp311-cp311-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54e17d3d76927bc48662938835d3e99644bfe65f89b0e7f2c23cbde68592fdb0 |
|
MD5 | 75855e01f49ab92decd374a972aabde2 |
|
BLAKE2b-256 | 15440e4384fdb5bb006c6a6fd164171575f45078bffb3c40d42eff54b0c56549 |
Hashes for pyvns-2.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de1ed711c8ccb207e7cce8ae74755ec98f73fceaebdc13b861f995057c374506 |
|
MD5 | 7158da309b48bb813cbc50e79e392169 |
|
BLAKE2b-256 | 4eae96c3c0686082ca983aea402cb05b40e434fb17f00398bc91884e14d19194 |
Hashes for pyvns-2.1-cp310-cp310-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81a6047ff35733ebbdd6daf368bc53a7668db6f6cc1d9d15aca5cf2dd4a20aa1 |
|
MD5 | 77049271d09347c798ce57e86ba8bbe4 |
|
BLAKE2b-256 | 5340b245059a359f9512c5987ec6d0fb3e0c113d0b35388b50d9c244c2ade1d6 |