home *** CD-ROM | disk | FTP | other *** search
/ Amiga Special: Spiele Hits / Hits-CD.iso / aminet / spiele / ammud1_1.lha / AmigaMUD / Doc / MUD.txt < prev    next >
Text File  |  1997-08-02  |  68KB  |  1,438 lines

  1. AmigaMUD, Copyright 1997 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 or via a
  9. TCP/IP internet connection. The operation of the program is the same
  10. in all cases, although some details of starting it up vary. This
  11. client program must be used in order to get graphics and audio output
  12. and to use mouse and keypad input. This is the recommended interface
  13. for use with AmigaMUD, although a remote user can operate in a simple
  14. text-only mode using just a terminal program or a telnet program in
  15. the case of an internet connection.
  16.  
  17. The display that MUD produces depends on how it is configured. The
  18. default display uses two Amiga screens. The upper screen is for
  19. graphics, and is 320 pixels across by 100 pixels high by 32 colours.
  20. The lower screen is used for text, and is roughly 640 pixels across by
  21. 100 pixels high by 4 colours. The text window has a scrollbar for
  22. viewing output history, and supports input history and line editing.
  23. Hires mode doubles both sizes of the graphics window and the vertical
  24. size of the text window. Onescreen mode puts both areas as windows on
  25. a single screen. Onewindow mode puts both areas as regions within a
  26. single window on the Workbench. Twowindow mode uses two Workbench
  27. windows, one for text and one for graphics. In Workbench modes, the
  28. text area is sizeable. See the "Display" section for more details.
  29.  
  30. The bottom line of the text window is the input area. Output text
  31. lines appear on the line above this one, thus any partial input lines
  32. are not disturbed by output from other events taking place in the MUD.
  33. Input line editing and history retrieval is done in this line and will
  34. be described later. When RETURN is pressed, the current input line is
  35. sent to the server, and is echoed (along with the current prompt) in
  36. the output area. Note that the position of the command in the output
  37. area does not necessarily correspond to the point at which the server
  38. will process it, since the server may not get around to it for a
  39. while, and because the server may already have generated other output
  40. that hasn't arrived yet.
  41.  
  42. MUD can be started either from the Workbench or from a CLI. All of the
  43. tool type values that can be put in the Workbench icon can also be
  44. given on a CLI command line. Additional, shorter, forms for many of
  45. the flags can also be used from a CLI. By default, MUD will attempt to
  46. make a connection to a server running on the local machine.
  47.  
  48. NOTE: in order to run MUD, either locally or remotely, there must be a
  49. copy of "mud.library" in your LIBS: directory.
  50.  
  51. NOTE: MUD requires a stack of at least 10000 bytes. It will exit right
  52. away if the stack is not at least that large. If you are running MUD
  53. from a shell, use the 'Stack' command (perhaps in your shell-startup)
  54. to set a sufficient stack size. If you are running MUD from the
  55. Workbench, use the "Icons"/"Information" Workbench menu item to set
  56. the stack size on the MUD icon to at least 10000.
  57.  
  58. MUD is able to call up an external editor to edit strings (such as
  59. character and room descriptions) and procs (AmigaMUD procedures). What
  60. program to run as the editor can be controlled by setting the
  61. "MUDEditor" environment variable to the full path to the editor to
  62. use. If the variable is not set, variable "EDITOR" (also used by other
  63. software) is checked, and if that is not set, "Ed" is used. The editor
  64. used must accept the name of the text file to edit on the CLI command
  65. line, and must be a able to edit and write a simple text file. MUD
  66. does not understand text processor or word processor documents. The
  67. editor must not "auto detach", since that causes the edit process to
  68. terminate prematurely from MUD's point of view. Many users will prefer
  69. to just use the simple editor built-in to the MUD program.
  70.  
  71. If an external editor is used, the AmigaDOS process created for it
  72. will by default have a stack size of 9996 bytes. If you wish to use
  73. more or less bytes, you can use the '-s' CLI flag, or the
  74. "EDITORSTACK" icon tooltype, to specify a different size. MUD will
  75. enforce a minimum size of 4096 bytes.
  76.  
  77. The MUD client program can display background pictures and brush
  78. images loaded from the machine it is running on. It can also play
  79. sound samples, and, in the future, will be able to play SMUS (and
  80. perhaps CMUS) music. A single assign or volume name of "AmigaMUD:"
  81. must be present when MUD is started. It does not need to contain
  82. anything, but if it does, it should be arranged into the following
  83. subdirectories:
  84.  
  85.     BackGrounds: background images (fill the graphics area)
  86.     Images: images of various sizes (often fill half the graphics)
  87.     Brushes: smaller brush images with a mask plane or with a
  88.     transparent colour specified
  89.     Sounds: IFF 8SVX sound samples
  90.     Music: IFF SMUS music scores
  91.     Instruments: IFF 8SVX instruments
  92.  
  93. The text window in MUD has a close box. Clicking on this box will
  94. start an exit sequence, which will normally result in MUD exiting.
  95. This can also be done with a menu selection. If MUD is started from a
  96. shell, using the 'Break' command on its process will also cause it to
  97. exit. If MUD refuses to exit for some reason (such as the server
  98. having been aborted, or the serial connection being lost), then MUD
  99. can be exited with the Abort menu item. Note that you should not abort
  100. unless absolutely necessary, since this can confuse the server if it
  101. is still active. In particular, manual intervention on the server will
  102. be required before you can log in again.
  103.  
  104. Following sections of this document will cover the CLI command line
  105. and icon tool type flags in more detail. Others will cover the use of
  106. the menus in MUD and the use of the internal editor. After that will
  107. be a discussion of the the various types of caching done by the
  108. program.
  109.  
  110.  
  111. Using MUD to Connect to an AmigaMUD Server
  112.  
  113. When connecting to a server running on the same machine as MUD, the
  114. connection is direct and immediate. The prompt to enter a character
  115. name will appear right away, and the text window will be used only for
  116. MUD input and output.
  117.  
  118. When connecting via a TCP/IP stack, the stack should be active before
  119. you start the MUD program. The name of the machine running the server
  120. (or its IP address) must be given, either on a CLI command line or via
  121. an icon tooltype. The TCP port number can also be given if it is
  122. different from the default 6667. Nothing else need be done with this
  123. kind of connection - status messages will be displayed in the text
  124. window as needed. Note: this MUD client program is *not* a suitable
  125. client for use with any MUD servers other than the AmigaMUD server.
  126. The connection to the server goes through an agent program, MUDBinary,
  127. on the server machine, but the client is not affected by this.
  128.  
  129. When connecting via a serial port (with or without a modem), the text
  130. window will initially play the role of a very simple terminal program.
  131. This mode has no emulations, does not support any escape sequences,
  132. etc. You can, however, use the logging facility to do the equivalent
  133. of "ASCII capture". The "Serial" menu can also be used to change the
  134. CD (Carrier Detect) status, change the connection speed, and generate
  135. BREAK conditions. When in this "terminal mode", characters typed are
  136. not locally echoed (full duplex), and no special processing or
  137. translation is done on sent or received carriage return or linefeed
  138. characters. This mode will attempt to ignore any ANSI escape sequences
  139. that it sees, however.
  140.  
  141. When serially connected, the MUD program on the remote machine uses a
  142. reliable bidirectional binary protocol to talk to a copy of the
  143. "MUDAgent" program running on the server machine. This means that
  144. information (messages) can be sent in both directions at the same
  145. time, and that messages are not limited to printable characters. Also,
  146. the programs will automatically retry messages that are not
  147. acknowledged by the other end, or are corrupted during transmission.
  148.  
  149. This protocol operates quite differently from the simple "terminal
  150. mode", so the programs must recognize and agree on when they switch to
  151. the protocol. Normally, the MUDAgent on the server will attempt to
  152. enter the protocol as soon as it is started up (e.g. as a result of a
  153. menu option entered on a BBS). When the local MUD program recognizes
  154. the special sequence sent out, it will display "REMOTE END DETECTED"
  155. and switch into the protocol mode. If this message is not seen when
  156. expected, then something is wrong in the connection. You may see the
  157. data lights on a modem blink at one-second intervals - this is the
  158. remote end resending its startup characters. If, however, the remote
  159. end is setup to allow either a full binary or a text-only connection,
  160. then it will not try to start the protocol until it sees a request.
  161. In that case, you must use the 'Serial/Connect' menu item to start the
  162. protocol from your end. If you don't know how the other end is set up,
  163. just wait a few seconds to see if MUD connects automatically. If it
  164. doesn't, then force the connection.
  165.  
  166. Because of the binary protocol, a serial connection for MUD must be an
  167. 8-bit no-parity connection. Other modes will not work, and will most
  168. likely result in either a failure to connect, or a hung connection. In
  169. that case, you must disconnect by exiting MUD, and try again with a
  170. proper connection.
  171.  
  172. In the serial case, that of using MUD to connect via modem to an
  173. AmigaMUD server running elsewhere, the sequence of operations goes
  174. something like this:
  175.  
  176.     - start MUD, possibly specifying options to change the baud rate,
  177.     use a different serial port, etc.
  178.  
  179.     - using MUD as a terminal program, dial the remote Amiga and log
  180.     on to it as normal.
  181.  
  182.     - do any further operations with the remote system as needed, such
  183.     as using BBS menus to get to an AmigaMUD selection.
  184.  
  185.     - instruct the remote system to run MUDAgent (e.g. select the
  186.     appropriate BBS menu item).
  187.  
  188.     - you should see some modem activity, followed by the "REMOTE END
  189.     DETECTED" message, then some more modem activity, and the
  190.     prompt to enter a character name.
  191.  
  192.     - enter your character name and start playing AmigaMUD
  193.  
  194. The MUDAgent program is able to monitor a serial port and make
  195. connections itself. If the host machine is operating this way, then
  196. when the initial modem connection is made, MUDAgent will immediately
  197. connect with your MUD client. MUDAgent can also be started by the
  198. "Getty" program, in which case you will see a "login:" prompt when you
  199. connect. At that point, enter the "userid" that is used on that system
  200. to get to AmigaMUD. You may have to enter a password other than your
  201. character password to get into AmigaMUD.
  202.  
  203. AmigaMUD also supports simple text-only connections. If you connect to
  204. one of these by, e.g. using the wrong BBS menu selection, then your
  205. MUD client and the MUDAgent program will not enter into the reliable
  206. protocol. You will not see the "REMOTE END DETECTED" message and will
  207. not get graphics/sound output and will not be able to use the normal
  208. features of the MUD program; instead, you will only have the "terminal
  209. mode" capabilities. Unless you will only be on the MUD for a short
  210. period, it is best if you disconnect and reconnect properly.
  211.  
  212. The MUD program supports Christopher Wichura's OwnDevUnit library for
  213. sharing of serial ports. This should be all automatic. If you are
  214. running something like 'Getty' or 'MUDAgent' to answer incoming calls,
  215. then MUD will request the port from that other program, and will fail
  216. to start up if that program does not release the port. If your system
  217. does not run OwnDevUnit.library, then this paragraph does not apply
  218. and can be ignored.
  219.  
  220. The MUD client program does not actually exit when you leave the
  221. scenario if you are connecting serially. Instead, it goes back into
  222. its "terminal mode", allowing you to do more connections in the one
  223. session. Note that it does NOT flush its cache of effects, so if you
  224. next connect to a different AmigaMUD, you should select the
  225. "Options/Effects/Zap Effects" menu item to empty the effects cache,
  226. since a given effect identifier is unlikely to mean the same thing on
  227. another AmigaMUD. If both AmigaMUD's are running the bare standard
  228. scenario, you are probably safe, however.
  229.  
  230.  
  231. Display
  232.  
  233. The display types supported by MUD are influenced by the version of
  234. the OS that you are running, and the Amiga hardware you are running
  235. on. For example, systems running pre-2.0 versions of the OS will only
  236. get an "oldstyle" display. Non-AGA systems (i.e. not A1200 or A4000)
  237. can only get the lo-res "basic" display or the "Workbench" display.
  238. Note that the Amiga OS will happily attempt to open screens of
  239. unsupported types, and nothing serious goes wrong - you just won't see
  240. all of the colours you expect. For example, on my V1.3 A1000, trying
  241. to open a hi-res basic display simply produces a graphics screen on
  242. which only colour 0 is ever displayed. On my A3000, the same request
  243. gets a screen in which only half of the colours are displayed. It can
  244. also be dangerous to run with the maximum number of colours that your
  245. Amiga will display when in a Workbench type - this can affect the
  246. Amiga's ability to handle the built-in serial port, causing
  247. communication problems. Alternative serial drivers may help.
  248.  
  249. As mentioned above, the on-Workbench display modes are only available
  250. on 2.0 and above systems. MUD's menus are designed to look most like
  251. standard 3.1 menus, but that appearance requires a 3.1 menu flag. So,
  252. on 2.0 and earlier systems, the menus will look like an intermediate
  253. between 2.0 style and 3.1 style (mostly 3.1 style with 2.0 colours).
  254. Other than that, MUD does not use any 3.1 features. In particular, it
  255. does not do any pen-locking, so on-Workbench colour handling is the
  256. same under 3.1 as it is under 2.0.
  257.  
  258. There are ten distinct display types supported by the MUD program,
  259. although some are only minor variations. If not told otherwise, it will
  260. open up the "basic" display. In this type, a graphics screen that is
  261. 320 pixels wide, 100 pixels high, and 5 bits deep (32 colours) is
  262. opened at the top of the display. It will be horizontally centered
  263. within your overscan range. The remainder of the display will be
  264. filled with a hi-res text screen, that is roughly as wide as your
  265. horizontal overscan, and roughly fills your vertical overscan. Note
  266. that this means that PAL systems will have more text lines than NTSC
  267. systems. The text display has a scroll-bar on the right hand side. All
  268. Amigas can use this display type with their built-in hardware.
  269.  
  270. Unless you are running a pre-2.0 system, the text colours of the
  271. "basic" display will be taken from your Workbench colours, so the text
  272. window should look much like a shell window with a scrollbar. The
  273. input prompt will be in a different colour, however. With this type,
  274. the menu-bar is attached to the text window in the text screen, so the
  275. menus will be half-way down the display, which is a bit unusual. Since
  276. the text window is using your Workbench colours, the effects function
  277. which changes the pens of the text window, and the scenario commands
  278. which use it (e.g. 'normalgrey' and 'brightgold'), are all disabled.
  279.  
  280. To the basic display type can be added the "oldstyle" modifier. This
  281. modifier makes MUD operate the way it used to, before the V1.1
  282. changes. With this display type, AmigaOS V2 and V3 features are not
  283. used, and the Workbench colours are ignored. Instead, the old gold
  284. colour scheme is used. When an oldstyle display is active, the
  285. function and commands for changing the text window colours are again
  286. active, and the 'dim' and 'bright' startup options are available.
  287.  
  288. A second modifier is the "hires" modifier. With this modifier active,
  289. the basic display will have a graphics area that is 640 pixels across,
  290. 200 pixels high, and 5 bits deep. The text screen will also be twice
  291. as many pixels high, giving twice as many lines of text. The "hires"
  292. modifier can be mixed with the "oldstyle" modifier to produce a total
  293. of four styles of "basic" display. Note that the hires displays use
  294. more memory and are a bit slower than the non-hires displays. As
  295. mentioned above, the hires displays require an AGA system, or a
  296. graphics card.
  297.  
  298. The second major display type is the "onescreen" display type. In this
  299. type of display, MUD opens only one screen, and uses Intuition windows
  300. on that screen for the graphics and text areas. In order that the
  301. standard 32 colours be available for graphics, in addition to the four
  302. (or more) colours needed for your standard Workbench windows, this
  303. display type opens a 64 colour (6 bit) display. The upper 32 colours
  304. are used for the graphics window, and the lower 32 are used (if at
  305. all) only by the text display, window borders, etc. The "onescreen"
  306. display type works on AGA systems, but is very slow. It is intended
  307. for those with graphics cards which cannot open multi-resolution or
  308. multi-depth displays. The "hires" modifier can be used with
  309. "onescreen" displays, with the expected effect. The combined type is,
  310. in my opinion, unusably slow on my all-CBM A4000T/040. In "onescreen"
  311. displays, the menus are attached to the graphics window, and so are
  312. at the top of the display.
  313.  
  314. The third major display type is the "twowindow" type. In this display,
  315. MUD opens up two windows on the Workbench screen (actually, on the
  316. default public screen). In the lores variant, the text window will
  317. open at the top of the screen, and will have room for 23 lines of text
  318. (the space needed for the builtin editor's HELP display) of 80 columns
  319. each. This will be reduced if it will not fit. The graphics window
  320. will have interior room for 320x100 pixels, and will be opened just
  321. inside the top-right-hand corner of the text window. In the hires
  322. variant of the "twowindow" type, the graphics window is double-size
  323. and opens at the top of the screen. The text window opens below it, if
  324. possible. If the text window doesn't fit there, it will be moved
  325. upwards, overlapping the graphics window, until it does fit. The text
  326. window can be resized from fullscreen to very small. The graphics
  327. window cannot be resized, since the MUD client does not maintain
  328. enough information to be able to redraw its contents at a different
  329. size. Scaling of non-bitmap graphics is actually done by scenario code
  330. running in the server.
  331.  
  332. The final major display type is the "onewindow" type. In this display,
  333. MUD opens up only a single window on the Workbench screen. There will
  334. be a fake separator between the graphics up top and the text down
  335. below. The text scroll-bar will only be beside the text portion of the
  336. window, and some user interface hacks can mess that up a bit. The
  337. combined window can be sized, but not narrower than the full width
  338. needed for the graphics, or shorter than the full height of the
  339. graphics plus a few lines of text. The graphics are always in the top-
  340. left corner of the window, to allow for the most resizing. In the
  341. hires variant, the graphics is twice as large, thus occupying twice as
  342. much space in the window.
  343.  
  344. Note that in both Workbench display types, MUD is constrained to only
  345. using the colours available on your Workbench screen. This can
  346. seriously affect the viewability of the graphics. MUD attempts to
  347. remap colours as best it can, but the results can be pretty bad,
  348. depending on the available colours. It is best to have a least one of
  349. each of the major colours: white, black, grey, red, blue, yellow,
  350. brown, etc. Four colour displays can be useable, and 8-colour ones can
  351. work not bad.
  352.  
  353. The various sizes and depths of available graphics displays have
  354. required some additional features in MUD, and some changes to the
  355. basic AmigaMUD programming language and builtin functions. When
  356. loading bitmap images (backgrounds, images or brushes), MUD will scale
  357. them to the required size. On pre-V2.0 systems, the scaling routine
  358. (in the Amiga's "graphics.library") does not exist, however, so those
  359. systems will get a mess.
  360.  
  361. With a Workbench display, MUD probably does not have its chosen set of
  362. 32 colours available, and it is not allowed to alter the palette.
  363. Instead, MUD will map the 32 standard colours to the available
  364. colours. So, it will report a colour count of 32, regardless of the
  365. actual colour count. It will also report that it can change the
  366. palette, even though it never will. It can, however, change its colour
  367. mapping in response to palette change requests from the server.
  368.  
  369. Remapping of IFF ILBM images is a slow process, and sometimes it
  370. doesn't work very well. The standard scenario is usable on my four-
  371. colour Workbench, but only just. Some images just do not come out at
  372. all. With an eight-colour display, things are much better, especially
  373. if the eight colours are chosen so as to give a good choice to MUD. A
  374. 32 colour Workbench can be just as good as letting MUD create its own
  375. screens (but slower, on my A4000T). One way of getting a good set of
  376. colours into your Workbench palette (since the Preferences tool only
  377. lets you set the lower 8 colours), is to set the included file
  378. "palette" as your background image, and then save your palette using
  379. the Preferences tool. Once you have your palette preferences set up,
  380. you can go back to your normal background pattern. If you normally use
  381. a background image, then the colours from the palette for that file
  382. will be the ones that MUD will have to use in "workbench" mode.
  383.  
  384. [The following is a technical note that is mostly relevant to
  385. designers of AmigaMUD scenarios.] When colour remapping is in effect,
  386. changing the colour of a pen doesn't work quite the same. Instead of
  387. changing a real pen, MUD simply takes the new colour, finds the best
  388. match for it in the real Workbench palette, and enters that value in
  389. the slot in its colour mapping table for the colour being changed.
  390. This will affect future drawing using that pen. In types other than
  391. "Workbench", all existing pixels in that pen will also be affected.
  392. So, it is best if a scenario does all colour palette changes before it
  393. does any drawing. This also holds true for tiles cached by MUD - they
  394. are mapped when they are cached, not each time they are used, so
  395. palette changes should be done before any tiles have to be sent to the
  396. clients.
  397.  
  398. When a Workbench display type is selected, you can also tell MUD to
  399. not do the above-mentioned colour remapping. When remapping is turned
  400. off, MUD works directly in the Workbench colour palette. The standard
  401. scenario drawn images (as opposed to the bitmap files, which will
  402. still be remapped as normal) will be drawn directly with the pen-
  403. numbers that the scenario gives. This will make a mess for the
  404. standard scenario, since it assumes the default 32 colours. However,
  405. if you are making a new scenario, this mode may be desireable, as it
  406. lets you access the full 256 colours of a 256-colour AGA Workbench.
  407. This will be reported via the GColours builtin returning 256. Note,
  408. however, that anyone playing such a scenario must have the same
  409. Workbench palette, for *all* colours that you use, in order for the
  410. graphics to come out right.
  411.  
  412. Setting the MUD display type can be done with command-line flags, icon
  413. tooltypes or shell environment variables. See the relevant sections
  414. of this document for details.
  415.  
  416.  
  417. MUD Icon Tool Types
  418.  
  419. Some tool types accept a boolean (true/false) argument. MUD interprets
  420. any of YES/yes/ON/on/TRUE/true or an empty argument as true, and any
  421. other value as false. Note that on early versions of the AmigaOS,
  422. empty values are not valid. They ARE valid under V2.0. Other tool
  423. types require numeric arguments. These must be given in decimal.
  424. String arguments can have any value not containing spaces.
  425.  
  426.     IPHOST (string) - this tooltype specifies the name (or IP address)
  427.     of the internet machine to connect to, and also forces MUD to
  428.     use only an internet connection through a TCP/IP stack. Use
  429.     this tooltype only on icons which you will use only when your
  430.     TCP/IP stack is active.
  431.  
  432.     IPPORT (numeric) - this tooltype specifies a different IP port to
  433.     use when connecting over the internet. The default value is
  434.     6667. Like IPHOST, this tooltype forces an internet
  435.     connection.
  436.  
  437.     MODE = { ONESCREEN | TWOSCREEN | ONEWINDOW | TWOWINDOW } - this
  438.     tooltype selects which display type the MUD program is to use.
  439.     See the above section on "Display" for details on the various
  440.     display types.
  441.  
  442.     HIRES (boolean) - this tooltype controls whether or not MUD will
  443.     use higher resolution for its screens and windows. This
  444.     provides twice the vertical and horizontal graphics
  445.     resolution. In non-Workbench display types, this will also
  446.     provide twice the number of text lines. This option does not
  447.     work correctly on non-AGA systems, since the Amiga chips do
  448.     not support the needed graphics capability.
  449.  
  450.     OLDSTYLE (boolean) - this tooltype controls whether or not MUD
  451.     will use the old-style gold text colours, and allow text
  452.     colour palette modification. The default is to not allow this
  453.     under V2.0 and above of the AmigaOS. This flag is only useful
  454.     with a "ONESCREEN" display.
  455.  
  456.     MAPCOLOURS (boolean) - this tooltype is only relevant in a
  457.     Workbench display mode, and is normally enabled. Turning
  458.     this option off forces MUD to work directly in the Workbench
  459.     colours, and not attempt to remap colours.
  460.  
  461.     FULLREDRAW (boolean) - this tooltype should not be needed. MUD
  462.     makes some undocumented assumptions about what happens when
  463.     a window is resized. This allows it to do faster operations
  464.     when showing or hiding the graphics window. If your display is
  465.     messed up when doing those operations, try setting this flag,
  466.     and let me know about it.
  467.  
  468.     EFFECTSQUIET (boolean) - this tooltype controls whether or not MUD
  469.     prints a warning message in the text window whenever the
  470.     scenario references an effects file (background, image, brush
  471.     or sound) that is not available on this system. Seeing the
  472.     warnings is useful in order to know what files the active
  473.     scenario can use, but the warnings can be annoying.
  474.  
  475.     SERIAL (boolean) - this tool type tells MUD to connect to a remote
  476.     server over a serial port. Using any of the serial-specific
  477.     tool types will also imply the setting of this tool type.
  478.  
  479.     LOCAL (boolean) - this tool type tells MUD to connect to a server
  480.     running on the local machine, rather than trying to connect to
  481.     a remote server via a serial port or via a TCP/IP stack. This
  482.     is the default action.
  483.  
  484.     CLOSEWORKBENCH (boolean) - this tool type tells MUD to try to
  485.     close the Workbench screen after it has started up. This will
  486.     normally only work from a Workbench startup, and only if there
  487.     are no other programs active that were started from the
  488.     Workbench. Using this option can recover system memory for use
  489.     in caching effects, images, sounds, etc. The Workbench can
  490.     also be closed (and opened) using menu items.
  491.  
  492.     BRIGHT (boolean) - this tool type tells MUD to start up using a
  493.     brighter than normal set of colours for the text window. This
  494.     is useful on bright sunny days. Only relevant for an
  495.     "oldstyle" display.
  496.  
  497.     DIM (boolean) - this tool type tells MUD to start up using a
  498.     dimmer than normal set of colours for the text window. This is
  499.     useful for nighttime MUDding. Only relevant for an "oldstyle"
  500.     display.
  501.  
  502.     EDITOR = { INTERNAL | SELECTED | EXTERNAL } - this tool type sets
  503.     the default setting for the similar menu item. If INTERNAL is
  504.     set, then all editing will use the built-in editor. If
  505.     SELECTED is set, then MUD will use the built-in editor for
  506.     editing strings, and an external editor for editing procs. If
  507.     EXTERNAL is set, then MUD will use an external editor for
  508.     everything.
  509.  
  510.     OHISTORY (numeric) - this tool type sets the size of the output
  511.     history buffer that MUD maintains. This is the text that can
  512.     be reviewed using the scroll bar in the text output window.
  513.     The minimum size is 1920 characters. Note that giving too
  514.     large a value can result in significant slowdown, as new text
  515.     is inserted at the end of a large buffer. The default value is
  516.     5000 characters.
  517.  
  518.     IHISTORY (numeric) - this tool type sets the size of the input
  519.     history buffer that MUD maintains. This is the command lines
  520.     that can be retrieved using the up-arrow key, in the same
  521.     method that is used in a shell window. As described later, the
  522.     shell's input editing functions can also be used. The default
  523.     size of the input history buffer is 1024 characters, and the
  524.     minimum size is 160 characters.
  525.  
  526.     PORTNAME (string) - this tool type allows the user to change the
  527.     name of the Amiga OS port that MUD will try to connect to for
  528.     a local connection. By default, this name is "MUD port". Using
  529.     a different name allows the simultaneous use of multiple
  530.     AmigaMUDs on a given system. This tool type lets MUD select
  531.     which one to connect to. Note that this is *not* an internet
  532.     IP port number or service name.
  533.  
  534.     TEST - this tool type is a short way of picking "MUD test port" as
  535.     the name of the Amiga OS port to connect to.
  536.  
  537.     BAUD (numeric) - this tool type allows the setting of the baud
  538.     rate (more properly called bps) to use for a connection on a
  539.     serial port. The default value is 19200. Note that the Amiga's
  540.     internal serial port can accept a wide range of values, but
  541.     standard values of 300, 1200, 2400, 9600, 19200 or 38400
  542.     should be used for compatibility. If a value that does not
  543.     appear on MUD's serial menu is used, then none of the speeds
  544.     in the menu will be checked.
  545.  
  546.     IGNORECD (boolean) - this tool type tells MUD to ignore the state
  547.     of the CD (Carrier Detect) serial port control signal.
  548.     Normally, MUD will exit when the CD signal is lost, since this
  549.     means that the modem connection has been lost. Setting this
  550.     flag is needed with modems that cannot (or have been
  551.     instructed to not) properly generate the signal, or with
  552.     serial cables that do not pass the signal. Also, when
  553.     connecting two Amigas directly via their serial ports (and a
  554.     "null modem"), this option is usually needed.
  555.  
  556.     7WIRE (boolean) - this tool type tells MUD to instruct the serial
  557.     driver to pay attention to the hardware flow control signals
  558.     on the serial port. This is recommended for use with direct
  559.     connections or high-speed modems. It should not be used if the
  560.     modem is not generating and paying attention to the signals,
  561.     or if the connecting cable is not carrying the signals.
  562.  
  563.     SHARED (boolean) - this tool type tells MUD to open the serial
  564.     port in "shared" mode. This means that other programs can have
  565.     the port open at the same time. MUD (and the MUDAgent program
  566.     at the other end) will become confused if any other program
  567.     actually reads from or writes to the port while MUD is
  568.     connected, so this flag should be used with care.
  569.  
  570.     RETRIES (numeric) - this tool type specifies the number of times
  571.     that MUD should attempt to send or receive any given message
  572.     via the serial port connection. The default value is 10.
  573.     Larger values may be needed for reliable operation over noisy
  574.     telephone lines. Too large a value should not be given,
  575.     however, since then MUD won't give up soon enough on a true
  576.     lost connection.
  577.  
  578.     DIAL (string) - this tool type allows the specification of a
  579.     string to be sent over the serial port (usually to a modem) on
  580.     startup. With most modems, a dial string of the form
  581.     ATD1234567 will cause the modem to start dialing a telephone
  582.     number. This is handy to set up an icon for MUD to connect to
  583.     a specific remote AmigaMUD, or in a shell alias.
  584.  
  585.     NAME (string) - specify the name of the character to log in as.
  586.     Note that this is an AmigaMUD login, not a BBS or other one.
  587.  
  588.     PASSWORD (string) - specify the password for your character. It is
  589.     not recommended that you use this flag if your system is open
  590.     to use by others, since they can find your password easily. If
  591.     the password given this way is incorrect, it counts as the
  592.     first of your three attempts at getting it right.
  593.  
  594.     DEVICE (string) - this tool type allows the specification of the
  595.     name of an alternative serial device to use for a connection.
  596.     The default name is "serial.device", which refers to the
  597.     standard built-in serial port.
  598.  
  599.     UNIT (numeric) - this tool type allows the specification of a
  600.     particular serial port unit on a device with several ports.
  601.     The default value is 0.
  602.  
  603.     FLAGS (numeric) - this tool type is used to specify some special
  604.     flag values which MUD passes on to "mud.library". The flag
  605.     values only effect the operation of some caching mechanisms
  606.     which are of value to wizards. The value is the sum of the
  607.     following:
  608.  
  609.         1 - cache procs. This remote client will cache the
  610.         definitions (but not the bodies) of builtin and user
  611.         procs in the AmigaMUD language. This saves refetching
  612.         them when parsing procs (such as after editing one).
  613.  
  614.         2 - cache symbols. This remote client will cache the
  615.         values of symbols that it has fetched from the server.
  616.         Again, this cuts down on communications when parsing
  617.         AmigaMUD procs.
  618.  
  619.     Note that both of these flags increase the amount of memory
  620.     consumed by MUD. This memory is not freed until MUD exits.
  621.     The default value of 'FLAGS' is 0, i.e. both caches off.
  622.  
  623.     EDITORSTACK (numeric) - this is the size of stack to use for an
  624.     external editor process. The default is 9996 bytes, and the
  625.     minimum is 4096 bytes.
  626.  
  627.     Examples:
  628.  
  629.     IPHOST=mud.myrias.com
  630.     MODE=onescreen
  631.     IHISTORY=10000
  632.  
  633.     This requests a connection over the internet to a machine
  634.     named "mud.myrias.com", using the default IP port. The display
  635.     is to be on a single custom screen (useful mostly with
  636.     graphics cards), and a large 10000 byte input history is used.
  637.  
  638.     MODE=twowindow
  639.     HIRES=true
  640.     LOCAL=true
  641.     PORTNAME=MUD2
  642.     OHISTORY=10000
  643.  
  644.     This requests a connection on the local machine to a server
  645.     running with Amiga OS port name "MUD2". An output history
  646.     buffer of 10000 characters will be allocated and used. The
  647.     display will use a high resolution graphics window and a
  648.     separate text window on the Workbench screen.
  649.  
  650.     MODE=twoscreen
  651.     OLDSTYLE=true
  652.     BAUD=9600
  653.     7WIRE
  654.     DEVICE=siosbx.device
  655.     UNIT=1
  656.  
  657.     This requests a 9600 bps connection, using hardware flow
  658.     control, on the second port of an ASDG dual-port board. The
  659.     display will be the oldstyle gold text display in a pair of
  660.     custom screens.
  661.  
  662.  
  663. MUD CLI Command Line Flags
  664.  
  665. All of the above icon tool types can be given on a CLI command line,
  666. as in:
  667.  
  668.     MUD HIRES BAUD=19200 7WIRE IHISTORY=2000 DIAL=atd1234567
  669.  
  670. In addition, there are short forms for many of the flags and some
  671. additional flags that are only meaningful from a CLI command line.
  672. In these flags, any needed value must directly follow the flag
  673. letter, i.e. there must not be any spaces between them. More detailed
  674. descriptions of these settings can be found in the previous section
  675. on icon tool types.
  676.  
  677. When started from a CLI, the name and optional port number of an
  678. internet host to connect to can be given, without being preceeded by a
  679. minus sign. E.g.    "mud supersys.com"      will attempt a TCP/IP
  680. connection to a remote machine named "supersys.com", using the default
  681. IP port of 6667, and using all other default values (as modified by
  682. any environment variables set).
  683.  
  684. The flags supported are:
  685.  
  686.     -w - open in one or two Workbench windows
  687.  
  688.     -1 - open in one window or screen, not two
  689.  
  690.     -h - hires display
  691.  
  692.     -O - oldstyle display
  693.  
  694.     -m - open on workbench, do not remap colours
  695.  
  696.     -f - fullredraw
  697.  
  698.     -q - effects quiet
  699.  
  700.     -w - try to close the Workbench on startup
  701.  
  702.     -L - make a local connection
  703.  
  704.     -T - make a local connection using port "MUD test port"
  705.  
  706.     -B - use the bright text window colours (oldstyle only)
  707.  
  708.     -D - use the dim text window colours (oldstyle only)
  709.  
  710.     -F <flags> - set the mud.library flags - see FLAGS tool type
  711.  
  712.     -P <portname> - use the given name as the local port to connect to
  713.  
  714.     -S - do a serial connection with the port opened in shared mode
  715.  
  716.     -d <device> - use the named device instead of "serial.device"
  717.  
  718.     -u <unit> - use the given device unit instead of unit 0
  719.  
  720.     -b <speed> - use the given serial speed instead of 19200
  721.  
  722.     -i - ignore the Carrier Detect serial signal
  723.  
  724.     -7 - use 7-wire hardware serial handshaking
  725.  
  726.     -N <name> - use <name> as the name of the character for the
  727.     playing sessions, rather than prompting for a name
  728.  
  729.     -W <word> - use <word> as the password for the playing sessions.
  730.     If it is incorrect, it counts as the first attempt, and only
  731.     two attempts remain. This is normally used in conjunction with
  732.     -N, but can be used without it.
  733.  
  734.     -r <count> - retry each failing message the given number of times
  735.  
  736.     -E - this flag was useful to me when I was testing the sample
  737.     online building sessions - it starts up MUD with its editing
  738.     capability disabled, so that text must be entered in the line-
  739.     by-line mode. The disabling is known to the MUD server, and
  740.     hence to the scenario.
  741.  
  742.     -s <size> - this flags specifies the size of stack to use for an
  743.     external editor process. The default size is 9996 bytes, and
  744.     the minimum size is 4096 bytes.
  745.  
  746. An interesting combination is to combine a DIAL= with -N and -W. If
  747. the system you are calling is directly running MUDAgent for a binary
  748. connection, then the call will happen and you will end up being
  749. connected to your character, without having to do anything else.
  750.  
  751. The following flags are included for compatibility with the "Getty"
  752. program. There is currently no real use for this support, but I
  753. believe that it may become desireable to have a terminal program which
  754. can call out to the MUD client program, much as Getty or BBS's call
  755. out to the MUDAgent program. This is because the terminal support in
  756. MUD is minimal, and the user may want to do other activities during a
  757. BBS connection which require more functionality. A terminal program
  758. which supports callouts in this manner could then be used to provide
  759. both levels of functionality in a given connection. Most people can
  760. ignore these flags, at least for now. See Getty documentation for
  761. details. The flags are:
  762.  
  763.     -Getty - supresses any port initialization, and opens shared
  764.     -DEVICE <name> - name of device to use
  765.     -UNIT <number> - unit number on device
  766.     -HLINK - ignore carrier detect
  767.     -BAUD <speed> - set connection speed
  768.     -USER <name> - parameter ignored
  769.  
  770.  
  771. Environment Variables
  772.  
  773. MUD checks for a number of environment variables (as set with the
  774. shell 'setenv' command). These values can override some default
  775. settings in MUD, and can be in turn overriden by icon tooltypes or
  776. command-line flags. All environment variables are of boolean type.
  777. The following variables are recognized:
  778.  
  779.     MUDLocal - if true, forces a local connection (no longer really
  780.     needed, now that the default is a local connection)
  781.  
  782.     MUDMode - can contain the name of the display type to be used
  783.  
  784.     MUDHiRes - if true, forces hires display
  785.  
  786.     MUDMapColours - if false, turns of colour remapping
  787.  
  788.     MUDFullRedraw - if true, forces full redraw mode
  789.  
  790.     MUDEffectsQuiet - if true, supresses effects warnings
  791.  
  792.     MUDEditor - path to the text editor to use an external editor
  793.  
  794.     EDITOR - editor path to use if MUDEditor is not specified
  795.  
  796. See the previous sections for discussion of the detailed meanings of
  797. these options.
  798.  
  799.  
  800. Menus in MUD
  801.  
  802. Some of the menu items in MUD have function key shortcuts. Others have
  803. right-amiga command key shortcuts. Both types of shortcuts will work
  804. regardless of which of the windows (graphics or text) is currently the
  805. active one. Most of the "Serial" menus will only work while in
  806. "terminal mode", and some others will not work in terminal mode.
  807. Inactive menus are shown ghosted. Key shortcuts for menu items are
  808. shown here inside square brackets.
  809.  
  810.     Project - the Project menu contains general utility operations.
  811.  
  812.     Log [F7] - this item will enable or disable logging of text
  813.         input and output. If no logfile name has been selected
  814.         when logging is turned on, one will be requested.
  815.  
  816.     Log File - allows selection of a file to log to. Logging will
  817.         be turned on after the selection of a name.
  818.  
  819.     Log Mode - the two modes, Both and Input, control what will be
  820.         logged to a log file. If 'Both' is checked, then both the
  821.         user's input and the game's output is logged. If 'Input'
  822.         is checked, then only the user's input is logged, with any
  823.         passwords omitted.
  824.  
  825.     Source - a file name is requested, and the contents of the
  826.         file is read and inserted as input from the user. This
  827.         operation works in either "wizard" mode (the user is
  828.         operating directly with the AmigaMUD interpreter) or in
  829.         normal mode, where input is being parsed as commands for
  830.         the scenario. Do not attempt to change modes inside a
  831.         sourced file, however, since the changing of modes is
  832.         not a synchronous event, and a few commands will end up
  833.         being given to the wrong mode.
  834.  
  835.     SnapShot
  836.  
  837.         Text - a file name is requested, and the entire contents
  838.         of the output history buffer is written to the file.
  839.  
  840.         Graphics - a file name is requested, and the current
  841.         contents of the graphics window is written to the file
  842.         as an IFF ILBM image. The current graphics palette is
  843.         included in the IFF file.
  844.  
  845.     Quit [R-A Q] - MUD disconnects from the server and either
  846.         exits, or goes back to the "terminal mode", depending on
  847.         whether you are running the client locally or remotely.
  848.         Using the close box on the text window has the same
  849.         effect, unless you are currently editing something, in
  850.         which case only the edit is aborted, as with typing a ^C.
  851.  
  852.     Abort - MUD exits immediately. This is useful if the server
  853.         has hung, or something has gone wrong with the connection
  854.         to it. Using this instead of 'Quit' may prevent you from
  855.         reconnecting to your character until the server times out
  856.         and shuts the connection down at its end. In some cases,
  857.         manual intervention on the server may be required before
  858.         you can connect to your character again.
  859.  
  860.     Modes - the Modes menu controls various parts of MUD that can be
  861.     enabled and disabled, or which give a choice of behaviours.
  862.  
  863.     History - this item allows you to control which of your input
  864.         lines is entered into the input history buffer. In 'Full'
  865.         mode, all input lines are entered, regardless of how they
  866.         were generated. In 'New' mode, input lines are entered
  867.         only if they were not taken unchanged from the input
  868.         history. In 'Minimal' mode, input lines are entered into
  869.         the history only if they did not originate from that
  870.         history, i.e. only if they were typed in completely. I
  871.         recommend 'New' mode.
  872.  
  873.     Scroll On - this item allows you to control when the output
  874.         window is scrolled. If 'Input' is chosen, then the output
  875.         window scrolls only when a new input line is entered, or
  876.         when it must be scrolled because it is full and an output
  877.         line must be added. If 'Output' is chosen, then the output
  878.         window is scrolled whenever a new line of output is added
  879.         to the bottom. If 'Either' is chosen, then both input and
  880.         output lines will cause the scrolling. If 'Neither' is
  881.         chosen, then the output window does not scroll unless the
  882.         user scrolls it or it is full. This last mode is useful
  883.         when typing input lines based on output history that has
  884.         already scrolled out of the text window.
  885.  
  886.     Editor - this item allows you to choose when to use the
  887.         internal editor and when to use an external editor. If
  888.         'Internal' is chosen, then the internal editor is used for
  889.         editing strings (such as descriptions) and when editing
  890.         AmigaMUD functions when in wizard mode. If 'Selected' is
  891.         chosen, then strings are edited with the internal editor
  892.         and functions with an external one. If 'External' is
  893.         chosen, then an external editor is used for everything. If
  894.         you are not familiar with running a text editor such as
  895.         'Ed' on the Amiga, I recommend using 'Internal'. When
  896.         editing AmigaMUD functions, the internal editor can move
  897.         the cursor to the position of errors when the function is
  898.         submitted for parsing. Some external editors support this
  899.         kind of operation using ARexx commands, but MUD does not
  900.         currently support this.
  901.  
  902.     Picture [F1] - this item controls whether or not the graphics
  903.         window is visible. A full screen text window can be useful
  904.         when wizarding or when chatting with a number of other
  905.         players. Note that the picture cannot be hidden when MUD
  906.         is running in a Workbench window.
  907.  
  908.     Graphics [F2] - this items allows the user to disable all
  909.         graphics operations in the MUD client. This setting is
  910.         sent to the server, so it will not even send graphics
  911.         output messages. Note that turning graphics off and then
  912.         on again at a later time can result in an out-of-date or
  913.         inconsistent graphics view.
  914.  
  915.     Sound [F3] - this item allows the user to disable all playing
  916.         of sound samples. The setting is sent to the server so
  917.         that it doesn't even send sound requests to the client.
  918.  
  919.     Music [F4] - this item allows the user to disable all playing
  920.         of music scores. The setting is sent to the server so that
  921.         it doesn't even send music requests to the client.
  922.  
  923.     Voice [F5] - this item allows the user to disable all speech
  924.         output. The setting is sent to the server so that it
  925.         doesn't even send speech requests to the client.
  926.  
  927.     Edit Win [F6] - this menu item is the only way to switch
  928.         between the full-screen internal editor window and the
  929.         normal split-screen playing view. The item is not enabled
  930.         when nothing is being edited. By switching to the normal
  931.         view when editing, you can continue to operate in the MUD,
  932.         but this shouldn't be done long, since you might suddenly
  933.         need to edit something else.
  934.  
  935.     Options - these menu items select some supplementary functions.
  936.  
  937.     ScreenToBack [R-A B] - this item sends the MUD client screens
  938.         (the graphics and text windows) to the back of the stack
  939.         of screens on your Amiga. Unless you are running other
  940.         programs, this will just result in the normal Workbench
  941.         screen coming to the front. It is useful during testing,
  942.         however, since then there might be several MUD clients
  943.         running on the same system as a server. Sending a ^F
  944.         signal to MUD will cause it to move its screens to the
  945.         front of the display. This function is not active when MUD
  946.         is running in a Workbench window.
  947.  
  948.     Workbench - this item allows you to try to turn the Amiga's
  949.         Workbench on and off. Turning the Workbench off is useful
  950.         to conserve memory. The Workbench will not turn off if
  951.         other applications are open on the Workbench screen, or if
  952.         MUD itself is running in a Workbench window.
  953.  
  954.     Effects - this item allows you to examine and manipulate the
  955.         local caches of graphics and sound effects that the MUD
  956.         client maintains.
  957.  
  958.         Free File - a single cached IFF file will be freed. This
  959.         can be a background, brush or image, a sound sample,
  960.         or a music score. The next time the selected file is
  961.         needed, it will have to be reloaded from disk. The
  962.         system will chose the least recently used file.
  963.  
  964.         Free Effect - free the single least recently used
  965.         unreferenced effect. See a later section on 'Caches'
  966.         for more details.
  967.  
  968.         Zap Effects [R-A Z] - free all effects
  969.  
  970.         Show Status - show the status of all cached files and
  971.         effects. This status is affected by requests coming
  972.         from the server and by the above three menu items. See
  973.         the 'Caches' section for more information.
  974.  
  975.         Quiet - when active (checked), this flag tells MUD to not
  976.         print warning messages about not being able to find
  977.         effects files. These messages let you know what files
  978.         the scenario is trying to use, but can be annoying.
  979.  
  980.     Memory - the amount of available chip and total memory is
  981.         shown. This can be useful in understanding why effects
  982.         aren't happening (lack of memory), and to get a feel for
  983.         the amount of memory that the MUD client can consume.
  984.  
  985.     Serial - these items are mostly of use only during an initial
  986.     "terminal mode" with a serial connection.
  987.  
  988.     IgnoreCD - controls whether or not MUD will expect a valid CD
  989.         (Carrier Detect) signal. This hardware signal should be
  990.         generated by a modem when it detects a carrier signal on
  991.         the telephone line. If your modem does not do this, or if
  992.         you have told it not to, or if your serial cable does not
  993.         transmit the signal, you should instruct MUD to ignore the
  994.         signal, else it will not think a connection has been made.
  995.  
  996.     Speed - provides a few manually-selectable speeds for use when
  997.         in terminal mode. Other values can be entered from an icon
  998.         tool type or a CLI command line.
  999.  
  1000.     Break [R-A .] - requests that a break condition be sent over
  1001.         the serial line. This condition is a lengthy pause in the
  1002.         raw transmit data stream that is detectable at the other
  1003.         end of the line. You can see it as an "on" pulse in your
  1004.         modem's TX light.
  1005.  
  1006.     Connect [R-A C] - this item forces MUD to attempt to initiate
  1007.         a binary connection with the other end. If the other end
  1008.         is set up to only handle a binary connection, this will
  1009.         not be necessary, since the other end will start things
  1010.         up. If, however the other end is waiting to distinguish
  1011.         either a binary or a text-only connection, then this menu
  1012.         item is used to start up a binary connection.
  1013.  
  1014.     Stats [R-A S] - this item shows some statistics maintained by
  1015.         the serial protocol code:
  1016.  
  1017.         Packets TX: - total number of packets (messages) sent
  1018.             out from this end.
  1019.  
  1020.         ACKs TX: number of positive acknowledgements of
  1021.             correctly received packets that this end has sent.
  1022.  
  1023.         NAKs TX: number of negative acknowledgements of
  1024.             incorrectly received packets that this end has
  1025.             sent. Incorrectly received packets must be resent
  1026.             by the sender.
  1027.  
  1028.         Packets RX: total number of packets that this end has
  1029.             received.
  1030.  
  1031.         ACKs RX: number of positive acknowledgements received.
  1032.  
  1033.         NAKs RX: number of negative acknowledgements received.
  1034.  
  1035.         Waits timed out: MUD puts a time limit on any of its
  1036.             waits for receiving something over the serial
  1037.             port. This number indicated how many times that
  1038.             time limit went off. Normally, this means that a
  1039.             packet sent from this end was completely lost, so
  1040.             the other end didn't either ACK or NAK it.
  1041.  
  1042.         Read no bytes: indicates the number of times a serial
  1043.             port read request returned, but indicated that no
  1044.             bytes were received. This can happen if a BREAK
  1045.             condition is received.
  1046.  
  1047.         Writes failed: indicates the number of times that a
  1048.             serial port write request did not complete due to
  1049.             some error, such as a loss of carrier signal.
  1050.  
  1051.  
  1052. History Manipulation and Input Line Editing
  1053.  
  1054. MUD maintains two forms of history. One is a history of commands
  1055. entered by the user, and the other is a history of both input lines
  1056. and output text from the server.
  1057.  
  1058. The output history is straightforward - it can be accessed by using
  1059. the scroll bar on the right hand side of the text window. Also,
  1060. pressing an ALT key and an up or down arrow key at the same time will
  1061. scroll the output window a line at a time. Additionally pressing a
  1062. shift key (along with the ALT key and the arrow key) will scroll by a
  1063. full window at a time.
  1064.  
  1065. Input history and input line editing is very similar to that done in
  1066. the standard Amiga shell, with some minor additions. The available
  1067. operations are as follows:
  1068.  
  1069.     up-arrow - scroll backward in the input history
  1070.  
  1071.     down-arrow - scroll forward in the input history
  1072.  
  1073.     shift-up-arrow - search backward in the input history for a line
  1074.     which matches the input text to the left of the cursor. If any
  1075.     is found, insert it into the input region in place of what was
  1076.     previously there.
  1077.  
  1078.     shift-down-arrow - move the current history search point to the
  1079.     end of the input history and clear the input region
  1080.  
  1081.     HELP, and numeric keypad keys - these are sent as is to the
  1082.     AmigaMUD server, where they can be used as desired by the
  1083.     currently running scenario
  1084.  
  1085.     right-arrow - move the cursor right one column
  1086.  
  1087.     left-arrow - move the cursor left one column
  1088.  
  1089.     shift-right-arrow - move the cursor to the end of the current
  1090.     input
  1091.  
  1092.     shift-left-arrow - move the cursor to the beginning of the input
  1093.     region
  1094.  
  1095.     cntl-A - move the cursor to the beginning of the input region
  1096.  
  1097.     cntl-B - move the cursor left one column
  1098.  
  1099.     cntl-E - move the cursor to the end of the current input
  1100.  
  1101.     cntl-F - move the cursor right one column
  1102.  
  1103.     cntl-H (backspace) - delete the character before the cursor
  1104.  
  1105.     cntl-I (tab) - move the cursor forward to the next 8 column
  1106.     boundary
  1107.  
  1108.     cntl-K - delete all characters from the one under the cursor to
  1109.     the end of the current input. The deleted characters are saved
  1110.     in the "undo buffer".
  1111.  
  1112.     cntl-M (carriage return) - send the current input to the server
  1113.     and clear the input region ready for another line. The line
  1114.     may be added to the input history, depending on the setting of
  1115.     the history choice, and on whether any editing of the line had
  1116.     been done.
  1117.  
  1118.     cntl-N - go forward one line in the input history
  1119.  
  1120.     cntl-P - go backward one line in the input history
  1121.  
  1122.     cntl-R - search backward through the input history. Same as
  1123.     shift-up-arrow.
  1124.  
  1125.     cntl-U - delete all input characters to the left of the current
  1126.     cursor position.
  1127.  
  1128.     cntl-W - delete the "word" to the left of the cursor
  1129.  
  1130.     cntl-X - clear the input region
  1131.  
  1132.     cntl-Y - insert from the undo buffer at the current cursor
  1133.     position, and move the cursor to the end of the input data.
  1134.  
  1135.     DEL - delete the character under the cursor
  1136.  
  1137.  
  1138. Using the Internal Editor
  1139.  
  1140. The internal editor in the MUD client program can be started to edit a
  1141. simple text string, such as a character description, a room
  1142. description, etc. or to edit an AmigaMUD function while in wizard
  1143. mode. The initial startup varies slightly between the two situations,
  1144. mostly relating to the quoting and escaping of things, but the main
  1145. operation of the editor is the same in both cases.
  1146.  
  1147. The edit session is actually started by messages from the server, but
  1148. the server is normally just responding to user requests. When editing
  1149. is to be done, the text to be edited must first be sent from the
  1150. server to the MUD client program. This can take a few seconds for a
  1151. large function or description operating over a slow link. When all of
  1152. the data has arrived, MUD will switch to a single full-screen text
  1153. window (if it wasn't already) containing the first windowfull of the
  1154. text. A menu item, or function key F6, can be used to temporarily
  1155. switch back to the normal mode of operation. The switch-back should be
  1156. short, however, since MUD will not allow multiple things to be edited
  1157. at once by any given client.
  1158.  
  1159. While editing, the normal function keys and menus still operate, but
  1160. their effect may not be immediately visible. Normal input and output
  1161. history do not work, however, as they are replaced by an expanded set
  1162. of editing operations. In edit mode, pressing the HELP key will
  1163. display a short summary of the editing operations available.
  1164.  
  1165. The internal editor is always in "insert mode"; that is, characters
  1166. typed will always be inserted before any characters at or after the
  1167. cursor on the current line, shifting those other characters to the
  1168. right. The editor limits lines being edited to 160 characters (two
  1169. displayed lines). Lines coming from the server will never be longer
  1170. than can be displayed in the window, so longer lines can only be
  1171. created by editing. There is no need to use long lines in AmigaMUD -
  1172. lines of descriptions are all joined when the description is sent
  1173. back to the server, and the spacing of functions is thrown away when
  1174. the function is parsed. When editing things like letters and
  1175. bulletins, the user's lines are preserved, but long ones will be
  1176. wrapped when sent to any clients reading them.
  1177.  
  1178. When editing an AmigaMUD function in wizard mode, the editor can work
  1179. with the parser to identify the location of errors. When the user
  1180. types the cntl-Q key combination, the text in the editor is parsed (on
  1181. the local machine, by code in mud.library) into an internal data
  1182. structure. If any errors are encountered, the parser gives an error
  1183. message and a position to the editor. The editor displays the message
  1184. in reverse video at the bottom of the window, and moves the cursor to
  1185. the reported position, redrawing the window if necessary. The user can
  1186. then immediately do editing to correct the error. If a further cntl-Q
  1187. is entered, the parsing will be restarted from the beginning of the
  1188. function. If, however, a cntl-G is entered, the parsing will continue
  1189. from the first error, perhaps showing further errors in the function.
  1190. A cntl-R combination can be entered to abort the parsing, but not
  1191. start another parse. At any point in editing, a cntl-C can be entered
  1192. to abort the entire edit session. Similarly, clicking on the edit
  1193. window close box will abort the edit session, but will not cause MUD
  1194. to exit.
  1195.  
  1196. The text window's scroll bar is active while editing, and can be used
  1197. to scroll around in a long function or description. Also, the same
  1198. alt-up-arrow, alt-down-arrow, shift-alt-up-arrow and shift-alt-down-
  1199. arrow key combinations that work in normal mode also operate while
  1200. editing. When scrolling this way, the text cursor may have to move to
  1201. remain visible in the window.
  1202.  
  1203. The available editing operations are:
  1204.  
  1205.     Control operations:
  1206.  
  1207.     HELP - display a short summary of operations
  1208.  
  1209.     cntl-C - abort the edit. If editing a description, the
  1210.         scenario code is informed that the edit was aborted. If
  1211.         editing an AmigaMUD function, the function will be
  1212.         unchanged from before the edit. The edit can also be
  1213.         aborted by clicking on the close box of the edit window.
  1214.         This will not cause MUD to exit.
  1215.  
  1216.     cntl-Q - if editing a description, then the description as it
  1217.         is in the editor is sent to the server as the result of
  1218.         editing, and the MUD client program switches back to
  1219.         normal operation. If editing a function, then MUD starts
  1220.         parsing the function. If no errors are encountered, the
  1221.         function is sent to the server where the new definition
  1222.         immediately replaces the old one. If an error is
  1223.         encountered, its message is displayed at the bottom of the
  1224.         window, and the cursor is moved to the location of the
  1225.         error.
  1226.  
  1227.     cntl-G - this combination does nothing unless a function is
  1228.         being editing, and an error has been encountered. In that
  1229.         situation, the parsing continues and the next error is
  1230.         reported. If there are no more errors, that is indicated.
  1231.  
  1232.     cntl-R - this combination does nothing unless a function is
  1233.         being edited, and an error has been encountered. In that
  1234.         case, all further errors from this parse of the function
  1235.         are discarded.
  1236.  
  1237.     Cursor motion operations:
  1238.  
  1239.     left-arrow - move cursor left one column
  1240.  
  1241.     right-arrow - move cursor right one column
  1242.  
  1243.     shift-left-arrow - move cursor to the beginning of the line
  1244.  
  1245.     shift-right-arrow - move cursor to just past the end of the
  1246.         line
  1247.  
  1248.     down-arrow - move cursor down one line, scrolling the window
  1249.         if necessary
  1250.  
  1251.     up-arrow - move cursor up one line, scrolling the window if
  1252.         necessary
  1253.  
  1254.     shift-down-arrow - move cursor to the bottom of the window
  1255.  
  1256.     shift-up-arrow - move cursor to the top of the window
  1257.  
  1258.     cntl-A - move cursor to the beginning of the line
  1259.  
  1260.     cntl-B - move cursor back one column
  1261.  
  1262.     cntl-E - move cursor to the end of the current line
  1263.  
  1264.     cntl-F - move cursor forward one column
  1265.  
  1266.     cntl-I (tab) - move cursor forward to the next 8-column
  1267.         tabstop
  1268.  
  1269.     cntl-L - move cursor to the beginning of the next line
  1270.  
  1271.     cntl-N - move cursor to the next line
  1272.  
  1273.     cntl-P - move cursor to the previous line
  1274.  
  1275.     cntl-T - move cursor to the line at the top of the window
  1276.  
  1277.     cntl-Z - move cursor to the line at the bottom of the window
  1278.  
  1279.     Editing operations:
  1280.  
  1281.     cntl-D - delete the current line
  1282.  
  1283.     cntl-H (backspace) - delete the character before the cursor
  1284.  
  1285.     cntl-J - join this line with the next line. The text of the
  1286.         next line is appended to the end of the current line.
  1287.  
  1288.     cntl-K - characters from the current one under the cursor to
  1289.         the end of the line are deleted (killed)
  1290.  
  1291.     cntl-M (carriage return) - a new line is inserted after the
  1292.         current one and the cursor moves to the beginning of that
  1293.         empty line
  1294.  
  1295.     cntl-S - split the current line. Characters from the one under
  1296.         the cursor to the end of the line are moved into a new
  1297.         line inserted after the current one.
  1298.  
  1299.     cntl-U - characters from the beginning of the current line
  1300.         upto the one just before the cursor are deleted
  1301.  
  1302.     cntl-W - the previous "word" is deleted. A word is a sequence
  1303.         of non-spaces delimited by spaces or the beginning or end
  1304.         of the line.
  1305.  
  1306.     cntl-X - the current line is cleared, or emptied
  1307.  
  1308.     cntl-Y - the line is put back to the same state it had before
  1309.         any changes were made to it. This backup copy of the line
  1310.         is discarded if the cursor is moved out of the line, i.e.
  1311.         only changes made to the line while the cursor is in the
  1312.         line can be undone.
  1313.  
  1314.  
  1315. Caches in the MUD Client Program
  1316.  
  1317. In computer usage, a cache is a set of local copies of things that are
  1318. expensive to get. An instruction cache in a CPU is a small memory
  1319. which contains some of the instructions executed most recently. This
  1320. cache memory can be accessed much faster than the main RAM memory
  1321. external to the CPU chip. This same technique is used in AmigaMUD to
  1322. speed up operation. This section will discuss the caches used in the
  1323. MUD client program. The symbol cache and the function header cache are
  1324. of benefit only to wizards, and were discussed earlier.
  1325.  
  1326. AmigaMUD uses the term "effect" to refer to any of the non-text output
  1327. items that are possible: graphics, sound, voice and music. Scenes in a
  1328. scenario can be drawn in a variety of ways. The simplest way is to
  1329. simply load an IFF ILBM image produced using a paint program. This
  1330. image must be present on the remote client machines, however, since
  1331. sending such an image over the serial connection every time it is
  1332. needed would be too slow. Many players of an AmigaMUD scenario will
  1333. not have the pictures, however, so an alternate method of drawing a
  1334. scene is needed.
  1335.  
  1336. As directed by code in AmigaMUD functions, the server can send
  1337. messages to remote clients directing them to draw various simple
  1338. graphical elements in the graphics window. These include lines,
  1339. rectangles, circles, etc. A simple form of a scene can be drawn using
  1340. these elements, and can be sent from the server to the client in less
  1341. time than sending a full bitmap of a similar scene. It is useful,
  1342. however, if a given scene needs to be sent over only once per session.
  1343. Then, the scene can be called up by a short command from the server,
  1344. thus greatly speeding up the play of the game.
  1345.  
  1346. This storing of graphics elements (and commands to play sounds, etc.
  1347. as well) by the remote clients is the "effects cache". Each effect is
  1348. uniquely identified, and can be called up much like a subroutine or
  1349. function can be called in a programming language. In fact, they ARE
  1350. effects subroutines, and can in turn call on other, lower-level
  1351. effects subroutines.
  1352.  
  1353. Many Amiga systems have a megabyte or more of RAM, but have only a
  1354. single floppy disk drive for permanent storage. Having to load up an
  1355. IFF image or sound sample every time they are needed could make for
  1356. slow and unpleasant playing of a graphics MUD. To alleviate this, the
  1357. MUD client program will cache such items in RAM. This is termed the
  1358. "file cache".
  1359.  
  1360. The menu item "Effects"/"Show Status" displays the status of the
  1361. caches in the client program. Here is a sample of its output:
  1362.  
  1363. Files:
  1364.   Sounds/clang >0<
  1365.   Images/Town/mall >0<
  1366. 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
  1367. Tiles:
  1368.  
  1369. Here there are currently two files loaded in the file cache. One is an
  1370. image (IFF ILBM) called 'Town/Mall'. The other is a sound sample (IFF
  1371. 8SVX) called 'clang'. The printed name shows the directory within the
  1372. "AmigaMUD:" assign that the file came from. The '>0<' indicates that
  1373. there are currently no references to the files, and thus they can be
  1374. flushed from the cache as desired. Files can be flushed from the file
  1375. cache using the "Effects"/"Free File" menu item, and can also be
  1376. flushed by the program itself if it runs out of memory (e.g. to load
  1377. in another file). When a file is flushed, the Least Recently Used one
  1378. (the one such that all others have been used more recently) is chosen
  1379. for flushing. A file cannot be flushed if its reference count is
  1380. greater than zero. This will be true while a sound sample is playing,
  1381. while a music score is playing, or while an instrument is referenced
  1382. by a score in the file cache.
  1383.  
  1384. There are nine effects subroutines currently stored in the effects
  1385. cache. For each one, the first number displayed (before the '/') is
  1386. the unique identifier for the effect. For a given compilation of the
  1387. scenario, these numbers will not change. The number after the '/' is
  1388. the size in bytes of the effect. The four length-18 effects in the
  1389. above display are for the four styles of doors used in the standard
  1390. scenario. A following number as in '>2<' shows the number of
  1391. references to the effect subroutine from other effects subroutines.
  1392. The various doors are used by both the 'streets' and the 'mall'
  1393. effects subroutines. A following number as in '(15)' shows the number
  1394. of references to other effects subroutines that this effect makes.
  1395. The list of effects subroutines is shown in order of the most recently
  1396. used one to the least recently used one. Thus, in this case, using the
  1397. "Effects"/"Free Effect" item would free the effect with key 1 and size
  1398. 48. Again, affects with non-zero reference counts cannot be freed.
  1399.  
  1400. Freeing an effect is not instantaneous. The server keeps track of
  1401. which effects each client has in its cache, so that it knows when it
  1402. has to send a copy of an effect to a client. So, when the client wants
  1403. to free an effect, it sends a request to the server, which will always
  1404. reply in the affirmative. This allows the server to try to keep its
  1405. records accurate. It is, however, still possible for the two to get
  1406. out of agreement. If the server sends an effect that the client
  1407. already has in its cache, the client just ignores the new copy. This
  1408. can happen even in proper operation, because of timing issues. If an
  1409. effect manages to call an effect that is not in the cache (this should
  1410. not happen), the call is ignored.
  1411.  
  1412. The "Tiles:" line in the output will currently always show nothing,
  1413. since no current scenario uses the tiling facility of the system. When
  1414. in use, each entry is simply the numeric identifier of the cached
  1415. tile.
  1416.  
  1417. The "Effects"/"Zap Effects" menu item sends a request to the server
  1418. saying that all of the effects subroutines cached by this client are
  1419. to be freed. When the reply gets back to the client, it in turn will
  1420. free all of the effects subroutines it has cached. This can be useful
  1421. if for some reason, the server and the client seem to get out of
  1422. agreement and the proper displays are not appearing. More likely,
  1423. however, is a bug in the scenario which is not displaying the scenes
  1424. correctly.
  1425.  
  1426. There is one circumstance where all of your cached images and brushes
  1427. will be removed. This is when you are running MUD with one or two
  1428. custom screens (as opposed to in WorkBench windows), and a new
  1429. background is loaded which has a different colour palette than the
  1430. currently in-use palette. In this situation, the remapping of the
  1431. colours of the images and brushes to the active palette becomes
  1432. invalid, and needs to be rebuilt. This is currently side-stepped, by
  1433. simply removing all of them from the cache, which will cause them to
  1434. be reloaded if needed, and remapped at that time. This is arguably the
  1435. best solution, since the images as mapped to the current palette may
  1436. have lost information from their in-file forms, which can perhaps be
  1437. fully utilized if they are remapped against the new palette.
  1438.