home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games Extra 1996 May / Amiga_Games_Extra_CD_5-96.bin / spiele / publicdomain / amclnt / doc / mud.txt < prev    next >
Text File  |  1996-02-19  |  50KB  |  1,100 lines

  1. AmigaMUD, Copyright 1996 by Chris Gray
  2.  
  3.  
  4.             The 'MUD' Client Program
  5.  
  6. The MUD client program (the file called "MUD") is used to connect to
  7. an AmigaMUD server, either locally on the same machine as the server,
  8. or remotely through a direct serial port or modem connection. The
  9. operation of the program is the same in both cases, although some
  10. details of starting it up vary. This client program must be used in
  11. order to get graphics and audio output and to use mouse and keypad
  12. input. This is the recommended interface for use with AmigaMUD,
  13. although a remote user can operate in a simple text-only mode using
  14. just a terminal program.
  15.  
  16. When running, MUD displays two windows. The top window displays 32
  17. colour graphics in a 320 by 100 window centered in the display. The
  18. bottom window displays text in a window sized to use up the remainder
  19. of the available display space. It will be wider if overscan is in use
  20. and it is higher on PAL systems. The text window has a scrollbar for
  21. reviewing earlier output, and it is this window that contains the
  22. menus. This means that the menus appear in the middle of the display,
  23. which is a little unusual.
  24.  
  25. The bottom line of the text window is the input area. Output text
  26. lines appear on the line above this one, thus any partial input lines
  27. are not disturbed by output from other events taking place in the MUD.
  28. Input line editing and history retrieval is done in this line and will
  29. be described later. When RETURN is pressed, the current input line is
  30. sent to the server, and is echoed (along with the current prompt) in
  31. the output area. Note that the position of the command in the output
  32. area does not necessarily correspond to the point at which the server
  33. will process it, since the server may not get around to it for a
  34. while, and because the server may already have generated other output
  35. that hasn't arrived yet.
  36.  
  37. MUD can be started either from the Workbench or from a CLI. All of the
  38. tool type values that can be put in the Workbench icon can also be
  39. given on a CLI command line. Additional, shorter, forms for many of
  40. the flags can also be used from a CLI. By default, MUD will attempt to
  41. make a remote connection on the standard serial port at a speed of
  42. 19200 bps. If the environment variable "MUDLOCAL" is set to any of
  43. YES/yes/ON/on/TRUE/true or to no value, then the default action is to
  44. connect to a server running on the local machine.
  45.  
  46. NOTE: in order to run MUD, either locally or remotely, there must be a
  47. copy of "mud.library" in your LIBS: directory.
  48.  
  49. NOTE: MUD requires a stack of at least 10000 bytes. It will exit right
  50. away if the stack is not at least that large. If you are running MUD
  51. from a shell, use the 'Stack' command (perhaps in your shell-startup)
  52. to set a sufficient stack size. If you are running MUD from the
  53. Workbench, use the "Icons"/"Information" Workbench menu item to set
  54. the stack size on the MUD icon to at least 10000.
  55.  
  56. MUD is able to call up an external editor to edit strings (such as
  57. character and room descriptions) and procs (AmigaMUD procedures). What
  58. program to run as the editor can be controlled by setting the
  59. "MUDEDITOR" environment variable to the full path to the editor to
  60. use. If the variable is not set, variable "EDITOR" (also used by other
  61. software) is checked, and if that is not set, "Ed" is used. The editor
  62. used must accept the name of the text file to edit on the CLI command
  63. line, and must be a able to edit and write a simple text file. MUD
  64. does not understand text processor or word processor documents. The
  65. editor must not "auto detach", since that causes the edit process to
  66. terminate prematurely from MUD's point of view. Many users will prefer
  67. to just use the simple editor built-in to the MUD program.
  68.  
  69. If an external editor is used, the AmigaDOS process created for it
  70. will by default have a stack size of 9996 bytes. If you wish to use
  71. more or less bytes, you can use the '-s' CLI flag, or the
  72. "EDITORSTACK" icon tooltype, to specify a different size. MUD will
  73. enforce a minimum size of 4096 bytes.
  74.  
  75. The MUD client program can display background pictures and brush
  76. images loaded from the machine it is running on. It can also play
  77. sound samples, and, in the future, will be able to play SMUS (and
  78. perhaps CMUS) music. A single assign or volume name of "AmigaMUD:"
  79. must be present when MUD is started. It does not need to contain
  80. anything, but if it does, it should be arranged into the following
  81. subdirectories:
  82.  
  83.     BackGrounds: 320 x 100 x 32 colour background images
  84.     Images: 32 colour images of various sizes
  85.     Brushes: smaller brush images with a mask plane or with a
  86.     transparent colour specified
  87.     Sounds: IFF 8SVX sound samples
  88.     Music: IFF SMUS music scores
  89.     Instruments: IFF 8SVX instruments
  90.  
  91. The text window in MUD has a close box. Clicking on this box will
  92. start an exit sequence, which will normally result in MUD exiting.
  93. This can also be done with a menu selection. If MUD is started from a
  94. shell, using the 'Break' command on its process will also cause it to
  95. exit. If MUD refuses to exit for some reason (such as the server
  96. having been aborted, or the serial connection being lost), then MUD
  97. can be exited with the Abort menu item. Note that you should not abort
  98. unless absolutely necessary, since this can confuse the server if it
  99. is still active. In particular, manual intervention on the server will
  100. be required before you can log on again.
  101.  
  102. Following sections of this document will cover the CLI command line
  103. and icon tool type flags in more detail. Others will cover the use of
  104. the menus in MUD and the use of the internal editor. After that will
  105. be a discussion of the the various types of caching done by the
  106. program.
  107.  
  108.  
  109. Using MUD to Connect to an AmigaMUD Server
  110.  
  111. When connecting to a server running on the same machine as MUD, the
  112. connection is direct and immediate. The prompt to enter a character
  113. name will appear right away, and the text window will be used only for
  114. MUD input and output.
  115.  
  116. When connecting via a serial port (with or without a modem), the text
  117. window will initially play the role of a very simple terminal program.
  118. This mode has no emulations, does not support any escape sequences,
  119. etc. You can, however, use the logging facility to do the equivalent
  120. of "ASCII capture". The "Serial" menu can also be used to change the
  121. CD (Carrier Detect) status, change the connection speed, and generate
  122. BREAK conditions. When in this "terminal mode", characters typed are
  123. not locally echoed (full duplex), and no special processing or
  124. translation is done on sent or received carriage return or linefeed
  125. characters.
  126.  
  127. When remotely connected, the MUD program on the remote machine uses a
  128. reliable bidirectional binary protocol to talk to a copy of the
  129. "MUDAgent" program running on the server machine. This means that
  130. information (messages) can be sent in both directions at the same
  131. time, and that messages are not limited to printable characters. Also,
  132. the programs will automatically retry messages that are not
  133. acknowledged by the other end, or are corrupted during transmission.
  134.  
  135. This protocol operates quite differently than the simple "terminal
  136. mode", so the programs must recognize and agree on when they switch to
  137. the protocol. Normally, the MUDAgent on the server will attempt to
  138. enter the protocol as soon as it is started up (e.g. as a result of a
  139. menu option entered on a BBS). When the local MUD program recognizes
  140. the special sequence sent out, it will display "REMOTE END DETECTED"
  141. and switch into the protocol mode. If this message is not seen when
  142. expected, then something is wrong in the connection. You may see the
  143. data lights on a modem blink at one-second intervals - this is the
  144. remote end resending its startup characters. If, however, the remote
  145. end is setup to allow either a full binary or a text-only connection,
  146. then it will not try to start the protocol until it sees a request.
  147. In that case, you must use the 'Serial/Connect' menu item to start the
  148. protocol from your end. If you don't know how the other end is set up,
  149. just wait a few seconds to see if MUD connects automatically. If it
  150. doesn't, then force the connection.
  151.  
  152. Because of the binary protocol, a serial connection for MUD must be an
  153. 8-bit no-parity connection. Other modes will not work, and will most
  154. likely result in either a failure to connect, or a hung connection. In
  155. that case, you must disconnect by exiting MUD, and try again with a
  156. proper connection.
  157.  
  158. In the most common case, that of using MUD to connect to an AmigaMUD
  159. server running elsewhere, the sequence of operations goes something
  160. like this:
  161.  
  162.     - start MUD, possibly specifying options to change the baud rate,
  163.     use a different serial port, etc.
  164.  
  165.     - using MUD as a terminal program, dial the remote machine and log
  166.     on to it as normal.
  167.  
  168.     - do any further operations with the remote system as needed, such
  169.     as using BBS menus to get to an AmigaMUD selection.
  170.  
  171.     - instruct the remote system to run MUDAgent (e.g. select the
  172.     appropriate BBS menu item).
  173.  
  174.     - you should see some modem activity, followed by the "REMOTE END
  175.     DETECTED" message, then some more modem activity, and the
  176.     prompt to enter a character name.
  177.  
  178.     - enter your character name and start playing AmigaMUD
  179.  
  180. The MUDAgent program is able to monitor a serial port and make
  181. connections itself. If the host machine is operating this way, then
  182. when the initial modem connection is made, MUDAgent will immediately
  183. connect with your MUD client. MUDAgent can also be started by the
  184. "Getty" program, in which case you will see a "login:" prompt when you
  185. connect. At that point, enter the "userid" that is used on that system
  186. to get to AmigaMUD. You may have to enter a password other than your
  187. character password to get into AmigaMUD.
  188.  
  189. AmigaMUD also supports simple text-only connections. If you connect to
  190. one of these by, e.g. using the wrong BBS menu selection, then your
  191. MUD client and the MUDAgent program will not enter into the reliable
  192. protocol. You will not see the "REMOTE END DETECTED" message and will
  193. not get graphics/sound output and will not be able to use the normal
  194. features of the MUD program; instead, you will only have the "terminal
  195. mode" capabilities. Unless you will only be on the MUD for a short
  196. period, it is best if you disconnect and reconnect properly.
  197.  
  198. The MUD program supports Christopher Wichura's OwnDevUnit library for
  199. sharing of serial ports. This should be all automatic. If you are
  200. running something like 'Getty' or 'MUDAgent' to answer incoming calls,
  201. then MUD will request the port from that other program, and will fail
  202. to start up if that program does not release the port. If your system
  203. does not run OwnDevUnit.library, then this paragraph does not apply
  204. and can be ignored.
  205.  
  206. The MUD client program does not actually exit when you leave the
  207. scenario if you are connecting remotely. Instead, it goes back into
  208. its "terminal mode", allowing you to do more connections in the one
  209. session. Note that it does NOT flush its cache of effects, so if you
  210. next connect to a different AmigaMUD, you should select the
  211. "Options/Caches/Zap Effects" menu item to empty the effects cache,
  212. since a given effect identifier is unlikely to mean the same thing on
  213. another AmigaMUD. If both AmigaMUD's are running the bare standard
  214. scenario, you are probably safe, however.
  215.  
  216.  
  217. MUD Icon Tool Types
  218.  
  219. Some tool types accept a boolean (true/false) argument. MUD interprets
  220. any of YES/yes/ON/on/TRUE/true or an empty argument as true, and any
  221. other value as false. Note that on early versions of the AmigaOS,
  222. empty values are not valid. They ARE valid under V2.0. Other tool
  223. types require numeric arguments. These must be given in decimal.
  224. String arguments can have any value not containing spaces.
  225.  
  226.     SERIAL (boolean) - this tool type tells MUD to connect to a remote
  227.     server over a serial port. This is the default action, unless
  228.     environment variable "MUDLOCAL" has been set to a true value,
  229.     in which case MUD will connect to a local server. In that
  230.     case, this tool type will override that behaviour and attempt
  231.     a serial connection. Using any of the serial-specific tool
  232.     types will also imply the setting of this tool type.
  233.  
  234.     LOCAL (boolean) - this tool type tells MUD to connect to a server
  235.     running on the local machine, rather than trying to connect to
  236.     a remote server via a serial port.
  237.  
  238.     CLOSEWORKBENCH (boolean) - this tool type tells MUD to try to
  239.     close the Workbench screen after it has started up. This will
  240.     normally only work from a Workbench startup, and only if there
  241.     are no other programs active that were started from the
  242.     Workbench. Using this option can recover system memory for use
  243.     in caching effects, images, sounds, etc. The Workbench can
  244.     also be closed (and opened) using menu items.
  245.  
  246.     BRIGHT (boolean) - this tool type tells MUD to start up using a
  247.     brighter than normal set of colours for the text window. This
  248.     is useful on bright sunny days.
  249.  
  250.     DIM (boolean) - this tool type tells MUD to start up using a
  251.     dimmer than normal set of colours for the text window. This is
  252.     useful for nighttime MUDding.
  253.  
  254.     EDITOR = { INTERNAL | SELECTED | EXTERNAL } - this tool type sets
  255.     the default setting for the similar menu item. If INTERNAL is
  256.     set, then all editing will use the built-in editor. If
  257.     SELECTED is set, then MUD will use the built-in editor for
  258.     editing strings, and an external editor for editing procs. If
  259.     EXTERNAL is set, then MUD will use an external editor for
  260.     everything.
  261.  
  262.     OHISTORY (numeric) - this tool type sets the size of the output
  263.     history buffer that MUD maintains. This is the text that can
  264.     be reviewed using the scroll bar in the text output window.
  265.     The minimum size is 1920 characters. Note that giving too
  266.     large a value can result in significant slowdown, as new text
  267.     is inserted at the end of a large buffer. The default value is
  268.     5000 characters.
  269.  
  270.     IHISTORY (numeric) - this tool type sets the size of the input
  271.     history buffer that MUD maintains. This is the command lines
  272.     that can be retrieved using the up-arrow key, in the same
  273.     method that is used in a shell window. As described later, the
  274.     shell's input editing functions can also be used. The default
  275.     size of the input history buffer is 1024 characters, and the
  276.     minimum size is 160 characters.
  277.  
  278.     PORTNAME (string) - this tool type allows the user to change the
  279.     name of the Amiga OS port that MUD will try to connect to for
  280.     a local connection. By default, this name is "MUD port". Using
  281.     a different name allows the simultaneous use of multiple
  282.     AmigaMUDs on a given system. This tool type lets MUD select
  283.     which one to connect to.
  284.  
  285.     TEST - this tool type is a short way of picking "MUD test port" as
  286.     the name of the Amiga OS port to connect to.
  287.  
  288.     BAUD (numeric) - this tool type allows the setting of the baud
  289.     rate (more properly called bps) to use for a connection on a
  290.     serial port. The default value is 19200. Note that the Amiga's
  291.     internal serial port can accept a wide range of values, but
  292.     standard values of 300, 1200, 2400, 9600, 19200 or 38400
  293.     should be used for compatibility. If a value that does not
  294.     appear on MUD's serial menu is used, then none of the speeds
  295.     in the menu will be checked.
  296.  
  297.     IGNORECD (boolean) - this tool type tells MUD to ignore the state
  298.     of the CD (Carrier Detect) serial port control signal.
  299.     Normally, MUD will exit when the CD signal is lost, since this
  300.     means that the modem connection has been lost. Setting this
  301.     flag is needed with modems that cannot (or have been
  302.     instructed to not) properly generate the signal, or with
  303.     serial cables that do not pass the signal. Also, when
  304.     connecting two Amigas directly via their serial ports (and a
  305.     "null modem"), this option is usually needed.
  306.  
  307.     7WIRE (boolean) - this tool type tells MUD to instruct the serial
  308.     driver to pay attention to the hardware flow control signals
  309.     on the serial port. This is recommended for use with direct
  310.     connections or high-speed modems. It should not be used if the
  311.     modem is not generating and paying attention to the signals,
  312.     or if the connecting cable is not carrying the signals.
  313.  
  314.     SHARED (boolean) - this tool type tells MUD to open the serial
  315.     port in "shared" mode. This means that other programs can have
  316.     the port open at the same time. MUD (and the MUDAgent program
  317.     at the other end) will become confused if any other program
  318.     actually reads from or writes to the port while MUD is
  319.     connected, so this flag should be used with care.
  320.  
  321.     RETRIES (numeric) - this tool type specifies the number of times
  322.     that MUD should attempt to send or receive any given message
  323.     via the serial port connection. The default value is 10.
  324.     Larger values may be needed for reliable operation over noisy
  325.     telephone lines. Too large a value should not be given,
  326.     however, since then MUD won't give up soon enough on a true
  327.     lost connection.
  328.  
  329.     DIAL (string) - this tool type allows the specification of a
  330.     string to be sent over the serial port (usually to a modem) on
  331.     startup. With most modems, a dial string of the form
  332.     ATD1234567 will cause the modem to start dialing a telephone
  333.     number. This is handy to set up an icon for MUD to connect to
  334.     a specific remote AmigaMUD, or in a shell alias.
  335.  
  336.     NAME (string) - specify the name of the character to log in as.
  337.     Note that this is an AmigaMUD login, not a BBS or other one.
  338.  
  339.     PASSWORD (string) - specify the password for your character. It is
  340.     not recommended that you use this flag if your system is open
  341.     to use by others, since they can find your password easily. If
  342.     the password given this way is incorrect, it counts as the
  343.     first of your three attempts at getting it right.
  344.  
  345.     DEVICE (string) - this tool type allows the specification of the
  346.     name of an alternative serial device to use for a connection.
  347.     The default name is "serial.device", which refers to the
  348.     standard built-in serial port.
  349.  
  350.     UNIT (numeric) - this tool type allows the specification of a
  351.     particular serial port unit on a device with several ports.
  352.     The default value is 0.
  353.  
  354.     FLAGS (numeric) - this tool type is used to specify some special
  355.     flag values which MUD passes on to "mud.library". The flag
  356.     values only effect the operation of some caching mechanisms
  357.     which are of value to wizards. The value is the sum of the
  358.     following:
  359.  
  360.         1 - cache procs. This remote client will cache the
  361.         definitions (but not the bodies) of builtin and user
  362.         procs in the AmigaMUD language. This saves refetching
  363.         them when parsing procs (such as after editing one).
  364.  
  365.         2 - cache symbols. This remote client will cache the
  366.         values of symbols that it has fetched from the server.
  367.         Again, this cuts down on communications when parsing
  368.         AmigaMUD procs.
  369.  
  370.     Note that both of these flags increase the amount of memory
  371.     consumed by MUD. This memory is not freed until MUD exits.
  372.     The default value of 'FLAGS' is 0, i.e. both caches off.
  373.  
  374.     EDITORSTACK (numeric) - this is the size of stack to use for an
  375.     external editor process. The default is 9996 bytes, and the
  376.     minimum is 4096 bytes.
  377.  
  378.     Examples:
  379.  
  380.     LOCAL=true
  381.     PORTNAME=MUD2
  382.     OHISTORY=10000
  383.  
  384.     This requests a connection on the local machine to a server
  385.     running with Amiga OS port name "MUD2". An output history
  386.     buffer of 10000 characters will be allocated and used.
  387.  
  388.     BAUD=9600
  389.     7WIRE
  390.     DEVICE=siosbx.device
  391.     UNIT=1
  392.  
  393.     This requests a 9600 bps connection, using hardware flow
  394.     control, on the second port of an ASDG dual-port board.
  395.  
  396.  
  397. MUD CLI Command Line Flags
  398.  
  399. All of the above icon tool types can be given on a CLI command line,
  400. as in:
  401.  
  402.     MUD BAUD=2400 7WIRE IHISTORY=2000 DIAL=atd1234567
  403.  
  404. In addition, there are short forms for many of the flags and some
  405. additional flags that are only meaningful from a CLI command line.
  406. In these flags, any needed value must directly follow the flag
  407. letter, i.e. there must not be any spaces between them. More detailed
  408. descriptions of these settings can be found in the previous section
  409. on icon tool types. The flags supported are:
  410.  
  411.     -L - make a local connection
  412.  
  413.     -T - make a local connection using port "MUD test port"
  414.  
  415.     -B - use the bright text window colours
  416.  
  417.     -D - use the dim text window colours
  418.  
  419.     -F <flags> - set the mud.library flags - see FLAGS tool type
  420.  
  421.     -P <portname> - use the given name as the local port to connect to
  422.  
  423.     -S - do a serial connection with the port opened in shared mode
  424.  
  425.     -w - try to close the Workbench on startup
  426.  
  427.     -d <device> - use the named device instead of "serial.device"
  428.  
  429.     -u <unit> - use the given device unit instead of unit 0
  430.  
  431.     -b <speed> - use the given serial speed instead of 19200
  432.  
  433.     -i - ignore the Carrier Detect serial signal
  434.  
  435.     -7 - use 7-wire hardware serial handshaking
  436.  
  437.     -N <name> - use <name> as the name of the character for the
  438.     playing sessions, rather than prompting for a name
  439.  
  440.     -W <word> - use <word> as the password for the playing sessions.
  441.     If it is incorrect, it counts as the first attempt, and only
  442.     two attempts remain. This is normally used in conjunction with
  443.     -N, but can be used without it.
  444.  
  445.     -r <count> - retry each failing message the given number of times
  446.  
  447.     -E - this flag was useful to me when I was testing the sample
  448.     online building sessions - it starts up MUD with its editing
  449.     capability disabled, so that text must be entered in the line-
  450.     by-line mode. The disabling is known to the MUD server, and
  451.     hence to the scenario.
  452.  
  453.     -s <size> - this flags specifies the size of stack to use for an
  454.     external editor process. The default size is 9996 bytes, and
  455.     the minimum size is 4096 bytes.
  456.  
  457. An interesting combination is to combine a DIAL= with -N and -W. If
  458. the system you are calling is directly running MUDAgent for a binary
  459. connection, then the call will happen and you will end up being
  460. connected to your character, without having to do anything else.
  461.  
  462. The following flags are included for compatibility with the "Getty"
  463. program. There is currently no real use for this support, but I
  464. believe that it may become desireable to have a terminal program which
  465. can call out to the MUD client program, much as Getty or BBS's call
  466. out to the MUDAgent program. This is because the terminal support in
  467. MUD is minimal, and the user may want to do other activities during a
  468. BBS connection which require more functionality. A terminal program
  469. which supports callouts in this manner could then be used to provide
  470. both levels of functionality in a given connection. Most people can
  471. ignore these flags, at least for now. See Getty documentation for
  472. details. The flags are:
  473.  
  474.     -Getty - supresses any port initialization, and opens shared
  475.     -DEVICE <name> - name of device to use
  476.     -UNIT <number> - unit number on device
  477.     -HLINK - ignore carrier detect
  478.     -BAUD <speed> - set connection speed
  479.     -USER <name> - parameter ignored
  480.  
  481.  
  482. Menus in MUD
  483.  
  484. Some of the menu items in MUD have function key shortcuts. Others have
  485. right-amiga command key shortcuts. Both types of shortcuts will work
  486. regardless of which of the windows (graphics or text) is currently the
  487. active one. Most of the "Serial" menus will only work while in
  488. "terminal mode", and some others will not work in terminal mode.
  489. Inactive menus are shown ghosted. Key shortcuts for menu items are
  490. shown here inside square brackets.
  491.  
  492.     Project - the Project menu contains general utility operations.
  493.  
  494.     Log [F7] - this item will enable or disable logging of text
  495.         input and output. If no logfile name has been selected
  496.         when logging is turned on, one will be requested.
  497.  
  498.     Log File - allows selection of a file to log to. Logging will
  499.         be turned on after the selection of a name.
  500.  
  501.     Log Mode - the two modes, Both and Input, control what will be
  502.         logged to a log file. If 'Both' is checked, then both the
  503.         user's input and the game's output is logged. If 'Input'
  504.         is checked, then only the user's input is logged, with any
  505.         passwords omitted.
  506.  
  507.     Source - a file name is requested, and the contents of the
  508.         file is read and inserted as input from the user. This
  509.         operation works in either "wizard" mode (the user is
  510.         operating directly with the AmigaMUD interpreter) or in
  511.         normal mode, where input is being parsed as commands for
  512.         the scenario. Do not attempt to change modes inside a
  513.         sourced file, however, since the changing of modes is
  514.         not a synchronous event, and a few commands will end up
  515.         being given to the wrong mode.
  516.  
  517.     SnapShot
  518.  
  519.         Text - a file name is requested, and the entire contents
  520.         of the output history buffer is written to the file.
  521.  
  522.         Graphics - a file name is requested, and the current
  523.         contents of the graphics window is written to the file
  524.         as an IFF ILBM image. The current graphics palette is
  525.         included in the IFF file.
  526.  
  527.     Quit [R-A Q] - MUD disconnects from the server and either
  528.         exits, or goes back to the "terminal mode", depending on
  529.         whether you are running the client locally or remotely.
  530.         Using the close box on the text window has the same
  531.         effect, unless you are currently editing something, in
  532.         which case only the edit is aborted, as with typing a ^C.
  533.  
  534.     Abort - MUD exits immediately. This is useful if the server
  535.         has hung, or something has gone wrong with the connection
  536.         to it. Using this instead of 'Quit' may prevent you from
  537.         reconnecting to your character until the server times out
  538.         and shuts the connection down at its end. In some cases,
  539.         manual intervention on the server may be required before
  540.         you can connect to your character again.
  541.  
  542.     Modes - the Modes menu controls various parts of MUD that can be
  543.     enabled and disabled, or which give a choice of behaviours.
  544.  
  545.     History - this item allows you to control which of your input
  546.         lines is entered into the input history buffer. In 'Full'
  547.         mode, all input lines are entered, regardless of how they
  548.         were generated. In 'New' mode, input lines are entered
  549.         only if they were not taken unchanged from the input
  550.         history. In 'Minimal' mode, input lines are entered into
  551.         the history only if they did not originate from that
  552.         history, i.e. only if they were typed in completely. I
  553.         recommend 'New' mode.
  554.  
  555.     Scroll On - this item allows you to control when the output
  556.         window is scrolled. If 'Input' is chosen, then the output
  557.         window scrolls only when a new input line is entered, or
  558.         when it must be scrolled because it is full and an output
  559.         line must be added. If 'Output' is chosen, then the output
  560.         window is scrolled whenever a new line of output is added
  561.         to the bottom. If 'Either' is chosen, then both input and
  562.         output lines will cause the scrolling. If 'Neither' is
  563.         chosen, then the output window does not scroll unless the
  564.         user scrolls it or it is full. This last mode is useful
  565.         when typing input lines based on output history that has
  566.         already scrolled out of the text window.
  567.  
  568.     Editor - this item allows you to choose when to use the
  569.         internal editor and when to use an external editor. If
  570.         'Internal' is chosen, then the internal editor is used for
  571.         editing strings (such as descriptions) and when editing
  572.         AmigaMUD functions when in wizard mode. If 'Selected' is
  573.         chosen, then strings are edited with the internal editor
  574.         and functions with an external one. If 'External' is
  575.         chosen, then an external editor is used for everything. If
  576.         you are not familiar with running a text editor such as
  577.         'Ed' on the Amiga, I recommend using 'Internal'. When
  578.         editing AmigaMUD functions, the internal editor can move
  579.         the cursor to the position of errors when the function is
  580.         submitted for parsing. Some external editors support this
  581.         kind of operation using ARexx commands, but MUD does not
  582.         currently support this.
  583.  
  584.     Picture [F1] - this item controls whether or not the graphics
  585.         window is visible. A full screen text window can be useful
  586.         when wizarding or when chatting with a number of other
  587.         players.
  588.  
  589.     Graphics [F2] - this items allows the user to disable all
  590.         graphics operations in the MUD client. This setting is
  591.         sent to the server, so it will not even send graphics
  592.         output messages. Note that turning graphics off and then
  593.         on again at a later time can result in an out-of-date or
  594.         inconsistent graphics view.
  595.  
  596.     Sound [F3] - this item allows the user to disable all playing
  597.         of sound samples. The setting is sent to the server so
  598.         that it doesn't even send sound requests to the client.
  599.  
  600.     Music [F4] - this item allows the user to disable all playing
  601.         of music scores. The setting is sent to the server so that
  602.         it doesn't even send music requests to the client.
  603.  
  604.     Voice [F5] - this item allows the user to disable all speech
  605.         output. The setting is sent to the server so that it
  606.         doesn't even send speech requests to the client.
  607.  
  608.     Edit Win [F6] - this menu item is the only way to switch
  609.         between the full-screen internal editor window and the
  610.         normal split-screen playing view. The item is not enabled
  611.         when nothing is being edited. By switching to the normal
  612.         view when editing, you can continue to operate in the MUD,
  613.         but this shouldn't be done long, since you might suddenly
  614.         need to edit something else.
  615.  
  616.     Options - these menu items select some supplementary functions.
  617.  
  618.     ScreenToBack [R-A B] - this item sends the MUD client screens
  619.         (the graphics and text windows) to the back of the stack
  620.         of screens on your Amiga. Unless you are running other
  621.         programs, this will just result in the normal Workbench
  622.         screen coming to the front. It is useful during testing,
  623.         however, since then there might be several MUD clients
  624.         running on the same system as a server. Sending a ^F
  625.         signal to MUD will cause it to move its screens to the
  626.         front of the display.
  627.  
  628.     Workbench - this item allows you to try to turn the Amiga's
  629.         Workbench on and off. Turning the Workbench off is useful
  630.         to conserve memory. The Workbench will not turn off if
  631.         other applications are open on the Workbench screen.
  632.  
  633.     Caches - this item allows you to examine and manipulate the
  634.         local caches of graphics and sound effects that the MUD
  635.         client maintains.
  636.  
  637.         Free File - a single cached IFF file will be freed. This
  638.         can be a background, brush or image, a sound sample,
  639.         or a music score. The next time the selected file is
  640.         needed, it will have to be reloaded from disk. The
  641.         system will chose the least recently used file.
  642.  
  643.         Free Effect - free the single least recently used
  644.         unreferenced effect. See a later section on 'Caches'
  645.         for more details.
  646.  
  647.         Zap Effects - free all effects
  648.  
  649.         Show Status - show the status of all cached files and
  650.         effects. This status is affected by requests coming
  651.         from the server and by the above three menu items. See
  652.         the 'Caches' section for more information.
  653.  
  654.     Memory - the amount of available chip and total memory is
  655.         shown. This can be useful in understanding why effects
  656.         aren't happening (lack of memory), and to get a feel for
  657.         the amount of memory that the MUD client can consume.
  658.  
  659.     Serial - these items are mostly of use only during an initial
  660.     "terminal mode" with a serial connection.
  661.  
  662.     IgnoreCD - controls whether or not MUD will expect a valid CD
  663.         (Carrier Detect) signal. This hardware signal should be
  664.         generated by a modem when it detects a carrier signal on
  665.         the telephone line. If your modem does not do this, or if
  666.         you have told it not to, or if your serial cable does not
  667.         transmit the signal, you should instruct MUD to ignore the
  668.         signal, else it will not think a connection has been made.
  669.  
  670.     Speed - provides a few manually-selectable speeds for use when
  671.         in terminal mode. Other values can be entered from an icon
  672.         tool type or a CLI command line.
  673.  
  674.     Break [R-A .] - requests that a break condition be sent over
  675.         the serial line. This condition is a lengthy pause in the
  676.         raw transmit data stream that is detectable at the other
  677.         end of the line. You can see it as an "on" pulse in your
  678.         modem's TX light.
  679.  
  680.     Connect [R-A C] - this item forces MUD to attempt to initiate
  681.         a binary connection with the other end. If the other end
  682.         is set up to only handle a binary connection, this will
  683.         not be necessary, since the other end will start things
  684.         up. If, however the other end is waiting to distinguish
  685.         either a binary or a text-only connection, then this menu
  686.         item is used to start up a binary connection.
  687.  
  688.     Stats [R-A S] - this item shows some statistics maintained by
  689.         the serial protocol code:
  690.  
  691.         Packets TX: - total number of packets (messages) sent
  692.             out from this end.
  693.  
  694.         ACKs TX: number of positive acknowledgements of
  695.             correctly received packets that this end has sent.
  696.  
  697.         NAKs TX: number of negative acknowledgements of
  698.             incorrectly received packets that this end has
  699.             sent. Incorrectly received packets must be resent
  700.             by the sender.
  701.  
  702.         Packets RX: total number of packets that this end has
  703.             received.
  704.  
  705.         ACKs RX: number of positive acknowledgements received.
  706.  
  707.         NAKs RX: number of negative acknowledgements received.
  708.  
  709.         Waits timed out: MUD puts a time limit on any of its
  710.             waits for receiving something over the serial
  711.             port. This number indicated how many times that
  712.             time limit went off. Normally, this means that a
  713.             packet sent from this end was completely lost, so
  714.             the other end didn't either ACK or NAK it.
  715.  
  716.         Read no bytes: indicates the number of times a serial
  717.             port read request returned, but indicated that no
  718.             bytes were received. This can happen if a BREAK
  719.             condition is received.
  720.  
  721.         Writes failed: indicates the number of times that a
  722.             serial port write request did not complete due to
  723.             some error, such as a loss of carrier signal.
  724.  
  725.  
  726. History Manipulation and Input Line Editing
  727.  
  728. MUD maintains two forms of history. One is a history of commands
  729. entered by the user, and the other is a history of both input lines
  730. and output text from the server.
  731.  
  732. The output history is straightforward - it can be accessed by using
  733. the scroll bar on the right hand side of the text window. Also,
  734. pressing an ALT key and an up or down arrow key at the same time will
  735. scroll the output window a line at a time. Additionally pressing a
  736. shift key (along with the ALT key and the arrow key) will scroll by a
  737. full window at a time.
  738.  
  739. Input history and input line editing is very similar to that done in
  740. the standard Amiga shell, with some minor additions. The available
  741. operations are as follows:
  742.  
  743.     up-arrow - scroll backward in the input history
  744.  
  745.     down-arrow - scroll forward in the input history
  746.  
  747.     shift-up-arrow - search backward in the input history for a line
  748.     which matches the input text to the left of the cursor. If any
  749.     is found, insert it into the input region in place of what was
  750.     previously there.
  751.  
  752.     shift-down-arrow - move the current history search point to the
  753.     end of the input history and clear the input region
  754.  
  755.     HELP, and numeric keypad keys - these are sent as is to the
  756.     AmigaMUD server, where they can be used as desired by the
  757.     currently running scenario
  758.  
  759.     right-arrow - move the cursor right one column
  760.  
  761.     left-arrow - move the cursor left one column
  762.  
  763.     shift-right-arrow - move the cursor to the end of the current
  764.     input
  765.  
  766.     shift-left-arrow - move the cursor to the beginning of the input
  767.     region
  768.  
  769.     cntl-A - move the cursor to the beginning of the input region
  770.  
  771.     cntl-B - move the cursor left one column
  772.  
  773.     cntl-E - move the cursor to the end of the current input
  774.  
  775.     cntl-F - move the cursor right one column
  776.  
  777.     cntl-H (backspace) - delete the character before the cursor
  778.  
  779.     cntl-I (tab) - move the cursor forward to the next 8 column
  780.     boundary
  781.  
  782.     cntl-K - delete all characters from the one under the cursor to
  783.     the end of the current input. The deleted characters are saved
  784.     in the "undo buffer".
  785.  
  786.     cntl-M (carriage return) - send the current input to the server
  787.     and clear the input region ready for another line. The line
  788.     may be added to the input history, depending on the setting of
  789.     the history choice, and on whether any editing of the line had
  790.     been done.
  791.  
  792.     cntl-N - go forward one line in the input history
  793.  
  794.     cntl-P - go backward one line in the input history
  795.  
  796.     cntl-R - search backward through the input history. Same as
  797.     shift-up-arrow.
  798.  
  799.     cntl-U - delete all input characters to the left of the current
  800.     cursor position.
  801.  
  802.     cntl-W - delete the "word" to the left of the cursor
  803.  
  804.     cntl-X - clear the input region
  805.  
  806.     cntl-Y - insert from the undo buffer at the current cursor
  807.     position, and move the cursor to the end of the input data.
  808.  
  809.     DEL - delete the character under the cursor
  810.  
  811.  
  812. Using the Internal Editor
  813.  
  814. The internal editor in the MUD client program can be started to edit a
  815. simple text string, such as a character description, a room
  816. description, etc. or to edit an AmigaMUD function while in wizard
  817. mode. The initial startup varies slightly between the two situations,
  818. mostly relating to the quoting and escaping of things, but the main
  819. operation of the editor is the same in both cases.
  820.  
  821. The edit session is actually started by messages from the server, but
  822. the server is normally just responding to user requests. When editing
  823. is to be done, the text to be edited must first be sent from the
  824. server to the MUD client program. This can take a few seconds for a
  825. large function or description operating over a slow link. When all of
  826. the data has arrived, MUD will switch to a single full-screen text
  827. window (if it wasn't already) containing the first windowfull of the
  828. text. A menu item, or function key F6, can be used to temporarily
  829. switch back to the normal mode of operation. The switch-back should be
  830. short, however, since the system will not allow multiple things to be
  831. edited at once by any given client.
  832.  
  833. While editing, the normal function keys and menus still operate, but
  834. their effect may not be immediately visible. Normal input and output
  835. history do not work, however, as they are replaced by an expanded set
  836. of editing operations. In edit mode, pressing the HELP key will
  837. display a short summary of the editing operations available.
  838.  
  839. The internal editor is always in "insert mode"; that is, characters
  840. typed will always be inserted before any characters at or after the
  841. cursor on the current line, shifting those other characters to the
  842. right. The editor limits lines being edited to 160 characters (two
  843. displayed lines). Lines coming from the server will never be longer
  844. than can be displayed in the window, so longer lines can only be
  845. created by editing. There is no need to use long lines in AmigaMUD -
  846. lines of descriptions are all joined when the description is sent
  847. back to the server, and the spacing of functions is thrown away when
  848. the function is parsed. When editing things like letters and
  849. bulletins, the user's lines are preserved, but long ones will be
  850. wrapped when sent to any clients reading them.
  851.  
  852. When editing an AmigaMUD function in wizard mode, the editor can work
  853. with the parser to identify the location of errors. When the user
  854. types the cntl-Q key combination, the text in the editor is parsed (on
  855. the local machine, by code in mud.library) into an internal data
  856. structure. If any errors are encountered, the parser gives an error
  857. message and a position to the editor. The editor displays the message
  858. in reverse video at the bottom of the window, and moves the cursor to
  859. the reported position, redrawing the window if necessary. The user can
  860. then immediately do editing to correct the error. If a further cntl-Q
  861. is entered, the parsing will be restarted from the beginning of the
  862. function. If, however, a cntl-G is entered, the parsing will continue
  863. from the first error, perhaps showing further errors in the function.
  864. A cntl-R combination can be entered to abort the parsing, but not
  865. start another parse. At any point in editing, a cntl-C can be entered
  866. to abort the entire edit session. Similarly, clicking on the edit
  867. window close box will abort the edit session, but will not cause MUD
  868. to exit.
  869.  
  870. The text window's scroll bar is active while editing, and can be used
  871. to scroll around in a long function or description. Also, the same
  872. alt-up-arrow, alt-down-arrow, shift-alt-up-arrow and shift-alt-down-
  873. arrow key combinations that work in normal mode also operate while
  874. editing. When scrolling this way, the text cursor may have to move to
  875. remain visible in the window.
  876.  
  877. The available editing operations are:
  878.  
  879.     Control operations:
  880.  
  881.     HELP - display a short summary of operations
  882.  
  883.     cntl-C - abort the edit. If editing a description, the
  884.         scenario code is informed that the edit was aborted. If
  885.         editing an AmigaMUD function, the function will be
  886.         unchanged from before the edit. The edit can also be
  887.         aborted by clicking on the close box of the edit window.
  888.         This will not cause MUD to exit.
  889.  
  890.     cntl-Q - if editing a description, then the description as it
  891.         is in the editor is sent to the server as the result of
  892.         editing, and the MUD client program switches back to
  893.         normal operation. If editing a function, then MUD starts
  894.         parsing the function. If no errors are encountered, the
  895.         function is sent to the server where the new definition
  896.         immediately replaces the old one. If an error is
  897.         encountered, its message is displayed at the bottom of the
  898.         window, and the cursor is moved to the location of the
  899.         error.
  900.  
  901.     cntl-G - this combination does nothing unless a function is
  902.         being editing, and an error has been encountered. In that
  903.         situation, the parsing continues and the next error is
  904.         reported. If there are no more errors, that is indicated
  905.         by showing the "proc not updated" message.
  906.  
  907.     cntl-R - this combination does nothing unless a function is
  908.         being edited, and an error has been encountered. In that
  909.         case, all further errors from this parse of the function
  910.         are discarded.
  911.  
  912.     Cursor motion operations:
  913.  
  914.     left-arrow - move cursor left one column
  915.  
  916.     right-arrow - move cursor right one column
  917.  
  918.     shift-left-arrow - move cursor to the beginning of the line
  919.  
  920.     shift-right-arrow - move cursor to just past the end of the
  921.         line
  922.  
  923.     down-arrow - move cursor down one line, scrolling the window
  924.         if necessary
  925.  
  926.     up-arrow - move cursor up one line, scrolling the window if
  927.         necessary
  928.  
  929.     shift-down-arrow - move cursor to the bottom of the window
  930.  
  931.     shift-up-arrow - move cursor to the top of the window
  932.  
  933.     cntl-A - move cursor to the beginning of the line
  934.  
  935.     cntl-B - move cursor back one column
  936.  
  937.     cntl-E - move cursor to the end of the current line
  938.  
  939.     cntl-F - move cursor forward one column
  940.  
  941.     cntl-I (tab) - move cursor forward to the next 8-column
  942.         tabstop
  943.  
  944.     cntl-L - move cursor to the beginning of the next line
  945.  
  946.     cntl-N - move cursor to the next line
  947.  
  948.     cntl-P - move cursor to the previous line
  949.  
  950.     cntl-T - move cursor to the line at the top of the window
  951.  
  952.     cntl-Z - move cursor to the line at the bottom of the window
  953.  
  954.     Editing operations:
  955.  
  956.     cntl-D - delete the current line
  957.  
  958.     cntl-H (backspace) - delete the character before the cursor
  959.  
  960.     cntl-J - join this line with the next line. The text of the
  961.         next line is appended to the end of the current line.
  962.  
  963.     cntl-K - characters from the current one under the cursor to
  964.         the end of the line are deleted (killed)
  965.  
  966.     cntl-M (carriage return) - a new line is inserted after the
  967.         current one and the cursor moves to the beginning of that
  968.         empty line
  969.  
  970.     cntl-S - split the current line. Characters from the one under
  971.         the cursor to the end of the line are moved into a new
  972.         line inserted after the current one.
  973.  
  974.     cntl-U - characters from the beginning of the current line
  975.         upto the one just before the cursor are deleted
  976.  
  977.     cntl-W - the previous "word" is deleted. A word is a sequence
  978.         of non-spaces delimited by spaces or the beginning or end
  979.         of the line.
  980.  
  981.     cntl-X - the current line is cleared, or emptied
  982.  
  983.     cntl-Y - the line is put back to the same state it had before
  984.         any changes were made to it. This backup copy of the line
  985.         is discarded if the cursor is moved out of the line, i.e.
  986.         only changes made to the line while the cursor is in the
  987.         line can be undone.
  988.  
  989.  
  990. Caches in the MUD Client Program
  991.  
  992. In computer usage, a cache is a set of local copies of things that are
  993. expensive to get. An instruction cache in a CPU is a small memory
  994. which contains some of the instructions executed most recently. This
  995. cache memory can be accessed much faster than the main RAM memory
  996. external to the CPU chip. This same technique is used in AmigaMUD to
  997. speed up operation. This section will discuss the caches used in the
  998. MUD client program. The symbol cache and the function header cache are
  999. of benefit only to wizards, and were discussed earlier.
  1000.  
  1001. AmigaMUD uses the term "effect" to refer to any of the non-text output
  1002. items that are possible: graphics, sound, voice and music. Scenes in a
  1003. scenario can be drawn in a variety of ways. The simplest way is to
  1004. simply load an IFF ILBM image produced using a paint program. This
  1005. image must be present on the remote client machines, however, since
  1006. sending such an image over the serial connection every time it is
  1007. needed would be too slow. Many players of an AmigaMUD scenario will
  1008. not have the pictures, however, so an alternate method of drawing a
  1009. scene is needed.
  1010.  
  1011. As directed by code in AmigaMUD functions, the server can send
  1012. messages to remote clients directing them to draw various simple
  1013. graphical elements in the graphics window. These include lines,
  1014. rectangles, circles, etc. A simple form of a scene can be drawn using
  1015. these elements, and can be sent from the server to the client in less
  1016. time than sending a full bitmap of a similar scene. It is useful,
  1017. however, if a given scene needs to be sent over only once per session.
  1018. Then, the scene can be called up by a short command from the server,
  1019. thus greatly speeding up the play of the game.
  1020.  
  1021. This storing of graphics elements (and commands to play sounds, etc.
  1022. as well) by the remote clients is the "effects cache". Each effect is
  1023. uniquely identified, and can be called up much like a subroutine or
  1024. function can be called in a programming language. In fact, they ARE
  1025. effects subroutines, and can in turn call on other, lower-level
  1026. effects subroutines.
  1027.  
  1028. Many Amiga systems have a megabyte or more of RAM, but have only a
  1029. single floppy disk drive for permanent storage. Having to load up an
  1030. IFF image or sound sample every time they are needed could make for
  1031. slow and unpleasant playing of a graphics MUD. To alleviate this, the
  1032. MUD client program will cache such items in RAM. This is termed the
  1033. "file cache".
  1034.  
  1035. The menu item "Caches"/"Show Status" displays the status of the caches
  1036. in the client program. Here is a sample of its output:
  1037.  
  1038. Files:
  1039.   Images/streetsX >0<
  1040.   Sounds/birds >0<
  1041. Effects: 4/18>2< 5/18>2< 3/18>10< 2/18>8< 13/240(7) 8/12 20/416(15) 6/112 1/48
  1042. Tiles:
  1043.  
  1044. Here there are currently two files loaded in the file cache. One is an
  1045. image (IFF ILBM) called 'streetsX'. The other is a sound sample (IFF
  1046. 8SVX) called 'birds'. The printed name shows the directory within the
  1047. "AmigaMUD:" assign that the file came from. The '>0<' indicates that
  1048. there are currently no references to the files, and thus they can be
  1049. flushed from the cache as desired. Files can be flushed from the file
  1050. cache using the "Caches"/"Free File" menu item, and can also be
  1051. flushed by the program itself if it runs out of memory (e.g. to load
  1052. in another file). When a file is flushed, the Least Recently Used one
  1053. (the one such that all others have been used more recently) is chosen
  1054. for flushing. A file cannot be flushed if its reference count is
  1055. greater than zero. This will be true while a sound sample is playing,
  1056. while a music score is playing, or while an instrument is referenced
  1057. by a score in the file cache.
  1058.  
  1059. There are nine effects subroutines currently stored in the effects
  1060. cache. For each one, the first number displayed (before the '/') is
  1061. the unique identifier for the effect. For a given compilation of the
  1062. scenario, these numbers will not change. The number after the '/' is
  1063. the size in bytes of the effect. The four length-18 effects in the
  1064. above display are for the four styles of doors used in the standard
  1065. scenario. A following number as in '>2<' shows the number of
  1066. references to the effect subroutine from other effects subroutines.
  1067. The various doors are used by both the 'streets' and the 'mall'
  1068. effects subroutines. A following number as in '(15)' shows the number
  1069. of references to other effects subroutines that this effect makes.
  1070. The list of effects subroutines is shown in order of the most recently
  1071. used one to the least recently used one. Thus, in this case, using the
  1072. "Caches"/"Free Effect" item would free the effect with key 1 and size
  1073. 48. Again, affects with non-zero reference counts cannot be freed.
  1074.  
  1075. Freeing an effect is not instantaneous. The server keeps track of
  1076. which effects each client has in its cache, so that it knows when it
  1077. has to send a copy of an effect to a client. So, when the client wants
  1078. to free an effect, it sends a request to the server, which will always
  1079. reply in the affirmative. This allows the server to try to keep its
  1080. records accurate. It is, however, still possible for the two to get
  1081. out of agreement. If the server sends an effect that the client
  1082. already has in its cache, the client just ignores the new copy. This
  1083. can happen even in proper operation, because of timing issues. If an
  1084. effect manages to call an effect that is not in the cache (this should
  1085. not happen), the call is ignored.
  1086.  
  1087. The "Tiles:" line in the output will currently always show nothing,
  1088. since no current scenario uses the tiling facility of the system. When
  1089. in use, each entry is simply the numeric identifier of the cached
  1090. tile.
  1091.  
  1092. The "Caches"/"Zap Effects" menu item sends a request to the server
  1093. saying that all of the effects subroutines cached by this client are
  1094. to be freed. When the reply gets back to the client, it in turn will
  1095. free all of the effects subroutines it has cached. This can be useful
  1096. if for some reason, the server and the client seem to get out of
  1097. agreement and the proper displays are not appearing. More likely,
  1098. however, is a bug in the scenario which is not displaying the scenes
  1099. correctly.
  1100.