TL;DR: Play my little game here for web users or at gopher://gopher.judges119.me:70/labyrinth for Gopher users.
I’ve written some posts recently about the Gopher protocol and how I’ve been exploring and playing around with it a bit. I don’t know what attracts me to it so much, potentially just the simplicity of it, the relatively unknown nature of it across the modern web/dev crowd, or even just the desire to resuscitate a dead standard.
Then one night I had a sudden brainwave while out to dinner with friends. The directory nature of the Gopher protocol makes it a perfect candidate for “Choose Your Own Ending” style books. While Gopher is commonly used in a hierarchical fashion as an information retrieval protocol, there’s nothing to stop you making it more of a graph structure, which would be perfectly suited to a story with branching endings.
To prove out my hypothesis, I decided to build a little labyrinth, using a maze generator I found online to generate a 5x5 maze. I then assigned coordinates to the maze, using “00” as the top-left and “44” as the bottom right, with the first digit being the x-axis (right) and the second being the y-axis (down). The Gopher daemon I’m running (PyGopherd) uses a file called “gophermap” for the index of a folder (much like index.html is for many HTTP/HTML web servers). So I created a folder for each coordinate, and in that a
gophermap file in which I put the story text as well as instructions (such as “North”, “East”, “Take laser blaster”). Some areas have subfolders, which apply to actions taken within a particular coordinate/room/area.
I’ve also made the game available to play publicly here for web users or at gopher://gopher.judges119.me:70/labyrinth for Gopher users. It’s very short, with a defined start and end, but was mostly designed to prove out a concept.
The game successfully showed that you can do some forms of interactive fiction within the Gopher standard, which is fantastic because I want to explore this more. Although this game was more location based (with commands to move location), I want to work on building something more story/choice based, so the branching links are you choosing different actions. Future future goal is to find some way of using the “full text search” function of the Gopher standard to potentially take user input, allowing people to play a full text adventure game from the safety of the gopher console (or web browser).