MULTI-TREK 1.0 INTRODUCTION This game was written as a tool to test the use of shared global areas with time-shared programs. The game consists of five parts, the shared global area (LEDFOR), the driver task (MTREKD) which controls the universe, the PLAYER task which interfaces with the players, the initialization program (MTREKINI), and the robot ship program (ROBOT). The source code for the game is intended to be public so that en- hancements can be added by any interested party. Those making addi- tions should add their names to those listed as contributors at the start of the MTREKD program. Note MTREK was originally developed under IAS but is written almost entirely in RATFOR and should be readily convertible to RSX-11M or, for that matter, to any system that supports shared global areas and time-shared tasks or some equivalent. MTREK was originally written at Boeing Computer Services in Seattle, Washington by Don Ledford, John Lutch, and Ray French. The current game is an enhanced version developed at The Institute For Cancer Research in Philadelphia, Pa. by Bill Wood, Bill Cael, and Bob Stodola. Good luck, and don't get discouraged as the game requires a little practice! MULTI-TREK Page 2 2.0 PLAYING MULTI-TREK The game is very similar to the traditional Star-Trek game with the following exceptions. First, the game involves several players (1-6), each of whom has his own terminal and starship. Second, the game runs in real time as far as the players are concerned. For exam- ple, if you are going warp 8 you will continue to move regardless of your activity at the terminal (unless you are destroyed, hit some- thing, run out of energy, or change your warp speed). Each player's status and position as well as the scores of all players is displayed and continuously updated at each player's terminal. (The update rate is twice per second, but the source code is commented on where to change it should you wish to do so.) Third, at the present time there are no Klingons or Romulans to shoot down, instead you shoot (or at least attempt to shoot) the other players. The universe consists of a 80 by 80 matrix which wraps around itself. Therefore if you move off one end of the universe you appear on the other end. (This is true of phasers and torpedoes also.) The universe is made up of the following items: 1. " " Empty space 2. "-" Universe boundary 3. "*" Star (a star may go supernova when a torpedo hits it) 4. "B" Star-base (ram it to dock and thereby refuel) 5. "H" Hyperspace point (described below) 6. "R" Random hyperspace point (also described below) 7. "+" Torpedo 8. "^" Homing torpedo (seeker) 9. "#" Black hole will pursue nearest player 10. "@" Anti-matter pod 11. "%" Energy net 12. "1"-"6" Player's ships 2.1 HYPERSPACE PORTS MULTI-TREK Page 3 When a hyperspace port is hit by a ship the ship is teleported to a new location in the universe. The "H" type of hyperspace port can be used to go to a set location whereas the "R" type of port produces a random jump. The "H" ports are located at fixed locations; these are as follows: Port Number X Coord Y Coord ----------- ------- ------- 1 20 75 2 50 70 3 80 75 4 20 25 5 50 30 6 80 25 The network of ports looks like this: 1 3 2 5 4 6 By using the "H" command a player can set the port number he wishes to appear beside the next time he goes into hyperspace through an "H" type port. For example, if a player used the "H" command to set his hyperspace setting to 4, the next time he ran into an "H" character he would appear near coordinates 20,25. A player's anti-matter pod can travel through hyper-space also; upon re-emergence in the universe, it blows up. Pods going through random hyperspace reappear randomly; those going through "H" type ports reappear at the pod owner's current hyperspace jump point. 2.2 SCORING The current scores of all players are displayed on the screen. A '*' beside a score indicates an active player. The following actions result in score changes: 1. Torpedo hit on enemy vessel: +500 2. Homer hit on enemy vessel: +300 3. Phaser hit on enemy vessel: +(between 70 and 200 depend- ing on distance) MULTI-TREK Page 4 4. Pod explosion: +(between 300 and 1500 de- pending on distance) 5. Torpedo hit on base: -200 6. Getting destroyed: -1000 2.3 ENERGY CONSUMPTION 1. Shooting phasers: -50 2. Warp: -.5 * WARP SPEED per time interval 3. Send message: -10 4. Collide with star: -200 5. Collide with ship: -100 6. Cloaking: -25 per time interval (default) 7. Energy net: -75 per net unit constructed (default) 8. Tractor beam: -200 per time interval (default) Energy loss due to weapon hit is a function of shield strength and weapon energy. 2.4 CALCULATIONS The following formula are used: 1. Phaser hit energy: ENERGY=900./(4. + DISTANCE) 2. Torpedo hit energy: ENERGY=500. 3. Shield protection: SHIELD ABSORBTION FACTOR=SHIELD ENERGY/1000. (With a maximum value of 1.) SHIELD DIRECTION FACTOR= MULTI-TREK Page 5 (.5 + ABS(SHIP'S DIREC - WEAPON'S DIREC)/360) SHIELD FACTOR = SHIELD DIRECTION FACTOR * SHIELD ABSORBTION FACTOR SHIELD ENERGY = SHIELD ENERGY - SHIELD FACTOR * ENERGY OF HIT ENERGY OF SHIP = ENERGY OF SHIP - (1.2 - SHIELD FACTOR) * ENERGY OF HIT * 6 4. Tractor beam pull: 8./SQRT(MAX(1., DISTANCE BETWEEN SHIPS-6.)) Anti-matter causes both damage to the scan, and results in an en- ergy hit. Both of these effects are energy dependent. 2.5 MTREK commands All commands consist of one character, and most of them require a numeric argument. This argument can be input with the command char- acter, or can be a default ship or direction. Generally, typing a new ship number or direction changes the default ship or direction, however there are exceptions. In addition, the "L" (long range scan) command changes the default direction to the direction of the scanned ship, which is convenient for firing at the scanned ship. See below for other commands which change the defaults. To use a default value, simply type carriage return. 1. Help "?" Prints a summary of all commands. 2. Shields "S" Raise or lower shields. You will be prompted for a real number (+ or -). Your default shield change value is reset every time you set positive shields, and this default value may be used by typing a after the "S" command. 1000 units is the most that will do any good. But you may want a little reserve. 3. Reset "R" Clears the screen and redraws the entire display. Not recommended during battle. 4. Torpedoes "T" Fire torpedoes. You will be prompted for a direc- tion. fires in the default direction, a number fires in that direction and resets the de- fault. Torpedoes move at warp 10, and destroy MULTI-TREK Page 6 anti-matter pods and sometimes stars. A star going supernova destroy an area of 2 X 2 around the star. 5. Phasers "P" Fire phasers. You will be prompted for a direc- tion. fires in the default direction, A number fires in that direction and resets the de- fault. Phasers are instantaneous, have a range of 10 squares, and shoot a band 3 squares wide. They will not destroy torpedoes (except homers). 6. Locate "L" Long range scan for another player. The "L" com- mand sets the default direction to that of the scanned ship. It takes a ship number as an argu- ment, or to locate the default ship. If a ship number is given, the default ship is reset to that ship. 7. Message In this version the message command was removed to conserve space. 8. Warp "W" Set warp speed 0-8. 9. Course "C" Set course 0-12 (clock face). This does not af- fect your warp speed or default direction. However, the default direction may be used to set the course. All directions are to be specified in "clock face" numbers. For example: 0. is up 9. is left 3. is right 6. is down 7.5 is toward the lower left corner, etc. 10. Quit "Q" Quit. 11. Hyperspace "H" Set hyperspace jump point 1 through 6. 12. Cloak on "F" Fade away. The cloaking device is a continuous energy drain when activated. 13. Cloak off "A" Appear. MULTI-TREK Page 7 14. Energy net on/off "E" Start/stop energy net construction. Energy nets provide a "wall" which other ships will bounce off of, however your ship travels instantaneously through your energy nets. Torpedoes may be used to destroy nets. The black hole is blocked by them. Phasers do not penetrate nets. 15. Seeking torpedo launch "K" You will be prompted for the ship number to home in on. homes in on the default ship, a ship number homes in on that ship and resets the de- fault. Homing torpedoes destroy anti-matter pods. Seeking torpedoes can be shot down with phasers (at least sometimes). 16. Anti-matter launch "Z" You will be prompted for a direction. Pods move at warp 5. fires in the default direction, a number fires in that direction and resets the de- fault. When an anti-matter pod hits a hyper-space port, it travels through it to your current hyper- space jump point and blows up. Pods also travel through random hyper-space ports to a random loca- tion and blow up. 17. Anti-matter freeze "N" Stop movement of anti-matter device. (It will be- come a static mine.) 18. Anti-matter detonate "X" Detonate anti matter pod. This explosion destroys an entire area, except for bases and hyperspace points. The pattern of the explosion is as below. X X X X X X X X X X X X X X X X X X X X X Ships within 4 of an exploding pod lose some ener- gy and have their vision partially obscured. The black hole is randomly relocated when caught in a pod explosion. 19. Tractor beams "B" Set tractor beam target ship (1-6). 0 to stop tractor beam. Tractor beams are used to pull your opponent's ship towards you. The closer the ships are the stronger the pull of the tractor beam. The default ship is reset. MULTI-TREK Page 8 20. Verbose/Non-verbose mode "V" Flip on/off verbose mode. In non-verbose mode, only the first letter of each word is printed. For example, + TORPEDO HIT ALIEN! becomes +THA This is sometimes useful in the heat of battle on a slow (1200 baud) terminal. MULTI-TREK Page 9 3.0 STARTING THE GAME If you are starting a new game, first initialize the universe using MTREKINI: MCR> RUN MTREKINI It will ask a series of set up questions (defaults are invoked by ): 1. A star density between 2 and 3 is good (default = 2.0). 2. About 20 to 25 star-bases is ok (default = 20). 3. Usually 1-6 random jump points (default = 6). 4. Any random integer between -32k and +32k (default = 0). 5. A cloaking energy drain of 20 to 40 (default = 25). 6. Net construction energy drain of 0 to 2000 (default = 75). 7. Black hole speed of 2. to 5. (default = 4.5). 3.1 PLAYER INITIATION Several crt terminals are required to play the game. The driver program, MTREKD must be started up prior to playing. Then each player should issue the following command at his/her terminal: MCR> PLY A list of unoccupied ships will be displayed, so choose an unoccupied ship and you are ready to play. It is possible for two or more pla- yers to control the same ship by selecting an occupied ship, e.g., one player can control navigation and the other weapons. Players may enter and leave the game at any time. 3.2 ROBOT SHIPS In addition to playing against human opponents you can turn the unused ships over to computer control. This is done by starting the ROBOT program. You can choose the ships to be controlled and the ca- pability of the ships' robot skippers. MULTI-TREK Page 10 Each running ROBOT program can control several ships which will act as a team. If more than one ROBOT program is started then their ships will fight with each other. Robot ships are started with the command: MCR> RUN ROBOT A list of unoccupied ships will be displayed. Enter the number(s) of the ship(s) to be under robot control. When the robot "team" has been selected, enter and the ROBOT program will ask several questions to set up the ability of the robot skippers (as with MTREKINI, de- faults are invoked by ): 1. Maximum speed of robot ships (default = warp 8). 2. Robot reaction time (default = 1.5). 3. Amount of phaser fire (default = 5). 4. Degree of inaccuracy (default = 0 degrees). MULTI-TREK Page 11 4.0 TERMINATING THE GAME It is important that the last MTREK players clean up the system before they leave. This is done by issuing the following set of com- mands: 1. Terminate each PLAYER program by entering the "Q" command. 2. If the universe manager MTREKD does not terminate automati- cally abort it as follows: C MCR> ABORT 3. If you are running any ROBOT programs abort each one as fol- lows: C MCR> ABORT Now mop up the blood, sweat, and tears; logout; and go home.