Oct 14, 2014

Things Change


This article is based on one I wrote several years ago. I was approached by a Polish magazine to write this article and since they offered me 300 Euros I was quite happy to do it. We had a contract. They published the article but did not pay me. I hope they all die slowly of a some painful and incurable disease. Something like elephantiasis of the testicles would be appropriate. I wish that to every publisher who ever stiffed a writer.

I've updated the article to reflect 2014.


My first paid programming job was to port the game TREK73 from a Hewlett Packard 2000C mini computer to a UNIVAC 1108 mainframe. That was in 1974 and I've been involved with games and graphics off and on since then. For a while I taught game programming at the local community college. It has been 40 years since I got my first job as a game programmer way back in 1974. At the time there were few programmers who wrote games and even fewer who managed to get paid to do it. I wound up doing a lot of other things in that job, but I did get to port several games and to develop a few of my own


So what has changed in the last 40 years? Just about everything. 1974 is the year Intel released the 8080 microprocessor; the many greats grandfather of the Core i7. Before 1974 very few people could have a computer for their own personal use. After 1974 personal computers started becoming common place in the industrialized world. In 1974 I did not work on a personal computer. In fact, I'm not sure I realized I would ever be able to own a computer until a year or two later when I saw a minicomputer being advertised for “only” $50,000. I worked at the computer center of the University of Utah. We operated a time share system that provided computing power to the rest of the university. 


Lets take a look at how some of the normal parts of a game porting project have changed since 1974.

Data Exchange


To port a game you have to get the source code and resources used in the game. In 2014 I would expect the data to come to me in one of several ways. I might be sent a URL and a password that would let me down load the game over the Internet. My 100 Mbps connection (the slowest my ISP offers) makes that pretty easy. It's also possible that I would be sent a stack of DVDs or blu-rays by snail mail or FedEx. In 2014 sending gigabytes of data is simple and we don't really even have to think about how to do it.


There was no Internet in 1974. A fast data connection was 300 bits per second, not kilobits, not megabits, but bits sent via acoustic modem over an analog telephone line. There was no Ethernet then, LANs as we know them did not exist. There was no FedEx either. Any exchange of data required you to send physical media via snail mail. 


DVDs did not exist. Even CDs were many years in the future. The diode lasers needed to build CD and DVD drives were first developed in 1975. Which means that CDs not only did not exist, they were not even possible in 1974. The floppy disk was invented in 1971. The 8 inch floppy disk was the high tech wonder of the time. But, they were very rare, I had never seen one by 1974 and didn't have one on the 1108. 


In 1974 the standard media used for exchanging data were punched cards and reel to reel tape. DEC had those cute little random access tape drives, but no one else used them. The 1108 had rows of huge high speed tape drives. If you ever watch old '50s and '60s science fiction films you have seen these drives. They were the size of a refrigerator with two huge tape reels and a divider in the middle. The drooping tapes always made them look like sad faces to me.


The HP2000c that the game was coming from did not have tape drives. It did not have a card punch either. Minicomputers and mainframes didn't share many of the same peripherals. The only media the two machines shared was punched paper tape. The computer center had a large number of TeleType ASR33 printing terminals. Some of those had paper tape readers. So, paper it tape it was. 


TREK73 was delivered to me on 8 channel punched paper tape. It was punched on about 6 small rolls. Each roll was wrapped with a rubber band to keep it from unwinding. The box they came in was a heavy duty cardboard box normally used to ship and store 2000 punch cards. Punched paper tape was not that commonly used in 1974, it was pretty much obsolete, but it was the only medium the 1108 and the HP2000C had in common. Since the bits on paper tape are large enough to see with the naked eye you can guess that TREK73 was not a large program.


The UNIVAC operating system, EXEC8, had a special command for reading paper tapes from ASR33 terminals. To read the tapes I first had to go to the system programmers and get a special account that was allowed to run real time commands. Then I had to figure out how to use the cryptic command that let the 1108 accept input from the paper table reader, and learn to start the tape reader at just the right time. I had to try several terminals before I found one that worked at all. It took a combination of special permission, skill, and luck to get a paper tape to read all the way through. I was not what you would call "lucky". The tape reader would just stop at random times. I don't remember being able to read a single tape all the way through in one try.


I had to read the tapes in pieces and assemble the pieces in a text editor. The tape reader did not always read the tapes correctly and never read them the same way twice. I had to read each tape several times and compare the files to find reader errors. I remember it took me a couple of days to get those tapes read and several more days before I thought I had a correct version of what was on the tapes. There were times when I had to count characters on the tape to find a missing piece of information and then read the bits by hand. They were read in at the astonishing speed of 10 characters/second over a 110 bits per second serial line. In 1974 the highest speed terminal I had ever seen ran at 1200 bits per second. 


Another big difference between then and now is the kind of displays we had. I did all of the editing and testing of TREK73 on printing terminals. CRT terminals were rare and very expensive in 1974. High resolution CRTs (anything over 640x480 is high resolution from the point of view of those times) were also rare and expensive. I did not have access to any WYSIWYG editors. In some editors the only way to change a line was to type in the line number followed by the new line of code. The process was slow, error prone, and horribly wasteful of paper.

The Computer


The computer center had a UNIVAC 1108 II (a.k.a. the 1108A). The 1108 was considered to be a super computer when it was installed at the University of Utah in the late '60s. I don't know exactly when it was installed, but I know it was between 1965 and 1968. The 1108 was one of the first computers to use integrated circuits and was considered to be a technological marvel of the time. Civic groups would book times to come and see our massive computer. By 1974 the 1108 was still considered to be a major computing installation. 


An 1108 was capable of being configured as a multiprocessor. In fact ours had separate instruction and I/O processors that could be used in parallel. It filled a room as big as a large house and required special power and cooling systems. Portions of the machine had to be carefully positioned over the building's structural girders to keep them from falling through the floor. This super computer had roughly a megabyte of memory (218 words with 36 bits per word) and could, with luck and careful coding, execute a million instructions per second. It had several hundred megabytes of magnetic drum storage. It sold new for $2.5 million dollars. 


I picked up a much better computer at a garage sale a few years ago for $15 dollars. I only wanted the monitor to use when I bring up new computers, but the guy wouldn't sell me the monitor unless I took the computer too. It was an ancient 486 with 4 megabytes of RAM and a 200 megabyte hard drive. (Much to my surprise the computer booted to Windows 3.5. I found the fellow's tax returns and bank records for 5 years on the hard drive. He was very lucky that I bought it rather than someone interested in identity theft!)


Moore's Law (which was first written down in 1965) says the number of transistors you can put on a chip doubles ever 18 to 24 months. The 1108 represents 1965 technology which means that Moore's Law has been cranking away for 50 years since the 1108 was developed.We can now put 225, or roughly 33 million, times more transistors on a chip than was possible when the 1108 was first designed. A quick look at the number of transistors on new chips verifies this enormous change in computer technology. Understanding a 33 million fold increase in capabilities is hard to do. But I've seen it happen. Everyone my age has seen this change.


Porting the code was a lot like porting code now days. There were a few exceptions. TREK73 was written in BASIC. To be specific it was written in the version of BASIC that HP created for their minicomputers. The 1108 was running a version of BASIC called Real Time Basic (RTB) that was developed by SUNYA (State University of New York, Albany). Neither of these versions of BASIC were exactly the same language that was originally called BASIC by its inventors. In 1974 BASIC was only ten years old but there were already several incompatible versions. There were no standards for the language and Microsoft Basic didn't show up until 1975. Every version of BASIC was proprietary and used by only a small number of people on a small number of computers. 


The hardest problem I had to solve in porting the code was getting a manual for HP2000 BASIC. I couldn't get one from HP. I couldn't get one off of the non-existent Internet. And, I couldn't buy one at a book store. I managed to find a friend of a coworker who worked at a company that had an HP2000. He was willing to let me come over to his office and read his manual. It took a couple of weeks to find a copy of the manual and I had to drive 20 minutes each way to read it. I can't imagine that happening any more. If you can't find the documentation you need on the Internet you can buy it through your favorite online book store and have it shipped to you over night. 


The other problem I had is that RTB had a hard limit on the number of lines of code a program can have. Really, I'm not making this up. An RTB program could have no more than 1000 lines of code. TREK73 was more than 1000 lines long. RTB did provide a way to chain from one program to another while retaining the values of all variables. So I was able to work around the size limitation. But, a lot of my porting time was spent factoring the program into chunks that were small enough to fit inside RTB's program size limits. This problem points to the small amount of memory on the 1108 and to the fact that RTB was a time sharing system that supported up to 50 simultaneous users on a computer with capabilities many times smaller than what you find in a modern cell phone.

Graphics


It is hard to describe the state of computer graphics in 1974. Computer graphics existed, SIGGRAPH (http://www.siggraph.org) had been established the previous year. The SIGGRAPH history page (http://www.siggraph.org/publications/newsletter/v32n3/contributions/machover2.html) will give you a better feel for it than I can. Think about it this way, my current graphics card has over 1,000 cores and 2 gigabytes of RAM. My graphics card has 2,000 times as much RAM and is at least 1,000,000 faster than the 1108. Modern computer graphics was not even science fiction in 1974.


The computer center had two graphics output devices. A Tektronix 4010 vector scope and a huge flat bed plotter. The 4010 used a storage tube display. You could draw lines, points, and text, but every write was cumulative. It was like drawing on paper with a pencil and no eraser. You could clear the entire screen, but not just one line. It was impossible to do animation with that device.


The flat bed plotter was a large table that used a suction system to hold paper flat while an ink pen attached to a turret mounted on a sliding arm moved back and forth actually drawing vector graphics in ink on the paper. The plotter was not connect directly to the mainframe. You wrote commands on tape and then waited for a human being to mount the tape on the plotter's controller, load the paper, position the pen, and press the start button. Then you waited for a human being to remove the paper, roll it up, and hand it to you. The backlog on the plotter ranged from minutes to days. It was not uncommon to wait two or three days for a plot to complete. That made debugging plotter programs a very costly and time consuming task. You could use the plotter to draw maps for use in table top games, but it was useless for interactive games.


The graphics library for the graphics scope and the flat bed plotter were incompatible. I made myself very popular by writing a package that emulated the plotter graphics library on the 4010. I wrote that package because I was writing a program to print out star charts used during one of the first Star Fleet Battles campaign games. I was a pretty hard core Trekker in those days (still am!) and I met the folks who developed that game through the local science fiction club. I was doing the star charts on my own time but on the universities computer (which I was allowed to do as long as I didn't use too much in the way of resources). To save plotter resources and to save my own time I had to find a faster way to test plotter programs. I figured that if it was useful to me it would be useful to everyone, and it was. It is always a good thing to turn your personal projects into something that can help the community.


I remember that the computer science department got a frame buffer some time during the early '70s. Yes, one single frame buffer. The few references I have found indicate that a 640x480 by 24 bit frame buffer sold for $80,000 in 1975. That's more than $350,000 in 2014 dollars. Graphics systems with the capabilities of current 3D video cards were not possible at that time. There was no technology that would allow you to build a machine with the combination of speed, computing power, and memory of a $19 bargain bin thrift store video card. The first affordable (less than $1,000) video display terminals didn't appear until 1977.


My version of TREK73 used only character graphics, on a printing terminal. Which is all I had access to at the time. As you played the game every move you made was printed on a long sheet of paper that piled up behind the terminal. People would roll the paper into scrolls and save their best games, sometimes tacking them up on the walls in their offices. It was the most popular program at the University of Utah Computer Center.


On the other hand, video games like Pong had already taken over the bars in the US. The difference in the game experience between what you could get on a dedicated video game and a general purpose computer was astonishing. Of course, the video games didn't have frame buffers, they either used vector graphics or they generated the video signal algorithmically.


In 1974 you could see what was going to be possible, but it wasn't until the Apple II came out in 1977 that the rest of us could start doing real computer graphics at home. The Apple II was affordable compared to what went before, but a machine with enough RAM to be useful and a floppy disk still cost the equivalent of 15% of my full time salary in '77. Not exactly cheap.


I had a ringside seat to the development of computer graphics in the early '70s by being a student at what was at the time the number one computer graphics school. Of course, I mostly studied compilers while I was there. I didn't realize that the graphics work being done at the computer science department was anything special! I only got interested in graphics because I saw it as an interesting form of output that compilers should understand, and later because of games.

Sound


There was no sound in TREK73. Which is a good thing because the 1108 had no sound card. The only way to make it play music was to shake tapes at audio frequencies by doing very short reads and writes on the tape drives


There was a program that would play polyphonic music on the 1108 by going into real time mode and shaking several tape drives, one for each voice, at the same time. This was a stunt we liked to trot out for tour groups and we had a good selection of Christmas tunes that we played during our yearly Christmas party. Caroling in the computer room with musical accompaniment provided by a 2.5 million dollar computer. Oh my...


Over the next 15 years game programmers learned to do some amazing things with sound using hardware timers and the lonely speakers built into computers. Those speakers were designed to go "beep" when you made a mistake, or when a computer was having trouble booting. We used them to play back pulse code modulated music and voice. I bought my first sound card, an original Creative labs Sound Blaster card, shortly after they were released in 1989. I used that card in several different computers for nearly 10 years

Networks


Before the 1970s a local network was a proprietary set up for connecting one manufacturers terminals to the same manufacturers mainframe computers. IBM had their way of connecting their terminals to their mainframes. UNIVAC had its way of doing it, and so on. There were companies that made lower cost clones of the different types of terminals and there were also serial terminals like the TeleType ASR33 that would work with any computer with a serial port. But, in 1974 LANs as we know them were research projects. Not common tools. It seems the very first experimental Ethernet was built in 1972 but wasn't patented until late 1977 and didn't become widely available until the early '80s. I remember first using an Ethernet network when I went back to graduate school in '81. Ethernet was so expensive that very few home computer owners could afford it until the '90s.


In 1974 the computer center had a serial line network that ran to rooms filled with printing terminals in the engineering college, the business college, and the library. As I remember it there was a separate set of wires for each remote terminal. We had no multiplayer games and RTB was not capable of supporting multiple users connected to a single program.


The first networked games worked over proprietary networks. The first networked games I saw worked between two computers connected via serial cable. That was in the late '70s. I, and a lot of other people, spent a lot of time during the '70s, '80s, and early '90s trying to come up with a cheap fast network to use for games. The best idea for a cheap network that I saw during that time converted a serial connection into a kind of token passing network. It looked like it could be implemented using only a few diodes and a smart serial port driver. It looked like a good idea at the time, but I was never able to make it work. The only reference to the idea I've been able to find on the net are some old emails from '91. Which is about the time that Ethernet started to be affordable. If you could afford a computer in the 90s you could most likely afford an Ethernet card

Programming Languages


Today we have a huge number of programming languages to chose from. And, while we can pay for commercial implementations of our favorite language there is almost always a high quality free version of the language just a down load away. If I want a C++ compiler I can have one or buy one. If I want Pascal or Python or Perl I can just down load them and use them. That was not the case in 1974. Most of those languages did not exist. C was developed between 1969 and 1973. I have a copy of the original K&R "C" book. It has a copyright date of 1978. I learned C in '81 or '82 and it was not widely available even then. I read the first paper on C++ published in "SIGPLAN Notices" in 1986. I learned Pascal by reading the original compiler with Norwegian comments some time around '75. I remember when PERL was announced on USENET and I remember hearing about this great new language called Python when it came out in the early '90s.

The majority of programming on the 1108 was done in dialects of FORTRAN and COBOL. A lot of student work was done in Algol 60 and LISP. We also had a couple of simulation languages including the original object oriented language, Simula. Not that anyone used it.

The point is that most of the languages we use today either did not exist or were not available to programmers in the middle 1970s. Object oriented programming was only known and used by a small group of academic and simulation programmers. Not to mention that the closest thing to an IDE was the line oriented text editor in BASIC.


The truth is that because we had so few tools we didn't get a lot done. But, the sad fact is that programmers today write about the same amount of code in a day as we did then. The advantage we have now is that a single line of code can invoke a library function that we don't have to write. In the bad old days we often had to start by writing the tools to make the tools needed to write the libraries we needed for a project. To write my first program that used 3D texture mapping I had to write my own 3D library and my own texture mapping code. To do that I had to develop a fixed point math library. All that added months to the project. Now, I can get a better visual effect using a few lines of OpenGL or DirectX code. IDEs make life much easier by automating many tasks that programmers used to have to do by hand. And, let me give a hand to the people who write source level debuggers! I can't tell you how much of my life has been spent working on systems with no debugger or with machine language only debuggers. Source level debuggers can save a lot of effort. On the other hand, I can't remember the last time I had a bug that was so trivial that I could find it with a debugger of any kind. 

Post Script


From the point of view of this programmer, any time before about 1998 are the bad old days of computing. I get nostalgic for the mid to late '70s because that is when personal computing started to get fun. But, it wasn't until the late '90s that computers became cheap enough and powerful enough to let me do any of what I was imaging back in the '70s. Now, I hope I can manage to live long enough to do all the projects I wanted to do back then!