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