home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd2.bin / bbs / game / amigamud-0.7.lha / AmigaMUD / Client / Doc / MUD.txt < prev    next >
Text File  |  1994-07-31  |  49KB  |  1,064 lines

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