Angular 4 Interactive Fiction Engine

An Angular 4 modern web application built around the old pieces of Interactive Fiction or text adventures of the 1980's and early 1990's.

What is Interactive Fiction?

Back in the early days of computer gaming, Infocom came up with a wide variety of text based adventure games where the game would describe its setting to you and you would interact with the game in the form of typing a command such as Pick up the lantern. The game would then parse your sentence, interpret your input into an intent, and attempt to execute it against its game logic, spitting out an authored response to the player. It allowed players to explore works of fiction and interact with worlds in many different ways, primarily non-combat puzzle solving gameplay in worlds that focused on being creative or telling an engaging story. Although Interactive Fiction (IF for short) hasn't gone away, it's never been as popular as it was in the 1980's, despite having an active community of developers and gamers. Typically development is done in a way to target applications mimicing the technology level of the original IF games and is written in author-friendly languages such as the fantastic Inform 7 language.

Why build another one? Why in Angular?

Over the course of my education from grade school to college, I built a number of Interactive Fiction game engines and parsers of varying complexity as I strove to learn programming and various languages. Although I've long since lost the code, I know I've written at least written implementations in QBasic, C++, Turbo Pascal, and .NET.

Recently I felt myself with a creative itch and a bit of nostalgia and wanted to revisit that type of a project that I hadn't touched since the early 2000's, and I wanted to do it in TypeScript with an Angular 4 front end, to see how such a project would look if it was coded entirely as an object-oriented game instead of as a programming language. I also wanted to take advantage of as many rich front-end tecnologies as I could in an attempt to freshen up the genre and get away from the more contemperary efforts that focus on trying to run code that executes in the same z-machine format as the original games from the prior century.

Additionally, the task of taking user input, tokenizing it into individual words, classifying those words, interpreting those words into a coherent sentence, and passing that sentence object on to an appropriate verb handler for whatever the user is trying to do is a very interesting technical problem that I would like to revisit now that I have over a decade of experience working professionally under my belt.

What stories have you written for it?

In working on the core engine, I adapted Roger Firth's Cloak of Darkness story to my engine. Cloak of Darkness is nearly the equivalent of a "Hello World" example in the IF community. While this is sufficiently more complex than displaying a "Hello World" message on the screen, the actual story itself is fairly trivial, even if the lexical analysis, tokenizing, verb handling, and representing the game world's internal state are not as trivial.

I was working on a much larger project, affectionately nicknamed "Fog Terrier", but I paused that project once it became clear how large the scope of it was and how I'd be much better off picking up a project involving procedurally generated content.

Are you still working on this?

In short, no. I believe in the concept, but I do recreational coding on things for fun in my evenings, and spending 99% of my time on the project just writing content is not a healthy use of my time and energy. If I can think of a shorter story with a much more limited scope, I may reactivate this project, but my "Fog Terrier" project is too involved to do as anything other than a full time job.

Learn More