Lesson Notes — Random Events and Return Visits
Course 2: Game Design & Development Principles / Unit 5: Game Design Storytelling & Nonlinear Narratives / Lesson 13: Random Events and Return Visits
Save your work every day: Export your story and save it to Google Drive at the end of every class. Twine only saves your story in the browser on the laptop you are using, and you may not get the same laptop next time.
Lesson overview
Right now your game plays the same way every time the player makes the same choices. Today you add random events so things can change from one playthrough to the next, and you make passages react when the player comes back to them. Both give your game replay value.
Pick a random word or phrase with (either:)
The clerk behind the counter is (either: "smiling", "yawning", "on the phone").
Each time the passage shows, Twine picks one of the choices.
Pick a random number with (random:)
(set: $wait to (random: 5, 60))
You wait $wait minutes for your number to be called.
Make a random event change the story
(set: $roll to (random: 1, 6))
(if: $roll is 6)[The computer system crashes. Everyone has to wait.]
(else:)[Your number is called.]
React when the player comes back with visits
visits counts how many times the player has been in the current passage.
(if: visits is 1)[You step into the waiting room for the first time.]
(else:)[You are back in the waiting room. Nothing has changed.]
Check where the player has been with (history:)
(history:) is the list of passages the player has already visited.
(if: (history:) contains "Check if anyone had made an appointment")[You already know there is no appointment.]
Tips
- Use randomness for flavor and surprises. Keep big outcomes tied to the player’s choices so the game feels fair.
- Play your game several times to see the random events change.
Your turn
- Add at least one
(either:)to make a passage read differently each time. - Add one random event that changes what happens next.
- Use
visitsor(history:)so at least one passage changes when the player returns or has been somewhere before. - Play your game at least 3 times and note what changed.
- Export your story and save it to Google Drive at the end of every class.
Check your understanding
- What is the difference between
(either:)and(random:)? - What does
visits is 1check? - How does randomness add replay value to your game?
Use this lesson’s Key Terms page to build your glossary.