Skip to content

Introducing choices and versions

Razdvizh edited this page Oct 22, 2024 · 5 revisions

Overview

One of the most powerful features of VisualU is the player ability to change story and its path in the visual novel narrative. This tutorial will show basic example of path choice and will explain scenario versioning.

Tree_structure

Setup

It is presumed that visual controller and scenario switching is already up. If not, check tutorial on how to set it up.

Data tables

First, create three data tables. First data table will be the starting one and it will also introduce choices. Second data table will be the first choice. Accordingly, third data table will be the second choice. Make sure to add some scenarios to them, too.

Choice sprite

Next, let's create basic user interface sprite to add choice options to the scenario. Create a blueprint widget that derives from Visual Sprite class. Now, add a reference to the visual controller and set it to the valid instance, see the example below:

image

Then, design the widget with buttons and text as you like, or look at the example below:

image

Finally, connect choice functionality to the buttons:

image

Adding choice to scenario

Open the first data table and select any scenario in it. Then, add newly created choice sprite to the selected scenario. Don't forget to adjust position so that the sprite is visible on the screen. Check this tutorial for more details on modifying scenarios.

Testing

Choice is ready to go! Test it in runtime and check gameplay debugger to see what happens internally.

Visual versioning

Visual versioning subsystem makes it possible to alter scenarios of a data table in runtime. Right now, this system is limited by two factors: altered data table will be chosen immediately after version is applied, which leads to all limitations of RequestNode function. Check this modified choice sprite that alters and afterwards chooses a node:

image

Improved visual versioning is planned to be developed in the future.