Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Inform
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Inform 6 == {{Infobox programming language | name = Inform 1–6 | logo = | paradigm = [[Object-oriented programming|object-oriented]], [[Procedural programming|procedural]] | year = 1993 | designer = [[Graham Nelson]] | developer = [[Graham Nelson]] | latest_release_version = 6.42 | latest_release_date = {{start date|2024|02|10}} <ref name="IN6repo">{{cite web | url = https://github.com/DavidKinder/Inform6/releases/tag/v6.42 | title = Release Inform 6.42 | website = [[GitHub]] | access-date = 2024-12-04 }}</ref> | typing = | implementations = | dialects = | influenced_by = [[Z-machine]], [[C (programming language)|C]]<ref name=Plotkin>{{cite web |last1=Plotkin |first1=Andrew |title=What is ZIL anyway? |url=http://blog.zarfhome.com/2019/04/what-is-zil-anyway.html |website=Zarf |language=en |date=April 17, 2019|quote=I6 follows C very closely, in this example.}}</ref> | influenced = Inform 7 | operating_system = [[Microsoft Windows]], [[macOS|Mac OS X]], [[Linux]], others | license = [[Freeware]] and [[Artistic License]] 2.0 | website = {{URL|https://inform-fiction.org/}} }} Inform was originally created by [[Graham Nelson]] in 1993. In 1996 Nelson rewrote Inform from first principles to create version 6 (or Inform 6). Over the following decade, version 6 became reasonably stable and a popular language for writing interactive fiction. The Inform 6 system consists of two major components: the '''Inform compiler''', which generates story files from Inform source code, and the '''Inform library''', a suite of software which handles most of the difficult work of [[parsing]] the player's text input and keeping track of the world model. The name Inform also refers to the '''Inform programming language''' that the compiler understands. Although Inform 6 and the Z-Machine were originally designed with interactive fiction in mind, many other programs have been developed, including a [[BASIC]] interpreter, a [[LISP (programming language)|LISP]] tutorial (complete with interpreter), a [[Tetris]] game, and a version of the game [[Snake (1998 video game)|Snake]]. === The Inform 6 compiler === The Inform [[compiler]] generates files for the [[Z-machine]] or [[Glulx]] (also called story files) from Inform 6 [[source code]]. === The Inform 6 programming language === The Inform programming language is [[Object-oriented programming|object-oriented]] and [[procedural programming|procedural]]. A key element of the language is objects. Objects are maintained in an object tree which lists the parent–child relationships between objects. Since the parent–child relationship is often used to represent location, an object which is the parent of another object is often said to "hold" it. Objects can be moved throughout the tree. Typically, top level objects represent rooms and other locations within the game, which may hold objects representing the room's contents, be they physical items, non-player characters, the player's character, or background effects. All objects can hold other objects, so a <code>livingroom</code> object might hold an <code>insurancesaleman</code> object which is holding a <code>briefcase</code> object which contains the <code>insurancepaperwork</code> object. In early versions of Inform, objects were different from the notion of objects from object-oriented programming, in that there was no such thing as a class. Later versions added support for class definitions and allowed objects to be members of classes. Objects and classes can inherit from multiple classes. Interactive fiction games typically contain many unique objects. Because of this, many objects in Inform do not inherit from any class, other than the "metaclass" Object. However, objects very frequently have attributes (boolean properties, such as <code>scenery</code> or <code>edible</code>) that are recognized by the Inform library. In other languages this would normally be implemented via inheritance. Here is a simple example of Inform 6 source code. <syntaxhighlight lang="inform6"> ! Square brackets define a routine. This is the Main routine, which takes no arguments. [ Main; print "Hello, World!^"; ]; </syntaxhighlight> The procedual parts, statements and operators, are largely borrowed from C, with the notable exception that {{code|-->x}} instead of {{code|[x]}} is used to take array subscripts. Routines are defined in square brackets, as in the {{code|Main}} routine above,<ref name=Plotkin/> but called with round brackets as in C. The character {{code|@}} is used to [[escape character]]s and to invoke raw Z-machine opcodes.<ref>{{cite web |title=The Inform Designer's Manual, v4, Contents |url=https://www.inform-fiction.org/manual/html/contents.html |website=www.inform-fiction.org}}</ref> === Inform 6 library === The Inform system also contains the Inform library, which automates nearly all the most difficult work involved in programming [[interactive fiction]]; specifically, it includes a text [[parsing|parser]] that makes sense of the player's input, and a world model that keeps track of such things as objects (and their properties), rooms, doors, the player's inventory, etc. The Inform compiler does not require the use of the Inform library. There are several replacement libraries available, such as Platypus<ref name="platypus">{{cite web | url = http://www.elvwood.org/InteractiveFiction/Platypus/ | title = Inform Platypus release 4 | access-date = 2007-01-04 | date = 2002-03-14 | last = Turner | first = Anson }}</ref> and [[InformATE]], a library that codes Inform in Spanish. Some games may use no library at all, such as a direct port of [[Zork]] into Inform 6.<ref name=Plotkin/> === Example game === {{missing information|section|C-like logic parts|date=January 2023}} Here is an example of Inform 6 source code that makes use of the Inform library. The Inform 6 code sample below is usable in Inform 7, but not without special demarcation indicating that it is embedded legacy code. <syntaxhighlight lang="inform6"> Constant Story "Hello Deductible"; Constant Headline "^An Interactive Example^"; Include "Parser"; Include "VerbLib"; [ Initialise; location = Living_Room; "Hello World"; ]; Object Kitchen "Kitchen"; Object Front_Door "Front Door"; Object Living_Room "Living Room" with description "A comfortably furnished living room.", n_to Kitchen, s_to Front_Door, has light; Object -> Salesman "insurance salesman" with name 'insurance' 'salesman' 'man', description "An insurance salesman in a tacky polyester suit. He seems eager to speak to you.", before [; Listen: move Insurance_Paperwork to player; "The salesman bores you with a discussion of life insurance policies. From his briefcase he pulls some paperwork which he hands to you."; ], has animate; Object -> -> Briefcase "briefcase" with name 'briefcase' 'case', description "A slightly worn, black briefcase.", has container; Object -> -> -> Insurance_Paperwork "insurance paperwork" with name 'paperwork' 'papers' 'insurance' 'documents' 'forms', description "Page after page of small legalese."; Include "Grammar"; </syntaxhighlight> === Notable games developed in Inform 6 or earlier versions === * ''[[Curses (video game)|Curses]]'', by [[Graham Nelson]] (1993), the first game ever written in the Inform programming language. Considered one of the first "modern" games to meet the high standards set by Infocom's best titles.<ref name="highprogrammer-Curses">{{cite web | author = Alan De Smet | date = 2006-03-14 | url = http://www.highprogrammer.com/alan/rants/reviews/video_games/if/curses.html | title = Curses (Interactive Fiction Reviews) | access-date = 2006-11-01 }}</ref> * ''[[Zork: The Undiscovered Underground]]'' (1997), written by [[Marc Blank]] & [[Michael Berlyn]], programmed by Gerry Kevin Wilson. Given away free by [[Activision]] to promote the release of ''[[Zork: Grand Inquisitor]]''. * ''[[Anchorhead]]'', by Michael S. Gentry (1998) is a highly rated horror story inspired by [[H. P. Lovecraft]]'s [[Cthulhu Mythos]].<ref name="ifratings-anchorhead">Of the 1219 games rated at "Interactive Fiction Ratings", Anchorhead was the highest rated game as of January 4, 2007. ({{cite web | url = http://www.carouselchain.com/if/statistics.php | title = IF Rating Stats | access-date = 2007-01-04 | archive-date = May 11, 2008 | archive-url = https://web.archive.org/web/20080511194344/http://www.carouselchain.com/if/statistics.php | url-status = dead }})</ref> * ''[[Photopia]]'', by [[Adam Cadre]] (1998), the first almost entirely puzzle-free game. Won the annual [[Interactive Fiction Competition]] in 1998. * ''[[Varicella (video game)|Varicella]]'' by Adam Cadre (1999). It won four [[XYZZY Award]]s in 1999 including the XYZZY Award for Best Game, and had a scholarly essay written about it.<ref name="montfort">{{cite web | archive-url = https://www.webcitation.org/5c8jC0dFt?url=http://www.mit.edu/~montfort/Varicella.pdf | archive-date = 2009-11-06 | url = https://www.mit.edu/~montfort/Varicella.pdf | title = Face It, Tiger, You Just Hit the Jackpot: Reading and Playing Cadre's Varicella | access-date = 2009-11-06 | date = August 2003 | last = Montfort | first = Nick | author2 = Stuart Moulthrop }} Published as {{Cite journal | last1 = Montfort | first1 = Nick | last2 = Moulthrop | first2 = Stuart | title = Face It, Tiger, You Just Hit the Jackpot: Reading and Playing Cadre's Varicella | periodical = Fine Art Online | publisher = [[Mississippi State University]] | date = August 2003 | volume = 17 | issue = 8 | url = http://www.msstate.edu/Fineart_Online/Backissues/Vol_17/faf_v17_n08/reviews/montfort.html | archive-url = https://web.archive.org/web/20071013191103/http://msstate.edu/Fineart_Online/Backissues/Vol_17/faf_v17_n08/reviews/montfort.html | archive-date = 2007-10-13 }}</ref> * ''[[Galatea (video game)|Galatea]]'', by [[Emily Short]] (2000). Galatea is focused entirely on interaction with the animated statue of the same name. Galatea has one of the most complex interaction systems for a [[non-player character]] in an interactive fiction game. Adam Cadre called Galatea "the best NPC ever".<ref name="avventuretestuali">{{cite web | url = http://www.avventuretestuali.com/interviste/cadre-eng | title = Photopia is a short story, Varicella is a world | access-date = 2007-01-04 | date = January 2002 | work = L’avventura è l’avventura }}</ref> * ''[[Slouching Towards Bedlam]]'', by Star C. Foster and Daniel Ravipinto (2003). Set in a [[steampunk]] setting, the game narratively integrates meta-game functionality (saving, restoring, restarting) into the game world itself. The game won two [[XYZZY Award]]s and received the highest average score of any game in the [[Interactive Fiction Competition]] as of 2006.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)