Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Inform

From Wikipedia, the free encyclopedia
Programming language and design system
This article is about the programming language. For other uses, seeInform (disambiguation).

Inform
Original authorGraham Nelson
DeveloperGraham Nelson
Stable release
10.1.2 / August 31, 2022 (2022-08-31)[1]
Operating systemMicrosoft Windows,Mac OS X,Linux, others
TypeInteractive fiction development and play
LicenseArtistic 2.0[2]
Websitehttps://ganelson.github.io/inform-website/

Inform is aprogramming language and design system forinteractive fiction originally created in 1993 byGraham Nelson. Inform can generate programs designed for theZ-code orGlulx virtual machines. Versions 1 through 5 were released between 1993 and 1996. Around 1996, Nelson rewrote Inform fromfirst principles to create version 6 (orInform 6).[3] Over the following decade, version 6 became reasonably stable and a popular language for writing interactive fiction. In 2006, Nelson releasedInform 7 (briefly known asNatural Inform), a completely new languagebased on principles of natural language and a new set of tools based around a book-publishing metaphor.

Z-Machine and Glulx

[edit]

The Inform compilers translate Inform code to story files forGlulx orZ-code, twovirtual machines designed specifically for interactive fiction. Glulx, which can support larger games, is the default.

The Z-machine was originally developed byInfocom in 1979 for their interactive fiction titles. Because there is at least one such interpreter for nearly every major and minor platform, this means that the same Z-code file can be run on a multitude of platforms with no alterations. Originally Inform targeted the Z-machine only.

Andrew Plotkin created an unofficial version of Inform 6 that was also capable of generating files forGlulx, a virtual machine he had designed to overcome many of the limitations of the several-decades-old Z-machine. Starting with Inform 6.3, released February 29, 2004, Inform 6 has included official support for both virtual machines, based on Andrew Plotkin's work. Early release of Inform 7 did not support Glulx, but in August 2006 Glulx support was released.

Inform 6

[edit]
Inform 1–6
Paradigmobject-oriented,procedural
Designed byGraham Nelson
DeveloperGraham Nelson
First appeared1993
Stable release
6.42 / February 10, 2024 (2024-02-10)[4]
OSMicrosoft Windows,Mac OS X,Linux, others
LicenseFreeware andArtistic License 2.0
Websiteinform-fiction.org
Influenced by
Z-machine,C[5]
Influenced
Inform 7

Inform was originally created byGraham 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: theInform compiler, which generates story files from Inform source code, and theInform library, a suite of software which handles most of the difficult work ofparsing the player's text input and keeping track of the world model. The name Inform also refers to theInform 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 aBASIC interpreter, aLISP tutorial (complete with interpreter), aTetris game, and a version of the gameSnake.

The Inform 6 compiler

[edit]

The Informcompiler generates files for theZ-machine orGlulx (also called story files) from Inform 6source code.

The Inform 6 programming language

[edit]

The Inform programming language isobject-oriented andprocedural. 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 alivingroom object might hold aninsurancesaleman object which is holding abriefcase object which contains theinsurancepaperwork 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 asscenery oredible) 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.

! Square brackets define a routine. This is the Main routine, which takes no arguments.[Main;print"Hello, World!^";];

The procedual parts, statements and operators, are largely borrowed from C, with the notable exception that-->x instead of[x] is used to take array subscripts. Routines are defined in square brackets, as in theMain routine above,[5] but called with round brackets as in C. The character@ is used toescape characters and to invoke raw Z-machine opcodes.[6]

Inform 6 library

[edit]

The Inform system also contains the Inform library, which automates nearly all the most difficult work involved in programminginteractive fiction; specifically, it includes a textparser 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[7] andInformATE, a library that codes Inform in Spanish. Some games may use no library at all, such as a direct port ofZork into Inform 6.[5]

Example game

[edit]
icon
This sectionis missing information about C-like logic parts. Please expand the section to include this information. Further details may exist on thetalk page.(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.

ConstantStory"Hello Deductible";ConstantHeadline"^An Interactive Example^";Include"Parser";Include"VerbLib";[Initialise;location=Living_Room;"Hello World";];ObjectKitchen"Kitchen";ObjectFront_Door"Front Door";ObjectLiving_Room"Living Room"withdescription"A comfortably furnished living room.",n_toKitchen,s_toFront_Door,haslight;Object->Salesman"insurance salesman"withname'insurance''salesman''man',description"An insurance salesman in a tacky polyester              suit.  He seems eager to speak to you.",before[;Listen:moveInsurance_Paperworktoplayer;"The salesman bores you with a discussion                 of life insurance policies.  From his                 briefcase he pulls some paperwork which he                 hands to you.";],hasanimate;Object->->Briefcase"briefcase"withname'briefcase''case',description"A slightly worn, black briefcase.",hascontainer;Object->->->Insurance_Paperwork"insurance paperwork"withname'paperwork''papers''insurance''documents''forms',description"Page after page of small legalese.";Include"Grammar";

Notable games developed in Inform 6 or earlier versions

[edit]

Inform 7

[edit]
Inform 7
Paradigmnatural-language,declarative,procedural
Designed byGraham Nelson
DeveloperGraham Nelson
First appeared2006
Stable release
10.1.2 / August 31, 2022 (2022-08-31)[12]
OSMicrosoft Windows,Mac OS X,Linux, others
LicenseFreeware (before 2022);Artistic License 2.0 (since 2022)
Websitehttp://inform7.com/
Influenced by
Inform 6,Natural-language programming

On April 30, 2006, Graham Nelson announced the beta release of Inform 7 to the rec.arts.int-fiction newsgroup.[13] Inform 7 consists of three primary parts: TheInform 7IDE with development tools specialized for testing interactive fiction, theInform 7 compiler for the new language, and "The Standard Rules" which form the core library for Inform 7. Inform 7 also relies on theInform library andInform compiler from Inform 6. The compiler compiles the Inform 7 source code into Inform 6 source code, which is then compiled separately by Inform 6 to generate aGlulx orZ-code story file. Inform 7 also defaults to writingBlorb files, archives which include the Z-code together with optional "cover art" and metadata intended for indexing purposes. The full set of Inform 7 tools are currently available forMac OS X,Microsoft Windows andLinux (since 2007).

As of 2023[update], Inform 7 and its and tools remain under development.[14] Since April 2022, Inform 7 is open source and developed onGitHub.[15]

Inform 7 was namedNatural Inform for a brief period of time, but was later renamed Inform 7. This old name is why the Inform 7 compiler is named "NI".[16]

Inform 7 IDE

[edit]
The Inform 7 IDE onMac OS X showing source code and the skein
The Inform 7 IDE on Mac OS X showing the Index Map and the transcript

Inform 7 comes with an integrated development environment (IDE) for Mac OS X, Microsoft Windows and Linux. The Mac OS X IDE was developed by Andrew Hunter. The Microsoft Windows IDE was developed by David Kinder. The Linux IDE (known as GNOME Inform) was developed by Philip Chimento.[17]

The Inform 7 IDE includes a text editor for editing Inform 7 source code. Like many other programming editors it features syntax highlighting. It marks quoted strings in one color. Headings of organizational sections (Volumes, Books, Chapters, Parts, and Sections) are bolded and made larger. Comments are set in a different color and made slightly smaller.

The IDE includes a built-inZ-code interpreter. The Mac OS X IDE's interpreter is based on the Zoom interpreter by Andrew Hunter, with contributions from Jesse McGrew.[citation needed] The Microsoft Windows IDE's interpreter is based onWinFrotz.

As a developer tests the game in the built-in interpreter, progress is tracked in the "skein" and "transcript" views of the IDE. The skein tracks player commands as a tree of branching possibilities. Any branch of the tree can be quickly re-followed, making it possible to retry different paths in a game under development without replaying the same portions of the game. Paths can also be annotated with notes and marked as solutions, which can be exported as text walkthroughs. The transcript, on the other hand, tracks both player commands and the game's responses. Correct responses from the game can be marked as "blessed". On replaying a transcript or a branch of the skein, variations from the blessed version will be highlighted, which can help the developer find errors.

The IDE also provides various indices into the program under development. The code is shown as a class hierarchy, a traditional IF map, a book-like table of contents, and in other forms. Clicking items in the index jumps to the relevant source code.

The IDE presents two side-by-side panes for working in. Each pane can contain the source code being worked on, the current status of compilation, the skein, the transcript, the indices of the source code, a running version of the game, documentation for Inform 7 or any installed extensions to it, or settings. The concept is to imitate an author's manuscript book by presenting two "facing pages" instead of a multitude of separate windows.[13]

Inform 7 programming language

[edit]

Notable features include strong bias towards declarative rule-based style of programming and ability to infer types and properties of objects from the way they are used. For example, the statement "John wears a hat." creates a "person" called "John" (since only people are capable of wearing things), creates a "thing" with the "wearable" property (since only objects marked "wearable" are capable of being worn), and sets John as wearing the hat.

Another notable aspect of the language is direct support for relations which track associations between objects. This includes automatically provided relations, like one object containing another or an object being worn, but the developer can add their own relations. A developer might add relations indicating love or hatred between beings, or to track which characters in a game have met each other.

Inform 7 is a highlydomain-specific programming language, providing the writer/programmer with a much higher level of abstraction than Inform 6, and highly readable resulting source code. General-purpose logical and arithmetic statements are written in natural language (see e.g. the "Physics" example inThe Inform Recipe Book).[18]

In early Inform 7, the compiler translates the code to Inform 6, much likeCFront did with C++ and C.[16] The current compiler (as of version 10 of 2022) is additionally able to translate the code directly to C for a native executable,[dubiousdiscuss] and to generate an "index mini-website" describing the story.[19]

Example game

[edit]

Statements in Inform 7 take the form of complete sentences. Blank lines and indentation are in some places structurally significant. The basic form of an Inform 7 program is as follows:

"Hello, World!" by "I.F. Author"The world is a room.When play begins, say"Hello, World!"

The following is a reimplementation of the above "Hello Deductible" example written in Inform 7. It relies on the library known as "The Standard Rules" which are automatically included in all Inform 7 compilations.

"Hello Deductible" by "I.F. Author"The story headline is"An Interactive Example".The Living Room is a room."A comfortably furnished living room."The Kitchen is north of the Living Room.The Front Door is south of the Living Room.The Front Door is a door. The Front Door is closed and locked.The insurance salesman is a man in the Living Room. The description is"An insurance salesman in a tacky polyester suit. He seems eager to speak to you." Understand"man" as the insurance salesman.A briefcase is carried by the insurance salesman. The description is"A slightly worn, black briefcase."  Understand"case" as the briefcase.The insurance paperwork is in the briefcase. The description is"Page after page of small legalese." Understand"papers" or"documents" or"forms" as the paperwork.Instead of listening to the insurance salesman: say"The salesman bores you with a discussion of life insurance policies. From his briefcase he pulls some paperwork which he hands to you.";move the insurance paperwork to the player.

Notable games written in Inform 7

[edit]

Mystery House Possessed (2005), byEmily Short,[20] was the first Inform 7 game released to be public. It was released as part of the "Mystery House Taken Over" project.

On March 1, 2006, Short announced the release of three further games:[21]Bronze[22] (an example of a traditional puzzle-intensive game) andDamnatio Memoriae[23] (a follow-up to her award-winning Inform 6 gameSavoir-Faire) were joined by Graham Nelson'sThe Reliques of Tolti-Aph[24] (2006). When the Inform 7 public beta was announced on April 30, 2006, six "worked examples" of medium to large scale works were made available along with their source code, including the three games previously released on March 1.[25][26][27]

Emily Short'sFloatpoint was the first Inform 7 game to take first place in theInteractive Fiction Competition.[28]It also won 2006XYZZY Awards for Best Setting and Best NPCs.[29]Rendition, by nespresso (2007), is apolitical art experiment in the form of a text adventure game. Its approach totragedy has been discussed academically by both theAssociation for Computing Machinery[30] andCambridge University.[31][better source needed]

See also

[edit]

Further reading

[edit]
Inform 6
  • The official manual of Inform isGraham Nelson'sInform Designer's Manual: it is a tutorial, a manual, and a technical document rolled into one. It is available online for free at Inform's official website,[32] and two printed editions are available: a softcover (ISBN 0-9713119-0-0) and a hardcover (ISBN 0-9713119-3-5).[33]
  • TheInform Beginner's Guide by Roger Firth and Sonja Kesserich (ISBN 0-9713119-2-7) attempts to provide a more gentle introduction to Inform. It is available for free at Inform's official website.[34]
Inform 7
  • The SPAG Interview - An interview with designersGraham Nelson andEmily Short about the development of Inform 7. This interview was made shortly before its release and published on the same day as the initial release.[3]
  • "Natural Language, Semantic Analysis and Interactive Fiction" - A paper on the design of Inform 7 by designerGraham Nelson.[35]

References

[edit]
  1. ^"Release notes for Inform v10.1.0 and v10.1.1". github.com. RetrievedAugust 26, 2022.
  2. ^"Inform 7 v10.1.0 is now open-source". April 28, 2022. RetrievedApril 28, 2022.
  3. ^ab"The SPAG Interview: Graham Nelson and Emily Short on Inform 7".SPAG #44. The Society for the Promotion of Adventure Games. April 30, 2006. RetrievedNovember 7, 2015.
  4. ^"Release Inform 6.42".GitHub. RetrievedDecember 4, 2024.
  5. ^abcPlotkin, Andrew (April 17, 2019)."What is ZIL anyway?".Zarf.I6 follows C very closely, in this example.
  6. ^"The Inform Designer's Manual, v4, Contents".www.inform-fiction.org.
  7. ^Turner, Anson (March 14, 2002)."Inform Platypus release 4". RetrievedJanuary 4, 2007.
  8. ^Alan De Smet (March 14, 2006)."Curses (Interactive Fiction Reviews)". RetrievedNovember 1, 2006.
  9. ^Of the 1219 games rated at "Interactive Fiction Ratings", Anchorhead was the highest rated game as of January 4, 2007. ("IF Rating Stats". Archived fromthe original on May 11, 2008. RetrievedJanuary 4, 2007.)
  10. ^Montfort, Nick; Stuart Moulthrop (August 2003)."Face It, Tiger, You Just Hit the Jackpot: Reading and Playing Cadre's Varicella"(PDF). Archived fromthe original(PDF) on November 6, 2009. RetrievedNovember 6, 2009.Published asMontfort, Nick; Moulthrop, Stuart (August 2003)."Face It, Tiger, You Just Hit the Jackpot: Reading and Playing Cadre's Varicella".Fine Art Online.17 (8).Mississippi State University. Archived fromthe original on October 13, 2007.
  11. ^"Photopia is a short story, Varicella is a world".L’avventura è l’avventura. January 2002. RetrievedJanuary 4, 2007.
  12. ^"Release notes for Inform v10.1.0 and v10.1.1". github.com. RetrievedAugust 26, 2022.
  13. ^abGraham Nelson (April 30, 2006)."Inform 7: Public Beta".Newsgrouprec.arts.int-fiction.Usenet: 1146419288.944486.157150@i39g2000cwa.googlegroups.com. RetrievedJanuary 4, 2007.
  14. ^Emily Short (February 18, 2007)."Inform 7: Possible future developments".Newsgrouprec.arts.int-fiction.Usenet: 1169164007.311210.64650@a75g2000cwd.googlegroups.com. RetrievedMarch 30, 2007.Also archived atShort, Emily;Graham Nelson (January 2007)."Inform 7: Possible future developments". Archived fromthe original on September 5, 2008. RetrievedMarch 31, 2007.
  15. ^Nelson, Graham (January 13, 2023)."Inform 7 Version History".GitHub.
  16. ^abGraham Nelson (March 30, 2007)."Re: "Inform 7" is the wrong name".Newsgrouprec.arts.int-fiction.Usenet: 1175250734.801804.199340@y80g2000hsf.googlegroups.com. RetrievedMarch 30, 2007.
  17. ^"GNOME Inform 7 SourceForge project page". February 2008. – Now moved to GitHub atChimento, Philip (December 27, 2022)."ptomato/inform7-ide".GitHub.
  18. ^"10.1. Gases".ganelson.github.io.
  19. ^"Structure of the Inform 7 compiler".ganelson.github.io.
  20. ^"Mystery House Taken Over". Archived fromthe original on May 4, 2006. RetrievedJanuary 4, 2007.
  21. ^Emily Short (at the request of Graham Nelson) (March 1, 2006)."Three games in Inform 7".Newsgrouprec.games.int-fiction.Usenet: 1141259182.610660.185360@p10g2000cwp.googlegroups.com. RetrievedJanuary 4, 2007.
  22. ^Short, Emily (2006)."Bronze". RetrievedJanuary 4, 2007.
  23. ^Short, Emily (2006)."Damnatio Memoriae". RetrievedJanuary 4, 2007.
  24. ^Nelson, Graham (2005)."The Reliques of Tolti-Aph". RetrievedJanuary 4, 2007.
  25. ^Short, Emily (2006)."Bronze". Archived fromthe original on February 10, 2007. RetrievedJanuary 4, 2007.
  26. ^Short, Emily (2006)."Damnatio Memoriae". Archived fromthe original on December 12, 2006. RetrievedJanuary 4, 2007.
  27. ^Nelson, Graham (2005)."The Reliques of Tolti-Aph". Archived fromthe original on February 6, 2007. RetrievedJanuary 4, 2007.
  28. ^"12th Annual Interactive Fiction Competition". 2006. RetrievedMay 12, 2007.
  29. ^"XYZZY Awards: Winning Games of 2006". Archived fromthe original on May 15, 2007. RetrievedMay 12, 2007.
  30. ^"ACM Hypertext 2007 conference slides (PDF)"(PDF).
  31. ^"Cambridge University lecture slides".
  32. ^"Download the Inform Designer's Manual". April 1, 2006. RetrievedJanuary 4, 2007.
  33. ^"About the Inform Designer's Manual". April 1, 2006. RetrievedJanuary 4, 2007.
  34. ^"Download the Inform Beginner's Guide". April 1, 2006. RetrievedJanuary 4, 2007.Firth, Roger; Sonja Kesserich (August 2004)."The Inform Beginner's Guide: Third Edition"(PDF). RetrievedJanuary 4, 2007.
  35. ^Graham Nelson (April 10, 2006)."Natural Language, Semantic Analysis, and Interactive Fiction"(PDF). Archived fromthe original(PDF) on March 14, 2018. RetrievedJanuary 4, 2007.{{cite journal}}:Cite journal requires|journal= (help)

External links

[edit]
Retrieved from "https://en.wikipedia.org/w/index.php?title=Inform&oldid=1305062774"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp