SamuZai
Idrelle Games
Idrelle Games

patreon


Behind the Scenes: Weird Workarounds

Wayfarer has been around for a few years now, and I thought I’d share some of the weird and whacky situations I’ve had to fix over time. There are a lot of benefits to working with Twine and SugarCube (Twine is the engine, SugarCube is the format). There are many resources, helpful guides, templates and macros that have been created communally over the years. Usually when I want the game to do something specific, there is a macro available that can assist with it so I don’t have to create it from scratch.   

One part of the game that may seem simple on the outside has been the source of many grievances over time. One would think that navigating a menu would be straightforward, but it is not. 

1. Issue #1

Wayfarer’s original UI looked something like this:

At this point, clicking on any of the menu options would bring you to a different screen. This was fine—the issue was then navigating back to the game without it forgetting where the player left off. If you have too many menus, it is possible for the player to click through them to a point where the history will forget where they started, locking them permanently in the menu. There is a macro called the Return macro that resolves this issue. 

However, the Return macro depends on the game’s history functioning in its default manner, which leads us to— 

2. Issue #2

At a certain point, Twine games will slow down if they are storing too many moments in their history states. The most efficient way to resolve this is to limit the max history state (the recommendation in the SugarCube documentation is for 1). Given how large of a game Wayfarer is, this is a change I implemented pretty early on (this is also the thing that prevents the player from being able to navigate backwards and forwards). 

When I redid the Wayfarer UI and turned it into its current version, I ran into an issue where I could no longer access the menu correctly due to the history save states. While I could increase them to 20 or 25, I would always run into an issue where the player would eventually get locked into the menu if they clicked around in the menu too long. Because there are so many menu options (Journal and everything in it, the codex, maps etc) and everything had its own page, that was a lot of clicking. And it would only grow with the game. 

So, I needed to come up with a different solution for the game menus, one that did not rely on navigating to a new page. SugarCube does support a number of dialogue boxes that you can use as pop-ups, but I was struggle to design them in a way that fit the look of what I was going for and also allowed the player to navigate around inside the dialogue box. 

I eventually settled on using the SlideWin Overlay by HiEv. This pulls an overlay over top of the game when the player clicks on a menu option, which means the game doesn’t need to access the history at all to navigate menus. I was able to get it to display different bits of information by using a few replace functions (which is how the player is able to see different information depending on what part of the Journal they click on—the buttons have a number associated with them, and whichever number is “active”, the overlay shows different information).

This worked great at first, until I ran into the next issue. 

3. Issue #3

Unfortunately because Wayfarer’s template has a separate function to pull up the menu bar from the bottom of the page, this conflicted with the overlay. If the player opened the save menu and loaded a save while the menu overlay was open, it would lock their game into the menu and they would be unable to close it. I couldn’t disable the player’s ability to access the menu bar while the overlay was open, but I also couldn’t change how the open/close button for the overlay worked. The solution for the time being is to make the save menu unavailable. 

And that is why if you ever open Wayfarer’s menu bar while the Journal or Codex is open, you will see this:

Saves are unavailable so you don’t break your game!


More Creators