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