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