Tutorial - Polaris Engine Wiki

Wiki Top   Edit   New   Duplicate   Rename   Freeze   Upload   Attached   Backup  

Suika2 Tutorial

This is a Suika2 tutorial. It will take 30 minutes for you to understand.

Nice to meet you!

Welcome to the world of Suika2!

This document explains how to make a basic visual novel using the engine, don't worry, it's really easy!

Okay, Ready? Let's get started!

Preparation

We'll be using Windows for this tutorial, but the process is similar on macOS.

Firstly, download the Suika2 binary.

Run the downloaded file and install Suika2 to your computer. A Suika2 icon will be created on your desktop.

1. Start Suika2. 2. Press "Yes" to "Going to create a new game." and you'll see a file chooser. 3. Create a folder and open a file. 4. Press "No" to "Do you want to use the full screen style?" 5. A sample game project will be opened. 6. Click "File" -> "Open Game Folder"

You'll see the following folders:

anime/ A folder to store anime files.
bg/ A folder to store background image files.
bgm/ A folder to store background music files.
cg/ A folder to store system image files such as for message boxes.
ch/ A folder to store character image files.
conf/ A folder to store setting file.
cv/ A folder to store voice files.
font/ A folder to store font files.
gui/ A folder to store GUI files. For me information on GUI files, see the documentation.
rule/ A folder to store rule files.
se/ A folder to store sound effect files.
txt/ A folder to store script files.

When you run Suika2, a sav/ folder will be automatically created, this will contain save-data.

At the moment, we're just going to use demo-game chunks to play around with Suika2's various features. This tutorial is by no means exhaustive, so please refer to the reference for more commands and updated information. This document will be updated in the future to better align with Suika2's current version and documentation.

Open a Script File

Within the txt folder we can find init.txt. When Suika2 starts, this will be the first script file that runs. The great thing about script files is that they're regular .txt files, so you don't need any special software to open them!

Whenever you see Insert the following into init.txt:, make sure you clear your script. (Highlight and delete the text) This will let you watch each example without interruption or distraction. You can, of course, mix these examples and your own work to see what you can create!

Comments

Before we get into things, it's important to note that Suika2 scripts support comments. You can use these to make notes and 'sections' of the document. Comments won't appear anywhere in your game, and will only be viewable in the file itself. To use a comment, insert a # at the beginning of the line. Suika2 comments don't need a closing tag.

My first Suika2 script!

Show a Background Image

For our first real step, we'll change the background image. This is the most basic command.

Insert the following into init.txt:

@bg roof.png 1.0 @click @bg is the command to show a background image. roof.png is a file inside the bg folder. 1.0 is the fade-in time counted in seconds. @click is the command to wait for the user to click.

After saving it, run Suika2 and click "Continue". Suika2 will show a roof terrace, wait for a click and then exit.

Show a Character Image

Showing character images is pretty similar to the @bg command.

Insert the following into init.txt, between the @bg and @click commands:

@ch center 001-fun.png 1.0 @ch is the command to show a character. center is the horizontal position to show a character. 001-fun.png is a file inside the ch folder. 1.0 is the fade-in time counted in seconds.

After saving it, run Suika2 and click "Continue". Suika2 will show a roof terrace, a character, wait for a click and then exit.

Show a Message

Showing dialogue is fundamental to visual novels. Messages are printed as text inside message boxes. Insert the following into init.txt, benearth the @ch command:

Hi, my name is Midori.

After saving it, run Suika2 and click "Continue". Suika2 will show a roof terrace, a character, one message and then exit.

Any script lines which don't start with @, : or \* are recognized as messages.

Show a Message with a Character's Name

In most cases, it's important to know whose speaking, this is achieved by enclosing the character's name in *.

Insert the following into init.txt:

*Midori*Now that you know my name, you can use it in your script!

Show a Message with Voice

Sometimes, you will have voice files that match the dialogue of your story, luckily, this is simple to implement with Suika2 scripts!

Using voice follows a similar structure to names, however, an extra * is inserted between the name and voice file.

Insert the following into init.txt:

*Midori*025.ogg*Messages can even be shown with voice lines!

025.ogg is a file inside the cv folder. Note: The English distribution only contains the cv/025.ogg and se/suika.ogg voice lines. 025.ogg doesn't reflect the written message above, and is just an example.

Playing Background Music

You can play background music (BGM) using the @bgm command. Insert the following into init.txt:

@bgm 01.ogg Playing BGM. @bgm is the command to play BGM. 01.ogg is a file inside the bgm folder.

After saving it, run Suika2 and click "Continue". Suika2 will now play the selected music file and display a message.

Note: Suika2 can only play sound files encoded using Ogg Vorbis 44.1kHz stereo or monaural format.

Showing Options

A game may have options for multiple endings. Insert the following into init.txt:

Ok, I'm gonna go to school.
@choose label1 "By foot." label2 "On my bicycle." label3 "I decided not to."
:label1
I'm gonna go to school by foot.
@goto end
:label2
I'm gonna go to school on my bicycle.
@goto end
:label3
I'm home sick from school.
:end

After saving it, run Suika2 and click "Continue". Suika2 will show three options. @choose is the command to show options. (You can create up to eight options with this command.) label1, label2 and label3 are jump destinations. Option messages follow labels.

:label1 is a label to specify a jump destination. Label lines are ignored when they are executed.

Easier and Label-less Options

<<<
Ok, I'm gonna go to school.
switch "By foot." "On my bicycle." "I decided not to." {
case:
    I'm gonna go to school by foot.
    break
case:
    I'm gonna go to school on my bicycle.
    break
case:
    I'm home sick from school.
    break
}
>>>

Set a Flag and Branch

Next, we set a flag and create a branch.

Insert the following into init.txt:

@bg roof.png 1.0
@ch center 001-fun.png 1.0
Ok, I'm gonna go to school.
@choose label1 "By foot." label2 "By bicycle." label3 "I decided not to."
:label1
I'm gonna go to school by foot.
@set $1 = 1
@goto next
:label2
I'm gonna go to school by bicycle.
@goto next
:label3
I'm home sick from school.
:next
@if $1 == 0 end
I found money on the ground.
:end

After saving it, run Suika2 and click "Continue". Suika2 will show three options. If you choose "By foot.", the message "I found money on the ground." is shown.

Here, we use a combination of @set and @if.

@set is the command to set variables. $1 on the LHS means we store to variable at number 1. = means simple assignment. Lastly, 1 means integer 1.

All variables are initially zero. $1 is set to 1 only when "By foot." is selected.

@if is the command to jump by condition. $1 == 0 means when variable at number 1 is 0. end is the jump destination label.

Easier and Label-less If

<<<
if $1 == 1 {
   I found money on the ground.
}
>>>

Show a Menu

You can make a menu screen using GUI.

@gui menu.txt 

After saving it, run Suika2 and click "Continue". Suika2 will show the title screen of the sample game.

@gui is a command to show a menu. In this case, the command calls the gui/menu.txt file.

Split Script Files

When script files start becoming to combresome to organise and undestand efficeintly, it may be a good idea to split the file. Thankfully, Suika2 supports this functionality by default.

Inside init.txt

@load second.txt
Create second.txt in the txt folder as follows.

Inside second.txt

Now we are on the second script!

After saving these files, run Suika2 and click "Continue". Suika2 will show "Now we are on the second script!".

@load is the command to jump to a specified script file.

Creating a Package

We can create a single package file that contains scripts, images, sounds and so on. To do so, click "Export" in the menu, then click "Export for Windows".

It will create a deplayable game folder. At least you need "data01.arc" and "suika.exe" for distribution. "mov" is required if you use videos.

Support

Please don't hesitate to reach out via Discord or E-Mail if you need any support, we'd love to hear from you!