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