SpaceAdventure

Gregory Saras
Shauna Thompson
December 8, 2014

Overview

Bimmy and Jimmy’s Space adventure is a piece of interactive fiction that we are going to deploy on a web platform. The reason that we are going to deploy this on the web instead of making this a standalone application is so that this can be easily accessible to anyone with a web browser. Interactive fiction utilizes browsers as a primary medium, however, most pieces are built in pre-existing software that enables more people to create stories, while allowing the software to handle the back end functions and message passing. Our piece covers a story, and also implements Scheme to a web browser.

Screenshot

Concepts Demonstrated

  • Data Base is used to provide characters speech in different parts of the world.
  • Object Orientation is used to create rooms, people, and things in the world.
  • Filtering to get to the proper data in the database.
  • Message Passing messages are passed to both the back-end, characters, and objects to tell them which action to perform.
  • Lambdas to allow the people and things to return what they need.

External Technology and Libraries

  • The front-end of our project relies on interacting with the user in a web browser so we made use of the web-server/insta language for racket.
  • We also used an article called Creating Languages in Racket to help us with some coding as well as some of the design choices. Link: http://queue.acm.org/detail.cfm?id=2068896
  • The SICP Adventure Game that we did for the class assignment was used heavily and the back-end is an extension of that code.
  • Other technologies we had to use were HTML/CSS/JavaScript to create the font-end of the application as well as a small PHP script which was used to help the back-end communicate with the UI

Favorite Lines of Code

Each partner should identify a favorite line of code, Scheme expression, or entire procedure written by himself / herself in the entire project, and explain what it does. E.g.:

  • Gregory Saras:
 (define (handle-request request-binding)
   (let ((type (extract-binding/single 'messagetype request-binding))
         (message (string-split (extract-binding/single 'messagecontent request-binding))))
     (dispatcher type message))) 
  • This code takes in variables that were sent to us via an ajax call and extracts the message type and message content to two variables. It then sends these to a dispatcher.
  • Shauna Thompson:
    (define (stuff-in-place stuff place)   
      (filter (lambda (object)
                (if (eq? object )
                    (is-a object 'ownable?)
                    false))
              (ask place 'things)))
    
  • This code takes in all the items in a place, and only returns the ones that are ownable. It can easily be changed to display any subset of an area's items.

Technology Used Block Diagram

Additional Remarks

  • The scale of this project ended up being much more than we initially envisioned, which unfortunately leads to the story being playable only about three quarters of the way through.
  • With the restraints that we were not able to work around in Racket, mainly being that all responses had to be a xexpr (valid HTML), we did have to run a PHP server in order to get the output of the game. What we did was write all the game output to a file which we then read in PHP and returned to the client in string form. We had to do this because the xexpr would not evaluate functions and you would end up just sending back a function name.
  • In standard interactive fiction, the player has a set of commands that tend to stay the same no matter who wrote the piece you're playing through. Many of the back end calls to look around a room, or even to move, involve typing in the message, the player it effects, and then the command. As many interactive fiction pieces are in the first person, most commands that are made can be assumed to be in reference to the player-character. I tried to create some similarity there by implementing some helper functions that allow the player to just type in commands such as (n) or (north) instead of (ask self 'go 'north), and (look) instead of (ask self 'look-around).
  • The world is also designed to keep the player on track with the story and not allow them to endlessly roam.