Gamereactor International English / Dansk / Svenska / Norsk / Suomi / Deutsch / Italiano / Español / Português / Français / Nederlands
Log in member

Forgot password?
I'm not a member, but I want to be

Or log in with a Facebook account
Gamereactor UK
Portal 2

Valve on Portal 2 (part 2)

In this second interview with the people behind Portal 2, we dig into the more technical side of things and chat with programmer Jeep Barnett.

What do you do?

I'm a programmer. I started at Valve on Portal 1, I was part of the kinda original group that came in, and worked on a bunch of stuff between Portal 1 and 2 - Left 4 Dead, Alien Swarm, all that. And in Portal 2 I've mostly been working on co-op.

So, programming. That's a pretty large field.

[Laughs] True. A lot of people in the gaming industry are pretty specialised, especially at some companies. Like, "I'm the networking guy, I'm the graphics guy" or whatever. I'm more of a generalist programmer, and I'd say that at Valve that's just more common. Everybody kinda does a little bit of everything. The other thing is that in Portal and Alien Swarm and even Portal 2 on the co-op side, there's been very, very few programmers, it's been small teams, and so it's basically whatever needs to be done, I'm your guy. So I have to learn to do whatever needs to be done.

Portal 2

So everything from gameplay mechanics to engine to...


So what do you think the biggest single challenge in making Portal 2 was?

Living up to expectations is the biggest challenge 'cause that's kind of the whole game? But we were trying to figure out... There's a paradox, which is, if we make Portal 2 very similar to Portal 1, we'll feel like it doesn't meet the expectation of doing something new and different, but if we do something completely new and different-

It won't be Portal?

Exactly, it won't be Portal, it doesn't meet the expectations of people wanting a continuing sequel. So there was a challenge in really finding the balance between those two things and essentially being able to do something new, but still making it something that feels like a continuation of what came before. So that was one of the biggest things.

Portal 2

In terms of more of a programming-type task, being able to do multiplayer portals was tricky for a bunch of reasons. Having two sets of portals is insanely intense in terms of the graphics processing that you need to be able to do that. Because with two portals, if you can see a portal through a portal, you end up rendering the world, I think, five times total, in the worst case. But with four portals, your worst case actually becomes sixteen, and in splitscreen it's 32, because you have to render both screens, right? And so we had to do an insane amount of optimisations in trying to make sure that it would run smoothly in what our worst case was.

And in a lot of ways I kind of feel like we've redone the portal rendering technology from the ground up, just so we would be able to pull that off, just rethinking how the pipeline works in terms of rendering all those sets through the different depths of portals.

So that's really tricky, and then the other part of it is that Portal uses a kind of, you could call it a non-euclidean or a non-linear 3D space, it's almost a four dimensional space in that you can move through and move from one place to another that are non-continuous points within the world. And the networking of multiplayer games in general, and especially our games, has a dependency in terms of being able to move players smoothly from one place to another, and accounting for network lag, you have to do all this blending between those positions. You also have to account for discrepancies between what the client thinks happens, and what the server thinks happens, and if they disagree on what's happening in that three-dimensional space, you have to essentially rewind time, decide what really happened, and then move back forward. And so you're jumping kinda backward and forward in the timeline of what exactly is going on and how we're resolving the collisions in the game.

And so when you have people going from one side of the map to the other through portals, that gets even harder?

Exactly. You have this non-linear movement space in this non-linear time, and it not only becomes very difficult to program for, but it becomes insanely confusing to even thing about [laughs]. So I would say that's one of the biggest challenges.

Portal 2

How many engine updates or upgrades have you done compared to previous games?

I would say that we're always moving forward at a pretty even pace in terms of the engine stuff writing. If you look at what we did with Left 4 Dead, where we added color correction and sharpness filters and things like that, as well as being able to render a hundred zombies on the screen. So pushing those sorts of boundaries in Left 4 Dead is ways that did upgrade the engine, and in Portal 2 we've added dynamic lighting, and we've done a lot with that. You can see it really prominently in the sections where Wheatley has his flashlight and those sorts of things, but we kinda use it all over the place in really subtle ways that kinda make the environment pop a little more than it used to.

I was thinking, the geometry in the test chambers is, by design I guess, relatively simple - it's all angular plates and so on - but still the game looks way better than Portal 1, and that's mostly because of the lighting, I think.

Yeah, there's the lighting and there's a lot we did with what we call detailed textures, which is, as you approach a surface we kinda have textures within that texture, that adds a lot of detail to it so it doesn't get all blurry when you stand right against it. And we also have added an impostor-technology, that's basically a system of rendering an object and then repeating it in a similar way, many times in a single scene, and you see that in some of the later parts of the game, where there's sort of these very large spaces with lots and lots of objects in them. So that's kinda how we did that effect of having just so much stuff, and it almost seems like it would be impossible to render something with so much detail, but we're able to do that through that new system.

Portal 2

I remember Half-Life 2 did this thing where you're outside and you have that big Citadel in the background, and it's actually a miniature model that's in a different room with a camera that gets projected. Do you do any sort of stuff like that in Portal 2?

That's called the 3D skybox, and the way that works, the way visually it works, is that the 3D box that you're in is essentially considered at a kinda infinite render depth, and the parts within it can move because we slide the camera within that three-dimensional box. But it really only works for objects that are considered to be essentially not in the way or very far away. And a lot of the stuff we do in Portal doesn't really have that distance. We do a little bit with skyboxes, but it doesn't give us a lot of the effect that we want, so that's why we had to do a lot of things that are actually in the same space as you, but again we're using that impostor-technology to render really highly detailed and repetitive objects straight in the scene.

When you're out on the walkways and looking down or looking up, some of the distances seem a lot bigger than I remember seeing in other Source games.

I think it's definitely kind of a mental trick that might be happening, in that those objects are actually closer than other objects you find in Source games, but because they're not within the skybox and not at that infinite distance, they seem more real in a certain sense, so they actually do seem farther. It's really weird how that works out.

You're doing this new thing with co-op Steam cross-platform play. How did that come about?

Basically, it's an evolving thing, in terms of, we've been doing Steam Play with PC and Mac, where we essentially want to treat our customers and fans who've bought the game as, basically they can play the game on any platform that they choose. And so when we say any platform, the PS3 is now an extension of that. We don't consider them PS3 players and PC players, they're all just the same players and they all want to play Portal 2, and they want to play it together. So that's basically what it is, it's trying to take what was once separate universes and just call them one big happy family.

Portal 2

But usually, multiplayer on consoles is sort of like a gated community. I think Id Software tried it with Quake III on the Dreamcast, but other than that, PC-console crossplay isn't that common, so you must have figured out something that the other guys haven't.

I see what you're saying, like that's our philosophy, but how did we actually make it happen? I think that, you know, we talked to Sony and I guess that they saw the value we were trying to get out of that sort of situation, and we were saying, "we think that customers will find value in this, not just ours but yours as well". And they agreed with us and said, let's do an experiment. Just like everything we do, we try something out, we see how it goes and then we go from there. But hopefully it will be a success, I think that it's gonna work out. But essentially this is just testing the water to see if it's really a feature that people find important.

Portal 2

How much of it is down to Steam? I think I heard someone saying that with Steam you can push updates to the game faster than would normally happen through the usual console manufacturer ecosystem.

We still go through a certification process. The main thing we do with Steam is that it uses our matchmaking systems in terms of understanding who's playing what game, being able to chat to each other, persistent storage of your save games, those sorts of things all use Steam features. The PSN features are basically the friends list and being able to connect with them as well, and also some of your multiplayer progress is saved through PSN and not Steam. So it uses a little bit of both, it's kinda Frankenstein, but what we're trying to do is make that as seamless to the players as it possibly can be, like they don't need to worry about which system it's in, we're kinda gluing them together and saying it's really all one big system.