Choose Your Own Adventure

From ADRIFT 5 Manual Wiki
Revision as of 01:19, 8 November 2011 by Saabie (Talk | contribs) (Converging branches)

Jump to: navigation, search

This is a different style of Interactive Fiction from that which is normally written with Adrift. Instead of the player directly controlling a characters every move, a "Choose Your Own Adventure" (CYOA) is more like reading a book, but one in which the player is periodically asked to choose what happens next from a given menu of possibilities.

It is similar to printed gamebook style fiction in which each page of the book ends with a list of choices. The reader picks one of the choices which then directs them to turn to a particular page number and continue reading from there.

In Adrift this is usually done by creating a general task for each of the pages of text in the interactive book, and using a variable with restrictions to control which tasks are valid at each point in the story.

The PAGE variable

At the end of each page we present the reader with a menu of choices, and we only want them to be able to choose those particular options, so we need a way to ensure that only the tasks corresponding to those options can be executed.

We do this by creating a variable that keeps track of which page of the story has just been displayed, and we add restrictions to the tasks that check the value of the page variable and prevent incorrect tasks from running.

We could simply number each page and use an integer variable, however as the story will have lots of branches and loops you may find it easier to sort the tasks and insert new pages if you use a hierachal numbering scheme, so create a new text variable, set it to "0" and call it "page".

PageVariable.jpg

The first page of the story is written in the introduction dialog, so select it from the main menu:

Main Menu.JPG

Note that we dont need to define any rooms because we are doing everything with tasks, so the "Display first room description" checkbox is not selected and "Start the adventure at location" drop-down is left set to "No location selected".

IntroCYOA.jpg

The first page of the story is written and at the bottom we provide a menu of choices for the reader to select from. In the example i have used a simple numbered list which makes it quick and easy for the reader to press a single key and enter to select an option. This technique is used by many CYOA authors but has one drawback, once you start using branches and loops it will be necisary to have gaps in the numbering, and sometimes you will need to rearrange the numbering because you have already used the number that you need to link back to an existing task. This is because a task is directly linked to a command, so every menu that links to it must use the same command.

An alternative is to have the reader type a word for each menu choice, so you could have:

  • [Mall] Go to the shopping mall
  • [Home] Go home
  • [Library] Go to library to borrow a book
  • [Park] Check out the local park

Now we need to create a general task for each of these choices. Here is the task for menu choice [1] from the introduction above.

TaskDescCYOA.jpg

For the task name i have given it a number followed by a short description of the page contents. The number is used to sort the tasks in the folder to keep related tasks together. This number will also be written to the page variable to keep track of the last page shown to the reader. A CYOA can contain hundreds of tasks so it is a good idea to use a hierachial numbering scheme to organise them. In the example 01AZ01 i used '01' for day 1, 'A' for the first scene on that day, 'Z' to signify the main story sequence (not a branch), and '01' for the task number within that sequence.

  • Always use a fixed-length format with leading zeroes if required, so the numbers sort correctly

The command is simply the name of the menu choice, here i used a numbered menu but you could also have used [hide] or [bed] if you preferred. The message is the next page of the story and the next menu.

  • Most of the tasks will NOT have "Task is repeatable" selected, but if you use quests and loop-backs then the task you go back to will need it selected.

On the restriction tab add the "Variable" restriction: [page][must be][equal to][0]

This ensures that this task can only be executed if page=0 and the reader types the command '1'.

On the action tab add the "Variable" action: set[page]=01AZ01

This ensures that the next menu choice that the reader makes will only execute a task which has the restriction [page][must be][equal to][01AZ01].

The combinatorial explosion

If each of the menu choices on each page links to a new page, then the number of pages that must be written quickly increases to unmanageable numbers. If each page only has two choices then you need at each level: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024 pages. So you need to write a thousand pages just to give the reader 11 pages to read on any particular path, and over a million if you have 4 choices on each page.

Clearly we need to greatly reduce the number of pages, but without limiting the readers choices too much. The simplest is just to make many of the choices dead-ends. If the reader makes an obviously bad choice then the main character can die or fail in their task so that the story ends there.

Often a CYOA will have a small number of main branches that will follow a different story line, each one concluding in a different ending for the story.

To give the reader more valid choices and make it more interesting we can also add short branches that offer a different path to the same result and which merge back to the main story, and quests which dont have to be done in a particular order.

Writing the story

A good way to start writing a CYOA is to start with the main story sequence and first write the main path through the story from beginning to its successful conclusion. Extra menu choices can be put in as you go, but leave all of these branches until the main story is complete, then go back and add in one branch at a time, fleshing it out further as you go.

  • Don't make the main path the first menu choice every time or its going to be very easy for the reader to figure out that they just need to keep pressing "1" to get to the successful conclusion.
  • To better keep track of the tasks, put each 'Chapter' of the story into its own folder.

Bypass branches

A simple way to add extra choices is to insert an optional page between two other pages that the reader can either select to see or bypass. This is usually a menu choice that either leads to a failure or in which nothing of importance happens in the story. Its menu then gives all of the same choices as the previous page (except itself) so that the story continues the same way regardless of whether this page was read or not.

A more complex variation of this might allow the main character to obtain an object or do something which is then used later in the story to change the presented options. Alternately, if the reader misses obtaining an object this time then later in the story they could be given other chances to obtain it by adding bypass branches that only appear in a menu if the object has not been obtained yet.

Converging branches

After branching into two (or more) separate story lines, both are continued independently for awhile but the goal in both is the same. You could be trying to obtain a particular object or certain information, but using different methods in each branch. When successful, the two branches converge back into the same page of the main story.

If the two branches need to repeat the same section of text then you can use a system task like a subroutine. Just fill the system task with the text and call it from multiple general tasks using an execute task action. On the advanced tab of each general task use the "Display completion message Before/After executing actions" selection to determine if the text of the general task or system task is displayed first. The page variable is not usually set by the system task, unless it displays the menu and you want it to lead to the same destinations for both branches.

The system task can also be used as the converging page that brings the separate branches together. The last page of each branch would be set to "Display completion message BEFORE executing actions" and would not contain menu's, just a description of how you succeeded in your task, then the system task would tell you what can happen next, display the menu, and set the "page" variable to itself.

Quests

Quests are parts of the story which can be separated into a self-contained sections which can be read in any order. This allows the reader to select which part of the story they read first, usually by choosing to go to a different location at a major branch point.

All of the quests in a group loop back to the original quest selection page, where the reader can then select one of the other quests to go on. Usually a certain number of quests, all of them, or particular quests, must be completed satisfactorily before the reader is offered the option to continue to the end of the main story.

Enabling Look and Examine