Unit 4 – Text story game

Plan

The text-adventure game that I want to make will mainly prioritise world-based storytelling and will be carrying the narrative through the setting and certain events.

The player will be able to choose from multiple classes and characters will which get different choices to make throughout the story as they all have different capabilities. Eventually all of the available characters will end up meeting and forming a group that act as the main group of heroes within the narrative that have to get through the different hardships of the brutal City of Los.

Depending on the choices of the player at the end of the story considering the different variables that the player encountered, the player be able to choose their own ending, whether that ending is good or bad is up to the narrative.
There will be around 9 variations of the final ending ranging between good, neutral and bad as well as 3 hidden, secret endings which are harder to encounter.

  • Good ending
  • Bad Ending
  • True Ending
  • Secret Ending

The story is similarly played to a stereotypical Dungeons and Dragons campaign, where a set of characters that normally wouldn’t meet, do meet and are made to set out on some sort of quest or to help out the city that they are residing in.

I plan to keep the player interested by giving them a lot of different branching paths to take to add replayability into my gameplay so that the player can find different endings to the game.

Audience
The demographic for the people playing this game will be gamers and DnD players that enjoy investigation and solving mysteries as well as world building enjoyers.

To make the player interested in the story, I started off with a small narrative exposition about the setting that they are in to catch their attention.

Story Beats
The story will include certain story points which will be kept constant no matter what character the player chooses.

  • Characters meeting
  • Quest begins
  • Investigation steps
  • Endings based on findings

Plan: Illustration / Diagrams

To start out the production, I created an illustration to get a rough idea on what to do with the story and how its going to look

Research

I want my story to replicate the feeling of a real Dungeons and Dragons session, for my mediums I looked back at both the starts of DnD campaigns that i’ve personally been in as well as listened to the beginnings of DnD podcasts and how the parties meet in them. I listened to Critical Role C2 and Dimension20 Fantasy High, I also wanted to explore and experiment with option-based storytelling so I looked at visual novel games such as “Steins;Gate” and “Doki Doki Literature Club” and looked at how they used a lot of variables after selecting options and having those variables be called back upon later in the story and I wanted to include something similar to the mechanic. I know that with making a “choices matter” game, I will have to be using a lot of if statements and variables.

As previously mentioned, I want my primary audience for this game to be gamers who enjoy mystery solving and fantasy worlds as well as DnD style mechanics such as chances for events to happen.

Before I started, I wanted to see what language Twine used to know how I was going to be doing the programming side of Twine, I found that “Harlowe” and “SugarCube” are their own languages or “story formats” which are capable of different things. https://twine2.neocities.org/#macro_else-if is the website I found which contains all macros for Harlowe and how they work along with examples of use, this website helped me figure out any syntax problems as well as any additional features that I added to my story (more on that later)

Structures
For the story I wanted to make I knew that I also wanted a certain structure to it with how interactive it is so I looked at this website to get an idea for the different structures that I could implement into my twine project.

Time Cave: The Time Cave structure features loads of branches, without the possibility of them meeting again as well as having the opportunity for a wide variety of endings. They often focus on replayability rather than length, usually having short playtimes but with many different routes that the player could take.
I don’t think that this would be that good of a choice for my story as I want to tell a continuous story that merges between perspectives.

The Gauntlet: The Gauntlet is an interactive structure that is very easy to create but can be difficult for the player. It is a set linear story with multiple opportunities for the player to fail before they reach the end. They are often filled with setbacks and obstacles and if there are multiple endings, they will generally come from one final choice rather than completely different branches of paths.
This is definitely not suitable for my game, as i want there to be more decisions and unique story lines.

Branch and Bottleneck: With this structure, the game branches very frequently but regularly merges back at specific points around events that are common to all perspectives of the story. To prevent avoiding the effects of past choices, these structures almost always rely on heavy use of variables and tracking them based on options chosen.
Somewhat rarely, the bottlenecks may be invisible – the plot branches and never reaches an explicit rejoining node, but the choices at the end of each branch are the same or similar.
I feel like this is the structure most suitable for my game with the most benefits to how I am imagining to run the story.

Quest: The quest structure works by branching together different branch-clusters which are small groups of clusters that all interconnect each other but very rarely go into connecting separate clusters. However, frequently they merge by the end of the story to create an ending sequence that leads to an ending.
I don’t think that I want this structure for my story as it seems too convoluted and complicated for my idea.

Open world: This story structure allows for easy passage between every node, probably on a collection quest among different nodes that the story provides. This structure requires the player to map out the map in their mind and navigate across it.

I decided that for my story I would go with the Branch and Bottleneck structure as it feels like it is going to be the best and most effective for the story that I want to tell.

Production

I started my story off with the player letting them choose their own names and saving it as a variable by using a macro that allows for user inputs and sets it to $pname (playername).

After the player chooses their own names, a small introduction plays that immerses the player into the world and the setting that they are put in before making the player choose between 4 perspectives and classes, all with different capabilities, these classes are:

  • Rogue
  • Fighter
  • Wizard
  • Civilian

All of these classes have different statistics and different choices in different moments of the story, as well as having their own special interactions in some scenes.

After the player has chosen their class, they will begin what is unofficially known as ‘Act 1’ which is the general getting the party all together. This whole game’s purpose is about perspectives, on the player’s first play through the other party members are with you and do their own actions but as the player reaches the end and creates a second playthrough and choose a different class, they very quickly discover that the whole story is the same however it is told with slight changes and in a different perspective with different choices based on the capabilities of the class that the player has chosen.

In the Introduction, I have the civilian being harassed by a petty thief who is trying to steal groceries, because of this a fight can break out between the civilian and the fighter, but has a chance to not happen due to the fighter appearing and intimidating the thief or the player can choose to just fight the thief straight up, which leads into a battle sequence.

Battle Sequence

Using 4 nodes, I have created a very simple and fun battle system ran completely by RNG (random number generator).

It also has specific flavour text based on number rolled.

This is the start of the combat and a start of turn. The very top of the passage checks if the player is dead and automatically redirects them to a death screen, however if not dead the fight continues and gives the player the options to “hit” or “block” which will deal damage to the thief or reduce the damage by a certain amount on the thief’s attack.

The bottom checks for the thief’s health and lets the player continue the story once the thief has been dealt with.

This is the attacking node, a random number between 1 and 20 is generated and the code checks for thresholds between values that then control the outcome of your turn.
On a 1, you hurt yourself, on a 20, your average damage is doubled due to the nature of the rare rolls.
Note the flavour text associated with the different rolls, describing how the fight is happening.

If I were to do this again, I would have created a second rng between 1 and 4 and added more flavour text to add more narration to the fight scene.

This is just the blocking text, all it does is sets a variable to true so that it can be called upon by the thief’s turn.

This is the thief’s turn. It is very similarly built to the player’s attacking turn except it has different flavour texts and additional if statements checking for the player blocking the attacks.

These 2 nodes are one of the great examples of the role of perspective in this overall story, it is a very similar conversation but specifically told through the perspective of the fighter or the civilian.

The same is told through these 2 branch sequences between the rogue and the wizard. They both meet at the same time but it is specifically told through their individual perspectives and how they react to each other as well as their thoughts.

Tying back to the “Bottleneck” story structure, this is the first bottleneck that is shown, where all of the character’s meeting together ties into each other.

The bottleneck node “Go to the hall” / “Act 1 End” is the node that has the most code in it, this is due to a Harlowe specific issue where it has troubles setting multiple variables to the same result in one (set:) macro. There was also the issue where for the next node where the story continued there was a lot of different variables dependant on who you were and who you met and didn’t meet in the previous act.

In this node there is a lot of set statements to set values of booleans to true or false as well as if statements that originally check your class that you picked at the start of the play through but for the character specific “introduction” variables ($lemon and $tangerine) I learnt how Harlowe processes arrays and added string arrays that create sentences which include the canon party names of everyone while still including the personal player name that the player chose.

The results of this as shows:
(Left side is the perspective of the fighter while the Right side is the perspective of the Rogue)

The next time that I will do something like this, I will be setting default values to a lot of the variables that I know I will have to be calling back to in the future as well as having instead of having all of the roles be individual, I would make a singular variable of “$role” and set the player’s role to a value and having a string check the value of the variable rather than the variable itself and then running a whole block of if: and else-ifs: to check for the value of the variable. In theory, it will provide cleaner code and will make adding more classes in the future easier.

Character Development

This is most clear character development in the story and a part of the story that happens if you choose to be the civilian. This is where it is revealed that the civilian has been held back by their own estimation of being “only a local civilian” while being able to achieve a lot more. This is a narrative twist which shows that a lot of people may not realise their true potential within themselves and could just be holding themselves back.

This is a small cluster of nodes similarly used in the ‘Quest’ structure. This cluster of nodes is the investigation of the mystery that is the main purpose of the game, the player is given many choices and can navigate between the different options to interrogate the different guards and check if they are suspicious or to investigate the water reservoir tower.

When you have completed each task, there is a brief recap to the player of what they have found in each area while the option they had to go there is crossed out.

This small cluster of nodes shows player agency and allows the player all different kinds of options to get up the big water tower, some choices are dependant on what class they are playing such as the wizard only being able to access the levitate spell option or “Operation Super Smart”

The Ending (Spoiler alert)

Based on the variables that the player has encountered throughout the investigation phase of the story, they can choose who to accuse of being the main culprit of the crime. Depending on the player’s choice, the ending will be different and there will be a final narration of the ending, similar to how “Fallout: New Vegas” narrates the different ending and the choices the player has made throughout the game.

I have also made several secret endings and added them:

  • Fishing ending (unlocked in a specific option in a specific node)
  • Lazy Ending (ignore the story)
  • “Eddie Ending” (Dying in act 1), named after my friend who was the first to die in act 1 after I forgot to implement dying in the act 1 fight.

Play testing

I had a few of my friends play testing my game and I had fixed a lot of the bugs that were encountered such as misspellings and programming that I missed out and forgot to include where if statements should have been or misspelled variables.

I then sent the same friends an updated version of the game and they all claimed that the game was good and they couldn’t find any bugs.

The Final Product

You can download and play the final product here by installing and running the html in a browser.

(Please message me for the file as I can’t upload it onto here}

Blogs associated with this unit

Conclusion

My biggest challenge when it came to the story writing in Twine was time amount of time that it consumed with the benefits of it all being how rewarding it felt when the whole story and especially the mechanic and code heavy scenes worked without any errors showing. This assignment has taught me a lot about variables and how to use them along with ifs and else-ifs and it has also taught me about how arrays work in strings as well as correct order and spacing for creating strings out of variables and strings in an array. I know that this isn’t going to work the exact same in languages like C++ or JavaScript but it will work on a similar basis. I think that doing all of the programming and hiding a lot behind previous variables went really well as it was done with minimal errors. Something that went wrong during the production was the original barrier between Harlowe and Javascript and how they differed slightly but it was fixed quickly as I found the macro documentation for Harlowe and began using it.
The next time that I will do something like this will be trying to aim to use cleaner code that will be easier to add to or remove from as well as expanding on my story to add more options or to just add more content and add to it. For the next time I may also try using SugarCube as I researched that it can do a lot more when it comes to mechanics and stylistic features for the story.

Thank you very much for reading.

Referencing

Kabo Ashwell, S. (2015). Standard Patterns in Choice-Based Games – IFWiki. [online] http://www.ifwiki.org. Available at: https://www.ifwiki.org/Standard_Patterns_in_Choice-Based_Games.

Neocities.org. (2024). Harlowe 3.3.8 Manual. [online] Available at: https://twine2.neocities.org/#macro_else-if.