1.\" $NetBSD: atc.6,v 1.12 2002/02/08 01:25:12 ross 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 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 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 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 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 `^', `\*[Gt]', `\*[Lt]', 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 "" , 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 \*[Lt]dir\*[Gt] 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\*[Lt]dir\*[Gt]" 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 \*[Lt]dir\*[Gt] (not 276.Em to 277\*[Lt]dir\*[Gt].) `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 \*[Lt]dir\*[Gt]. 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 ignored 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 unmarked 336plane is treated the same as an 337.Em ignored 338plane, except that it will automatically switch to 339.Em marked 340status when a delayed command has been processed. This is useful if 341you want to forget about a plane for a while, but its flight path has 342not yet been completely set. 343.Pp 344As with all of the commands, marking, unmarking and ignoring will take effect 345at the beginning of the next update. Do not be surprised if the plane does 346not immediately switch to unhighlighted mode. 347.Ss EXAMPLES 348.Bl -tag -width gtte4ab2 -offset indent 349.It atlab1 350Plane A: turn left at beacon #1 351.It cc 352Plane C: circle 353.It gtte4ab2 354Plane G: turn towards exit #4 at beacon #2 355.It ma+2 356Plane M: altitude: climb 2000 feet 357.It stq 358Plane S: turn to 315 359.It xi 360Plane X: ignore 361.El 362.Sh "OTHER INFORMATION" 363.Bl -bullet 364.It 365Jets move every update; prop planes move every other update. 366.It 367All planes turn a most 90 degrees per movement. 368.It 369Planes enter at 7000 feet and leave at 9000 feet. 370.It 371Planes flying at an altitude of 0 crash if they are not over an airport. 372.It 373Planes waiting at airports can only be told to take off (climb in altitude). 374.El 375.Sh "NEW GAMES" 376The 377.Pa Game_List 378file lists the currently available play fields. New field description 379file names must be placed in this file to be playable. If a player 380specifies a game not in this file, his score will not be logged. 381.Pp 382The game field description files are broken into two parts. The first 383part is the definition section. Here, the four tunable game parameters 384must be set. These variables are set with the syntax: 385.Pp 386.Dl "variable = number;" 387.Pp 388Variable may be one of: 389.Li update , 390indicating the number of seconds between forced updates; 391.Li newplane , 392indicating (about) the number of updates between new plane entries; 393.Li width , 394indicating the width of the play field; or 395.Li height , 396indicating the height of the play field. 397.Pp 398The second part of the field description files describes the locations 399of the exits, the beacons, the airports and the lines. 400The syntax is as follows: 401.Pp 402.Bd -literal -offset indent 403.Bl -tag -width airport: -compact 404.It beacon : 405(x y) ... ; 406.It airport : 407(x y direction) ... ; 408.It exit : 409(x y direction) ... ; 410.It line : 411[ (x1 y1) (x2 y2) ] ... ; 412.El 413.Ed 414.Pp 415For beacons, a simple x, y coordinate pair is used (enclosed in 416parenthesis). Airports and exits require a third value, which is one 417of the directions 418.Em wedcxzaq . 419For airports, this is the direction that planes must be going to take 420off and land, and for exits, this is the direction that planes will going 421when they 422.Em enter 423the arena. This may not seem intuitive, but as there is no restriction on 424direction of exit, this is appropriate. 425Lines are slightly different, since they need two coordinate pairs to 426specify the line endpoints. These endpoints must be enclosed in 427square brackets. 428.Pp 429All statements are semi-colon (;) terminated. Multiple item statements 430accumulate. Each definition must occur exactly once, before any 431item statements. Comments begin with a hash (#) symbol 432and terminate with a newline. 433The coordinates are between zero and width-1 and height-1 434inclusive. All of the exit coordinates must lie on the borders, and 435all of the beacons and airports must lie inside of the borders. 436Line endpoints may be anywhere within the field, so long as 437the lines are horizontal, vertical or 438.Em exactly 439diagonal. 440.Ss "FIELD FILE EXAMPLE" 441.Bd -literal -unfilled 442# This is the default game. 443 444update = 5; 445newplane = 5; 446width = 30; 447height = 21; 448 449exit: ( 12 0 x ) ( 29 0 z ) ( 29 7 a ) ( 29 17 a ) 450 ( 9 20 e ) ( 0 13 d ) ( 0 7 d ) ( 0 0 c ) ; 451 452beacon: ( 12 7 ) ( 12 17 ) ; 453 454airport: ( 20 15 w ) ( 20 18 d ) ; 455 456line: [ ( 1 1 ) ( 6 6 ) ] 457 [ ( 12 1 ) ( 12 6 ) ] 458 [ ( 13 7 ) ( 28 7 ) ] 459 [ ( 28 1 ) ( 13 16 ) ] 460 [ ( 1 13 ) ( 11 13 ) ] 461 [ ( 12 8 ) ( 12 16 ) ] 462 [ ( 11 18 ) ( 10 19 ) ] 463 [ ( 13 17 ) ( 28 17 ) ] 464 [ ( 1 7 ) ( 11 7 ) ] ; 465 466.Ed 467.Sh FILES 468Files are kept in a special directory. See the OPTIONS for a way to 469print this path out. It is normally 470.Pa /usr/share/games/atc . 471.Pp 472This directory contains the file 473.Pa Game_List , 474which holds the list of playable games, as well as the games 475themselves. 476.Pp 477The scores are kept in 478.Pa /var/games/atc_score . 479.Sh AUTHOR 480Ed James, UC Berkeley: edjames@ucbvax.berkeley.edu, ucbvax!edjames 481.Pp 482This game is based on someone's description of the overall flavor 483of a game written for some unknown PC many years ago, maybe. 484.Sh BUGS 485The screen sometimes refreshes after you have quit. 486.Pp 487Yet Another Curses Bug was discovered during the development of this game. 488If your curses library clrtobot.o is version 5.1 or earlier, 489you will have erase problems with the backspace operator in the input 490window. 491