>> Rodney Roberts IT Professional Homepage

 

Early Computer Gaming - Classic Star Trek

This page is a tidbit of history of early computer games, ASCII graphics, and HP3000s.  Classic Star Trek is an example of a pre-PC computer game without complex graphics and GUIs.  Computer gaming has been around as nearly as long as computers, well before PCs.  Its commonly believed that the age of computers and computer gaming began with the PC.  Not so.  Minicomputers were developed after mainframes and before PCs (the PC was called a microcomputer) - PDP-8 (the first minicomputer, first shipped in 1965), PDP-11, DEC VAX, HP1000, HP2000, HP3000, and others.  And then there were the computer games - Adventure, a text-based game of cave exploration, dwarfs, and treasure, written in FORTRAN (and executed on the HP3000), ported to C for the PC; Star Trek, which used ASCII graphics; and many others.

While looking through some old printouts, came across the source code for Classic Star Trek written in HP3000 Basic, circa late-1970s.  Just for grins, ported it to IBM Basic for MS-DOS.  The files needed for running Classic Star Trek can be downloaded below.

HP3000 Basic and IBM Basic for MS-DOS are very similiar to Dartmouth Basic, though both have unique extensions.  Dartmouth Basic is an interpretted language.  That means an interpretter reads, parses, and executes each line of the Basic program as needed. 


The HP3000 has been around and continuously improved for many years.  It has been classified as everything from a minicomputer to a mainframe.  Users originally interfaced with it through either VDT (Video Display Terminal) or teletype terminals.  Today, PCs running terminal emulation software such as Reflection are often used; in this case the HP3000 is commonly refered to as a database server.  The HP1000, HP2000, and HP3000 are time sharing systems, allowing multiple concurrent users to be logged on, sequentially giving each user a 'slice' of CPU time.

HP3000
ASCII graphics (also called ASCII art and character graphics) is the art of drawing diagrams using the ASCII character set.  In other words, ASCII graphics is just using conventional keyboard characters for a graphic representation.  For instance, an asterisk ("star") can be used to represent a star.  A classic example of ASCII graphics is the Doom FAQ.  Early computer art (Peanuts characters, etc.), as well as flowcharts and PERT diagrams printed with line printers are also ASCII graphics.  Remember early emoticons?  :-) is a character graphic for a smiley face, ;-) represents a wink, :-( represents a frown, and so on.  Some may argue otherwise, but these could be considered ASCII graphics.

ASR-33 Teletype terminal

Digital VT100
Classic Star Trek, like many early computer games, used ASCII graphics to present its output to the player.  ASCII graphics was the solution to present graphical output using common text-based VDT or teletype terminals. What allowed ASCII graphics to work so well is that all characters use the same spacing (fixed-pitched font).
Below is a full screenshot of a Classic Star Trek sample game.  To the right is a magnified portion of the screenshot, illustrating each ASCII character using the same space.  This allowed characters to line up under each other and to scale the representation.  Classic Star Trek uses a grid of 33 * 8 characters to represent one quadrant of space.

In the full screenshot's lower portion is a short range sensor scan.  On the lower left, the area between the dashed lines represents a two-dimensional view of one quadrant of space; this representation uses ASCII graphics.  On the lower right is a status summary.  In the upper left is a legend of what each ASCII graphic symbol group represents (not in original version; added for this port).  A random number generator is used to generate Stars, Klingon ships, and Federation Starbases for each quadrant.

The game goal is to save the Federation from the Klingons.  The game cycle is 1 output event to 1 input event based.  The game presents to the player a scenario (output event) as above, and the player then responds with a command (input event).  Available commands are:

      COMMAND 0 = WARP ENGINE CONTROL
      COMMAND 1 = SHORT RANGE SENSOR SCAN
      COMMAND 2 = LONG RANGE SENSOR SCAN
      COMMAND 3 = PHASER CONTROL
      COMMAND 4 = PHOTON TORPEDO CONTROL
      COMMAND 5 = SHIELD CONTROL
      COMMAND 6 = DAMAGE CONTROL REPORT
      COMMAND 7 = LIBRARY COMPUTER
      COMMAND 8 = ABORT MISSION
      
If a command requires additional information, Classic Star Trek will request it.  The game then processes the command, and present the results to the user.

The PC port of Classic Star Trek runs within a MS-DOS box (Win9x) or a Command Line (WinXP).  The Classic Star Trek download consist of 3 Basic interpretter files (BASIC.COM, BASICA.COM, and BASICA.EXE), 7 Basic source files (STTR1.BAS, STTR2.BAS, STTR3.BAS, STTR4.BAS, STTR5.BAS, STTR6.BAS and STTR7.BAS), and a Batch file (STGWB.BAT).  As much of the 'flavor' of the originial has been retained as possible (including the Bell, or ctrl-G) with one more exception - colored text foreground has been used.


Download/Install/Run Instuctions:
  1. Download stgwb.zip into the directory (folder) of your choice.
     
  2. Win95 - Win98: Will need zip file decompression utuility (PKZIP, WinZip, etc).
    WinXP: Use Windows Explorer to navigate to the folder containing stgwb.zip and decompress.

    Be sure to extract stgwb.zip into the root directory (C:\); it will add another folder, C:\IBMBASIC, to your C: drive.  This is required for the file stgwb.bat to successfully launch.  It is necessary to hard-code the destination folder for one simple reason - each of the Basic programs contain at least one chain command.  The chain command causes the Basic interpretter to transfer control from one Basic program to another.  The chain command has the directory of the target program embedded in its argument, as shown below.
          650 CHAIN "C:\IBMBASIC\STARTREK\STTR3.BAS"
          
    There are other solutions, but it just adds another layer of complexity.  If the files must be stored in an another folder, then each occurence of the chain command in the 7 Basic source files must be modified to reflect the change.  And the MS-DOS short name must be used. For example, if the new directory is "C:\Program Files\IBMBASIC\STARTREK", then the chain command must be changed to
          650 CHAIN "C:\Progra~1\IBMBASIC\STARTREK\STTR3.BAS"
          
    The 7 Basic source files are in plain text format.  Also, the Batch file STGWB.BAT must be modified to reflect the folder change.
     
  3. Start a MS-DOS box (Win9x) or a Command Prompt (WinXP).
    Type in CD \IBMBASIC and press enter.
    Type in stgwb and press enter.
    After the game ends, type in system and press enter to exit the Basic interpretter.


To those whose experience with computers began with Win9x, Basic Classic Star Trek will seem incredibly primitive.  But an experienced computer gamer of that time could spend hours in front of the terminal playing.  And not because of slow response times!  It was a case of taking then current technology and using it for fun and games.  For people who enjoyed working with computers and were Star Trek fans, it was an intersection of two enjoyable activities.


Any and all copyrights, trademarks, or other intellectual property mentioned here are the property of their respective owners.

>> Rodney Roberts IT Professional Homepage