More selected projects

Nothing to Fear

A short interactive fiction game that utilises natural language processing to create a more open input format. The game is envisioned to emphasis how data information is collected and used.

produced by: James Lawton

Introduction

This project is a proof-of-concept for experimental interactive fiction game. This is a project that combines some experimental code of my own, as well as an original story that I wrote. I used a combination of natural language programming and chatbot technology to attempt to create a custom interactive fiction game that allows a broad range of typed input. The game format takes as its inspiration from the original text-based adventure games such as Colossal Cave Adventure, Zork, and many others. While most modern interactive fiction has become an exercise in solving puzzles via button mashing choices, this game seeks a return to text input by utilising new technology to allow a broad freedom of input. The plot uses this very aspect, the ability to type freely, in order to collect information on the player's character in similar manner to real life and then use it against the player later in the game. Only fictional information willing input in the game is recorded. This is a proof of concept and is designed to register feedback and errors in order to improve the project for a future beta version.

Concept and background research

Technical background:
The game implementation is based off of the older generation of text-based games that allowed manual text input. Examples of this may include Colossal Cave Adventure (1975-77), Zork (1977-79), The Hitchhiker's Guide to the Galaxy, Transylvania, and many others. These required the player to type their actions, which would then be parsed by the game. They were fun for exploring and problem-solving, but usually had limited vocabulary capabilities. The concept has survived both in an active interactive fiction gaming environment, as well as variations of dialog in major console games. These are heavily weighted towards simply choosing between options, instead of free input. I was interested in using natural language programming and chatbot/AI technology to try to allow for more freedom of input. After quite a bit of research I decided on two paths, one is an ideal path, that uses much more complex technology and the second uses simpler technology, with more limitations but an easier entry-point. I decided to go with the latter, using a combination of nlp-compromise and Rivescript in order to create a quick, online, and accessible proof-of-concept.

Theoretical background:
The vehicle for showing the work that I did with natural language programming would be a simple proof-of-concept game that utilized the freedom of input that the nlp work provided. The commands, unlike the games mentioned above would allow more liberal sentence structure. Then theoretically the game would collect and use that input later in the game. Due to the technical constraints of natural language programming it would be impossible to have a flawless parsing system or full game world by exhibition time and the work was created so as to learn and evolve. The very act of logging user input positioned in a critical way to highlight data surveillance also allowed me to understand how users were interacting with the game and improve upon it.

Technical

I decided to use web technologies as this allowed for a more egalitarian entry point if others were ever to use this. This included my own skills and accessibility in the development. The Natural Language Toolkit would have been amazing but very challenging to use both for myself and others. Using web technologies alleviated this.
Specific to the language parsing and response, I used nlp-compromise to help with the language parsing, and Rivescript to help the input-reply mechanism. Because nlp-compromise is basically just JavaScript regex identification of parts of the sentence, much of the parsing that identified what to do with the sentence had to be written by me, which was the fun of the programming. The process is quite complicated and ever evolving but in brief works like this: The input is matched against a Rivescript file to see if there is a known reply for the raw input, if so that reply is returned. If not the input is broken into sentences and each sentence is matched for a known reply. There are  many other subbranches but basically if the sentences, or clauses aren't matched the sentence is stripped of any unusual characteristics like punctuation, abbreviations, etc and then a process of finding keyword verbs and nouns associated with the game location is commenced. If a keyword verb is found it then looks first forward, and then backward for a matching noun. There are evolving processes for complex sentences, as well as non-keywords. The locations are each JavaScript modules with elements like ids, keyword lists and custom call-backs for specific actions.

Future development

Many things. The parser is ever evolving and I have been working on it almost every day since late May, including through and after the exhibition. Further game development would be nice but it's not actually my greatest priority. I need to tweak the parser and get the location of the character’s flat fleshed out as I think this would be enough to put on forums and chat rooms in order to ask, "Is this way of doing things valid and interesting?" One of the interesting program challenges since the exhibition was how to deal with the desire for conversation. People frequently want to chat and confess to the game, trying to interact with it like an AI. Responses included things such as repeated instances of "I am sad." Creating a splash screen specifying that it was a game with objectives dramatically increased the serious attempt at the stated goals of getting up, dressing, etc but still people tried to converse with it often. I researched Eliza in the early weeks of the project and since the exhibition I have returned to Eliza's carefully crafted psychological replies to understand how to implement some of these pseudo-conversational techniques better.

Self evaluation

I’d say two things, starting with the bad. The bad is that for an art exhibition I did not create a flashy, cool art piece for everyone to go "oooh!" over. I don't regret that but I acknowledge that a limited proof-of-concept is liable for some strong criticism and I accept that.

On the other side of that I basically wrote a simple JavaScript nlp processor that can be used for games or really any web-related text input -- which is really cool! As imperfect as it is, I'm quite proud that I did that over the few summer months of lockdown.

References

https://github.com/spencermountain/compromise
https://www.rivescript.com/

Kill All Defects. “Adventure Game Sentence Parsing with Compromise,” February 20, 2020. https://killalldefects.com/2020/02/20/adventure-game-sentence-parsing-with-compromise/.
“Bag-of-Words Model.” In Wikipedia, May 11, 2020. https://en.wikipedia.org/w/index.php?title=Bag-of-words_model&oldid=956130772.
“Bruce Schneier.” In Wikipedia, March 13, 2020. https://en.wikipedia.org/w/index.php?title=Bruce_Schneier&oldid=945429331.
DEV Community. “Building Text-Based Games with Compromise NLP.” Accessed July 13, 2020. https://dev.to/integerman/building-text-based-games-with-compromise-nlp-jnm.
“Chatbot.” In Wikipedia, June 22, 2020. https://en.wikipedia.org/w/index.php?title=Chatbot&oldid=963893117.
GitHub. “Compromise.” Accessed July 13, 2020. https://github.com/nlp-compromise.
“Content Analysis.” In Wikipedia, June 10, 2020. https://en.wikipedia.org/w/index.php?title=Content_analysis&oldid=961739563.
“ELIZA.” In Wikipedia, May 13, 2020. https://en.wikipedia.org/w/index.php?title=ELIZA&oldid=956386399.
“Emily Short.” In Wikipedia, June 19, 2020. https://en.wikipedia.org/w/index.php?title=Emily_Short&oldid=963296657.
FutureLearn. “Games Reflecting Life - Introduction to Indie Games.” FutureLearn. Accessed August 21, 2020. https://www.futurelearn.com/courses/introduction-to-indie-games/0/steps/96368.
“Howling Dogs.” Accessed August 21, 2020. http://slimedaughter.com/games/twine/howlingdogs/.
“Howling Dogs | ELMCIP.” Accessed August 21, 2020. https://elmcip.net/creative-work/howling-dogs.
“James Bridle.” In Wikipedia, July 5, 2020. https://en.wikipedia.org/w/index.php?title=James_Bridle&oldid=966120487.
Jeffries, Adrianne, Leon Yin, and Surya Mattu. “Is Gmail Hiding Bernie’s Emails to You? How Inbox Filtering May Impact Democracy.” The Guardian, February 26, 2020, sec. US news. https://www.theguardian.com/us-news/2020/feb/26/gmail-hiding-bernie-sanders-emails-google-inbox-sorting-consequences-2020.
“Natural Language Processing.” In Wikipedia, June 2, 2020. https://en.wikipedia.org/w/index.php?title=Natural_language_processing&oldid=960429765.
“Natural Language Processing.” In Wikipedia, June 2, 2020. https://en.wikipedia.org/w/index.php?title=Natural_language_processing&oldid=960429765.
“Natural Language Toolkit.” In Wikipedia, April 15, 2020. https://en.wikipedia.org/w/index.php?title=Natural_Language_Toolkit&oldid=951031114.
“Natural Language Toolkit.” In Wikipedia, April 15, 2020. https://en.wikipedia.org/w/index.php?title=Natural_Language_Toolkit&oldid=951031114.
“Natural-Language Generation.” In Wikipedia, April 30, 2020. https://en.wikipedia.org/w/index.php?title=Natural-language_generation&oldid=954068681.
“Natural-Language Understanding.” In Wikipedia, May 25, 2020. https://en.wikipedia.org/w/index.php?title=Natural-language_understanding&oldid=958801074.
Twitter. “Nlp-Compromise (@nlp_compromise) / Twitter.” Accessed July 13, 2020. https://twitter.com/nlp_compromise.
“Nothing to Hide.” In Wikipedia, May 15, 2019. https://en.wikipedia.org/w/index.php?title=Nothing_to_Hide&oldid=897273977.
“Nothing to Hide Argument.” In Wikipedia, July 2, 2020. https://en.wikipedia.org/w/index.php?title=Nothing_to_hide_argument&oldid=965679365.
Paul, Kari. “‘Ban This Technology’: Students Protest US Universities’ Use of Facial Recognition.” The Guardian, March 3, 2020, sec. US news. https://www.theguardian.com/us-news/2020/mar/02/facial-recognition-us-colleges-ucla-ban.
Artspace. “Play Porpentine Charity Heartscape’s Emotional, Irreverant Computer Games.” Accessed August 21, 2020. http://www.artspace.com/magazine/news_events/art-bytes-porpentine-charity-heartscape.
Solon, Olivia. “Facial Recognition Database Used by FBI Is out of Control, House Committee Hears.” The Guardian, March 27, 2017, sec. Technology. https://www.theguardian.com/technology/2017/mar/27/us-facial-recognition-database-fbi-drivers-licenses-passports.
“Terminology Extraction.” In Wikipedia, April 2, 2020. https://en.wikipedia.org/w/index.php?title=Terminology_extraction&oldid=948674006.
“Text Mining.” In Wikipedia, July 2, 2020. https://en.wikipedia.org/w/index.php?title=Text_mining&oldid=965669881.
“XYZZY Awards.” In Wikipedia, July 24, 2017. https://en.wikipedia.org/w/index.php?title=XYZZY_Awards&oldid=792133648.