Philhour and Boyle
"I think you're wrong. I'm a
computer, so I have a really terrific memory, and I'm almost positive
you already rang the doorbell. Couldn't you be mistaken?" -- from The
Hichhiker's Guide to the Galaxy computer game manual
Introduction
to Object Oriented Programming through Interactive Fiction
A
Self-Paced Computer Science & Gaming Tutorial
Purpose
To have fun in a novel and creative way; to
introduce the fundamental concepts and methods of object-oriented
programming, source code compiling, and creating executable files;
to promote the art and science of interactive
fiction.
Outcomes
Beginners: Participants will learn to play and appreciate classic and modern works of interactive fiction. Advanced: Participants
will write a partial-length work of interactive fiction over the course
of one semester, and a full-length work of interactive fiction suitable
for entry to international competition
over the course of a full year. Participants will understand the applicability
of the skills and knowledge gained through these projects to programming
and problem solving in general.
Methodology
We will use the Frotz interpreter to play classic (1980s) and modern works of interactive fiction.
We
will use the Inform language,
written for use by interactive fiction
(IF) authors, to produce interactive text-based puzzles and adventure
games. The crucial programming concepts of object, message, class, inheritance,
and interfaces will be introduced through fun, real-world examples and
projects.
Students
will work independently or in groups at their own pace, according to the
set of lessons below. No formal meetings or classes will be held. Occasional
informal meetings will allow students to share their work, solve problems
together, and get help. Mr. Philhour and Mr. Boyle will serve as mentors
and advisors when students are particularly stuck with a programming or
software issue.
Schedule
First
task: Introduction (~2 weeks)
- Purpose:
to figure out what this is all about, and if it really interests you;
to learn a little about the methods and history
of interactive fiction
- Read "Playing, Studying, and Writing Interactive Fiction" at http://jerz.setonhill.edu/if/index.html
- Play
a few classic Infocom adventures: you can find them online at http://www.xs4all.nl/~pot/infocom/
... we recommend Wishbringer for the novice, the Zork and Enchanter/Sorcerer/Spellbreaker
trilogies for the intermediate player, and the Hitchhiker's Guide to the Galaxy for
experts. Depending on your taste, you might prefer crime and suspense (Deadline, The Witness, Seastalker), fantasy (Zork, Enchanter, etc.), or science fiction (Starcross, Planetfall, Hitchhiker's Guide to the Galaxy).
- Play a few of the modern winners of the Xyzzy Award for interactive fiction.
Second
Task: Software installation (~1 day -- warning, like all software installation,
this can be frustrating, so don't give up!)
- Installation
of the Inform compiler and associated libraries
- download
the Inform
6.30 compiler and library and save the .zip file to
your desktop
- right-click
on the .zip file and select 'extract all'
- move
the interior directory 'Inform' to your My Documents folder, then
delete the .zip file and the (now-empty) extracted outer
directory; this basic directory, 'Inform,' will contain everything
we do from now on
- refer
to the Inform
Installation FAQ if you have any problems; in particular, check
out the directory structure shown there
- download
the Curses
game, by Graham Nelson (1993), and save the .z5 file to
the 'Games/Download' folder within your Inform folder
- navigate
to the 'bin' folder within your 'inform' folder, then to the 'frotz'
folder. Double-click on 'Frotz.exe' and select the 'curses.z5' game
to open
- In
the future, you will be able to just double-click on any .z5 file
to play it
- Example
gameplay
- important
commands: north (n), south (s), northwest (nw), etc., inventory
(i), examine, wait
- how
to communicate with other people in the game: 'harold, tell me about
maude' and "say 'hello" to harold'
- Installation
of the TextPad developer environment for editing and compiling source
code THIS STEP REQUIRES A COMPUTER
ADMINISTRATOR if
you are doing it on campus, but I thought I'd include it if you wanted
to install this all at home
- visit
these
instructions to get a handle on what we are going to be doing
- download
the TextPad self-extracting executable and the inform (2) .zip file
as instructed
- create
a TextPad document class styled to Inform, as instructed
- follow
the instructions under 'running the compiler within textpad' (note
that Frotz.exe is located with the bin directory) and 'running the
interpreter within textpad' (note that Inform.exe is located within
the Lib/Base directory)
- (You
should add to the Inform tool '..\..\lib\base' and '..\..\lib\contrib'
as include paths to make sure you can reach it from your game directories)
- we
will discuss registration of this program later; for now, we are
evaluating its use as our primary developer environment for this
project
Third
task: Beginning to Program (~4 weeks)
- Introduction
to writing and compiling simple games
- "Homework"
- Use
this new software to do the following
- play
around with Wishbringer,
by Brian Moriarty, Infocom (1985) ... this is a beginners
game.
- play
around with Curses,
by Graham Nelson (1993)
-
play around with Enchanter,
by Marc Blanc and Dave Lebling, Infocom (1983) / description;
useful hint: you can use 'memorize' to memorize a spell, then 'cast'
to cast it
- browse
Graham Nelson's The
Craft of Adventure
-
continue with the Ruins
tutorial Inform
Designer's Manual
- if
you are so inclined, create a well-described region with five navigable
rooms; save your '.inf' file in 'Inform\Games\MyGame1' (or make
your own directory instead of 'MyGame1' if you prefer).
Fourth
task: Intermediate Programming and using public code as a resource (~4
weeks)
- Go
to the Inform --> Resources --> Examples
site and download Balances.inf,
Toyshop.inf,
Museum.inf,
and Ruins.inf;
then, take each of these and open them in TextPad, compile them, and
play around within them. From these files you should be able to learn
a ton of stuff about objects.
- "Homework"
- create
a 'bag' which holds other objects and can become full
- create
a 'flashlight' which can be turned on and off
- create
a 'vending machine'
- create
an impending event
- play
around with Deadline,
by Marc Blanc, Infocom (1982) / description
- play
around with Hitchhiker's
Guide to the Galaxy, by Douglas Adams and Steve Meretzky, Infocom
(1984) / description
Fifth
task: Intermediate Programming: Verbs
Sixth
task: Intermediate Programming: Non-player Characters
- non-player
characters (NPCs)
- create
a humorous interactive NPC who will provide clues to a puzzle
[Further
tasks TBD. Topics may include advanced Z-machine programming.]
Additional
Web Resources
Inform
http://www.inform-fiction.org/
The
Interactive Fiction Archive
http://www.ifarchive.org/
The
World of Interactive Fiction
http://www.igs.net/~tril/if/
The
Interactive Fiction Page
http://www-2.cs.cmu.edu/~wsr/IF/
Magnus'
Interactive Fiction Page
http://www.df.lth.se/~mol/if.html
The
Interactive Fiction Competition
http://ifcomp.org/
Inform
FAQ
http://www.firthworks.com/roger/informfaq/index.html
Doe's
Inform Primer
http://members.aol.com/doepage/doefaq.htm
Inform
Developer's Guide
http://www.onyxring.com/InformGuide.aspx
Graham
Nelson's The Craft of Adventure
http://www.csd.uwo.ca/courses/CS641b/articles/craft-of-adventure.html
Graham
Nelson's Inform Designers Manual
http://www.inform-fiction.org/manual/html/index.html
List
of Infocom Games from LATZ
http://www.latz.org/games/list_abc.shtml
Archive
of rec.arts.int-fiction newsgroup
http://bang.tinyplanet.ca/if/raif/