xref: /netbsd-src/games/atc/atc.6 (revision 89c5a767f8fc7a4633b2d409966e2becbb98ff92)
1.\"	$NetBSD: atc.6,v 1.6 1999/07/17 19:48:40 hubertf Exp $
2.\"
3.\" Copyright (c) 1990, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" This code is derived from software contributed to Berkeley by
7.\" Ed James.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\" 3. All advertising materials mentioning features or use of this software
18.\"    must display the following acknowledgement:
19.\"	This product includes software developed by the University of
20.\"	California, Berkeley and its contributors.
21.\" 4. Neither the name of the University nor the names of its contributors
22.\"    may be used to endorse or promote products derived from this software
23.\"    without specific prior written permission.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35.\" SUCH DAMAGE.
36.\"
37.\"	@(#)atc.6	8.1 (Berkeley) 5/31/93
38.\"
39.\" Copyright (c) 1986 Ed James. All rights reserved.
40.\"
41.Dd May 31, 1993
42.Dt ATC 6
43.Os BSD 4.3
44.Sh NAME
45.Nm atc
46.Nd air traffic controller game
47.Sh SYNOPSIS
48.Nm atc
49.Op Fl u?lstp
50.Op Fl gf Ar "game name"
51.Op Fl r Ar "random seed"
52.Sh DESCRIPTION
53.Nm Atc
54lets you try your hand at the nerve wracking duties of the air traffic
55controller without endangering the lives of millions of
56travelers each year.
57Your responsibilities require you to direct the flight of jets
58and prop planes into and out of the flight arena and airports.
59The speed (update time) and frequency of the planes depend on the
60difficulty of the chosen arena.
61.Sh OPTIONS
62.Bl -tag -width flag
63.It Fl u
64Print the usage line and exit.
65.It Fl ?
66Same as
67.Fl u.
68.It Fl l
69Print a list of available games and exit.
70The first game name printed is the default game.
71.It Fl s
72Print the score list (formerly the Top Ten list).
73.It Fl t
74Same as
75.Fl s.
76.It Fl p
77Print the path to the special directory where
78.Nm atc
79expects to find its private files.  This is used during the
80installation of the program.
81.It Fl g Ar game
82Play the named game.  If the game listed is not one of the
83ones printed from the
84.Fl l
85option, the default game is played.
86.It Fl f Ar game
87Same as
88.Fl g.
89.It Fl r Ar seed
90Set the random seed.  The purpose of this flag is questionable.
91.El
92.Sh GOALS
93Your goal in
94.Nm atc
95is to keep the game going as long as possible.
96There is no winning state, except to beat the times of other players.
97You will need to: launch planes at airports (by instructing them to
98increase their altitude); land planes at airports (by instructing them to
99go to altitude zero when exactly over the airport); and maneuver planes
100out of exit points.
101.Pp
102Several things will cause the end of the game.
103Each plane has a destination (see information area), and
104sending a plane to the wrong destination is an error.
105Planes can run out of fuel, or can collide.  Collision is defined as
106adjacency in all three dimensions.  A plane leaving the arena
107in any other way than through its destination exit is an error as well.
108.Pp
109Scores are sorted in order of the number of planes safe.  The other
110statistics are provided merely for fun.  There is no penalty for
111taking longer than another player (except in the case of ties).
112.Pp
113Suspending a game is not permitted.  If you get a talk message, tough.
114When was the last time an Air Traffic Controller got called away to
115the phone?
116.Sh "THE DISPLAY"
117.Pp
118Depending on the terminal you run
119.Nm atc
120on, the screen will be divided into 4 areas.
121It should be stressed that the terminal driver portion of the
122game was designed to be reconfigurable, so the display format can vary
123depending the version you are playing.  The descriptions here are based
124on the ascii version
125of the game.  The game rules and input format, however,
126should remain consistent.
127Control-L redraws the screen, should it become muddled.
128.Ss RADAR
129The first screen area is the radar display, showing the relative locations
130of the planes, airports, standard entry/exit points, radar
131beacons, and ``lines'' which simply serve to aid you in guiding
132the planes.
133.Pp
134Planes are shown as a single letter with an altitude.  If
135the numerical altitude is a single digit, then it represents
136thousands of feet.
137Some distinction is made between the prop
138planes and the jets.  On ascii terminals, prop planes are
139represented by a upper case letter, jets by a lower case letter.
140.Pp
141Airports are shown as a number and some indication of the direction
142planes must be going to land at the airport.
143On ascii terminals, this is one of `^', `>', `<', and `v', to indicate
144north (0 degrees), east (90), west (270) and south (180), respectively.
145The planes will also
146take off in this direction.
147.Pp
148Beacons are represented as circles or asterisks and a number.
149Their purpose is to offer a place of easy reference to the plane pilots.
150See ``the delay command'' under the input section of this manual.
151.Pp
152Entry/exit points are displayed as numbers along the border of the
153radar screen.  Planes will enter the arena from these points without
154warning.  These points have a direction associated with them, and
155planes will always enter the arena from this direction.  On the
156ascii version of
157.Nm atc,
158this direction is not displayed.  It will become apparent
159what this direction is as the game progresses.
160.Pp
161Incoming planes will always enter at the same altitude: 7000 feet.
162For a plane to successfully depart through an entry/exit point,
163it must be flying at 9000 feet.
164It is not necessary for the planes to be flying in any particular
165direction when they leave the arena (yet).
166.Ss "INFORMATION AREA"
167The second area of the display is the information area, which lists
168the time (number of updates since start), and the number of planes you
169have directed safely out of the arena.
170Below this is a list of planes currently in the air, followed by a
171blank line, and then a list of planes on the ground (at airports).
172Each line lists the plane name and its current altitude,
173an optional asterisk indicating low fuel, the plane's destination,
174and the plane's current command.  Changing altitude is not considered
175to be a command and is therefore not displayed.  The following are
176some possible information lines:
177.Pp
178.Bd -literal -unfilled -offset indent
179B4*A0: Circle @ b1
180g7 E4: 225
181.Ed
182.Pp
183The first example shows a prop plane named `B' that is flying at 4000
184feet.  It is low on fuel (note the `*').  Its destination is
185Airport #0.
186The next command it expects
187to do is circle when it reaches Beacon #1.
188The second example shows a jet named `g' at 7000 feet, destined for
189Exit #4.  It is just now executing a turn to 225 degrees (South-West).
190.Ss "INPUT AREA"
191The third area of the display is the input area.  It is here that
192your input is reflected.  See the INPUT heading of this manual
193for more details.
194.Ss "AUTHOR AREA"
195This area is used simply to give credit where credit is due. :-)
196.Sh INPUT
197A command completion interface is built into
198the game.  At any time, typing `?' will list possible input characters.
199Typing a backspace (your erase character) backs up, erasing the last part
200of the command.  When a command is complete, a return enters it, and
201any semantic checking is done at that time.  If no errors are detected,
202the command is sent to the appropriate plane.  If an error is discovered
203during the check, the offending statement will be underscored and a
204(hopefully) descriptive message will be printed under it.
205.Pp
206The command syntax is broken into two parts:
207.Em "Immediate Only"
208and
209.Em Delayable
210commands.
211.Em "Immediate Only"
212commands happen on the next
213update.
214.Em Delayable
215commands also happen on the next update unless they
216are followed by an optional predicate called the
217.Em Delay
218command.
219.Pp
220In the following tables, the syntax
221.Em [0\-9]
222means any single digit, and
223.Em <dir>
224refers to a direction, given by the keys around the `s' key: ``wedcxzaq''.
225In absolute references, `q' refers to North-West or 315 degrees, and `w'
226refers to North, or 0 degrees.
227In relative references, `q' refers to -45 degrees or 45 degrees left, and `w'
228refers to 0 degrees, or no change in direction.
229.Pp
230All commands start with a plane letter.  This indicates the recipient
231of the command.  Case is ignored.
232.Ss "IMMEDIATE ONLY COMMANDS"
233.Bl -tag -width "aaaa"
234.It "a [ cd+- ]" Em number
235Altitude: Change a plane's altitude, possibly requesting takeoff.
236`+' and `-' are the same as `c' and `d'.
237.Bl -tag -width "aaaaaaaaaa" -compact
238.It a Em number
239Climb or descend to the given altitude (in thousands of feet).
240.It ac Em number
241Climb: relative altitude change.
242.It ad Em number
243Descend: relative altitude change.
244.El
245.It m
246Mark: Display in highlighted mode.  Plane and command information
247is displayed normally.
248.It i
249Ignore: Do not display highlighted.  Command is displayed as a
250line of dashes if there is no command.
251.It u
252Unmark: Same as ignore, but if a delayed command is processed,
253the plane will become marked.  This is useful if you want
254to forget about a plane during part, but not all, of its
255journey.
256.El
257.Ss "DELAYABLE COMMANDS"
258.Bl -tag -width "aaaa"
259.It "c [ lr ]"
260Circle: Have the plane circle.
261.Bl -tag -width "aaaaaaaaaa" -compact
262.It cl
263Left: Circle counterclockwise.
264.It cr
265Right: Circle clockwise (default).
266.El
267.It "t [ l-r+LR ] [ dir ] or tt [ abe* ]" Em number
268Turn: Change direction.
269.Bl -tag -width "aaaaaaaaaa" -compact
270.It "t<dir>"
271Turn to direction: Turn to the absolute compass heading given.
272The shortest turn will be taken.
273.It "tl [ dir ]"
274Left: Turn counterclockwise: 45 degrees by default, or the amount
275specified in <dir> (not
276.Em to
277<dir>.) `w' (0 degrees) is no turn. `e' is 45 degrees; `q' gives -45
278degrees counterclockwise, that is, 45 degrees clockwise.
279.It "t- [ dir ]"
280Same as left.
281.It "tr [ dir ]"
282Right: Turn clockwise, 45 degrees by default, or the amount specified
283in <dir>.
284.It "t+ [ dir ]"
285Same as right.
286.It tL
287Hard left: Turn counterclockwise 90 degrees.
288.It tR
289Hard right: Turn clockwise 90 degrees.
290.It "tt [abe*]"
291Towards: Turn towards a beacon, airport or exit.  The turn is
292just an estimate.
293.It "tta" Em number
294Turn towards the given airport.
295.It "ttb" Em number
296Turn towards the specified beacon.
297.It "tte" Em number
298Turn towards an exit.
299.It "tt*" Em number
300Same as ttb.
301.El
302.El
303.Ss THE DELAY COMMAND
304The
305.Em Delay
306(a/@)
307command may be appended to any
308.Em Delayable
309command.  It allows the controller to instruct a plane to do an action
310when the plane reaches a particular beacon (or other objects in future
311versions).
312.Bl -tag -width "aaaa"
313.It ab Em number
314Do the delayable command when the plane reaches the specified
315beacon. The `b' for ``beacon'' is redundant to allow for expansion.
316`@' can be used instead of `a'.
317.El
318.Ss "MARKING, UNMARKING AND IGNORING"
319Planes are
320.Em marked
321by default when they enter the arena.  This means they are displayed
322in highlighted mode on the radar display.  A plane may also be either
323.Em unmarked
324or
325.Em ignored.
326An
327.Em unmarked
328plane is drawn in unhighlighted mode, and a line of dashes is displayed in
329the command field of the information area.  The plane will remain this
330way until a mark command has been issued.  Any other command will be issued,
331but the command line will return to a line of dashes when the command
332is completed.
333.Pp
334An
335.Em ignored
336plane is treated the same as an unmarked plane, except that it will
337automatically switch to
338.Em marked
339status when a delayed command has been processed.  This is useful if
340you want to forget about a plane for a while, but its flight path has
341not yet been completely set.
342.Pp
343As with all of the commands, marking, unmarking and ignoring will take effect
344at the beginning of the next update.  Do not be surprised if the plane does
345not immediately switch to unhighlighted mode.
346.Ss EXAMPLES
347.Bl -tag -width gtte4ab2 -offset indent
348.It atlab1
349Plane A: turn left at beacon #1
350.It cc
351Plane C: circle
352.It gtte4ab2
353Plane G: turn towards exit #4 at beacon #2
354.It ma+2
355Plane M: altitude: climb 2000 feet
356.It stq
357Plane S: turn to 315
358.It xi
359Plane X: ignore
360.El
361.Sh "OTHER INFORMATION"
362.Bl -bullet
363.It
364Jets move every update; prop planes move every other update.
365.It
366All planes turn a most 90 degrees per movement.
367.It
368Planes enter at 7000 feet and leave at 9000 feet.
369.It
370Planes flying at an altitude of 0 crash if they are not over an airport.
371.It
372Planes waiting at airports can only be told to take off (climb in altitude).
373.El
374.Sh "NEW GAMES"
375The
376.Pa Game_List
377file lists the currently available play fields.  New field description
378file names must be placed in this file to be playable.  If a player
379specifies a game not in this file, his score will not be logged.
380.Pp
381The game field description files are broken into two parts.  The first
382part is the definition section.  Here, the four tunable game parameters
383must be set.  These variables are set with the syntax:
384.Pp
385.Dl "variable = number;"
386.Pp
387Variable may be one of:
388.Li update,
389indicating the number of seconds between forced updates;
390.Li newplane,
391indicating (about) the number of updates between new plane entries;
392.Li width,
393indicating the width of the play field; or
394.Li height,
395indicating the height of the play field.
396.Pp
397The second part of the field description files describes the locations
398of the exits, the beacons, the airports and the lines.
399The syntax is as follows:
400.Pp
401.Bd -literal -offset indent
402.Bl -tag -width airport: -compact
403.It beacon:
404(x y) ... ;
405.It airport:
406(x y direction) ... ;
407.It exit:
408(x y direction) ... ;
409.It line:
410[ (x1 y1) (x2 y2) ] ... ;
411.El
412.Ed
413.Pp
414For beacons, a simple x, y coordinate pair is used (enclosed in
415parenthesis).  Airports and exits require a third value, which is one
416of the directions
417.Em wedcxzaq.
418For airports, this is the direction that planes must be going to take
419off and land, and for exits, this is the direction that planes will going
420when they
421.Em enter
422the arena.  This may not seem intuitive, but as there is no restriction on
423direction of exit, this is appropriate.
424Lines are slightly different, since they need two coordinate pairs to
425specify the line endpoints.  These endpoints must be enclosed in
426square brackets.
427.Pp
428All statements are semi-colon (;) terminated.  Multiple item statements
429accumulate.  Each definition must occur exactly once, before any
430item statements.  Comments begin with a hash (#) symbol
431and terminate with a newline.
432The coordinates are between zero and width-1 and height-1
433inclusive.  All of the exit coordinates must lie on the borders, and
434all of the beacons and airports must lie inside of the borders.
435Line endpoints may be anywhere within the field, so long as
436the lines are horizontal, vertical or
437.Em exactly
438diagonal.
439.Ss "FIELD FILE EXAMPLE"
440.Bd -literal -unfilled
441# This is the default game.
442
443update = 5;
444newplane = 5;
445width = 30;
446height = 21;
447
448exit:		( 12  0 x ) ( 29  0 z ) ( 29  7 a ) ( 29 17 a )
449		(  9 20 e ) (  0 13 d ) (  0  7 d ) (  0  0 c ) ;
450
451beacon:		( 12  7 ) ( 12 17 ) ;
452
453airport:	( 20 15 w ) ( 20 18 d ) ;
454
455line:		[ (  1  1 ) (  6  6 ) ]
456		[ ( 12  1 ) ( 12  6 ) ]
457		[ ( 13  7 ) ( 28  7 ) ]
458		[ ( 28  1 ) ( 13 16 ) ]
459		[ (  1 13 ) ( 11 13 ) ]
460		[ ( 12  8 ) ( 12 16 ) ]
461		[ ( 11 18 ) ( 10 19 ) ]
462		[ ( 13 17 ) ( 28 17 ) ]
463		[ (  1  7 ) ( 11  7 ) ] ;
464
465.Ed
466.Sh FILES
467Files are kept in a special directory. See the OPTIONS for a way to
468print this path out. It is normally
469.Pa /usr/share/games/atc.
470.Pp
471This directory contains the file
472.Pa Game_List,
473which holds the list of playable games, as well as the games
474themselves.
475.Pp
476The scores are kept in
477.Pa /var/games/atc_score.
478.Sh AUTHOR
479Ed James, UC Berkeley: edjames@ucbvax.berkeley.edu, ucbvax!edjames
480.Pp
481This game is based on someone's description of the overall flavor
482of a game written for some unknown PC many years ago, maybe.
483.Sh BUGS
484The screen sometimes refreshes after you have quit.
485.Pp
486Yet Another Curses Bug was discovered during the development of this game.
487If your curses library clrtobot.o is version 5.1 or earlier,
488you will have erase problems with the backspace operator in the input
489window.
490