Henadzi Matuts, Software Engineer

GitHub Profile

Publicatons

Reuromancer

10 September 2018

by Henadzi Matuts

published on https://habr.com/post/422625/

Behind the «Neuromancer» Game - An Interview with Troy Miles

[Troy Miles, an award winning software developer, speaker, and author with decades of professional experience. Began his career writing games in 6502 and x86 assembly for early computers like the Commodore 64, Apple II, and IBM PC. Twice won the game of the year award. Nowadays writes web & mobile apps for automotive valuation company.]


— Hi Troy, I think that it’s time to start our little interview. Firstly I want you to introduce yourself for my readers. Please, Troy, get us through the milestones of your professional career.

— Hi All, I am Troy Miles. I have been a paid programmer since 1979, while I was still in high school. I was employee number four at Interplay back in 1983. Those were great times and great guys. I wrote «Neuromancer», «Lord of the Rings», and helped out on a lot of other games.

I left Interplay in 1992. Still loved the company, but needed to work regular hours. Spent sometime at Phoenix Technologies Ltd. Working on PCMCIA system software. Even wrote an article about it for Dr. Dobb’s magazine.

After Phoenix I went independent for quite sometime. Did some CDI, compact disc interactive games on contract. They were all terrible. Not because of the programming, but because CDI was not a good idea and the gameplay wasn’t very fun.

In 2007, I joined Kelley Blue Book, where I still am today. Our site is www.kbb.com. It is an automotive valuation site. Not glamorous, but my team mates are smart and fun.

While here at KBB, I started writing again and eventually doing small conferences. For awhile most of talks were on jQuery and jQuery Mobile. I eventually wrote a book on jQuery and did a video on Ionic. I also did a video for Learn Now Online, on jQuery Mobile.

Last year I started doing videos for LinkedIn Learning / Lynda.com. So far I have 5 videos out. Two on C++, two on Kotlin, and one on Bash. I planned to a few more videos on C++ over the next few months.

In my spare time, I have been designing a mobile game. Nothing fancy, a casual game, which I hope to have complete by Q1 or Q2 of 2019. It will be my first game since the CDI era of the mid-90’s.


— Quite an impressive track record you have. But let’s get back to 1983 when you first came to the Interplay. Tell us more about how did you get there and who were the others you mentioned?

— I had been making my own games for the Vic 20 and C64 in San Diego roughly 100 km from Orange County, both in California. In 1983, there was a computer game expo held at a place called Lion Country Safari. There, I met Brian Fargo. He was working for a company called Boone, which was headed by a guy named, Michael Boone. (He would later go on to create Boone Boards.) I had been talking with Boone about coming on board as a game programmer, but when they collapsed, Brian gave me a call and asked if I wanted to join his startup, Interplay Productions. I said yes. Our original offices were in an industrial section of Newport Beach, above an office the clothing manufacturer, Quiksilver.

[Photo provided by Troy itself.] In the photo, front row: Alan Pavlish, Brian Fargo, me, and Jay Patel. Back row: Bill Heineman, Troy Worrell, and Todd Camasta. The picture dates to late 1984 or early 1985.

In those days we did titles, contract work, and ports for other companies. We even did some work for the Department of Defense, through Loral. We got a commendation from U.S. Army for our work. It involved moving map with GPS, which was a new thing back then. We also did some contract development for the University of California, Irvine. We made some edutainment games under the direction of a professor. And we did some action adventures games for Activision. They were «MindShadow», «Tass Times in Tonetown» and «Borrowed Time», in no particular order. Distributing games was very difficult in those days. Getting small computer stores to carry your game wasn’t too difficult, but it was time consuming and it was impossible to get big retailers like Sears and Walmart or chain computer stores to sell your product, unless you had millions of dollars in the bank. Developers today have it much easier. You can just upload to an app store or sell it your self on your own web site. So getting Activision to license our games was a big deal and helped us stay solvent.

During this time, around 1987, I created the coolest app that was never released. It was called «Software Studio». It allowed you to make a kind of cartoon on the C64 and Apple II. It came with a collection of pre-built stages and characters. Each character had a collection of animations. They could walk, sit down, dance, etc. The whole thing used an animation engines that was super efficient. In just a kilobytes, you could make a 5 minute cartoon. Initially, Activision was interested, but then they pulled out. Then we tried to interest other players including Disney. Everyone liked the app, but their big concern was the product was too flexible. Disney especially was worried about people making cartoons which inappropriately used their characters. In the end, we admitted defeat and shelved it.

Then, Brian Fargo, asked if I was interested in doing a game based on «Neuromancer». A book we had both read. It seems the Cabana Boys, had the movie rights and it had been green lighted for production. Tim Leary had the computer game rights but the development of the game had stalled. Tim is not a coder and the coders he was working with had abandoned the project. We went to Bel-Air, about 60 km to the north to meet with him at his house and the rest is history.


— Such a stunning story, Troy. Sorry that your «Software Studio» never released, it seems like it was a serious breakthrough. I remember how I was using similar software when I was a kid. It was something like «The Simpsons: Cartoon Studio» but adapted for Soviet cartoons, can’t remember how it called. But it was in the 2000s, and you already did it 15 years ago. So impressive.

But let’s get back to our business. The next question should be about how did the Interplay come up with «Neuromancer», but you already answered it :) Anyway, before we start talking about the actual game, I have a couple of questions which answers is important personally to me. Here we go, there’s no doubt that Timothy Leary is an outstanding man, so how it was working with such a person?

And the other question, did William Gibson itself take part in it?

[Timothy Francis Leary (October 22, 1920 – May 31, 1996) - a known American psychologist and writer.]

— Tim Leary [on the photo] was super cool to work with. He was genuine nice guy. He invited us to his home to talk about the project. We just all sat in his living room which had a spectacular view of the Los Angeles skyline. We explained to him our vision for the game which was very different from his over a few beers. We weren’t really sure how he would react. But he liked our idea and seemed excited for us to make it real.

A weird side note, Tim kind of tripped out on how intense I was. Seems he’d not met an extrovert computer nerd yet. He wanted to know if I was an actor, I’m not, but he really want me to have a part in the movie. At that time, the movie was real, but alas it was never made and there went my chance at stardom ;-).

William Gibson, didn’t play any role in the game. We did actually meet once in Santa Monica, where he was doing a book signing. I got about 2 minutes to talk to him. We invited him to drinks or coffee after the signing, but he already had plans. He seemed like a nice guy and I appreciated that he took a few minutes to chat with us even though he was busy.


— Just wondering if Gibson played the game. As far as I know he wasn’t much into computers at that time :)

So, the «Neuromancer». I already know that you were a sole programmer on a game, but for now let’s focus on the whole Neuromancer team. Who else worked on the game? What was the roles?

— To the best of my knowledge Gibson never played the game.

Bruce Balfour was the producer and a writer. He was the glue that kept us together. Very smart and also amiable. He was kind of like a coach. Michael Stackpole was the main writer for the game. He was a rising star then and has become a well known author of science fiction. Charles H. H. Weidman III was our awesome artist. He was able to use the tools I slapped together to create the UI and the characters, and their animation. And Brian Fargo, the head of Interplay, was the executive producer and was very much involved in the creation of the game.

[Photos taken from the Internet. From left to Right: Michael Stackpole, Todd Kamasta, Bill Heineman, Troy Miles, Bruce Balfour, Charles H. H. Weidman III.]

The game took about a total of 9 or 10 months to make. It was stressful but fun. The best part was how we were able to speak openly and honestly with each other without anyone taking the comments personal. This made the game better and allowed us to get the best out of each other.


— Here is an important point, the game was released on certain set of platforms. So when you talking about how much time it took to make Neuromancer, do you mean one specific version (what is it if so?) or all of them at once? I’m asking because, Amiga [left] version compared with MS-DOS [center] version, for example, looks like completly different game, not to mention C64 [right] version.

— I am only talking about the C64. The ports were done by others. The C64 was an amazing machine for the price. It also had excellent sound and video chips. The 6502 processor was also an interesting beast. Because it was so simple, you could do things that other more powerful CPUs could not, like self-modifying code. These kinds of tricks gave some of the port writers the blues. The entire game was written in 6502 assembly.


— Amazing! Making our port we assumed that the game was entirely written in assembly, but never known it was 6502. By the way about the tricks, could you remember and describe some more?

— There were three interesting techniques I can think of right now: blasting, interrupts, and self-modifying code.

Blasting - the C64 can have multiple visible screens and you can change which one is active by setting a value. In order to use a screen you need to clear it, draw it, and then flip the bit to show it. Obviously you want a method to clear the screen as fast as possible. The fastest way possible is to load the accumulator with zero and store the accumulator in each memory address of the screen. It looks crazy and your desire as a coder is to put it a for loop. But the act of branch and checking the branch dramatically slows the code down.

Interrupts - the C64 has a video interrupt every 30th of a second. You can hook into that interrupt to do a bit of a poor man’s multi-tasking. Whatever you do must be quick, or the video display will break, but you can do useful stuff like drive the audio or multiplex the sprites.

Self-modifying code - One very weird thing the 6502 can do, is to change an instruction before it is executed. This sounds pointless, but the idea is simple rather than do a compare and a jump to the new code, change the code once you know the choice that needs to made so that subsequent passes don’t need to check.

repeat N times {
    if STATE is 1
       increase A by one
    else
       decrease A by one
    do something with A
}

repeat N times {
    increase A by one
    do something with A
    when STATE has to switch {
       replace the opcode "increase" above with the opcode to decrease, or vice versa
    }
 }

A side note - the original PC architecture was a terrible gaming environment. Sound on the PC was not include, the graphics were very simple, and let’s not talk about the 640 K memory issue. Most PCs were 8088 which were slower than their 8086 cousins. So even though the CPU was better and the memory was bigger it didn’t make it a better developer environment.


— Indeed the PC version looks and sounds poor compared to it’s brothers. Anyway there is a thing about sound, the game soundtrack based on the song «Some Things Never Change» by Devo. Is there a story about why especially this song was chosen and who was responsible for sound design at all?

— This is a point I am a bit fuzzy on. To the best of my knowledge, Tim Leary was friends with Mark Mothersbaugh [on the photo] of Devo. Somehow we got an intro, most likely via Tim, and met Mark at his studio in Marina del Rey. Mark was a super cool guy. He was also very tech savvy. We listened to a lot tracks on Devo’s new album. Mark felt that «Some Things Never Change» would be the best track for our project, and we agreed. He gave us a digital copy of the track on a DAT.

It was an immense pain to work with sound files in the late 80’s. Burger Bill Heineman, now Rebecca Heineman, was the wizard who processed the file and made it 8 bit on the C64 and 1 bit on all others. It was the first time I had heard an actual song in a computer game. It wasn’t perfect but it was cool for its time.


— That song suits perfectly in my view. Now let’s get back to programming and talk a little about overall game architecture. The first thing, have you written the brand new engine for the Neuromancer or it was based on some of your previous works?

— The architecture of Neuromancer was divided into two parts: animation and game play. The animation survived from Software Studio. It gave all of the NPCs there animated responses and text bubbles. The system was only had a minor update. The game play engine was all new. It had initially been more complicated with more randomness but that part was toned down since no one likes a game that is too random. The game itself had two interesting tools. The first was possible to record the game. Essentially a text file would get output and if you fed that file back into the game it would play itself. It was for debugging. And the game engine was playable by itself without the animation. Again, this was for debugging. The game play could also run without the animation. This made it easier for the writers including myself, since we go directly to the scene we wanted to write or edit.


— I want to get a closer look on the gameplay part of this. Exploring the MS-DOS version of the game we found that it utilises a some kind of virtual machine. The Machine executes the bytecode stored in “R%n.BIH” data files, which seems to be an NPC scripts. Those files are crazy mix of control data, the bytecode, some 8086 object code, and ASCII strings. So is it was a part of initial design or it is version specific?

— I didn’t do much with the ports except walk the programmer through the 6502 code but it sounds like it is based on the game data files. I combined the animation and the game play together in the data files. There would also be code in it for the levels. Keep in mind that the 6502 assembly didn’t have a linker, so I created one.


— Well, since we work with the port, then I haven’t got much to ask about the code. Go on if you have something to add. We already discussed a number of low-level techniques, but maybe you could remember some interesting problems you solved while working on the game logic?

— I don’t really have anything else relevant that I can think of right now. Good luck with your port and please send me links to your port and the article when they are ready.


— Yeah, I will. Thanks for your time, Troy. I hope you like the interview. To finish with there is a last little question: what is your favourite game?

— The only game I really play nowadays is a simulation, X-Plane. It is awesome. I occasionally waste time playing games on my iPad and I really like physic based games, like Hello Stars. It is stupid, but clever. I have also been toying with making clones of old school 8 bit games like Pitfall! and Donkey Kong. Neither is very far along, never seem to have enough time.