Classic Tools Retrospective: Tim Sweeney on the first version of the Unreal Editor

Jan. 9, 2018
protect

Introduction

In recent years, retrospectives of classic games have been well received at GDC, but there have been very few stories about classic game tools. This series of articles will attempt to fill that gap, by interviewing key people who were instrumental in the history of game development tools.

The first article in this series was an interview with John Romero about TEd, the Tile Editor he created at Id Software, that went on to ship over 30 games.

For the second article, I am fortunate to have the opportunity to speak to Tim Sweeney about the first version of the Unreal Editor, or UnrealEd. We spoke at the Unreal booth during the GamesCom 2017 conference in Cologne, Germany.

 

Fallacies and BSPs: "I'll write an editor"

DL: Thank you for taking the time to talk to me, Tim! Let's start with the early days of the Unreal Editor. I read that James Schmaltz – creator of Epic Pinball – showed you a game that he was working on, and when you saw it, you offered to build an editor for it. Is that correct?

TS: Yeah! He had been inspired by Bullfrog’s game, Magic Carpet. James is this insanely brilliant programmer, but he only wrote code in assembly language, he didn't want to learn C. [laughs] And so – in pure assembly language – he wrote this 3D engine that rendered terrain backgrounds and game objects. He didn't want to build an editing tool, so he actually built a BSP tree by hand and placed a capsule in the middle of this terrain. When I saw that, I was like "No, no, no, James, James... this is not how we do things." [laughs]

 

James SchmaltzMagic Carpet, by Bullfrog

James Schmaltz and Magic Carpet, by Bullfrog

 

I said "I'll write an editor”, and so I set about building the user interface for the Unreal Editor, laying out the UI in Visual Basic, of all things. It had a text mode command-line interface to the C++ engine that was doing the rendering. Next I wrote the wireframe editor, and it went from there.

So, it was a funny learning process. I thought I was just going to write this editor and integrate it into James's renderer. At some point, I said "Can you send me the code? I'd like to figure out how to integrate the renderer.” So he sent me 30,000 lines of assembly code. [laughs] The 3D rendering engine had some elements of Epic Pinball in it and some other prior assembly code that he had been copy / pasting, and I was like "Oh my god, what is this stuff? I don't wanna touch this!" [laughs]

But I said to myself, before I figure this out, I'm just going to write a little texture mapper. So, I went through Michael Abrash's articles on texture mapping and looked at some stuff that Billy Zelsnack has shared early on. The texture mapping was actually pretty simple, so I said, "I guess I can figure this out".

The one real piece of wizardry in the early Unreal Editor – before I implemented lighting and things like that – was the real-time BSP tree creation. The idea is that you can reposition brushes in 3-D space, and then all the BSP work is updated completely in real-time.

 

 

"It was a real example of programmer geekery"

This had some mind-boggling implications, and I created this torus-building tool just to show off how cool it was. I got together with James – who, remember, had been building his BSPs by hand – and I said "check this out." I created two toruses that were interlocked, and subtracted them from the world, and he said "Whoa, no way? That's awesome!" It was a real example of programmer geekery.

DL: Speaking of BSPs, it was my understanding that John Carmack was one of the first people to use BSPs in a game engine, and that the idea of working with BSPs was fairly new in the games industry at that time.

TS: Carmack had written this really advanced editor on the NeXT. I'd read all about it and I had seen screenshots of it, but I never actually used it. At the time, I thought to myself "Holy shit, Carmack wrote a real-time BSP editor!" What I didn't realize was that it wasn't actually real-time, there was this re-build process and all this other offline stuff. I didn't know that, and so I thought I had to create a completely real-time thing, and so I did. [laughs]

 

QuakeEd on NeXT and John Carmack

 

DL: [laughs] You thought that's how it was, and so you accepted the challenge.

TS: Yeah! A lot of the features in Unreal arose from fallacies of what I misperceived other people did.

"A lot of the features in Unreal arose from fallacies of what I misperceived other people did."

Also, a bunch of the former Future Crew demo-scene guys had formed a hardware company, and they had released some screenshots with incredibly realistic volumetric lighting in an indoor scene. There were some lights with really big spheres around them, and the volumetric lighting was really clearly clipped by all the geometry around it. It looked completely physically accurate. I was like "Oh my god, it's something I've never seen before, I have to figure it out!”

So I figured out that I needed to compute the line integral from the eye to every point on the screen. I learned some calculus in college, so I said to myself "I should be able to do this." So I figured out the formula for it with some crazy complicated trigonometry. I implemented it, but it was 100 times too slow. Then I realized, "Oh wait, I can do this in the lightmap space”, because the lightmap is a discretization of geometry into bite-sized chunks. I did that with lightmaps, so it was real-time.

 

Examples of lightmap-based lighting from Unreal

 

I took a screenshot of it, and I emailed it to the guy I knew at the hardware company in Finland. He replied "Oh that's really awesome! But, our picture is just a rendering from 3D Studio Max because we couldn't figure out how to do that in real-time. [laughs]

DL: [laughs] Wow…

[Author's Note: The company that Tim is referring to is Bit Boys]

"There was this huge leap frogging process, where Carmack was implementing crazy new things, [and] I was implementing crazy new things"

JikGuard.com, a high-tech security service provider focusing on game protection and anti-cheat, is committed to helping game companies solve the problem of cheats and hacks, and providing deeply integrated encryption protection solutions for games.

Read More>>