A laptop displays an illustrated lighthouse beside draft storyboard pages.

How to Make a Visual Novel in Ren’Py: A Small Working Project

To make a visual novel in Ren’Py, create a project, write a scene, add a choice, and store a value that changes what happens next. You can build that complete loop with one short script.

This workshop makes Harbor Signal: one menu with two options, a harbor keeper named Mara, and two possible departures. Light the signal and a ferry arrives against an amber background. Head to the boathouse and you leave by skiff against blue. A saved flag determines the outcome.

What you need to run Harbor Signal

The accompanying article assets include the runnable HarborSignal source folder, with game/script.rpy, game/screens.rpy, and game/tests.rpy, plus the original TEST_RUN.json and TEST_RUN.txt validation records. The Ren’Py SDK is separate. The story script and route map are also included below so you can build the project yourself.

The recorded validation used Ren’Py SDK 8.5.0.25111603 on Windows 11 x86-64. Use the official SDK for that version to match the recorded environment. The SDK supplies its own Python runtime; you do not need a separate Python installation. Once the SDK and project are on your computer, the game needs no network connection or additional art files.

Open the sample or create an empty project

Choose either route. Both lead to the same small story.

  1. Run the supplied sample: Open the Ren’Py launcher. In its preferences, set Projects Directory to the folder containing HarborSignal. Select HarborSignal in the project list, then choose Launch Project.
  2. Build from an empty project: Use the launcher to create a new project named HarborSignal. Open its game/script.rpy file and replace the contents with the script below. Keep the project’s generated game/screens.rpy, then launch the project.

Use one set of screen definitions: either the sample’s supplied screens or the new project’s generated screens. Copy only the story script into a generated project; combining both versions of screens.rpy can create duplicate definitions. The supplied game/tests.rpy contains automated checks and is separate from the story logic.

Write the complete story script

Put this source in HarborSignal/game/script.rpy. Preserve the indentation: it tells Ren’Py which statements belong to each choice and condition.

define config.name = _("Harbor Signal") define config.save_directory = "Field121-HarborSignal-8.5.0" define keeper = Character("Mara", color="#ffffff") image harbor_blue = Solid("#25364d") image harbor_amber = Solid("#563b29") default signal_lit = False default landing_outcome = None label start: $ signal_lit = False $ landing_outcome = None scene harbor_blue keeper "The ferry lost sight of the pier." menu: "Light the signal": $ signal_lit = True jump landing "Go to the boathouse": jump landing label landing: if signal_lit: $ landing_outcome = "ferry" scene harbor_amber keeper "They saw the lamp. The ferry is coming in." else: $ landing_outcome = "skiff" keeper "The ferry is turning back. We'll take the skiff." return

The two backgrounds are original solid colors defined inside the script. There are no image files to locate or copy.

Understand choice, state, jump, and return

A choice is the player’s visible decision. The menu: statement presents “Light the signal” and “Go to the boathouse.” Ren’Py runs the indented statements beneath the selected option.

State is information the story remembers. Here, signal_lit is a flag: a variable with two possible values, True or False. Lighting the signal changes it to True. Choosing the boathouse leaves it False.

The default statements establish the variables’ initial values. The assignments under label start: deliberately reset them whenever a new game begins. landing_outcome starts as None, meaning no outcome has been selected yet, and later becomes "ferry" or "skiff".

A label names a place in the script. jump landing moves execution to label landing:. Both choices reach that same label, where if signal_lit: checks the flag and selects the background and final line. The skiff route keeps the blue background established at the start.

Return ends this playthrough after the player advances past Mara’s final line. Because the story began at start, the final return takes the player back to the main menu.

These constructs are covered in the bundled Ren’Py Quickstart sections on menus, labels and jumps, and supporting flags. Together, they let two branches share a destination while preserving the consequence of the earlier choice.

Follow the two routes

Start signal_lit = False landing_outcome = None blue background Mara opens | +-- Light the signal | signal_lit = True | jump landing | outcome = "ferry" | amber background | ferry closing line | return | +-- Go to the boathouse signal_lit stays False jump landing outcome = "skiff" blue background remains skiff closing line return

This is the project’s central design decision: the menu records what the player did, and the landing scene interprets it. You can change the landing dialogue later without duplicating it beneath each menu option.

Play both paths and restore a save

Launch the project and begin with Start. Test each option from a fresh start so the reset assignments run before the choice.

  1. Choose Light the signal. Confirm that the background turns amber and Mara says the ferry has seen the lamp and is coming in.
  2. While that outcome line is still on screen, use the supplied sample UI: Save → Save Slot 1 → Back.
  3. Advance past the final line to return to the main menu. Choose Start again, then Go to the boathouse. Confirm that the background stays blue and Mara gives the skiff line.
  4. Use Load → Load Slot 1. The saved ferry context should return, including the amber background and ferry outcome line.

Those button names describe the supplied sample UI. If you built a new project with generated screens, use its equivalent save and load controls; their labels may differ.

Ordinary Ren’Py saves store the story context, including these variables. Starting a new game runs the resets; loading a save restores the saved point and values. The flag does not need to remain true across every new playthrough to survive a save and load.

What the recorded validation checked

The supplied package’s recorded run reports 3 of 3 testcases passed and 10 of 10 assertions passed.

Testcase Recorded check
lamp The signal route produced signal_lit = True and landing_outcome = "ferry".
skiff The boathouse route produced signal_lit = False and landing_outcome = "skiff".
restore_lamp The test saved through the actual UI, changed both variables, loaded the same slot, and asserted that both saved values were restored.

The original records are in TEST_RUN.json and TEST_RUN.txt. These results cover the supplied project on the specified Windows and SDK environment. They are automated engine checks, not a report of an interactive user playthrough. The bundled CLI documentation’s “Run Testcases” section covers running the test suite.

Diagnose branch and project problems

Problem What to check
Both choices appear to produce the same outcome. Begin a clean game through Start, then test each path separately. A hot start that resumes an existing session, or loading an old save, can obscure whether the reset and choice statements ran.
The boathouse route still gets the ferry. Check that signal_lit = False is under label start: and that only “Light the signal” sets it to True.
A choice does not reach the landing. Check that each option contains its own indented jump landing and that the destination is spelled label landing:.
Ren’Py reports duplicate labels or screens. Keep one definition of each label and screen. Replace the generated story script instead of appending another start label, and use only one set of screens.
The launcher does not show HarborSignal. Set Projects Directory to the folder containing HarborSignal. The story file belongs inside that project’s game folder.

Extend one consequence

For your next scene, let Mara remember the same flag. She might thank the player for lighting the signal or ask them to help carry the skiff. That gives the first decision another consequence without adding another variable.

You do not need a first playable Twine story before working in Ren’Py. If you explore Twine later, the choice-and-state pattern will be familiar, while its syntax remains separate from Ren’Py’s.