A-code (Dave Platt): Difference between revisions

From IFWiki

(Adding cross-reference to A-code disambiguation page)
(Fixed some formatting, added licence)
Line 2: Line 2:
|Type=Authoring system
|Type=Authoring system
|Style=Parser
|Style=Parser
|Multimedia=No multimedia as such, but browser builds can support games making use of all
|Multimedia=No multimedia as such, but browser builds can support games making use of all HTML capabilities, giving latent multimedia support.
HTML capabilities, giving latent multimedia support.
|Developer=Dave Platt, Mike Arnautov
|Developer=Dave Platt, Mike Arnautov
|Home page=https://mipmip.org/acode/
|Home page=https://mipmip.org/acode/
Line 12: Line 11:
|Date=2022/01/04
|Date=2022/01/04
|Status=Stable
|Status=Stable
|License=GPL3
|Notes=A-code can be used on any platform supporting (a) command line and (b) an ANSI C compiler/linker.
|Notes=A-code can be used on any platform supporting (a) command line and (b) an ANSI C compiler/linker.
}}
}}
Line 36: Line 36:
IMPLEMENTATIONS
IMPLEMENTATIONS


Platt's implementation of the system consisted of a "munger" which took A-code
Platt's implementation of the system consisted of a "munger" which took A-code source of a game and created a tokenised pseudo-binary. The game was then played by running a separate "executive" interpreter, interpreting the psudo-binary. Both programs were written in Fortran 77.
source of a game and created a tokenised pseudo-binary. The game was then
played by running a separate "executive" interpreter, interpreting the
psudo-binary. Both programs were written in Fortran 77.


The Current implementation, supported and developed by Mike Arnautov takes an
The Current implementation, supported and developed by Mike Arnautov takes an alternative approach. It uses an translator ("acdc") to convert A-code source into derived ANSI C source. This derived source can be then build into standalone executables (using command line console or browser for display and input), executables suitable for CGI or PHP wripper on-line implementations, QT5 executables. It can be further translated by Emscripten into stand-alone
alternative approach. It uses an translator ("acdc") to convert A-code source
into derived ANSI C source. This derived source can be then build into
standalone executables (using command line console or browser for display and
input), executables suitable for CGI or PHP wripper on-line implementations,
QT5 executables. It can be further translated by Emscripten into stand-alone
HTML/JavaScript web pages.
HTML/JavaScript web pages.


NOTABLE FEATURES
NOTABLE FEATURES


The Platt version of A-code had some unusual features, such as e.g. "text  
The Platt version of A-code had some unusual features, such as e.g. "text switches", effectively replacing some code with declarative syntax of game texts, or "procedure groups", where separate chunks of code could bear the same name and be executed in order of their declaration. Both these (and some others) were subsequently built upon in later versions by Mike Arnautov. Thus the basic text switch mechanism got developed into fairly complex "text morphing" (see e.g. https://mipmip.org /acode/acode-texts.html) and to provide powerful means for adding "wizard mode" for game debugging.
switches", effectively replacing some code with declarative syntax of game
texts, or "procedure groups", where separate chunks of code could bear the
same name and be executed in order of their declaration. Both these (and some
others) were subsequently built upon in later versions by Mike Arnautov. Thus
the basic text switch mechanism got developed into fairly complex "text
morphing" (see e.g. https://mipmip.org /acode/acode-texts.html) and to provide
powerful means for adding "wizard mode" for game debugging.


As another feature of note, with a minimum of discipline, A-code games can be
As another feature of note, with a minimum of discipline, A-code games can be written to guarantee upward compatibility of saved games. This is invaluable particularly in the beta-testing stage of game development, since objects, locations and general functionality can me added (or fixed) without invalidating game saves generated by a previous version. (See https://mipmip.org /acode/acode-upward.html)
written to guarantee upward compatibility of saved games. This is invaluable  
particularly in the beta-testing stage of game development, since objects,
locations and general functionality can me added (or fixed) without
invalidating game saves generated by a previous version. (See
https://mipmip.org /acode/acode-upward.html)


PARSER
PARSER


While under the hood A-code parser is a simple verb/noun one (currently no
While under the hood A-code parser is a simple verb/noun one (currently no adverbs, instruments or adjectives), it is nevertheless capable of parsing complex sentences, such as e.g. "take all except keys and food then go out". It supports natural use of "it" and also collective nouns "all" and "treasure", features undo and redo. It provides automatic abbreviation of all vocabulary words to the least unambiguous length as well as single-typo error correction. And its vocabulary structure is effectively a 3D one, making it possible automatically to echo back at the player more appropriate versions of command words used.
adverbs, instruments or adjectives), it is nevertheless capable of parsing
complex sentences, such as e.g. "take all except keys and food then go out".
It supports natural use of "it" and also collective nouns "all" and
"treasure", features undo and redo. It provides automatic abbreviation of all
vocabulary words to the least unambiguous length as well as single-typo error
correction. And its vocabulary structure is effectively a 3D one, making it
possible automatically to echo back at the player more appropriate versions of
command words used.


EXISTING GAMES
EXISTING GAMES


As already noted, A-code was designed by Dave Platt specifically for writing
As already noted, A-code was designed by Dave Platt specifically for writing Adv550 (known version is dated Sep 1972. It was subsequently used by Mike Goetz for the well known Adv580 version of the game. (The A-code source of this was recently recovered from Goetz himself, thereby scotching earlier belief that Adv580 followed the implementation model of the original Adventure.)
Adv550 (known version is dated Sep 1972. It was subsequently used by Mike Goetz for the well known Adv580 version of the game. (The A-code source of this was recently recovered from Goetz himself, thereby scotching earlier belief that Adv580 followed the
implementation model of the original Adventure.)


Mike Arnautov used A-code in mid-1980s to merge Platt's Adv550 with Luckett's and
Mike Arnautov used A-code in mid-1980s to merge Platt's Adv550 with Luckett's and Pike's Adventure II (now known as Adv440) into Adv660. At some stage in 1990s Mike implemented Roger Firth's "Cloak of Darkness" nano-adventure in A-code.  And in 2003 Mike further expanded Adv660 into Adv770. Finally, in 2020, as an exercise, Mike created an A-code implementation of the original Adventure which took the advantage of greatly improved player interaction made possibleby the current version of A-code.
Pike's Adventure II (now known as Adv440) into Adv660. At some stage in 1990s
Mike implemented Roger Firth's "Cloak of Darkness" nano-adventure in A-code.   
And in 2003 Mike further expanded Adv660 into Adv770. Finally, in 2020, as an
exercise, Mike created an A-code implementation of the original Adventure
which took the advantage of greatly improved player interaction made possible
by the current version of A-code.
{{interpreter navbox}}
{{interpreter navbox}}

Revision as of 10:54, 4 February 2022

A-code (Dave Platt)
Authoring system
[[File:|385px|center]]
Links Home page Download
Developers Dave Platt, Mike Arnautov
Format Other
Interaction style Parser
Systems Windows, Mac, Linux, iOS, Other
System details
Latest version 12.86 / 4 Jan 2022
Status Stable
Implements
Uses
Multimedia support No multimedia as such, but browser builds can support games making use of all HTML capabilities, giving latent multimedia support.
License GPL3
Notes A-code can be used on any platform supporting (a) command line and (b) an ANSI C compiler/linker.
Browse the software database
Edit this infobox

Note that there is a disambiguation page for A-code.

Dave Platt developed the A-code language (not to be confused with the Level 9 A-code system!) for writing his influential "Adventure 3" (now known as Adventure550) expansion of the original Crowther/Woods Adventure game. In doing so, he broke from the traditional format of Adventure and its expanded versions, which relying on a custom executable processing a standard format data file.

THE A-CODE LANGUAGE

The A-code language is a "Polish prefix notation" notation one, where each executable statement consists of an instruction keyword (a "minor directive" or "minor opcode" in Platt's usage), optionally followed by one or more arguments to which the instruction is to be applied. Thus e.g. "add count, 1" is an instruction to increment the value of the the entity "count" by one. Game entities (variables, objects, locations, texts, code chunks...) are declared using "major directives". Full description of the current version of the language can be found in https://mipmip.org/acode/acode-language.html

IMPLEMENTATIONS

Platt's implementation of the system consisted of a "munger" which took A-code source of a game and created a tokenised pseudo-binary. The game was then played by running a separate "executive" interpreter, interpreting the psudo-binary. Both programs were written in Fortran 77.

The Current implementation, supported and developed by Mike Arnautov takes an alternative approach. It uses an translator ("acdc") to convert A-code source into derived ANSI C source. This derived source can be then build into standalone executables (using command line console or browser for display and input), executables suitable for CGI or PHP wripper on-line implementations, QT5 executables. It can be further translated by Emscripten into stand-alone HTML/JavaScript web pages.

NOTABLE FEATURES

The Platt version of A-code had some unusual features, such as e.g. "text switches", effectively replacing some code with declarative syntax of game texts, or "procedure groups", where separate chunks of code could bear the same name and be executed in order of their declaration. Both these (and some others) were subsequently built upon in later versions by Mike Arnautov. Thus the basic text switch mechanism got developed into fairly complex "text morphing" (see e.g. https://mipmip.org /acode/acode-texts.html) and to provide powerful means for adding "wizard mode" for game debugging.

As another feature of note, with a minimum of discipline, A-code games can be written to guarantee upward compatibility of saved games. This is invaluable particularly in the beta-testing stage of game development, since objects, locations and general functionality can me added (or fixed) without invalidating game saves generated by a previous version. (See https://mipmip.org /acode/acode-upward.html)

PARSER

While under the hood A-code parser is a simple verb/noun one (currently no adverbs, instruments or adjectives), it is nevertheless capable of parsing complex sentences, such as e.g. "take all except keys and food then go out". It supports natural use of "it" and also collective nouns "all" and "treasure", features undo and redo. It provides automatic abbreviation of all vocabulary words to the least unambiguous length as well as single-typo error correction. And its vocabulary structure is effectively a 3D one, making it possible automatically to echo back at the player more appropriate versions of command words used.

EXISTING GAMES

As already noted, A-code was designed by Dave Platt specifically for writing Adv550 (known version is dated Sep 1972. It was subsequently used by Mike Goetz for the well known Adv580 version of the game. (The A-code source of this was recently recovered from Goetz himself, thereby scotching earlier belief that Adv580 followed the implementation model of the original Adventure.)

Mike Arnautov used A-code in mid-1980s to merge Platt's Adv550 with Luckett's and Pike's Adventure II (now known as Adv440) into Adv660. At some stage in 1990s Mike implemented Roger Firth's "Cloak of Darkness" nano-adventure in A-code. And in 2003 Mike further expanded Adv660 into Adv770. Finally, in 2020, as an exercise, Mike created an A-code implementation of the original Adventure which took the advantage of greatly improved player interaction made possibleby the current version of A-code.

Interpreters
By format ADRIFTAdvSysAGTAlanGlulxHugoMagnetic ScrollsTADSZ-code
By system BrowserAndroidiOSLinuxmacOSWindows
Browse Recommended interpretersSearch formDrilldown
Other software Authoring systemsUtilities