]> git.cameronkatri.com Git - bsdgames-darwin.git/blob - atc/atc.6
use warn instead of perror/fprintf/...
[bsdgames-darwin.git] / atc / atc.6
1 .\" $NetBSD: atc.6,v 1.3 1995/03/21 15:03:43 cgd 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 . \" XP - exdented paragraph
40 .de XP
41 .RT
42 .if \\n(1T .sp \\n(PDu
43 .ne 1.1
44 .if !\\n(IP .nr IP +1
45 .in +\\n(I\\n(IRu
46 .ti -\\n(I\\n(IRu
47 ..
48 .\" Copyright (c) 1986 Ed James. All rights reserved.
49 .\"
50 .TH ATC 6 "May 31, 1993"
51 .UC
52 .SH NAME
53 atc \- air traffic controller game
54 .SH SYNOPSIS
55 .B atc
56 -[u?lstp] [-[gf] game_name] [-r random seed]
57 .SH DESCRIPTION
58 .LP
59 .I Atc
60 lets you try your hand at the nerve wracking duties of the air traffic
61 controller without endangering the lives of millions of
62 travelers each year.
63 Your responsibilities require you to direct the flight of jets
64 and prop planes into and out of the flight arena and airports.
65 The speed (update time) and frequency of the planes depend on the
66 difficulty of the chosen arena.
67 .SH OPTIONS
68 .LP
69 .TP 8
70 .B \-u
71 Print the usage line and exit.
72 .TP
73 .B \-?
74 Same as
75 .B \-u.
76 .TP
77 .B \-l
78 Print a list of available games and exit.
79 The first game name printed is the default game.
80 .TP
81 .B \-s
82 Print the score list (formerly the Top Ten list).
83 .TP
84 .B \-t
85 Same as
86 .B \-s.
87 .TP
88 .B \-p
89 Print the path to the special directory where
90 .I atc
91 expects to find its private files. This is used during the
92 installation of the program.
93 .TP
94 .B "\-g game"
95 Play the named game. If the game listed is not one of the
96 ones printed from the
97 .B \-l
98 option, the default game is played.
99 .TP
100 .B "\-f game"
101 Same as
102 .B \-g.
103 .TP
104 .B "\-r seed"
105 Set the random seed. The purpose of this flag is questionable.
106 .SH GOALS
107 .LP
108 Your goal in
109 .I atc
110 is to keep the game going as long as possible.
111 There is no winning state, except to beat the times of other players.
112 You will need to: launch planes at airports (by instructing them to
113 increase their altitude); land planes at airports (by instructing them to
114 go to altitude zero when exactly over the airport); and maneuver planes
115 out of exit points.
116 .LP
117 Several things will cause the end of the game.
118 Each plane has a destination (see information area), and
119 sending a plane to the wrong destination is an error.
120 Planes can run out of fuel, or can collide. Collision is defined as
121 adjacency in any of the three dimensions. A plane leaving the arena
122 in any other way than through its destination exit is an error as well.
123 .LP
124 Scores are sorted in order of the number of planes safe. The other
125 statistics are provided merely for fun. There is no penalty for
126 taking longer than another player (except in the case of ties).
127 .LP
128 Suspending a game is not permitted. If you get a talk message, tough.
129 When was the last time an Air Traffic Controller got called away to
130 the phone?
131 .SH "THE DISPLAY"
132 .LP
133 Depending on the terminal you run
134 .I atc
135 on, the screen will be divided into 4 areas.
136 It should be stressed that the terminal driver portion of the
137 game was designed to be reconfigurable, so the display format can vary
138 depending the version you are playing. The descriptions here are based
139 on the ascii version
140 of the game. The game rules and input format, however,
141 should remain consistent.
142 Control-L redraws the screen, should it become muddled.
143 .SS RADAR
144 .IP
145 The first screen area is the radar display, showing the relative locations
146 of the planes, airports, standard entry/exit points, radar
147 beacons, and "lines" which simply serve to aid you in guiding
148 the planes.
149 .IP
150 Planes are shown as a single letter with an altitude. If
151 the numerical altitude is a single digit, then it represents
152 thousands of feet.
153 Some distinction is made between the prop
154 planes and the jets. On ascii terminals, prop planes are
155 represented by a upper case letter, jets by a lower case letter.
156 .IP
157 Airports are shown as a number and some indication of the direction
158 planes must be going to land at the airport.
159 On ascii terminals, this is one of '^', '>', '<', and 'v', to indicate
160 north (0 degrees), east (90), west (270) and south (180), respectively.
161 The planes will also
162 take off in this direction.
163 .IP
164 Beacons are represented as circles or asterisks and a number.
165 Their purpose is to offer a place of easy reference to the plane pilots.
166 See 'the delay command' under the input section of this manual.
167 .IP
168 Entry/exit points are displayed as numbers along the border of the
169 radar screen. Planes will enter the arena from these points without
170 warning. These points have a direction associated with them, and
171 planes will always enter the arena from this direction. On the
172 ascii version of
173 .I atc,
174 this direction is not displayed. It will become apparent
175 what this direction is as the game progresses.
176 .IP
177 Incoming planes will always enter at the same altitude: 7000 feet.
178 For a plane to successfully depart through an entry/exit point,
179 it must be flying at 9000 feet.
180 It is not necessary for the planes to be flying in any particular
181 direction when they leave the arena (yet).
182 .SS "INFORMATION AREA"
183 .IP
184 The second area of the display is the information area, which lists
185 the time (number of updates since start), and the number of planes you
186 have directed safely out of the arena.
187 Below this is a list of planes currently in the air, followed by a
188 blank line, and then a list of planes on the ground (at airports).
189 Each line lists the plane name and its current altitude,
190 an optional asterisk indicating low fuel, the plane's destination,
191 and the plane's current command. Changing altitude is not considered
192 to be a command and is therefore not displayed. The following are
193 some possible information lines:
194 .IP
195 B4*A0: Circle @ b1
196 .br
197 g7 E4: 225
198 .IP
199 The first example shows a prop plane named 'B' that is flying at 4000
200 feet. It is low on fuel (note the '*'). It's destination is
201 Airport #0.
202 The next command it expects
203 to do is circle when it reaches Beacon #1.
204 The second example shows a jet named 'g' at 7000 feet, destined for
205 Exit #4. It is just now executing a turn to 225 degrees (South-West).
206 .SS "INPUT AREA"
207 .IP
208 The third area of the display is the input area. It is here that
209 your input is reflected. See the INPUT heading of this manual
210 for more details.
211 .SS "AUTHOR AREA"
212 .IP
213 This area is used simply to give credit where credit is due. :-)
214 .SH INPUT
215 .LP
216 A command completion interface is built into
217 the game. At any time, typing '?' will list possible input characters.
218 Typing a backspace (your erase character) backs up, erasing the last part
219 of the command. When a command is complete, a return enters it, and
220 any semantic checking is done at that time. If no errors are detected,
221 the command is sent to the appropriate plane. If an error is discovered
222 during the check, the offending statement will be underscored and a
223 (hopefully) descriptive message will be printed under it.
224 .LP
225 The command syntax is broken into two parts:
226 .I "Immediate Only"
227 and
228 .I Delayable
229 commands.
230 .I "Immediate Only"
231 commands happen on the next
232 update.
233 .I Delayable
234 commands also happen on the next update unless they
235 are followed by an optional predicate called the
236 .I Delay
237 command.
238 .LP
239 In the following tables, the syntax
240 .B [0\-9]
241 means any single digit, and
242 .B <dir>
243 refers to the keys around the 's' key, namely ``wedcxzaq''.
244 In absolute references, 'q' refers to North-West or 315 degrees, and 'w'
245 refers to North, or 0 degrees.
246 In relative references, 'q' refers to -45 degrees or 45 degrees left, and 'w'
247 refers to 0 degrees, or no change in direction.
248 .LP
249 All commands start with a plane letter. This indicates the recipient
250 of the command. Case is ignored.
251 .SS "IMMEDIATE ONLY COMMANDS"
252 .RS
253 .B "\- a Altitude:"
254 .RS
255 Affect a plane's altitude (and take off).
256 .RE
257 .RS
258 .B "\- [0\-9] Number:"
259 .RS
260 Go to the given altitude (thousands of feet).
261 .RE
262 .B "\- c/+ Climb:"
263 .RS
264 Relative altitude change.
265 .RE
266 .RS
267 .B "\- [0\-9] Number:"
268 .RS
269 Difference in thousands of feet.
270 .RE
271 .RE
272 .B "\- d/\- Descend:"
273 .RS
274 Relative altitude change.
275 .RE
276 .RS
277 .B "\- [0\-9] Number:"
278 .RS
279 Difference in thousands of feet.
280 .RE
281 .RE
282 .RE
283 .B "\- m Mark:"
284 .RS
285 Display in highlighted mode. Command is displayed normally.
286 .RE
287 .B "\- i Ignore:"
288 .RS
289 Do not display highlighted. Command is displayed as a
290 line of dashes if there is no command.
291 .RE
292 .B "\- u Unmark:"
293 .RS
294 Same as ignore, but if a delayed command is processed,
295 the plane will become marked. This is useful if you want
296 to forget about a plane during part, but not all, of its
297 journey.
298 .RE
299 .RE
300 .SS "DELAYABLE COMMANDS"
301 .RS
302 .B "\- c Circle:"
303 .RS
304 Have the plane circle (clockwise by default).
305 .RE
306 .RS
307 .B "\- l Left:"
308 .RS
309 Circle counterclockwise.
310 .RE
311 .B "\- r Right:"
312 .RS
313 Circle clockwise.
314 .RE
315 .RE
316 .B "\- t Turn:"
317 .RS
318 Change direction.
319 .RE
320 .RS
321 .B "\- l Left:"
322 .RS
323 Turn counterclockwise (45 degrees by default).
324 .RE
325 .RS
326 .B "\- <dir> Direction:"
327 .RS
328 Turn ccw the given number of degrees.
329 Zero degrees is no turn. A ccw turn
330 of -45 degrees is 45 cw.
331 .RE
332 .RE
333 .B "\- r Right:"
334 .RS
335 Turn clockwise (45 degrees by default).
336 .RE
337 .RS
338 .B "\- <dir> Direction:"
339 .RS
340 Same as turn left <dir>.
341 .RE
342 .RE
343 .B "\- L Left 90:"
344 .RS
345 Turn counterclockwise 90 degrees.
346 .RE
347 .B "\- R Right 90:"
348 .RS
349 Turn clockwise 90 degrees.
350 .RE
351 .B "\- <dir> Direction:"
352 .RS
353 Turn to the absolute compass heading given.
354 The shortest turn will be taken.
355 .RE
356 .B "\- t Towards:"
357 .RS
358 Turn towards a beacon, airport or exit. The turn is
359 just an estimate.
360 .RE
361 .RS
362 .B "\- b/* Beacon:"
363 .RS
364 Turn towards the beacon.
365 .RE
366 .RS
367 .B "\- [0-9] Number:"
368 .RS
369 The beacon number.
370 .RE
371 .RE
372 .B "\- e Exit:"
373 .RS
374 Turn towards the exit.
375 .RE
376 .RS
377 .B "\- [0-9] Number:"
378 .RS
379 The exit number.
380 .RE
381 .RE
382 .B "\- a Airport:"
383 .RS
384 Turn towards the airport.
385 .RE
386 .RS
387 .B "\- [0-9] Number:"
388 .RS
389 The airport number.
390 .RE
391 .RE
392 .RE
393 .RE
394 .RE
395 .SS THE DELAY COMMAND
396 .LP
397 The
398 .B Delay
399 (a/@)
400 command may be appended to any
401 .B Delayable
402 command. It allows the controller to instruct a plane to do an action
403 when the plane reaches a particular beacon (or other objects in future
404 versions).
405 .sp
406 .RS
407 .B "\- a/@ At:"
408 .RS
409 Do the given delayable command when the plane reaches the given beacon.
410 .RE
411 .RS
412 .B "\- b/* Beacon:"
413 .RS
414 This is redundant to allow for expansion.
415 .RE
416 .RS
417 .B "\- [0-9] Number:"
418 .RS
419 The beacon number.
420 .RE
421 .RE
422 .RE
423 .RE
424 .SS "MARKING, UNMARKING AND IGNORING"
425 .LP
426 Planes are
427 .B marked
428 when they enter the arena. This means they are displayed in highlighted
429 mode on the radar display. A plane may also be either
430 .B unmarked
431 or
432 .B ignored.
433 An
434 .B unmarked
435 plane is drawn in unhighlighted mode, and a line of dashes is displayed in
436 the command field of the information area. The plane will remain this
437 way until a mark command has been issued. Any other command will be issued,
438 but the command line will return to a line of dashes when the command
439 is completed.
440 .LP
441 An
442 .B ignored
443 plane is treated the same as an unmarked plane, except that it will
444 automatically switch to
445 .B marked
446 status when a delayed command has been processed. This is useful if
447 you want to forget about a plane for a while, but its flight path has
448 not yet been completely set.
449 .LP
450 As with all of the commands, marking, unmarking and ignoring will take effect
451 at the beginning of the next update. Do not be surprised if the plane does
452 not immediately switch to unhighlighted mode.
453 .SS EXAMPLES
454 .RS
455 .TP 16
456 atlab1
457 a: turn left at beacon #1
458 .TP 16
459 cc
460 C: circle
461 .TP 16
462 gtte4ab2
463 g: turn towards exit #4 at beacon #2
464 .TP 16
465 ma+2
466 m: altitude: climb 2000 feet
467 .TP 16
468 stq
469 S: turn to 315
470 .TP 16
471 xi
472 x: ignore
473 .RE
474 .SH "OTHER INFORMATION"
475 .LP
476 Jets move every update; prop planes move every other update.
477 .LP
478 All planes turn a most 90 degrees per movement.
479 .LP
480 Planes enter at 7000 feet and leave at 9000 feet.
481 .LP
482 Planes flying at an altitude of 0 crash if they are not over an airport.
483 .LP
484 Planes waiting at airports can only be told to take off (climb in altitude).
485 .SH "NEW GAMES"
486 .LP
487 The
488 .B Game_List
489 file lists the currently available play fields. New field description
490 file names must be placed in this file to be 'playable'. If a player
491 specifies a game not in this file, his score will not be logged.
492 .LP
493 The game field description files are broken into two parts. The first
494 part is the definition section. Here, the four tunable game parameters
495 must be set. These variables are set with the syntax:
496 .IP
497 variable = number;
498 .LP
499 Variable may be one of:
500 .B update,
501 indicating the number of seconds between forced updates;
502 .B newplane,
503 indicating (about) the number of updates between new plane entries;
504 .B width,
505 indicating the width of the play field; and
506 .B height,
507 indicating the height of the play field.
508 .LP
509 The second part of the field description files describes the locations
510 of the exits, the beacons, the airports and the lines.
511 The syntax is as follows:
512 .IP
513 beacon: (x y) ... ;
514 .br
515 airport: (x y direction) ... ;
516 .br
517 exit: (x y direction) ... ;
518 .br
519 line: [ (x1 y1) (x2 y2) ] ... ;
520 .LP
521 For beacons, a simple x, y coordinate pair is used (enclosed in parenthesis).
522 Airports and exits require a third value, a direction, which is one
523 of
524 .B wedcxzaq.
525 For airports, this is the direction that planes must be going to take
526 off and land, and for exits, this is the direction that planes will going
527 when they
528 .B enter
529 the arena. This may not seem intuitive, but as there is no restriction on
530 direction of exit, this is appropriate.
531 Lines are slightly different, since they need two coordinate pairs to
532 specify the line endpoints. These endpoints must be enclosed in
533 square brackets.
534 .LP
535 All statements are semi-colon (;) terminated. Multiple item statements
536 accumulate. Each definition must occur exactly once, before any
537 item statements. Comments begin with a hash (#) symbol
538 and terminate with a newline.
539 The coordinates are between zero and width-1 and height-1
540 inclusive. All of the exit coordinates must lie on the borders, and
541 all of the beacons and airports must lie inside of the borders.
542 Line endpoints may be anywhere within the field, so long as
543 the lines are horizontal, vertical or
544 .B "exactly diagonal."
545 .SS "FIELD FILE EXAMPLE"
546 .RS
547 .sp
548 .nf
549 .TA 1i 1i
550 .ta 1i 1i
551 # This is the default game.
552
553 update = 5;
554 newplane = 5;
555 width = 30;
556 height = 21;
557
558 exit: ( 12 0 x ) ( 29 0 z ) ( 29 7 a ) ( 29 17 a )
559 ( 9 20 e ) ( 0 13 d ) ( 0 7 d ) ( 0 0 c ) ;
560
561 beacon: ( 12 7 ) ( 12 17 ) ;
562
563 airport: ( 20 15 w ) ( 20 18 d ) ;
564
565 line: [ ( 1 1 ) ( 6 6 ) ]
566 [ ( 12 1 ) ( 12 6 ) ]
567 [ ( 13 7 ) ( 28 7 ) ]
568 [ ( 28 1 ) ( 13 16 ) ]
569 [ ( 1 13 ) ( 11 13 ) ]
570 [ ( 12 8 ) ( 12 16 ) ]
571 [ ( 11 18 ) ( 10 19 ) ]
572 [ ( 13 17 ) ( 28 17 ) ]
573 [ ( 1 7 ) ( 11 7 ) ] ;
574 .fi
575 .RE
576 .SH FILES
577 .LP
578 Files are kept in a special directory. See the OPTIONS for a way to
579 print this path out.
580 .TP 16
581 .B ATC_score
582 Where the scores are kept.
583 .TP 16
584 .B Game_List
585 The list of playable games.
586 .SH AUTHOR
587 .LP
588 Ed James, UC Berkeley: edjames@ucbvax.berkeley.edu, ucbvax!edjames
589 .LP
590 This game is based on someone's description of the overall flavor
591 of a game written for some unknown PC many years ago, maybe.
592 .SH BUGS
593 .LP
594 The screen sometimes refreshes after you have quit.
595 .LP
596 Yet Another Curses Bug was discovered during the development of this game.
597 If your curses library clrtobot.o is version 5.1 or earlier,
598 you will have erase problems with the backspace operator in the input
599 window.
600