PDP-10 / its

Incompatible Timesharing System
Other
846 stars 80 forks source link

Zork story by EJS #813

Closed larsbrinkhoff closed 6 years ago

larsbrinkhoff commented 6 years ago

@eswenson1 wrote:

While an undergraduate at MIT between 1976 and 1980 I became introduced to Adventure and Dungeon (Zork) and spent many hours with both games. One might say I became obsessed with obtaining the maximum number of points possible in both of these games. With Zork, which was still being developed, this was a moving target, so I had to play over and over as few features were added to the game and as the "endgame" was added. I did succeed in my pursuit of all the points in both games. Once that goal was met, however, my obsession turned to seeing and getting the source code for both games. Adventure source was easy to obtain. Zork sources, on the other hand, were closely guarded by the four implementors (Tim Anderson, Marc Blanc, Dave Lebling, and Bruce Daniels). I knew the game was developed on the MIT-DM ITS system, scouring the file system didn't reveal where the sources were. I did find some XGP printout of one of the game source files and was able to confirm the machine (DM) and directory in which the sources were kept. But I had no luck listing that directory nor finding the files.

I made it my mission to get hold of the Zork sources. I had guessed that some ITS patch was hiding the directory where the sources were kept, and some magic incantation was required to make the directory accessible. I'm not sure if, at the time, the sources were encrypted -- that might have come later. I spent countless hours disassembling ITS and looking for the hack. Eventually, I was able to successfully patch ITS and gain access to the files. I know I needed to work quickly at this point because each time you patched ITS, a message was written on the system console -- a DEC LA36 printing console, I believe. I also didn't know whether any alerts were provided to the Zork implementors and at the time I hacked in, at least Tim Anderson (TAA), and possibly others, were logged into DM and (ostensibly) working on Zork. So as soon as I was able to access the files, I started madly FTP'ing the them from MIT-DM to MIT-MULTICS. I figured that copying them to MIT-MC would be risky as anyone could locate the files there and delete them. Multics, on the other hand, provided a more secure place to store the contraband.

In the middle of my FTP session, Tim Anderson (TAA) came into the room where I was furiously snarfing files. He declared to me that what I was doing was "most distateful". He made no attempt to stop me at the time, and there was little I could do but accept the chastisement. I did manage to get all the files copied, but I felt bad that I had been caught red-handed. I still don't know how Tim knew what I was doing -- hence my suspicion that the implementors were alerted to my intrusion.

My "work" was not done, however, I still had to preserve my copy of the files, and for that, I created a Multics backup tape of the sources. That tape followed me everywhere for years -- usually sitting in an attic until my wife made me throw it out. Interestingly, I begrudgingly thew out that tape (and lots of other old artifacts) just prior to learning that Multics was in the process of being resurrected on the DPS8M emulator. Had I kept them a bit longer, I could have had the backup tape imaged and loaded onto a currently running emulated Multics system. I did, however, copy all the Zork sources back to MIT-MC prior to my leaving MIT (to work on Multics at the Pentagon). I wanted to get a nice, bound XGP copy of the sources. I did manage to get this printout and have the set to this day. I encrypted the sources and left them in an archive when I graduated. Of great surprise to me, I recently uncovered that archive in MIT-MC backup tape images and have loaded them onto an emulated ITS system. Of course, until we manage to get a working MDL interpreter, those files serve only informational and historical purposes. I do hold out hope, however, that we'll get an MDL interpreter working some day and will be able to run those sources. While I'm sure the game experience will be exactly the same as that gleamed from running the Dungeon that was ported to Fortran and C and freely available on the Internet, somehow, I'll get much more satisfaction if we can run MDL Zork on ITS some day.

larsbrinkhoff commented 6 years ago

This file set is checked in as 1b555896ebae8fa122210322e0b01490a9bc02a4

eswenson1 commented 6 years ago

By the way, the BUILD.CMD in that commit here is most definitely the one for ITS. I think the other commit (with later sources?) has a build.cmd for TOPS-20, right? We may wish to try to use the BUILD.CMD with my sources or try that same BUILD.CMD with the later sources.

larsbrinkhoff commented 6 years ago

No, Bob's file set only has .mud files, no .cmd files. BUILD CMD is from you. I renamed Bob's files and overlaid them on top of yours. Most files were the same, and for the few that differed I increased their version numbers.

I think BUILD CMD looks like TOPS-20 commands (or TENEX). "CONN \" means connect to the MDL directory.

larsbrinkhoff commented 6 years ago

@taa01776, in the top comment in this issue, Eric reveals how he got the Zork source code files. Do you remember this event?

larsbrinkhoff commented 6 years ago

These are the changes in Bob's version: 93879ee82fb0b635213739ddc66214e1c2228989

larsbrinkhoff commented 6 years ago

I transcribed Bob's story as told in his Get Lamp interview:

The game was known as Dungeon at the time I met it. And what happened was it drifed in from MIT, via the ARPAnet. The MIT system that was being used as a development base was called ITS, which stood for the "Incompatible Timesharing System", which was a play on a much older MIT system called CTSS, the "Compatible Time-Sharing System". And there was a way to run it on a more conventional PDP-10 operating system called TOPS-20 of which there were a few, but only a few, in DEC. Most of them ran an older system called TOPS-10.

And so it drifted in and as usual for a company - relatively small company in those day - the word began to get around that there was this much more elaborate, much more interesting and complicated puzzle/text adventure/problem solving game. And it was extraordinary difficult to get access to it because, as I said, the machines that even DEC owned that could run it were relatively few and far between. And having just come off working with Adventure, I was very eager to learn more about these games and when I saw Dungeon with its full-fledged parser and its far more elaborate descriptive mechanisms and just the general richness of the whole environment, it was very very interesting to me to see it.

And it was also frustrating to play, because access was limited. It was a hard game - much harder than Adventure. And it was incomplete at the time. It was still being elaborated by Marc and Tim and the rest of the MIT gang. There was version skew going on between them and anybody else was playing it.

So the same idea occurred to me which was if it was on a small machine, I'd have access to it. A lot more people would have acess to it, and we'd know more about it. So kind of without quite really understanding what was involved, I decided, well I'll do the same thing. I'll port it. There were only a couple of, sort of, minor assumptions that weren't quite right in my thinking.

The first is of course that it wasn't written in Fortran. It was written in an obscure variant of a functional language like Lisp that was called MDL, Model Development Language. And when I first saw the sources I was like, what is this? I'd just have no clue what I was looking at.

Then the second thing is, it's a much bigger game. The source size for Dungeon at the time was probably five to ten times the size of the Adventure sources. So the notion of trying to shoe-horn this into the machine target I had, which was the smallest most personal PDP-11 of the time, was a bit more daunting.

And then the third problem was it wasn't done. It was changing all the time.

So, well, I didn't know any better. And nonetheless I decided I would do this. I would do it in the only higher-level language that I was really fluent in which was Fortran. C was certainly available but it was probably not a single Unix system in DEC at the time. So Fortran was it.

I bought a book on Muddle from the MIT Press. And started in doing some probe coding. And this was probably in late 1977 or early 1978. And I would not have made a huge amount of progress, except that in early 1978 there occurred what is foundly called the Blizzard of 78, when 26 inches or so of snow fell on the place in early February. And the state was shut down for a week. I was home. I was home with a printed Muddle listings. And the book. And I didn't have anything else to do at the time. So during that week I fundamentally worked out how to represent the data structures and the algorithms in Fortran from the sources I had. And I did a probe coded version of the game with no parser. But nonetheless you could basically type in numerical equivalents for a command and then it would go off and it would do the game action. It would display rooms and do actions and the pirate would show up and the thief would show up and cut your throat and all the good things it's supposed to do.

When I had this running in March of 78 I made contact with the guys at MIT and said, hey you know, it's possible to run this on a much smaller machine. Would you be interested in supporting this by actually giving me the complete source set as opposed to the fragment that I had. They came out to where I was working, and I was actually working right across the divide here in the other building. And they were completely astounded to see that what they regarded as a mainframe large scale program was running on this - from their point of view - tiny machine. They agreed to provide the full source set so that I could port as much of the game as existed at the time. So for really the first half of 78, I finished off an initial complete implementation and put that out in DECUS. Their one condition was that the big database file, the text file, that sort of had all the strings couldn't be published in unencrypted form.

And then basically as new inputs came in - they finished the endgame and so forth - I kept up with what they were doing for about the next eighteen months.

taa01776 commented 6 years ago

Only vaguely. I was a little disappointed that Bob’s story about translating Zork didn’t mention how he got the sources. Not that different from Eric’s, but there was a third party involved, along with ITS 1.5 documentation and a DEC-20 running acceptance. Good times. -ta

From: Lars Brinkhoff [mailto:notifications@github.com] Sent: Monday, 16 April, 2018 15:46 To: PDP-10/its its@noreply.github.com Cc: Anderson, Timothy A. taa@stresearch.com; Mention mention@noreply.github.com Subject: Re: [PDP-10/its] Zork story by EJS (#813)

@taa01776https://github.com/taa01776, in the top comment in this issue, Eric reveals how he got the Zork source code files. Do you remember this event?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/PDP-10/its/issues/813#issuecomment-381726116, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABnTXXXRfDwZQhzdNK-RwM3n_B5XTYjnks5tpPUJgaJpZM4TXGJK.

larsbrinkhoff commented 6 years ago

Some more details have been published in the New Zork Times:

Although people could get runnable Zorks, they couldn’t get sources. We tried two approaches to protecting the sources (remember, there was no protection of any sort on DM): they were normally kept encrypted; and we patched the system to protect the directory where we kept the sources (named CFS, for either “Charles F. Stanley” or “Computer Fantasy and Simulation”). This worked pretty well, but was finally beaten by a system hacker from Digital: using some archaic ITS documentation (there’s never been any other kind), he was able to figure out how to modify the running operating system. Being clever, he was also able to figure out how our patch to protect the source directory worked. Then it was just a matter of decrypting the sources, but that was soon reduced to figuring out the key we’d used. Ted had no trouble getting machine time; he just found a new TOPS-20 machine that was undergoing final testing, and started a program that tried every key until it got something that looked like text. After less than a day of crunching, he had a readable copy of the source. We had to concede that anyone who’d go to that much trouble deserved it.

larsbrinkhoff commented 4 years ago

From Oral History of Robert Supnik:

Supnik: Right when I got there. Yes, I’m still in Disk Engineering. So now it’s a little later. It’s coming into late ’77 and early ’78 and a new craze starts sweeping down.

Gardner: \

Supnik: And it’s a program from MIT called Dungeon.

Gardner: Oooh. Yes.

Supnik: And Dungeon is far more sophisticated.

Gardner: It’s the death of my--

Supnik: And it’s much bigger.

Gardner: Death of my oldest son. Yes.

Supnik: It’s complicated. The puzzles are fiendish. It’s got a full syntax parser, so you can give it really complex commands instead of just subject verb, and I really, really, really want to know how it works. But we don’t have source code.

Gardner: Okay. Do we know what it’s written in?

Supnik: Well, it comes from MIT, from the Incompatible Timesharing System, ITS.

Gardner: Okay.

Supnik: And it turns out it’s written in what’s known as the model development language or MDL, which is a bastardized form of LISP, and-- but as I said, we don’t have the source code.

Gardner: Right. Or a compiler probably.

Supnik: Or a compiler or anything else.

Gardner: Or anything, yes.

Supnik: In fact, it’s running on TOPS-20 in a compatibility mode TOPS-20 had that emulated ITS. So it wasn’t even native code. Well, this, you know, I’m not going to put up with this. \

Supnik: I mean, so Ted Hess, another ADR veteran who had joined DEC, also had connections at MIT, and he found some fragments of the source code for me to look at. I said, “Okay. We should try and get the whole thing,” but by this time the developers were getting wary of it being propagated, and they had encrypted it. So Ted applies the combined computing power of the 10 group that he was in at night when nobody was using the machines and he cracks the encryption for me. \

Supnik: No. I’m not even going to comment on the legality of all this.

Gardner: Yeah, yeah, yeah, okay. You don’t need.

Supnik: The only thing I will say is there were no copyrights on the code at the time.

Gardner: Yes.

Supnik: So I have the code, I buy a MDL manual and, you know, what is this?

Gardner: What is this?

Supnik: And again, my goal was to get it on to an 11 so that people can play it.

Gardner: Yes. A machine that’s ubiquitous at DEC.

Supnik: Right. So I have the listings, and I bring them home on a Monday, and it turns out it’s the Monday of the Great Blizzard of ’78.

Gardner: Okay.

Supnik: I left DEC early because they told us to go home. I put the listing in my briefcase and brought it home, and essentially over the next five days while we were all housebound, I worked out the mechanisms I would use to rewrite it in FORTRAN and pack it into a PDP-11.

Gardner: Wow. \

Supnik: So I then proceed to code up a skeleton of this. I don’t want to tackle the syntax parser, but I get the, you know, quite a bit of the game running. You have to type in subject, verb, indirect object by hand, and then I asked Ted to arrange a meeting with these guys. The guys who had written it at MIT, the four authors, as they were called, and they come out from MIT. I show them this, and they’re just flabbergasted. They’re just flabbergasted that this mainframe monster program of theirs is running on this Tinkertoy machine.

Gardner: \

Supnik: And--

Gardner: Well, they had no need to even think of the word optimization.

Supnik: Right. So…

Gardner:

Supnik: And of course the techniques you use in FORTRAN to map what’s fundamentally a functional language are brutally ugly, and they’re just, you know, they’re as appalled as they are flabbergasted. But they say, “Okay. Go on ahead. Finish it.” “This is-- see what happens.” So I work at it. It’s much more difficult this time because the program’s much bigger. It ends up being not only having separate databases, but it’s overlaid five levels deep and all kinds of problems, but again the same thing. I get it running on an LSI-11, with two floppy drives and show it to them, and a light bulb goes off in their heads. Which is, “If he can get this running on such a small machine--“ because I was, this was a 56K byte PDP11 with two-- what was it-- 256K byte floppy drives.

Gardner: Yeah.

Supnik: Then we can get it running on a personal computer. A hobbyist personal computer. You know, the ones that existed in the late ‘70s like the TSR-80 and the Atari and so forth.

larsbrinkhoff commented 3 years ago

Apparently a third person copied the Zork source code. There is a set of files dated April 2, 1978 in a directory called "   GSB". That's three spaces first, making the name hard to type in HACTRN. The ACT and DUNG files are encrypted.

The files are on ToTS tape 7005896, which is ML tape 782 dated 5/10/78.

larsbrinkhoff commented 3 years ago

The ML "   GSB" files are not encrypted with the same key as the files found on the DM PDP-10. I wonder if the key was changed between January and April 1978?

eswenson1 commented 3 years ago

Or whether GSB just did as I did -- and reencrypted them with his own key.