WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000 00:00:00.000 --> 00:00:03.920 [MUSIC PLAYING] 00:00:16.470 --> 00:00:17.470 COLTON OGDEN: All right. 00:00:17.470 --> 00:00:18.553 Good afternoon, everybody. 00:00:18.553 --> 00:00:20.490 Thank you so much for coming to today's talk. 00:00:20.490 --> 00:00:21.510 My name is Colton Ogden. 00:00:21.510 --> 00:00:23.730 I'm the course instructor for GD50, which 00:00:23.730 --> 00:00:26.105 is CS50's new Introduction to Game Development course. 00:00:26.105 --> 00:00:28.980 We started this last spring and we've been having lectures every week 00:00:28.980 --> 00:00:30.690 so far for the last semester. 00:00:30.690 --> 00:00:32.790 Last week we took a look at Portal, which 00:00:32.790 --> 00:00:36.240 is a famous game by Valve, whereby you get a gun that can essentially 00:00:36.240 --> 00:00:39.460 shoot these portals that defy the laws of space 00:00:39.460 --> 00:00:41.010 onto different services in the game. 00:00:41.010 --> 00:00:44.820 Walk in and out of them and teleport through them and see through them. 00:00:44.820 --> 00:00:47.340 And there are a host of interesting challenges associated 00:00:47.340 --> 00:00:48.798 with implementing a game like this. 00:00:48.798 --> 00:00:51.450 Now last week we looked at a simple version of it in Unity, 00:00:51.450 --> 00:00:55.961 but today we are joined by Dave Kircher and Tejeev Kohli of Valve Software who 00:00:55.961 --> 00:00:57.960 actually were on the Portal team and implemented 00:00:57.960 --> 00:01:00.570 all of the interesting sort of design and technical decisions 00:01:00.570 --> 00:01:03.270 that went about making it work and making it fun and believable. 00:01:03.270 --> 00:01:07.020 So without any further ado, this is the "Portal Problems." 00:01:07.020 --> 00:01:07.769 Thank you. 00:01:07.769 --> 00:01:10.114 [APPLAUSE] 00:01:13.866 --> 00:01:14.810 TEJEEV KOHLI: Hi. 00:01:14.810 --> 00:01:17.960 So we're just going to run through. 00:01:17.960 --> 00:01:22.850 Both me and Dave were actually students when we were hired by Valve, 00:01:22.850 --> 00:01:29.630 and we were hired to recreate the work we did as a student project for Valve 00:01:29.630 --> 00:01:32.480 for Portal 1 and for Portal 2. 00:01:32.480 --> 00:01:35.660 And today we just wanted to talk to you about some 00:01:35.660 --> 00:01:41.900 of the issues we had trying to create the mechanic for portals, 00:01:41.900 --> 00:01:45.380 and then also some of the design, both the technical and some of the design 00:01:45.380 --> 00:01:53.880 issues that we had to tackle and work on to make the mechanic work properly. 00:01:53.880 --> 00:01:56.915 So Dave is going to start off and then I'll jump in later. 00:01:56.915 --> 00:01:58.670 DAVE KIRCHER: Hey, folks. 00:01:58.670 --> 00:02:01.130 As he mentioned, my name is Dave Kircher I was hired 00:02:01.130 --> 00:02:03.960 on specifically to work for Portal. 00:02:03.960 --> 00:02:05.970 So I'm going to go ahead and preface. 00:02:05.970 --> 00:02:09.060 We're jumping through a lot of topics today and jumping very quickly, 00:02:09.060 --> 00:02:11.119 so this is a very video heavy presentation 00:02:11.119 --> 00:02:13.560 so that we can jump quickly in and out. 00:02:13.560 --> 00:02:16.260 And I'm sorry if I go a little too fast. 00:02:16.260 --> 00:02:18.350 I'm kind of optimizing for the stream. 00:02:18.350 --> 00:02:21.470 So hopefully, if I have gone too quickly over something, 00:02:21.470 --> 00:02:25.230 you can review the stream and see it a second time. 00:02:25.230 --> 00:02:28.280 So without further ado, let's start off-- just quickly. 00:02:28.280 --> 00:02:30.620 I'm assuming that most of the people here 00:02:30.620 --> 00:02:34.497 have played Portal or at least are familiar with it in some sense. 00:02:34.497 --> 00:02:35.580 That's just an assumption. 00:02:35.580 --> 00:02:37.790 And that, for at least the technical portions, 00:02:37.790 --> 00:02:41.300 that you are at least somewhat familiarized with 3D rendering. 00:02:41.300 --> 00:02:44.300 If you're not, you may need to study up a little bit and then come back. 00:02:44.300 --> 00:02:46.970 But let's start off with just what is a portal? 00:02:46.970 --> 00:02:49.250 A portal is a discontinuity in 3D space. 00:02:49.250 --> 00:02:51.080 It's a 2D discontinuity where we basically 00:02:51.080 --> 00:02:56.210 define a 2D rectangle somewhere in space such that the front face-- sorry, 00:02:56.210 --> 00:02:59.960 the back face of the 2D rectangle is defined as the front face of another 2D 00:02:59.960 --> 00:03:01.260 rectangle. 00:03:01.260 --> 00:03:04.252 So I've got my simple little example here of this blue portal 00:03:04.252 --> 00:03:05.210 and this orange portal. 00:03:05.210 --> 00:03:09.420 We're defining them to be back to back, which gets us this result over here. 00:03:09.420 --> 00:03:11.887 So from the perspective of this little portal guy, 00:03:11.887 --> 00:03:14.720 it should look like there's another room attached with a cube in it. 00:03:14.720 --> 00:03:17.197 But we're not actually moving 3D space at all 00:03:17.197 --> 00:03:20.030 because otherwise we're trying to make sure that this perspective is 00:03:20.030 --> 00:03:21.920 true for both this guy and the cube. 00:03:21.920 --> 00:03:23.919 And then you'd have this weird overlapping space 00:03:23.919 --> 00:03:25.670 that doesn't make any sense to anybody. 00:03:25.670 --> 00:03:28.130 So we do a lot of hacks to make it seem like space 00:03:28.130 --> 00:03:32.930 is folding in these interesting ways without actually moving space. 00:03:32.930 --> 00:03:35.510 Another way to think of it is that it's a door. 00:03:35.510 --> 00:03:38.690 If you look closely at this doorway, it's a very standard door. 00:03:38.690 --> 00:03:41.760 It's a door like you walk through it, different stuff happens. 00:03:41.760 --> 00:03:44.900 But what I'm not telling you initially is that this actually isn't a door. 00:03:44.900 --> 00:03:47.540 For technical reasons, this level required a portal here 00:03:47.540 --> 00:03:50.120 because we needed this room to move. 00:03:50.120 --> 00:03:53.000 So even though it looks like a doorway, it's completely fake. 00:03:53.000 --> 00:03:55.190 And that it's a doorway that actually takes you 00:03:55.190 --> 00:03:59.300 about a half mile across the level. 00:03:59.300 --> 00:04:02.090 But it looks like a door, and so my job on the Portal series 00:04:02.090 --> 00:04:06.080 was to make sure that when we're creating portals that they 00:04:06.080 --> 00:04:08.720 feel to the player like a doorway. 00:04:08.720 --> 00:04:11.390 And if you think of them in terms of a doorway, 00:04:11.390 --> 00:04:14.600 all the interesting stuff for a portal happens on the inside of the doorway 00:04:14.600 --> 00:04:17.089 and nothing interesting happens on the outside. 00:04:17.089 --> 00:04:19.797 And it's my job to make sure that all the interesting things that 00:04:19.797 --> 00:04:22.280 are happening outside the door don't happen. 00:04:22.280 --> 00:04:26.101 Because that's all stuff that doesn't make any sense. 00:04:26.101 --> 00:04:28.100 So as you can see, I just flew across the level. 00:04:28.100 --> 00:04:30.320 And that's the other side of that door that we just looked at. 00:04:30.320 --> 00:04:32.270 And I'm walking through it and it's a doorway. 00:04:32.270 --> 00:04:34.250 So it's a door that doesn't take you a couple of inches. 00:04:34.250 --> 00:04:36.249 It takes you about a half mile across the level. 00:04:40.319 --> 00:04:42.110 Now we're into our rendering section, which 00:04:42.110 --> 00:04:47.207 is basically one of my main expertises in the portal area. 00:04:47.207 --> 00:04:49.290 So we're going be talking about quite a few things 00:04:49.290 --> 00:04:51.650 and I'm going to jump in quickly, so hopefully I 00:04:51.650 --> 00:04:52.940 don't spew it out too quickly. 00:04:52.940 --> 00:04:55.920 That's kind of my problem. 00:04:55.920 --> 00:04:58.610 So there are primarily two layers to render a portal of view. 00:04:58.610 --> 00:05:03.500 There might be more, but these are the two that I am primarily familiar with. 00:05:03.500 --> 00:05:06.200 The preliminary way that we did it with Narbacular Drop, which 00:05:06.200 --> 00:05:10.280 was the predecessor to Portal was with rendered texture. 00:05:10.280 --> 00:05:12.682 And then when we got to working on the Portal franchise, 00:05:12.682 --> 00:05:14.390 we switched to a method where you draw it 00:05:14.390 --> 00:05:16.848 all in a single pass using what's known as a stencil buffer 00:05:16.848 --> 00:05:19.230 and I'll be talking more about that in a bit. 00:05:19.230 --> 00:05:21.600 But there are tradeoffs to each method. 00:05:21.600 --> 00:05:25.460 So with a texture, you have to have separate textures per portal view. 00:05:25.460 --> 00:05:27.260 And if you have support for recursion, you 00:05:27.260 --> 00:05:29.676 have to have many, many textures pre-allocated to do this. 00:05:29.676 --> 00:05:32.570 So your memory growth gets big very fast. 00:05:32.570 --> 00:05:35.270 You have to use the Painter's Algorithm or something like it 00:05:35.270 --> 00:05:37.130 to render your portals. 00:05:37.130 --> 00:05:39.470 You basically have to figure out the deepest portal you 00:05:39.470 --> 00:05:41.681 can see into and render that one first. 00:05:41.681 --> 00:05:43.430 And then any outward ones from that you're 00:05:43.430 --> 00:05:44.510 going to render them because they're going 00:05:44.510 --> 00:05:46.610 to contain a view of that first portal. 00:05:46.610 --> 00:05:48.500 So you have to render it in that order. 00:05:48.500 --> 00:05:50.240 And I don't know if it's true anymore. 00:05:50.240 --> 00:05:53.300 It definitely was when I originally was working on the first portal. 00:05:53.300 --> 00:05:55.670 That you couldn't effectively use anti-aliasing, 00:05:55.670 --> 00:05:58.391 so you get small visual artifacts as you get close to a portal 00:05:58.391 --> 00:06:00.890 because it would be rendered as a texture that doesn't quite 00:06:00.890 --> 00:06:04.730 render the same way as the rest of the back buffer. 00:06:04.730 --> 00:06:06.837 But it is the simplest to implement, especially 00:06:06.837 --> 00:06:08.420 if you don't support recursion at all. 00:06:08.420 --> 00:06:11.450 It is super simple to do because you can ignore the Painter's Algorithm 00:06:11.450 --> 00:06:15.080 and just render all of them before you of your main view. 00:06:15.080 --> 00:06:17.120 By contrast, when you render with stencils, 00:06:17.120 --> 00:06:19.340 it renders the entire frame to the back buffer 00:06:19.340 --> 00:06:21.673 so you don't have any extra texture memory requirements. 00:06:21.673 --> 00:06:23.600 You're doing it all in a single pass. 00:06:23.600 --> 00:06:26.510 You're starting from your main view and working your way in. 00:06:26.510 --> 00:06:29.234 You actually have to nest it a little bit, so it's interesting. 00:06:29.234 --> 00:06:31.400 You are guaranteed to get homogeneous visual quality 00:06:31.400 --> 00:06:32.570 because it's a single pass. 00:06:32.570 --> 00:06:35.450 The way you're rendering the rest of your frame. 00:06:35.450 --> 00:06:39.200 But it has a lot of extra complexity of when you render them 00:06:39.200 --> 00:06:41.840 and how you render them. 00:06:41.840 --> 00:06:46.640 So this rendering portion is going to require 00:06:46.640 --> 00:06:48.390 quite a bit of spatial thinking. 00:06:48.390 --> 00:06:49.970 So I'm going to show you this video. 00:06:49.970 --> 00:06:52.590 Basically this is a layout I'm going to use a couple of times. 00:06:52.590 --> 00:06:53.320 Does this play? 00:06:53.320 --> 00:06:55.280 Hopefully-- yes, OK. 00:06:55.280 --> 00:06:57.860 This is a room layout that I'm going to use a couple of times 00:06:57.860 --> 00:06:59.990 where I've got an orange portal and a blue portal. 00:06:59.990 --> 00:07:03.650 And behind each one is a thin wall with some stuff behind it. 00:07:03.650 --> 00:07:07.460 But hopefully to help illustrate what's in front of the blue portal, 00:07:07.460 --> 00:07:10.520 you can see there's a whole bunch of blue stuff over there. 00:07:13.550 --> 00:07:17.890 So yes, that is the example layout I want you to kind of keep in your head 00:07:17.890 --> 00:07:21.451 because spatial thinking is important to actually have reference. 00:07:21.451 --> 00:07:22.700 Let this finish one more time. 00:07:26.850 --> 00:07:28.650 OK. 00:07:28.650 --> 00:07:33.550 Now this is something that pertains to both rendering with textures 00:07:33.550 --> 00:07:35.550 and stencils and I'm going to let this play once 00:07:35.550 --> 00:07:37.650 because I was advised that if I front load this too much, 00:07:37.650 --> 00:07:38.490 it sounds confusing. 00:07:38.490 --> 00:07:40.865 So while I'm playing this, I want you to look at the fact 00:07:40.865 --> 00:07:44.010 that when the orange portal is on screen and when it's not, 00:07:44.010 --> 00:07:46.260 everything inside where the orange oval is 00:07:46.260 --> 00:07:49.320 looks exactly the same for when it is and when it is not there. 00:07:52.270 --> 00:07:55.980 And so what I'm doing here is as I'm toggling between the views 00:07:55.980 --> 00:07:58.410 is I am teleporting to where the virtual camera is. 00:07:58.410 --> 00:08:01.070 That's rendering out of the orange portal. 00:08:01.070 --> 00:08:03.665 Whoops-- come on, go back. 00:08:03.665 --> 00:08:06.480 Oh, God. 00:08:06.480 --> 00:08:07.924 OK. 00:08:07.924 --> 00:08:09.090 I'm toggling back and forth. 00:08:09.090 --> 00:08:10.881 I'm looking into the orange portal, but I'm 00:08:10.881 --> 00:08:14.519 toggling to where the virtual camera is behind the blue portal. 00:08:14.519 --> 00:08:16.560 So if you remember back to when I said that we're 00:08:16.560 --> 00:08:18.780 defining the back face of one rectangle to be 00:08:18.780 --> 00:08:20.910 the front face of another rectangle, that 00:08:20.910 --> 00:08:24.100 means that they should be coplanar at all times. 00:08:24.100 --> 00:08:27.720 And so if you think of my player model in terms 00:08:27.720 --> 00:08:29.790 of walking it to the orange portal. 00:08:29.790 --> 00:08:33.809 When I'm rendering my exit view, I should end up behind the blue portal 00:08:33.809 --> 00:08:35.070 as I'm rendering out of it. 00:08:35.070 --> 00:08:39.060 So it's important to remember that all the angles carry over from that. 00:08:39.060 --> 00:08:42.059 And most importantly that whether you're rendering textures or rendering 00:08:42.059 --> 00:08:45.690 to stencil that nothing inside ever moves 00:08:45.690 --> 00:08:47.850 because it should be the exact same view angles, 00:08:47.850 --> 00:08:49.725 the pixels should be in the exact same place. 00:08:49.725 --> 00:08:52.260 If they're not in the same place, your math is wrong. 00:08:52.260 --> 00:08:54.801 And this is especially important when rendering with textures 00:08:54.801 --> 00:08:57.480 because one of the first mistakes I've seen several people do 00:08:57.480 --> 00:09:00.900 is that they render the entire screen to a texture. 00:09:00.900 --> 00:09:05.790 And then they map the entire texture to this little quadratic here 00:09:05.790 --> 00:09:09.760 and it looks all weird depending on how close or far away you are. 00:09:09.760 --> 00:09:12.030 But as long as you project the-- 00:09:15.360 --> 00:09:17.190 sorry. 00:09:17.190 --> 00:09:19.260 Trying to work with videos is not the easiest. 00:09:19.260 --> 00:09:22.860 So as long as you project where the vertices of your mesh 00:09:22.860 --> 00:09:27.840 are in screen space, you can reuse those coordinates as your texture coordinates 00:09:27.840 --> 00:09:29.797 and then it will line up perfectly. 00:09:29.797 --> 00:09:32.130 So that's the point of why it's rendering as one-to-one. 00:09:32.130 --> 00:09:34.755 You just want to make sure that you're rendering the same parts 00:09:34.755 --> 00:09:37.120 to the same part of the screen. 00:09:37.120 --> 00:09:39.287 Now I said I'd be using that previous layout a bunch 00:09:39.287 --> 00:09:41.078 and I swear I'm going to get back to there. 00:09:41.078 --> 00:09:43.800 But this is a much better layout for rendering with stencils, 00:09:43.800 --> 00:09:46.299 and so now you need to learn a new layout just for a minute. 00:09:46.299 --> 00:09:47.425 It's only used in stencils. 00:09:47.425 --> 00:09:49.632 But I've got these two portals looking at each other. 00:09:49.632 --> 00:09:51.750 They're kind of-- one stacked on top of the other, 00:09:51.750 --> 00:09:53.970 and they've got these light bridges that are just 00:09:53.970 --> 00:09:56.960 serving to show you that transparencies are kind of a special case. 00:09:56.960 --> 00:09:57.720 So I'm going to play it one more time. 00:09:57.720 --> 00:09:59.636 So you just got two portals facing each other. 00:09:59.636 --> 00:10:03.210 And even though they're tiny, it does make an infinite recursion down 00:10:03.210 --> 00:10:03.990 into the portals. 00:10:06.750 --> 00:10:10.500 So rendering with stencils. 00:10:10.500 --> 00:10:13.290 I'm kind of assuming that for this part of the talk 00:10:13.290 --> 00:10:16.830 that you have some idea what a depth buffer is. 00:10:16.830 --> 00:10:18.900 You may need to read up on that if you don't. 00:10:18.900 --> 00:10:21.600 The stencil buffer is very similar to the depth buffer 00:10:21.600 --> 00:10:27.330 in that it defines rules and operations for when we can wholesale just not 00:10:27.330 --> 00:10:29.130 draw a pixel or when we do want to draw it. 00:10:29.130 --> 00:10:31.810 And then also while we are drawing pixels, 00:10:31.810 --> 00:10:34.950 you can define several operations of how to modify the depth buffer. 00:10:34.950 --> 00:10:37.680 But for all intents and purposes, it's invisible to the user 00:10:37.680 --> 00:10:42.430 except for the end result. So stencil buffer, a lot like a depth buffer, 00:10:42.430 --> 00:10:48.870 but you're controlling the values in code instead of by vertex depth. 00:10:48.870 --> 00:10:52.770 So before we render any scene using stencils, what we're going to do 00:10:52.770 --> 00:10:55.290 is we're going to clear our stencil buffer at the same time 00:10:55.290 --> 00:10:56.498 as we clear our depth buffer. 00:10:56.498 --> 00:10:58.320 We're going to clear it to all zero values. 00:10:58.320 --> 00:11:02.190 And the stencil buffer we were working with with Portal 1-- 00:11:02.190 --> 00:11:03.990 I believe it only had two bits. 00:11:03.990 --> 00:11:04.750 I could be wrong. 00:11:04.750 --> 00:11:07.125 It might be up to eight bits, but it's not a lot of bits. 00:11:07.125 --> 00:11:10.162 So we need to be very conservative with the values we put in there. 00:11:10.162 --> 00:11:11.620 So we're going to clear it to zero. 00:11:11.620 --> 00:11:14.590 So everything in it is zero. 00:11:14.590 --> 00:11:17.400 And then we're going to render all of the OPEC objects in our scene 00:11:17.400 --> 00:11:19.840 and that's where we get to the visual I'm showing you here. 00:11:19.840 --> 00:11:22.214 So you'll notice that none of the light bridges are here. 00:11:22.214 --> 00:11:24.660 None of the cool fancy window stuff is here. 00:11:24.660 --> 00:11:27.390 So all we've done is draw in all the opaque objects. 00:11:27.390 --> 00:11:31.020 And then we take a special detour to render a portal. 00:11:31.020 --> 00:11:33.430 At this point, we've rendered this oval here. 00:11:33.430 --> 00:11:36.990 And while we're rendering the oval, we tell the rendering system 00:11:36.990 --> 00:11:41.220 to increment the stencil buffer wherever we render a pixel. 00:11:41.220 --> 00:11:45.420 So while we're rendering, all of the pixels here go from 0 to 1 00:11:45.420 --> 00:11:47.370 and that's an important bit. 00:11:47.370 --> 00:11:49.780 So we're going to be able to use that to tell the depth-- 00:11:49.780 --> 00:11:53.940 to tell draw operations where to draw from then on. 00:11:53.940 --> 00:11:58.110 And then as soon as we've drawn the incrementing of the stencil buffer, 00:11:58.110 --> 00:12:01.882 we tell all draw operations from then on to only draw 00:12:01.882 --> 00:12:03.090 where the stencil value is 1. 00:12:03.090 --> 00:12:04.673 And we tell it to not modify anything. 00:12:04.673 --> 00:12:06.780 We're only drawing where there's a 1. 00:12:06.780 --> 00:12:09.630 And then we can basically just forget all about stencil buffers 00:12:09.630 --> 00:12:12.582 for a little bit and keep drawing. 00:12:12.582 --> 00:12:15.540 But at this point if you've been following along with the depth buffer, 00:12:15.540 --> 00:12:18.510 we've already drawn this nice little wall behind the portal. 00:12:18.510 --> 00:12:22.432 So the depth is the same as this little quad here. 00:12:22.432 --> 00:12:25.390 And so the first thing we do is we render a full screen quad with depth 00:12:25.390 --> 00:12:27.980 at maximum value, which does really effectively 00:12:27.980 --> 00:12:29.560 make this a hole at this point. 00:12:29.560 --> 00:12:32.518 And if we were to continue drawing opaque objects and things like that, 00:12:32.518 --> 00:12:34.760 they would just show up in this hole. 00:12:34.760 --> 00:12:37.490 So then we start-- 00:12:37.490 --> 00:12:40.220 after we have drawn, after we have punched our hole in depth 00:12:40.220 --> 00:12:44.060 and we've required that all draw operations have this matching 00:12:44.060 --> 00:12:48.140 stencil value of 1, then what we do is we just start over in our main scene 00:12:48.140 --> 00:12:49.490 again and just draw it again. 00:12:49.490 --> 00:12:51.855 But this time we move our virtual camera. 00:12:51.855 --> 00:12:54.230 Just the same operation as I showed you in the rendering. 00:12:54.230 --> 00:12:57.500 It's one-to-one, we just have to do a matrix transform such 00:12:57.500 --> 00:13:00.530 that we're behind the blue portal and we draw it again. 00:13:00.530 --> 00:13:02.130 And so, let's see here. 00:13:02.130 --> 00:13:05.460 I think I have a magnifying glass. 00:13:05.460 --> 00:13:08.216 So you may notice that we're in-- 00:13:08.216 --> 00:13:09.840 whoops. 00:13:09.840 --> 00:13:12.619 OK, I can't apparently zoom and use a laser pointer. 00:13:12.619 --> 00:13:14.660 So you may notice that the player model is there, 00:13:14.660 --> 00:13:17.240 and then the exact same setup as I had shown you before. 00:13:17.240 --> 00:13:20.859 It's the same set of quads and the oval again. 00:13:20.859 --> 00:13:22.400 And we do the exact same thing again. 00:13:22.400 --> 00:13:25.730 We tell it to increment so all the values in this tiny little oval 00:13:25.730 --> 00:13:27.320 here are now 2. 00:13:27.320 --> 00:13:32.257 And then at that point we tell, OK, only render pixels with a stencil value of 2 00:13:32.257 --> 00:13:34.340 and then we can just ignore stencil buffers again. 00:13:34.340 --> 00:13:37.710 We punch the hole again, and then we recurse again. 00:13:37.710 --> 00:13:39.860 And we go into a value of 3. 00:13:39.860 --> 00:13:41.154 At this point-- 00:13:41.154 --> 00:13:43.070 I'm going to get more into detail on it later, 00:13:43.070 --> 00:13:46.405 but we stop recursively rendering to stencil buffers 00:13:46.405 --> 00:13:48.530 because otherwise we'd draw a whole bunch of scenes 00:13:48.530 --> 00:13:50.300 that we're not going to actually see. 00:13:50.300 --> 00:13:53.360 We pull a little trick that I'm going to get into. 00:13:53.360 --> 00:13:56.850 So as we've drawn all of our opaques, we would theoretically do our detour. 00:13:56.850 --> 00:13:57.830 We don't. 00:13:57.830 --> 00:14:01.630 And then we finish by drawing all of our translucent objects. 00:14:01.630 --> 00:14:04.100 And I know it's very tiny to see them there, 00:14:04.100 --> 00:14:06.550 but it will become more apparent later. 00:14:06.550 --> 00:14:08.967 I think that-- sorry, that's actually our rendering trick. 00:14:08.967 --> 00:14:11.716 And there, now we've actually drawn the translucence in that view. 00:14:11.716 --> 00:14:14.990 And I know this is very small, but it'll make more sense at recursion level 1. 00:14:14.990 --> 00:14:16.823 So as we draw our translucent objects, we're 00:14:16.823 --> 00:14:20.360 still all confined to drawing where stencil value is 2. 00:14:20.360 --> 00:14:24.410 And then once we are done drawing all of our translucent objects, 00:14:24.410 --> 00:14:27.120 we render the portal oval-- 00:14:27.120 --> 00:14:29.720 whoops, sorry, sorry. 00:14:29.720 --> 00:14:32.540 I'm going to pretend that we're drawing to the big oval 00:14:32.540 --> 00:14:34.800 here because it's easier to see. 00:14:34.800 --> 00:14:38.750 We would draw another quad at this level, sort of like a window, 00:14:38.750 --> 00:14:45.597 telling it to decrement the stencil value back to 1. 00:14:45.597 --> 00:14:47.180 I'm sorry, I need to take a step back. 00:14:47.180 --> 00:14:50.630 We need to replace depth so that there's no longer a hole there. 00:14:50.630 --> 00:14:54.440 So we draw the full screen quad with depth equal to the portal plane 00:14:54.440 --> 00:14:57.560 while still restricting to the nested view and then we decrement. 00:14:57.560 --> 00:14:58.370 Sorry. 00:14:58.370 --> 00:15:01.160 So by the time we've done decrementing, that 00:15:01.160 --> 00:15:05.600 means all of these pixels inside this first recursion are now 1 again. 00:15:05.600 --> 00:15:08.180 Every single one of them is a 1 on the stencil value. 00:15:08.180 --> 00:15:11.514 So we can continue rendering the translucence from the first recursion 00:15:11.514 --> 00:15:13.430 just like we did when we're doing the opaques. 00:15:13.430 --> 00:15:18.550 We can say just restrict your drawing to all stencil value 1. 00:15:18.550 --> 00:15:20.300 And then we finish our translucence there. 00:15:20.300 --> 00:15:23.660 We do the exact same thing again while we're going back to the main view. 00:15:23.660 --> 00:15:28.329 We fix up our depth and then we decrement the stencil values again. 00:15:28.329 --> 00:15:30.120 And then we just finish out our main scene, 00:15:30.120 --> 00:15:33.860 and now you have portals drawn using stencils. 00:15:33.860 --> 00:15:37.970 They required no extra texture memory whatsoever. 00:15:37.970 --> 00:15:41.060 So bouncing back to the scene that we had 00:15:41.060 --> 00:15:45.020 shown before this, one of the things that we had to solve pretty quickly 00:15:45.020 --> 00:15:48.584 is when you have some object in the middle of a portal, 00:15:48.584 --> 00:15:50.750 you have to be able to see it in two places at once. 00:15:50.750 --> 00:15:53.150 And the way that we do this is we literally just look up 00:15:53.150 --> 00:15:55.010 every piece and rendering geometry. 00:15:55.010 --> 00:15:58.940 It uses every texture and replicate it and teleport it every single frame 00:15:58.940 --> 00:16:01.040 to wherever the original is. 00:16:01.040 --> 00:16:03.860 And while we're replicating, this object over here. 00:16:03.860 --> 00:16:07.010 You can see that it's slightly more in front of the orange portal. 00:16:07.010 --> 00:16:10.070 So basically the rules are defined such that whichever object-- 00:16:10.070 --> 00:16:15.530 whichever side of the object has its origin in front of the portal 00:16:15.530 --> 00:16:16.460 is the master. 00:16:16.460 --> 00:16:18.980 And the origin for this cube is right in its middle, 00:16:18.980 --> 00:16:23.510 and origin is just a term that we use to define the one point in space that 00:16:23.510 --> 00:16:25.259 defines where this object is. 00:16:25.259 --> 00:16:27.050 So usually it's in the center of an object. 00:16:27.050 --> 00:16:30.350 Not always, but that means this is the real one. 00:16:30.350 --> 00:16:33.080 And this is our complete and utter fake one 00:16:33.080 --> 00:16:37.700 that we have to do for every single object that is penetrating the portal. 00:16:37.700 --> 00:16:39.620 Now when we duplicate geometry and whether we 00:16:39.620 --> 00:16:42.650 not-- whether we duplicate or not, we have another problem to solve. 00:16:42.650 --> 00:16:44.025 I'm going to let this video play. 00:16:44.025 --> 00:16:47.360 I'm going to be toggling a broken part on and off. 00:16:47.360 --> 00:16:51.690 So when the cube is not behind the wall, that's the fixed version. 00:16:51.690 --> 00:16:54.630 And when you can see it behind the wall, that's the broken version. 00:16:54.630 --> 00:16:57.110 So if you think about replicating geometry, 00:16:57.110 --> 00:17:00.260 we have replicated the entire model to this orange portal. 00:17:00.260 --> 00:17:03.367 Which means all the stuff that is supposed 00:17:03.367 --> 00:17:06.200 to be in front of the blue portal is also sticking behind this wall. 00:17:06.200 --> 00:17:10.940 Because once again, we have defined the two faces to be coplanar. 00:17:10.940 --> 00:17:13.996 So what we have to do is we have to use what's known as a clip plane 00:17:13.996 --> 00:17:15.829 to tell the rendering system, you know what? 00:17:15.829 --> 00:17:20.869 Just don't draw any pixels if the mesh is on this half of this half space. 00:17:20.869 --> 00:17:23.640 And we define the half space to be the portal plane. 00:17:23.640 --> 00:17:25.390 And we can turn this clip plane on and off 00:17:25.390 --> 00:17:27.400 as we're drawing objects inside the portal plane 00:17:27.400 --> 00:17:28.369 and that's what makes it work. 00:17:28.369 --> 00:17:30.290 Otherwise it would clip the whole world. 00:17:30.290 --> 00:17:32.110 I'm going to play the video again. 00:17:32.110 --> 00:17:32.742 It happens. 00:17:32.742 --> 00:17:34.450 So, yeah, we're just telling it, hey, you 00:17:34.450 --> 00:17:38.740 need to just ignore every single pixel that's on that half of all of space. 00:17:38.740 --> 00:17:40.034 Don't draw them. 00:17:40.034 --> 00:17:41.950 And that makes it so it doesn't seem like it's 00:17:41.950 --> 00:17:46.170 sticking out the back in weird ways that people don't understand. 00:17:46.170 --> 00:17:50.200 OK, now this is a very similar concept. 00:17:50.200 --> 00:17:53.080 Something that we coined the term "banana juice" for. 00:17:53.080 --> 00:17:56.040 Even back in Narbacular Drop because it's just confusing. 00:17:56.040 --> 00:17:58.960 And I know you're asking yourself, what in the heck is "banana juice?" 00:17:58.960 --> 00:18:00.260 That doesn't make any sense. 00:18:00.260 --> 00:18:04.270 So we decided to use a completely insane term for it. 00:18:04.270 --> 00:18:07.450 Because even our technical shorthand for describing the problem 00:18:07.450 --> 00:18:10.270 didn't accurately describe what it was. 00:18:10.270 --> 00:18:12.790 So we decided to use a term that-- 00:18:12.790 --> 00:18:15.320 it was obvious that explanation was needed. 00:18:15.320 --> 00:18:20.050 So what we've got here is I've got my orange camera 00:18:20.050 --> 00:18:22.381 and I'm looking into the orange portal here. 00:18:22.381 --> 00:18:24.880 And that means I've got my blue camera, virtual camera here, 00:18:24.880 --> 00:18:27.340 looking out of the blue portal. 00:18:27.340 --> 00:18:29.290 And if you remember back to my example, we've 00:18:29.290 --> 00:18:31.690 got this geometry that's behind the blue portal. 00:18:31.690 --> 00:18:35.200 And it's between the blue virtual camera and the portal, 00:18:35.200 --> 00:18:38.410 and if we render that, it's going to look completely broken. 00:18:38.410 --> 00:18:42.280 So "banana juice" is a term to define this broken stuff 00:18:42.280 --> 00:18:45.370 that you would see if you were looking behind the thin wall. 00:18:45.370 --> 00:18:48.100 And I have a video of it here. 00:18:48.100 --> 00:18:50.980 I believe I'm toggling back and forth between views just like when 00:18:50.980 --> 00:18:52.060 I showed you rendering as one-to-one. 00:18:52.060 --> 00:18:53.860 And that's me turning off the clip plane. 00:18:53.860 --> 00:18:57.026 This is what it would look like if we were in the virtual space and the clip 00:18:57.026 --> 00:19:00.700 planes were not enabled and then I go back to our main view. 00:19:00.700 --> 00:19:04.030 And you'll see as I move around in a second that it looks completely broken 00:19:04.030 --> 00:19:07.870 and it kind of breaks your brain if you don't understand what's going on. 00:19:07.870 --> 00:19:11.770 So that is "banana juice," and you fix it exactly the same way 00:19:11.770 --> 00:19:14.110 as with the entity clipping. 00:19:14.110 --> 00:19:19.600 You have clip models, but what we do is I'm going to replay the video here. 00:19:19.600 --> 00:19:24.370 If you're watching, this entire part of the level is now clipped. 00:19:24.370 --> 00:19:27.760 So what we do is while we're rendering a virtual camera, 00:19:27.760 --> 00:19:31.851 we just clip the entire world behind the portal plane. 00:19:31.851 --> 00:19:32.350 All of it. 00:19:32.350 --> 00:19:35.382 Everything that's back there. 00:19:35.382 --> 00:19:37.090 So that's how you fix "banana juice" too. 00:19:37.090 --> 00:19:39.090 It's not super difficult once you understand it, 00:19:39.090 --> 00:19:41.140 but I can tell you it took me about two days 00:19:41.140 --> 00:19:43.848 to figure out exactly what was going on when I originally saw it. 00:19:43.848 --> 00:19:46.010 It just didn't make any sense. 00:19:46.010 --> 00:19:49.150 So moving on again, I know we're jumping a lot and I'm sorry. 00:19:49.150 --> 00:19:51.580 We're just going to keep moving on at a quick pace. 00:19:51.580 --> 00:19:54.299 So infinite recursion is something that people kind of expected 00:19:54.299 --> 00:19:55.840 to see when they were playing portal. 00:19:55.840 --> 00:19:57.839 If you ever played the original Narbacular Drop, 00:19:57.839 --> 00:20:01.090 we didn't support any form of recursion and it was kind of a letdown. 00:20:01.090 --> 00:20:03.470 So I'm going to go into how this works. 00:20:03.470 --> 00:20:06.910 So in this view, you can see that we have this blue portal. 00:20:06.910 --> 00:20:10.810 That's our first recursion right here and it's taking up most of the screen. 00:20:10.810 --> 00:20:14.230 And then we've got this blue portal that you can see the entirety of it. 00:20:14.230 --> 00:20:16.150 That's our second recursion. 00:20:16.150 --> 00:20:20.170 And this one in here is completely and totally fake. 00:20:20.170 --> 00:20:23.170 So that one, there is no portal there whatsoever. 00:20:23.170 --> 00:20:26.500 What we're doing is we're taking whatever we see 00:20:26.500 --> 00:20:28.570 of this portal, the second recursion. 00:20:28.570 --> 00:20:31.720 We're taking that exact view from the previous frame. 00:20:31.720 --> 00:20:35.470 We're taking those pixels and then we're basically doing a fix up 00:20:35.470 --> 00:20:37.600 in case you moved your camera around. 00:20:37.600 --> 00:20:43.000 And we're applying the texture coordinates from the second portal 00:20:43.000 --> 00:20:45.070 to where the third portal would be. 00:20:45.070 --> 00:20:48.000 And by a completely fake, I mean we didn't even render this blue oval. 00:20:48.000 --> 00:20:51.310 That's just a copy of this oval right here. 00:20:51.310 --> 00:20:56.890 So it's the exact same thing as if you point a video camera at a video monitor 00:20:56.890 --> 00:20:58.600 that's showing what it's recording. 00:20:58.600 --> 00:21:00.290 You get that feedback loop. 00:21:00.290 --> 00:21:02.665 But we have access to a little bit of extra special math. 00:21:02.665 --> 00:21:04.623 That means that we don't get that weird snaking 00:21:04.623 --> 00:21:06.380 effect if you move it back and forth. 00:21:06.380 --> 00:21:08.620 We can fix it up quickly. 00:21:08.620 --> 00:21:12.229 But this video is actually going to show you about how this quickly breaks down. 00:21:12.229 --> 00:21:14.020 Because if you're thinking ahead, you might 00:21:14.020 --> 00:21:17.680 be wondering what happens if you can't see all the second portal. 00:21:17.680 --> 00:21:20.620 And the answer is that we stretch it. 00:21:20.620 --> 00:21:24.610 So as you watch the third one, it just kind of stretches off in weird ways. 00:21:24.610 --> 00:21:26.892 Which is a problem that, if we spend a bunch of time, 00:21:26.892 --> 00:21:28.100 we probably could have fixed. 00:21:28.100 --> 00:21:31.600 But in game development, sometimes you just call it good enough 00:21:31.600 --> 00:21:34.660 and move on because I bet anybody that played the original Portal never 00:21:34.660 --> 00:21:36.096 noticed this whatsoever. 00:21:36.096 --> 00:21:37.434 [LAUGHING] 00:21:40.300 --> 00:21:44.830 So another breakdown of it, which I find personally annoying and interesting 00:21:44.830 --> 00:21:45.570 at the same time. 00:21:45.570 --> 00:21:47.519 I'm just going to show the video of it first. 00:21:47.519 --> 00:21:50.560 As I'm walking, you'll notice at the third recursion, which is completely 00:21:50.560 --> 00:21:52.320 fake, you're going to see a pop. 00:21:52.320 --> 00:21:56.860 You're going to see every single time I walk through a portal, it pops around. 00:21:56.860 --> 00:22:00.610 So this is actually fairly easy to explain once you understand-- 00:22:00.610 --> 00:22:02.950 really understand how the hack works. 00:22:02.950 --> 00:22:05.530 So if you look at my visualization here, this 00:22:05.530 --> 00:22:08.840 is what the actual recursion would look like if we actually did it. 00:22:08.840 --> 00:22:12.040 So we've got a couple of portals here at these blue lines. 00:22:12.040 --> 00:22:15.130 And so inside our first portal that we're fairly close to, 00:22:15.130 --> 00:22:17.590 our field of view is really wide. 00:22:17.590 --> 00:22:21.970 And then as we get to our second portal, it gets really narrow really fast. 00:22:21.970 --> 00:22:24.220 But then as we get to the third, it narrows even more. 00:22:24.220 --> 00:22:26.260 And then the fourth, it narrows even more. 00:22:26.260 --> 00:22:29.110 But since we're cutting and pasting, the second recursion, 00:22:29.110 --> 00:22:32.260 if you look down here on this visualization, this is the hack. 00:22:32.260 --> 00:22:34.701 So we take this one, the second visualization, and copy 00:22:34.701 --> 00:22:36.700 and paste it onto the third and onto the fourth. 00:22:36.700 --> 00:22:38.680 And you can notice that this doesn't converge at all. 00:22:38.680 --> 00:22:39.610 It doesn't narrow. 00:22:39.610 --> 00:22:42.400 So we're seeing the same amount of wall around each 00:22:42.400 --> 00:22:50.050 of the recursions no matter what, no matter how narrow this magenta cone is. 00:22:50.050 --> 00:22:53.620 So as we walk through a portal, the magenta cone, 00:22:53.620 --> 00:22:56.110 we're picking a portal that's further off because now 00:22:56.110 --> 00:22:58.568 that's the second recursion after we walk through a portal. 00:22:58.568 --> 00:23:00.760 So it starts off narrow, which is closer to what 00:23:00.760 --> 00:23:02.920 it should look like at infinity. 00:23:02.920 --> 00:23:06.070 It should narrow to basically where you're seeing a blue tube. 00:23:06.070 --> 00:23:10.626 But then as we walk closer and closer to the main portal, 00:23:10.626 --> 00:23:12.500 then it's going to widen and widen and widen. 00:23:12.500 --> 00:23:17.702 And so there's just a pop where it snaps into place. 00:23:17.702 --> 00:23:18.910 So hopefully that made sense. 00:23:18.910 --> 00:23:21.250 And once again, completely changing topics because we 00:23:21.250 --> 00:23:23.560 got so many things to cover. 00:23:23.560 --> 00:23:27.280 So when we're rendering portals, we have to have 00:23:27.280 --> 00:23:30.470 a mix of rendering first person and third person. 00:23:30.470 --> 00:23:33.700 So in this case, you can see I've got my third-person model over here 00:23:33.700 --> 00:23:34.750 through this portal. 00:23:34.750 --> 00:23:36.580 Another third person model over here. 00:23:36.580 --> 00:23:39.880 And then we don't see it in the main view because I'm about to turn it on. 00:23:39.880 --> 00:23:43.870 It would look really weird if you saw the third-person view in the main view. 00:23:43.870 --> 00:23:46.570 Yeah. 00:23:46.570 --> 00:23:50.620 I mean, some games do try to fix this with very special representations. 00:23:50.620 --> 00:23:53.640 They'll try to draw just the legs or something like that. 00:23:53.640 --> 00:23:58.360 But, yes, so we have to have a complicated system 00:23:58.360 --> 00:24:02.200 to figure out when to draw third person and when to draw first person. 00:24:02.200 --> 00:24:05.320 And if you were to guess, I bet you would say, well, just 00:24:05.320 --> 00:24:08.020 render a third person every time you look through a portal. 00:24:08.020 --> 00:24:09.940 And it turns out it's slightly more complicated than that. 00:24:09.940 --> 00:24:11.960 I'm not actually going to get into the complicated version, 00:24:11.960 --> 00:24:13.668 but I'm going to show you how it's broken 00:24:13.668 --> 00:24:16.420 if you use that simple rule because why would life be easy 00:24:16.420 --> 00:24:18.295 and we would just be able to render just when 00:24:18.295 --> 00:24:20.380 we're on the other side of a portal. 00:24:20.380 --> 00:24:21.640 So in this case-- 00:24:21.640 --> 00:24:22.280 let me look up. 00:24:22.280 --> 00:24:25.090 So you'll notice in this case, I'm on a tilted angle. 00:24:25.090 --> 00:24:27.710 And this is a case where my feet are on one side of the portal 00:24:27.710 --> 00:24:29.710 and my eyes are on the other side of the portal. 00:24:29.710 --> 00:24:31.960 So it kind of breaks the original system that 00:24:31.960 --> 00:24:35.830 would say, oh, just render if you're on the other side of a portal. 00:24:35.830 --> 00:24:38.079 And so, yeah, it's a little more complicated. 00:24:38.079 --> 00:24:38.620 Not terribly. 00:24:38.620 --> 00:24:40.703 It should actually look way more broken than this, 00:24:40.703 --> 00:24:42.649 but we actually had the fix in several places. 00:24:42.649 --> 00:24:45.440 And this is a special build where I had to go back and break things 00:24:45.440 --> 00:24:49.030 and only broken it in one place. 00:24:49.030 --> 00:24:50.560 Yeah, OK. 00:24:50.560 --> 00:24:54.430 And then the last on our rendering portion. 00:24:54.430 --> 00:24:56.680 So earlier I had talked about how we need to duplicate 00:24:56.680 --> 00:24:59.235 geometry that is mid-portal. 00:24:59.235 --> 00:25:01.610 But there's also another thing that we need to duplicate, 00:25:01.610 --> 00:25:05.050 which there are screen space affects where we can query 00:25:05.050 --> 00:25:06.940 draw operations and things like that. 00:25:06.940 --> 00:25:11.320 And so one way that we use these draw operations that are in screen space 00:25:11.320 --> 00:25:15.850 is to determine how much light glare to use around these lights. 00:25:15.850 --> 00:25:21.130 And so how these work are basically we draw a quad 00:25:21.130 --> 00:25:22.420 while we're drawing the light. 00:25:22.420 --> 00:25:24.904 And then we say, OK, in a couple of frames 00:25:24.904 --> 00:25:27.070 I want you to tell me how many pixels actually drew. 00:25:27.070 --> 00:25:30.320 And we're not allowed to actually query this immediately because of pipeline 00:25:30.320 --> 00:25:30.820 reasons. 00:25:30.820 --> 00:25:33.086 We don't have the results for several frames. 00:25:33.086 --> 00:25:34.960 So we have to cache off that handle that says 00:25:34.960 --> 00:25:38.125 how many pixels did you draw and we'll get the result at some point later. 00:25:38.125 --> 00:25:40.750 Sometimes you're lucky and it's just one frame, but usually two 00:25:40.750 --> 00:25:43.015 or three frames-- you have to save it for a while. 00:25:43.015 --> 00:25:44.890 But you may notice that even though we're not 00:25:44.890 --> 00:25:48.820 replicating the geometry of the light, we're drawing two of them 00:25:48.820 --> 00:25:50.210 because they're in screen space. 00:25:50.210 --> 00:25:53.380 So that means that this query system had to be smart about it 00:25:53.380 --> 00:25:57.340 and I'm going to show how we have two separate results. 00:25:57.340 --> 00:26:00.490 Now if we had used the engine as it was originally written, 00:26:00.490 --> 00:26:03.380 there would be just one query for one light. 00:26:03.380 --> 00:26:06.410 But then that would mean that these lights would dim in unison. 00:26:06.410 --> 00:26:09.370 So we need to have separate buckets for each view of portals. 00:26:09.370 --> 00:26:11.200 And every view query that portal-- 00:26:11.200 --> 00:26:15.190 any view query that is issued while in that recursion, 00:26:15.190 --> 00:26:18.670 we have to keep it in a totally separate bucket and call it back later. 00:26:18.670 --> 00:26:22.070 And then as we walk through portals, we have to transfer those buckets. 00:26:22.070 --> 00:26:25.360 So if I were to walk into the blue portal at this point, all of those 00:26:25.360 --> 00:26:27.250 handles we have to transfer to the main view. 00:26:27.250 --> 00:26:30.610 And then all the ones that are from the main view we transfer into what was now 00:26:30.610 --> 00:26:32.985 orange because we would be walking out of this orange one 00:26:32.985 --> 00:26:35.260 if we walked into the blue. 00:26:35.260 --> 00:26:39.340 So, yeah, that is the quick set of rendering things I wanted to cover. 00:26:39.340 --> 00:26:42.610 So now I'm going to hand it off to my colleague, Tejeev, 00:26:42.610 --> 00:26:44.190 to talk a bit about design. 00:26:44.190 --> 00:26:47.308 Give your spatial thinking a bit of a rest. 00:26:47.308 --> 00:26:48.286 [CHUCKLES] 00:26:51.220 --> 00:26:53.450 TEJEEV KOHLI: So that was a lot of technical stuff 00:26:53.450 --> 00:26:55.810 about rendering of portals. 00:26:55.810 --> 00:27:00.020 And you can see it's more complex than it seems at first. 00:27:00.020 --> 00:27:03.130 The naive solution seems like we'll get you most of the way there, 00:27:03.130 --> 00:27:07.250 but then as you start putting in more things in the game and more ways 00:27:07.250 --> 00:27:09.139 to play a game, to interact with the game, 00:27:09.139 --> 00:27:11.180 you see there's a bunch of different complexities 00:27:11.180 --> 00:27:13.060 that you have to account for. 00:27:13.060 --> 00:27:16.580 And a lot of those complexities are not just in a technical sense, 00:27:16.580 --> 00:27:18.770 but also from a design sense. 00:27:18.770 --> 00:27:21.440 So I just want to talk through some of the issues 00:27:21.440 --> 00:27:25.460 that we came up with as we were making Portal 1 and 2 and some of the ways 00:27:25.460 --> 00:27:27.179 we tried to solve them. 00:27:27.179 --> 00:27:28.970 One of the first things I wanted to mention 00:27:28.970 --> 00:27:33.740 was when first coming up with the idea for portals, 00:27:33.740 --> 00:27:38.210 before figuring out if we should spend a bunch of time 00:27:38.210 --> 00:27:45.400 making this idea, this new game mechanic that most people haven't seen before. 00:27:45.400 --> 00:27:48.920 What we did was-- 00:27:48.920 --> 00:27:53.930 Dave and his team made a prototype of Portal 00:27:53.930 --> 00:28:00.710 in a 2D game engine that is used in DigiPen while they were students. 00:28:00.710 --> 00:28:05.390 And it was made in-house DigiPen 2D engine. 00:28:05.390 --> 00:28:08.810 And you can see here that it's a 2D version of Portal, 00:28:08.810 --> 00:28:14.200 but it's still got all the basic game mechanics that are used in Portal. 00:28:14.200 --> 00:28:20.510 And the main goal of doing something like this is to vet out the mechanics 00:28:20.510 --> 00:28:23.980 and see if they're still fun at their core. 00:28:23.980 --> 00:28:28.070 And part of what you do here is you playtest, right? 00:28:28.070 --> 00:28:30.890 You make this simple prototype, and you get 00:28:30.890 --> 00:28:33.710 other people to try it out and play it and say, hey, is this fun? 00:28:33.710 --> 00:28:38.240 Is this something that we should spend our next year working on 00:28:38.240 --> 00:28:40.092 as a proper 3D game? 00:28:40.092 --> 00:28:42.800 And the prototype you can see had most of the basic functionality 00:28:42.800 --> 00:28:50.840 there and kind of vetted out the idea of the mechanics to take it forward. 00:28:50.840 --> 00:28:53.360 And as we take the mechanics forward, one 00:28:53.360 --> 00:28:56.120 of the first things that you realize is this 00:28:56.120 --> 00:28:58.760 is a brand new mechanic that people don't really understand 00:28:58.760 --> 00:29:01.080 and you have a train them. 00:29:01.080 --> 00:29:04.397 Train them with how the mechanic works and also 00:29:04.397 --> 00:29:06.230 train them with sufficient knowledge so they 00:29:06.230 --> 00:29:10.310 can use that mechanic to solve puzzles, which is the core of the game. 00:29:10.310 --> 00:29:14.060 And one of the things that we did is you have 00:29:14.060 --> 00:29:17.390 to have certain sections of the game where 00:29:17.390 --> 00:29:22.470 you can be sure that the player has the knowledge that they need to progress. 00:29:22.470 --> 00:29:28.670 So a lot of this is about making sure that the levels you're designing 00:29:28.670 --> 00:29:32.330 are done in such a way that when the player finishes that level, 00:29:32.330 --> 00:29:35.330 they have that knowledge that you want them to have. 00:29:35.330 --> 00:29:41.060 And one of the ways we ensure that is through doing a lot of play testing, 00:29:41.060 --> 00:29:44.810 and play testing is something I'll talk about a little more as the talk goes 00:29:44.810 --> 00:29:45.990 on. 00:29:45.990 --> 00:29:48.847 But the basic idea of play testing is just 00:29:48.847 --> 00:29:50.430 getting someone else to play the game. 00:29:50.430 --> 00:29:52.138 And that someone else could be a coworker 00:29:52.138 --> 00:29:54.920 who sits next to you, your friend-- 00:29:54.920 --> 00:29:57.050 anyone else really. 00:29:57.050 --> 00:30:00.320 Someone you get especially to come play the game from outside the company, 00:30:00.320 --> 00:30:03.560 but usually it's just your coworkers, people that sit next to you. 00:30:03.560 --> 00:30:07.460 People that see you work on the game but don't know exactly what you're doing. 00:30:07.460 --> 00:30:10.250 And you can observe them and see what they're doing, 00:30:10.250 --> 00:30:13.490 get some feedback from them, and then use that data 00:30:13.490 --> 00:30:15.390 and iterate on the mechanic. 00:30:15.390 --> 00:30:21.680 And you can see here, this was a level in Portal 1. 00:30:21.680 --> 00:30:25.250 It was pretty early on, this level, and you could see the portals here. 00:30:25.250 --> 00:30:28.070 The blue portal here is moving on a timer. 00:30:28.070 --> 00:30:30.740 It moves from one to the next to the next. 00:30:30.740 --> 00:30:34.170 And the idea of this level was by the time players solve this, 00:30:34.170 --> 00:30:37.980 they understand that I go in one portal and come out the other. 00:30:37.980 --> 00:30:40.430 That's the basic idea here. 00:30:40.430 --> 00:30:44.970 And in Portal 1, this level did a pretty good job of teaching players that. 00:30:44.970 --> 00:30:48.650 For Portal 2, we have a very similar puzzle. 00:30:48.650 --> 00:30:50.750 I'm going to just try and play here. 00:30:50.750 --> 00:30:52.280 It's a pretty similar puzzle. 00:30:52.280 --> 00:30:54.440 The idea is the same thing. 00:30:54.440 --> 00:30:57.260 You have the three sections that the portal can go. 00:30:57.260 --> 00:31:01.839 The one change we made here was we move the portal away from a timer 00:31:01.839 --> 00:31:02.880 and moved it to a button. 00:31:02.880 --> 00:31:07.240 So this way the player has more control of where the portals are opening. 00:31:07.240 --> 00:31:09.110 There are a few reasons for this. 00:31:09.110 --> 00:31:13.970 The main one here is like the level in Portal 2 has a lot more visual noise. 00:31:13.970 --> 00:31:15.210 There's a lot more like-- 00:31:15.210 --> 00:31:18.870 it's an old level, a lot of foliage, a lot of destroyed stuff. 00:31:18.870 --> 00:31:21.590 So it's not as clean as Portal 1. 00:31:21.590 --> 00:31:24.860 And also, there's a case of Portal 2, there's 00:31:24.860 --> 00:31:27.980 a lot of people that have already played Portal 1 00:31:27.980 --> 00:31:30.620 and are probably already familiar with the mechanics. 00:31:30.620 --> 00:31:33.770 So we don't want them to have to go through the timers 00:31:33.770 --> 00:31:36.960 and wait for all the things to happen, even though they know how it works. 00:31:36.960 --> 00:31:42.080 So this way they can just go in and show us 00:31:42.080 --> 00:31:44.180 that they know how the portals work without having 00:31:44.180 --> 00:31:46.090 to wait through all the timers. 00:31:46.090 --> 00:31:48.170 And the basic goal is the same thing. 00:31:48.170 --> 00:31:51.582 That by the end of this level, we're confident that the players understand 00:31:51.582 --> 00:31:52.290 how portals work. 00:31:56.210 --> 00:31:59.190 One of the other things that you learn through play testing 00:31:59.190 --> 00:32:02.390 is you learn what you need to teach the player. 00:32:02.390 --> 00:32:04.680 There's sometimes when you'll be making the game 00:32:04.680 --> 00:32:08.010 and there's certain things that you as a designer or as a creator 00:32:08.010 --> 00:32:12.540 won't think are challenging concepts or are things that need 00:32:12.540 --> 00:32:15.240 to be talked to players explicitly. 00:32:15.240 --> 00:32:17.910 One of those things that we noticed early on 00:32:17.910 --> 00:32:23.550 is this concept here where a lot of players kind of thought portals 00:32:23.550 --> 00:32:24.810 were one way. 00:32:24.810 --> 00:32:28.290 That you go in one and you come out the other and that's it. 00:32:28.290 --> 00:32:32.645 But they have to be taught that you can actually go in both ways. 00:32:32.645 --> 00:32:34.770 You can go in the blue one and come out the orange, 00:32:34.770 --> 00:32:37.200 or you can go in the orange one and come out the blue one. 00:32:37.200 --> 00:32:40.925 And so this puzzle specifically does that, where the blue one 00:32:40.925 --> 00:32:42.300 is the only one that'd be moving. 00:32:42.300 --> 00:32:44.220 The orange one stays stationary. 00:32:44.220 --> 00:32:47.550 First you go in the blue one, you come out the orange one, replace the blue, 00:32:47.550 --> 00:32:52.310 and then you go in the orange one and come out the blue one. 00:32:52.310 --> 00:32:57.890 The idea with this again is you have to figure through play testing 00:32:57.890 --> 00:33:00.580 is how you figure out the different things. 00:33:00.580 --> 00:33:04.110 The different discrete small things that you need to teach the player. 00:33:04.110 --> 00:33:06.750 And also try to figure out how to teach them in a way 00:33:06.750 --> 00:33:10.210 where they're figuring it out instead of you telling it to them. 00:33:10.210 --> 00:33:13.316 So for the most part in Portal 1 and 2, there's 00:33:13.316 --> 00:33:14.940 certain things that we tell the player. 00:33:14.940 --> 00:33:17.880 But for the most part we want them to figure it 00:33:17.880 --> 00:33:21.280 out and have that epiphany themselves. 00:33:21.280 --> 00:33:23.170 Because then they really learn it. 00:33:23.170 --> 00:33:28.860 If you just tell it to them, they might not take in the exact knowledge. 00:33:28.860 --> 00:33:33.340 Another thing here is this was a level in Portal 2, 00:33:33.340 --> 00:33:37.570 but we noticed through one of our play tests-- 00:33:37.570 --> 00:33:40.980 I looked through a few of our play tests that players were super 00:33:40.980 --> 00:33:44.520 hesitant to place portals on the floor. 00:33:44.520 --> 00:33:48.000 Even though this level is probably the fifth or sixth one in the game, 00:33:48.000 --> 00:33:50.580 and you've done that a few times in the game before this. 00:33:50.580 --> 00:33:52.670 But usually you are doing it way down there 00:33:52.670 --> 00:33:57.510 and doing a fling mechanic where you fly through the portal and come out. 00:33:57.510 --> 00:34:00.180 So players have placed portal on the floor before, 00:34:00.180 --> 00:34:03.270 but they haven't done it right at their feet. 00:34:03.270 --> 00:34:07.790 So we had to design a scenario here where the only way forward-- 00:34:07.790 --> 00:34:10.090 you're trapped in this black room with nothing else 00:34:10.090 --> 00:34:13.260 and the only thing you can do is place a portal on the floor there. 00:34:13.260 --> 00:34:18.300 And that's one of the things that you realize as you keep testing. 00:34:18.300 --> 00:34:21.147 You'll come across players of different skill levels 00:34:21.147 --> 00:34:23.730 and different knowledge of video games and different knowledge 00:34:23.730 --> 00:34:25.330 of how controls work. 00:34:25.330 --> 00:34:29.070 And typically you want to make sure that you're not only catering 00:34:29.070 --> 00:34:30.850 to the low end or the high end. 00:34:30.850 --> 00:34:35.080 You want to make sure that both of them can have a good time with your game. 00:34:35.080 --> 00:34:39.870 So you want to design puzzle games in a way that aren't super intrusive. 00:34:39.870 --> 00:34:42.960 If a player that sees this get here already 00:34:42.960 --> 00:34:45.473 knows that I can place portals on floor and go by. 00:34:45.473 --> 00:34:47.639 This doesn't seem like anything that's stopping him. 00:34:47.639 --> 00:34:49.290 This just seems like part of the level. 00:34:49.290 --> 00:34:52.080 But to a new player that comes in here and is 00:34:52.080 --> 00:34:55.920 like I don't know how to proceed, it takes them a while to figure it out. 00:34:55.920 --> 00:34:59.260 And then when they have that aha moment, they feel pretty smart about it. 00:34:59.260 --> 00:35:01.860 So you want to make sure that you're designing stuff 00:35:01.860 --> 00:35:07.000 in a way that isn't frustrating players that already understand the mechanics, 00:35:07.000 --> 00:35:12.780 but also isn't making players that don't understand the mechanics have 00:35:12.780 --> 00:35:14.310 to be super frustrated as well. 00:35:19.440 --> 00:35:20.870 Another thing that we had to do-- 00:35:20.870 --> 00:35:27.680 Portal 1 and 2 both have this mechanic where you go into a portal on the floor 00:35:27.680 --> 00:35:31.220 and come out one on the wall and it keeps your momentum and velocity 00:35:31.220 --> 00:35:33.290 and flings you forward. 00:35:33.290 --> 00:35:37.520 One of the things we noticed while we were working on this mechanic 00:35:37.520 --> 00:35:42.680 is that there's a lot of times when players don't exactly quite line up 00:35:42.680 --> 00:35:44.690 as they're falling through the portal. 00:35:44.690 --> 00:35:47.570 Which means that when they fall in, they're going to fall out-- 00:35:47.570 --> 00:35:51.860 they're not going to come out of the portal on the wall in the correct way. 00:35:51.860 --> 00:35:57.950 And a lot of times players won't know that they had the right solution, 00:35:57.950 --> 00:36:00.440 they just kind of messed up the execution a little bit. 00:36:00.440 --> 00:36:04.680 And we want to try and help the players in these cases, 00:36:04.680 --> 00:36:06.950 but again try to be not intrusive about it. 00:36:06.950 --> 00:36:10.170 Because you want to make sure that the players-- 00:36:10.170 --> 00:36:12.620 as they're solving puzzles, they're not thinking 00:36:12.620 --> 00:36:17.060 that they had the right solution but it didn't work the first time I tried it. 00:36:17.060 --> 00:36:20.060 So now I have to rethink the whole solution even though the solution was 00:36:20.060 --> 00:36:21.419 correct the first time. 00:36:21.419 --> 00:36:23.960 So one of the things we used-- we used a few different things 00:36:23.960 --> 00:36:25.890 to help the players out in this way. 00:36:25.890 --> 00:36:30.650 And again, with the idea of them being mostly invisible to the player. 00:36:30.650 --> 00:36:33.410 They're not always completely invisible and in some cases 00:36:33.410 --> 00:36:35.690 we have ways to opt out of them. 00:36:35.690 --> 00:36:38.670 But this is one of the things that we used. 00:36:38.670 --> 00:36:40.700 So if you notice here, the player's going 00:36:40.700 --> 00:36:43.730 to drop through the orange portal. 00:36:43.730 --> 00:36:46.160 But as you notice as I walk through-- 00:36:46.160 --> 00:36:50.660 walk forward here, I'm purposely not going to fall exactly straight. 00:36:50.660 --> 00:36:54.570 And one of the mechanics we had in the game was-- 00:36:54.570 --> 00:36:57.499 it was pretty subtle there, but I'm going to do it again. 00:36:57.499 --> 00:37:00.290 You'll see I'm walking to the side and the game kind of funnels you 00:37:00.290 --> 00:37:01.640 into the portal. 00:37:01.640 --> 00:37:06.770 So we had the special thing we used in portals, for portals 00:37:06.770 --> 00:37:09.980 that are on the floor facing mostly up. 00:37:09.980 --> 00:37:12.710 Imagine there's a cone coming out of the portal, 00:37:12.710 --> 00:37:16.100 and if you're falling from some height and if you're 00:37:16.100 --> 00:37:17.640 within that cone and the cone-- 00:37:17.640 --> 00:37:18.710 it's not super wide. 00:37:18.710 --> 00:37:20.090 It's pretty narrow. 00:37:20.090 --> 00:37:22.490 If you're within that cone, then we kind of 00:37:22.490 --> 00:37:24.680 funnel you into the center of the portal. 00:37:24.680 --> 00:37:26.513 So that when you're coming out of it, you're 00:37:26.513 --> 00:37:28.330 going to be lined up perfectly with it. 00:37:28.330 --> 00:37:31.280 And as you can see, the third time I did it there, it didn't happen. 00:37:31.280 --> 00:37:33.830 Because the way this works is that it only 00:37:33.830 --> 00:37:36.450 works if you're looking at a portal. 00:37:36.450 --> 00:37:38.780 So it works the second time, but the third time I'm 00:37:38.780 --> 00:37:43.480 going to go mostly in the same direction and it's not going to work. 00:37:43.480 --> 00:37:48.130 So that's our way of trying to make these things be non-intrusive. 00:37:48.130 --> 00:37:51.626 To where if players don't expect to go in that portal, it's not going to work. 00:37:51.626 --> 00:37:54.500 But if the player is looking at a portal and they expect to go in it, 00:37:54.500 --> 00:37:58.240 we kind of nudge them along a little bit. 00:37:58.240 --> 00:38:01.634 And you can see it here, and this is a second case 00:38:01.634 --> 00:38:04.550 of the same thing where there's a portal on the floor and the ceiling. 00:38:04.550 --> 00:38:06.710 And you can see as the funnel is working, 00:38:06.710 --> 00:38:08.750 the play is perfectly in the center of it. 00:38:08.750 --> 00:38:11.499 But I'm going to look forward a little bit and disable the funnel. 00:38:11.499 --> 00:38:13.574 And you can see the player's going to go off axis 00:38:13.574 --> 00:38:16.490 because the funnels are disabled and the player slowly went out of it. 00:38:19.060 --> 00:38:20.630 Yeah, the funnel is disabled now. 00:38:23.810 --> 00:38:28.280 And again, the idea of this is to reduce a bunch of the player frustration 00:38:28.280 --> 00:38:31.940 and to reduce a bunch of the false negatives that players get. 00:38:31.940 --> 00:38:35.300 You want to make sure that players that think they've got the solution, 00:38:35.300 --> 00:38:37.490 and if it was the correct solution, you want 00:38:37.490 --> 00:38:38.700 to kind of help them out a little bit. 00:38:38.700 --> 00:38:40.325 You don't to solve the puzzle for them. 00:38:40.325 --> 00:38:42.770 You don't want to give them, like, here's the answer. 00:38:42.770 --> 00:38:44.978 But you do want to try and help them out a little bit 00:38:44.978 --> 00:38:48.140 because that helps that makes the game a little bit more fun 00:38:48.140 --> 00:38:49.942 and reduces the frustration. 00:38:52.660 --> 00:38:56.960 So that was the help that we had for when you're entering portals. 00:38:56.960 --> 00:39:00.630 We also have the opposite and that was there in Portal 1. 00:39:00.630 --> 00:39:03.380 And in Portal 2, we introduced something that 00:39:03.380 --> 00:39:08.000 was the opposite of a helper, which we used when you're coming out of portals. 00:39:08.000 --> 00:39:11.750 So Portal 2 had this mechanic called Aerial Faith Plates, 00:39:11.750 --> 00:39:13.950 which is pretty straightforward. 00:39:13.950 --> 00:39:18.110 You step on this faith plate and it propels you to the air. 00:39:18.110 --> 00:39:23.660 And the level designers can place the faith plate on a level 00:39:23.660 --> 00:39:26.960 and can kind of control the trajectory of the arc 00:39:26.960 --> 00:39:29.650 of where the player is going to fly. 00:39:29.650 --> 00:39:32.690 And this arc is not really visible to the player, 00:39:32.690 --> 00:39:35.730 but it's pretty apparent based on the level design. 00:39:35.730 --> 00:39:40.220 So you can see in this one, I'm going to play the video as I'm talking 00:39:40.220 --> 00:39:42.930 and then maybe play it a couple of times. 00:39:42.930 --> 00:39:46.490 So the tech that was developed for these Aerial Faith Plates 00:39:46.490 --> 00:39:51.466 is something that we reuse for a fling helper. 00:39:51.466 --> 00:39:53.090 So you can see here there's all these-- 00:39:53.090 --> 00:39:55.070 I'm going to turn on some debug draw. 00:39:55.070 --> 00:39:58.140 And you can see right here. 00:39:58.140 --> 00:40:02.150 So this green arc here is the arc that's on the faith plates, 00:40:02.150 --> 00:40:06.150 but you can see there's some stuff coming out of the walls there as well. 00:40:06.150 --> 00:40:10.610 So this is a part of the level where the player is going to fling out of. 00:40:13.800 --> 00:40:17.330 He's going to fling a box out of that actually because he wanted this to work 00:40:17.330 --> 00:40:20.410 for objects as well as the player. 00:40:20.410 --> 00:40:23.840 So you can see as the box goes through here 00:40:23.840 --> 00:40:27.050 and then here, these are those faith plates. 00:40:27.050 --> 00:40:29.270 And then when the box comes out of that, we 00:40:29.270 --> 00:40:34.111 have the box follow the arc that's kind of predetermined. 00:40:34.111 --> 00:40:36.860 Because that's I think what the player is expecting at that point. 00:40:36.860 --> 00:40:40.550 They expected to have solved the solution-- solve the puzzle. 00:40:40.550 --> 00:40:43.630 But the funnel, the trigger here-- 00:40:43.630 --> 00:40:46.370 this kind of corrects the arc to make sure that it's always going 00:40:46.370 --> 00:40:50.480 to go in the place the player expects. 00:40:50.480 --> 00:40:55.435 And we also have a case of the same things working for the player. 00:40:55.435 --> 00:40:57.560 So you can see here there's two different arcs that 00:40:57.560 --> 00:41:01.520 are coming out because we doubled up the triggers over here. 00:41:01.520 --> 00:41:03.590 The way these triggers worked in the game 00:41:03.590 --> 00:41:06.800 is they won't always enable when the player touches them. 00:41:06.800 --> 00:41:09.270 They require a minimum velocity threshold. 00:41:09.270 --> 00:41:11.550 So the player has to be doing most of the work. 00:41:11.550 --> 00:41:14.570 So the player has to have figured out a way in the level 00:41:14.570 --> 00:41:17.990 through the puzzle design to get that velocity. 00:41:17.990 --> 00:41:21.260 But we know that there's some differences in physics and differences 00:41:21.260 --> 00:41:23.570 in the exact mechanism you might use. 00:41:23.570 --> 00:41:26.930 So we're just saying if you got the minimum velocity that we acquire, 00:41:26.930 --> 00:41:29.310 we're going to take it all the way there. 00:41:29.310 --> 00:41:33.870 So in this one, you can see we have two different cases. 00:41:33.870 --> 00:41:37.790 So if I just fall out of the portal, it's not going to activate any of them. 00:41:37.790 --> 00:41:40.300 If I somehow manage to get some velocity, 00:41:40.300 --> 00:41:45.350 is going to activate the fail case one and take me there. 00:41:45.350 --> 00:41:47.780 And the reason we have the fail case one is 00:41:47.780 --> 00:41:51.920 because we want to make sure that if players somehow get 00:41:51.920 --> 00:41:55.069 most of the velocity but bonk on the wall, 00:41:55.069 --> 00:41:58.110 they don't keep thinking that they can-- that's the correct way to do it. 00:41:58.110 --> 00:42:00.300 So we want to make it obvious that you failed. 00:42:00.300 --> 00:42:01.425 So again it's the same way. 00:42:01.425 --> 00:42:04.383 We have to help-- you're helping the players out but not by giving them 00:42:04.383 --> 00:42:05.060 the solution. 00:42:05.060 --> 00:42:08.979 Just by making it obvious that the thing you did was correct or wrong. 00:42:08.979 --> 00:42:11.270 And then if you do the correct way in this level, which 00:42:11.270 --> 00:42:16.730 is to get philosophy doing that, and then you make a portal there, 00:42:16.730 --> 00:42:21.040 you're going to do the correct thing and swing out of it. 00:42:21.040 --> 00:42:27.410 And again, the main idea here is to get rid of those false negatives. 00:42:27.410 --> 00:42:30.380 Especially here because there's a few different spots on the wall 00:42:30.380 --> 00:42:31.777 that you can put a portal. 00:42:31.777 --> 00:42:33.860 And we don't really want to restrict a lot of that 00:42:33.860 --> 00:42:35.526 and just put the one square on the wall. 00:42:35.526 --> 00:42:37.490 That is the solution square. 00:42:37.490 --> 00:42:41.330 Because again, if you put the portal down here or put the portal up here, 00:42:41.330 --> 00:42:43.470 the arc is going to be slightly different. 00:42:43.470 --> 00:42:47.120 So this mechanism we had just kind of corrects 00:42:47.120 --> 00:42:51.320 those arcs and makes sure that it goes in the one or two ways that we want. 00:42:55.440 --> 00:42:57.080 Another thing we added in-- 00:42:57.080 --> 00:42:58.730 this we added in Portal 2-- 00:42:58.730 --> 00:43:02.210 was highlights for your portals so you can see where 00:43:02.210 --> 00:43:04.340 your portals are placed through walls. 00:43:04.340 --> 00:43:07.550 And this is something that's super useful in levels 00:43:07.550 --> 00:43:12.410 where you have to keep track of which portal you placed over there. 00:43:12.410 --> 00:43:14.300 So you know which one to place over here. 00:43:14.300 --> 00:43:17.107 Because sometimes it's like, OK, I just got out of the blue one 00:43:17.107 --> 00:43:18.440 and the orange one's over there. 00:43:18.440 --> 00:43:19.797 So if I place the blue one-- 00:43:19.797 --> 00:43:22.880 oh, I got to do the whole puzzle again now because I placed the wrong one. 00:43:22.880 --> 00:43:27.317 So this helps a lot in just making sure that you know where your portals are 00:43:27.317 --> 00:43:29.400 so you can be like I want to come out of that one, 00:43:29.400 --> 00:43:31.585 so I'm going to place the other one. 00:43:31.585 --> 00:43:34.460 And this is something we added in Portal 2 and it was pretty helpful. 00:43:34.460 --> 00:43:37.730 And it's also helpful in the co-op version of the game. 00:43:37.730 --> 00:43:40.020 Because in the co-op one, you want to see 00:43:40.020 --> 00:43:42.800 where both the players' portals are at all times 00:43:42.800 --> 00:43:46.100 and this kind mechanic helps in that. 00:43:46.100 --> 00:43:49.160 Another thing we added to kind of help the player a little bit 00:43:49.160 --> 00:43:52.180 is a thing we call the placement helper. 00:43:52.180 --> 00:43:55.220 And this does not use a whole lot in the game, 00:43:55.220 --> 00:43:57.830 but there's a few sections in the game where 00:43:57.830 --> 00:44:01.760 we want to encourage the players to come out 00:44:01.760 --> 00:44:05.250 of a portal in a particular direction. 00:44:05.250 --> 00:44:10.010 So we have these things that we place in the level with a certain radius. 00:44:10.010 --> 00:44:13.100 And if you place a portal within that radius, 00:44:13.100 --> 00:44:15.640 we just kind of snap it to the direction-- 00:44:15.640 --> 00:44:17.452 to the center of it. 00:44:17.452 --> 00:44:18.410 But they don't a timer. 00:44:18.410 --> 00:44:22.610 So if you place one portal and you're like, 00:44:22.610 --> 00:44:25.790 oh, I actually want to place it over here, you can always opt out of it. 00:44:25.790 --> 00:44:27.800 And that's again what I was talking earlier. 00:44:27.800 --> 00:44:31.160 You want to add something-- excuse me. 00:44:31.160 --> 00:44:36.800 You want to add these helpers in a way that, for players, they're mostly 00:44:36.800 --> 00:44:39.180 invisible to most of the players. 00:44:39.180 --> 00:44:42.590 But the players that want to opt out of them have a way of opting out of them. 00:44:42.590 --> 00:44:43.766 [COUGHS] 00:44:44.672 --> 00:44:46.031 Excuse me. 00:44:46.031 --> 00:44:49.090 So you can see the first portal that's placed does get snapped, 00:44:49.090 --> 00:44:53.260 but the second one that's placed is exactly where the player wanted. 00:44:53.260 --> 00:44:55.640 And we use these in a few spots in the game, 00:44:55.640 --> 00:44:58.430 but they weren't used a whole lot because for the most part 00:44:58.430 --> 00:45:00.380 you want to have-- you want to make sure the player feels 00:45:00.380 --> 00:45:01.379 like they're in control. 00:45:05.400 --> 00:45:08.990 And one of the other things that was a lot of fun 00:45:08.990 --> 00:45:12.070 while making Portal, and Dave will talk a lot about this-- 00:45:12.070 --> 00:45:17.120 excuse me-- will talk a lot about this later is the physics of portals, 00:45:17.120 --> 00:45:20.380 or physics of objects interacting with portals. 00:45:20.380 --> 00:45:23.440 And for the most part we're trying to be super accurate with it, right? 00:45:23.440 --> 00:45:27.234 We're trying to make stuff work the way players expect in real life 00:45:27.234 --> 00:45:29.650 because that's kind of what we're trying to simulate here. 00:45:29.650 --> 00:45:34.600 But one of the things that we thought that we added here-- that we thought 00:45:34.600 --> 00:45:36.910 was more fun than accurate. 00:45:36.910 --> 00:45:37.820 So you can see the-- 00:45:37.820 --> 00:45:39.464 [COUGHING] 00:45:41.860 --> 00:45:44.170 Sorry, I'm a little bit sick. 00:45:44.170 --> 00:45:47.140 You can see here that when the box starts off, 00:45:47.140 --> 00:45:48.850 it's just resting on the floor. 00:45:48.850 --> 00:45:50.960 So it's got no initial velocity whatsoever. 00:45:50.960 --> 00:45:53.830 So when you place the blue portal down, the expectation 00:45:53.830 --> 00:45:56.550 is probably that it keeps resting there or maybe it 00:45:56.550 --> 00:45:59.440 goes in the center of the portal and just stands there. 00:45:59.440 --> 00:46:02.140 But that's not a super fun game mechanic. 00:46:02.140 --> 00:46:05.350 So here we just have it be so that objects coming out of portals 00:46:05.350 --> 00:46:06.910 have some minimum velocity. 00:46:06.910 --> 00:46:09.860 So they always have some minimum velocity. 00:46:09.860 --> 00:46:14.590 And this works in lots of other parts of the game like the paint. 00:46:14.590 --> 00:46:17.090 And you can see here that there is some air 00:46:17.090 --> 00:46:21.920 resistance that takes place and the paint does slowly come down. 00:46:21.920 --> 00:46:25.330 But once it comes down to this minimum velocity, it just stays there. 00:46:25.330 --> 00:46:29.890 And this is-- it's like completely fabricated fiction. 00:46:29.890 --> 00:46:32.110 I guess there's no real physics for this. 00:46:32.110 --> 00:46:37.120 It's just kind of like this is more fun than trying to simulate real physics. 00:46:37.120 --> 00:46:39.370 So you can see here air resistance is making 00:46:39.370 --> 00:46:41.024 it go down, like they're slowing down. 00:46:41.024 --> 00:46:43.690 But once they get to the minimum velocity, they just stay there. 00:46:46.342 --> 00:46:47.180 This is about it. 00:46:47.180 --> 00:46:49.700 So once it gets here, it's just going to stay here. 00:46:49.700 --> 00:46:51.033 It's not going to go below that. 00:46:55.350 --> 00:46:59.920 And speaking of gels, the gels actually came up-- 00:46:59.920 --> 00:47:02.800 were an idea that we had for our student game 00:47:02.800 --> 00:47:05.057 that we made while we were in DigiPen. 00:47:05.057 --> 00:47:05.890 It was called "Tag-- 00:47:05.890 --> 00:47:08.830 The Power of Paint." 00:47:08.830 --> 00:47:15.040 And in Tag, you had a paint gun that you used to shoot the different colors. 00:47:15.040 --> 00:47:20.560 And the Portal 2 mechanic was adapted from this and it's pretty similar. 00:47:20.560 --> 00:47:23.350 But one of the things we did get rid of for Portal 2 00:47:23.350 --> 00:47:26.770 was the idea of having the paint gun. 00:47:26.770 --> 00:47:31.840 Because one of the core ideas we had while working on Portal 2 00:47:31.840 --> 00:47:36.760 was that any mechanics we add to the game should really work with portals 00:47:36.760 --> 00:47:41.980 and should really interact at a core level with portals. 00:47:41.980 --> 00:47:45.400 So we thought instead of using a gun to move the paint around, 00:47:45.400 --> 00:47:49.610 it will made much more sense to use the portals to move the paint around. 00:47:49.610 --> 00:47:53.230 And that was kind of core not just with the gels, but with any new mechanic 00:47:53.230 --> 00:47:54.370 we added to the game. 00:47:54.370 --> 00:47:57.470 Was that portals is the core idea of the games. 00:47:57.470 --> 00:48:00.340 Everything we do should kind of center around how portals work. 00:48:03.140 --> 00:48:06.650 I'm just showing you the different colors we had in Tag. 00:48:10.670 --> 00:48:14.240 One of the colors that we added in Portal that wasn't there in Tag 00:48:14.240 --> 00:48:16.370 was the portal gel. 00:48:16.370 --> 00:48:18.710 And this was again going with the idea of how 00:48:18.710 --> 00:48:21.920 do we make the gels and the portals interact better. 00:48:21.920 --> 00:48:24.780 So this one just lets you spread around white paint 00:48:24.780 --> 00:48:27.281 so you can put portals anywhere that the paint can go. 00:48:27.281 --> 00:48:29.030 And this is a pretty cool mechanic in that 00:48:29.030 --> 00:48:32.810 it allows for a lot more open-ended level design and a lot more player 00:48:32.810 --> 00:48:33.650 freedom. 00:48:33.650 --> 00:48:36.050 Because you can play portals essentially anywhere now. 00:48:36.050 --> 00:48:38.240 Because for a lot of the game we're restricting 00:48:38.240 --> 00:48:41.570 where the players can put portals on the black surface or the white surface. 00:48:41.570 --> 00:48:42.920 And this just allows-- 00:48:42.920 --> 00:48:46.730 you can just put white anywhere and put portals anywhere. 00:48:46.730 --> 00:48:50.000 We didn't use this a whole lot because it is pretty open-ended 00:48:50.000 --> 00:48:52.500 and it does break a lot of puzzle designs. 00:48:52.500 --> 00:48:56.180 But there are a few cases where we use it in a pretty open-ended way 00:48:56.180 --> 00:48:57.960 and have the player just kind of have fun. 00:48:57.960 --> 00:49:01.880 Spend some time painting the whole level and then figuring out what to do. 00:49:01.880 --> 00:49:04.755 And these kind of levels usually have a couple of different solutions 00:49:04.755 --> 00:49:07.213 because we don't know where the players are going to paint. 00:49:07.213 --> 00:49:10.627 So we just put a bunch of different ways to get to the exit and players. 00:49:10.627 --> 00:49:12.210 Some players figure out all the knobs. 00:49:12.210 --> 00:49:14.750 Some players find the first one and just go there. 00:49:14.750 --> 00:49:20.030 And it helps to break up the pacing a little bit from the conventional puzzle 00:49:20.030 --> 00:49:23.330 design with the specific spots where here are some white spots, here 00:49:23.330 --> 00:49:24.970 are some black spots. 00:49:24.970 --> 00:49:28.260 So it helps break that up a little bit. 00:49:28.260 --> 00:49:32.450 One of the things that didn't make it through from our student game 00:49:32.450 --> 00:49:36.860 was the sticky gel that you saw in the student version. 00:49:36.860 --> 00:49:38.960 So this is going to look a little bit broken 00:49:38.960 --> 00:49:41.960 because this is from a really old version of Portal 2 00:49:41.960 --> 00:49:45.230 because the sticky gel got cut pretty early on. 00:49:45.230 --> 00:49:47.810 And you're going to see some stuff here that doesn't really 00:49:47.810 --> 00:49:50.120 make sense, but just go with it. 00:49:52.910 --> 00:49:56.600 So you can see we used purple instead of blue here. 00:49:56.600 --> 00:50:00.350 So you can jump on-- you can walk on walls and stuff, which is pretty cool. 00:50:00.350 --> 00:50:03.720 So here you can see there's blue paint coming out of there 00:50:03.720 --> 00:50:06.110 but you can't see the actual paint blobs because there 00:50:06.110 --> 00:50:07.610 are invisible for some reason. 00:50:07.610 --> 00:50:09.230 I couldn't figure it out. 00:50:09.230 --> 00:50:12.744 But you can see the actual paint on the walls, on the floor. 00:50:12.744 --> 00:50:14.660 So this is just an idea of the kind of puzzles 00:50:14.660 --> 00:50:18.094 we were trying to come up with using sticky paint. 00:50:18.094 --> 00:50:20.010 There's an extra portal there for some reason. 00:50:20.010 --> 00:50:21.960 Ignore it. 00:50:21.960 --> 00:50:24.119 This is a really old version of the game. 00:50:24.119 --> 00:50:26.660 So this is the kind of puzzles we are trying to come up with. 00:50:26.660 --> 00:50:32.870 Of combining the different paint colors and portals together. 00:50:32.870 --> 00:50:35.810 But we did end up cutting this feature though. 00:50:35.810 --> 00:50:37.860 There were a few different reasons. 00:50:37.860 --> 00:50:41.060 One of them was obviously it is quite disorienting. 00:50:41.060 --> 00:50:43.970 You can see going up a wall and trying to figure out where 00:50:43.970 --> 00:50:45.950 the ceiling is, where the floor is. 00:50:45.950 --> 00:50:48.640 Especially in a lot of these levels where 00:50:48.640 --> 00:50:50.270 they're mostly just black and white. 00:50:50.270 --> 00:50:53.795 It gets pretty disorienting and we had more than a few play 00:50:53.795 --> 00:50:55.970 testers complain about that. 00:50:55.970 --> 00:51:00.710 But the other big reason that we cut it is because it didn't really 00:51:00.710 --> 00:51:02.470 interact well with portals. 00:51:02.470 --> 00:51:04.220 You don't really want to walk into a level 00:51:04.220 --> 00:51:07.130 and have the pots already placed for you. 00:51:07.130 --> 00:51:11.540 And there's no real good way to make pots on the entire wall 00:51:11.540 --> 00:51:15.740 without having to place the portal like 50 times. 00:51:15.740 --> 00:51:20.150 And also it didn't really interact well with the portal player 00:51:20.150 --> 00:51:24.080 physics and portal physics, and Dave will talk some more about the player 00:51:24.080 --> 00:51:25.730 physics through portals. 00:51:25.730 --> 00:51:30.020 And this is one of the things that you can see. 00:51:30.020 --> 00:51:33.250 We had a paint gun for a little bit, but we ended up cutting it. 00:51:33.250 --> 00:51:36.050 So you can see I'm painting the wall over here 00:51:36.050 --> 00:51:39.140 and I'm going to walk on the wall. 00:51:39.140 --> 00:51:41.690 But as I enter the blue portal, you can see oh, it's 00:51:41.690 --> 00:51:43.020 not going to let me go through. 00:51:43.020 --> 00:51:45.020 But if I go through this way, it works. 00:51:45.020 --> 00:51:47.720 And that's just one of the things that's like, well, we've got to solve this. 00:51:47.720 --> 00:51:48.620 We've got to ship like this. 00:51:48.620 --> 00:51:50.030 We've got to solve the problems. 00:51:50.030 --> 00:51:53.310 And we spent some time trying to work on these issues. 00:51:53.310 --> 00:51:56.060 But at some point, you realize that you're not 00:51:56.060 --> 00:51:59.190 guaranteed to solve these problems no matter how long you spend on them. 00:51:59.190 --> 00:52:01.190 So at some point you've got to just be like, OK, 00:52:01.190 --> 00:52:03.350 I don't want to spend an extra month or two 00:52:03.350 --> 00:52:06.610 trying to fix these problems not knowing if you'll get there. 00:52:06.610 --> 00:52:09.360 And plus there's other reasons why the mechanic isn't working out. 00:52:09.360 --> 00:52:13.790 So let's just stop working on this and work on other stuff instead. 00:52:13.790 --> 00:52:15.980 Another thing we ended up cutting-- 00:52:15.980 --> 00:52:20.360 this is from Portal 1 that was present in Narbacular Drop was the ability 00:52:20.360 --> 00:52:23.780 to place portals through portals. 00:52:23.780 --> 00:52:26.660 And it's a pretty confusing thing and that 00:52:26.660 --> 00:52:29.090 was the main reason we cut it because most players just 00:52:29.090 --> 00:52:30.890 thought it was way too confusing. 00:52:30.890 --> 00:52:33.723 Because you're placing the blue portal by looking through the orange 00:52:33.723 --> 00:52:34.250 portal here. 00:52:34.250 --> 00:52:35.974 So the blue portal is-- 00:52:35.974 --> 00:52:39.140 he's pointing through the orange portal here and facing the blue portal over 00:52:39.140 --> 00:52:42.630 here because the other blue portal is behind them. 00:52:42.630 --> 00:52:44.780 It's just like-- it's too confusing. 00:52:44.780 --> 00:52:46.790 And also it doesn't-- 00:52:46.790 --> 00:52:53.000 there's not a lot of puzzle design that you lose by disabling this feature. 00:52:53.000 --> 00:52:56.480 The thing you do gain is players aren't getting super confused 00:52:56.480 --> 00:52:59.450 and also you're not necessarily cutting a bunch of puzzles 00:52:59.450 --> 00:53:01.220 that you can't make now. 00:53:01.220 --> 00:53:03.800 So this feature got cut as well. 00:53:03.800 --> 00:53:07.410 And this is something that we didn't really cut, 00:53:07.410 --> 00:53:11.980 but we stopped using in Portal 2 that was used a little bit in Portal 1 00:53:11.980 --> 00:53:14.062 was the idea of a double fling. 00:53:14.062 --> 00:53:16.230 And I'm going to show it here. 00:53:16.230 --> 00:53:19.190 So double fling is basically placing a portal 00:53:19.190 --> 00:53:21.860 while you're falling out of a portal. 00:53:21.860 --> 00:53:25.190 And it's one of those things that it works pretty well. 00:53:25.190 --> 00:53:26.450 It's a pretty cool mechanic. 00:53:26.450 --> 00:53:29.090 And it was used in a few spots in Portal 1. 00:53:29.090 --> 00:53:32.210 A couple of puzzles required it, like this puzzle here required you 00:53:32.210 --> 00:53:33.890 to do this double fling. 00:53:33.890 --> 00:53:37.610 But one of the things we noticed was a lot of players 00:53:37.610 --> 00:53:42.380 have difficulty in executing a lot of these super hyper-sized, 00:53:42.380 --> 00:53:44.630 high-precision movements even though they know 00:53:44.630 --> 00:53:46.190 what the solution of the puzzle is. 00:53:46.190 --> 00:53:49.820 So players will walk in this room and figure out, OK, I've got to do this, 00:53:49.820 --> 00:53:51.890 I've got to do that, and this is going to work. 00:53:51.890 --> 00:53:54.590 But then a lot of players have trouble walking out of a portal, 00:53:54.590 --> 00:53:58.040 making a portal as quickly, and it adds a lot of stress. 00:53:58.040 --> 00:54:01.940 And we wanted to move away from a lot of the twitch movement based stuff 00:54:01.940 --> 00:54:05.239 and towards more of a kind of, aha, I got it. 00:54:05.239 --> 00:54:06.030 That kind of stuff. 00:54:06.030 --> 00:54:09.720 And once you get it, we don't want you to spend a bunch of time 00:54:09.720 --> 00:54:13.144 in making sure you get the precise movements right. 00:54:13.144 --> 00:54:14.810 So this feature we didn't really cut it. 00:54:14.810 --> 00:54:16.850 It's still a mechanic that works in Portal 2, 00:54:16.850 --> 00:54:19.370 but none of the puzzles in Portal 2 required it anymore. 00:54:19.370 --> 00:54:22.460 And once we added the level editor, a lot of the puzzles people 00:54:22.460 --> 00:54:26.100 are making do require it and a lot of players like it. 00:54:26.100 --> 00:54:31.100 But it's not something that we thought we wanted to make everyone have to do. 00:54:33.870 --> 00:54:38.360 Another thing that we changed from Portal 1 to Portal 2 00:54:38.360 --> 00:54:41.735 was these energy balls. 00:54:41.735 --> 00:54:45.140 These energy balls at the time-- 00:54:45.140 --> 00:54:47.510 part of the reason we used them in Portal 1 00:54:47.510 --> 00:54:51.410 was because they were there in Half-Life and it 00:54:51.410 --> 00:54:56.760 was an already created mechanic that we had that we could just keep from them. 00:54:56.760 --> 00:55:00.610 But the basic mechanic is these things fire-- 00:55:00.610 --> 00:55:03.890 these things fire this ball that bounces around 00:55:03.890 --> 00:55:07.794 and it needs to go in this receptacle here under my gun right now. 00:55:07.794 --> 00:55:10.460 And it should go in this receptacle here and once it goes there, 00:55:10.460 --> 00:55:12.507 it finishes the puzzle. 00:55:12.507 --> 00:55:14.590 There are a few issues with this mechanic, though, 00:55:14.590 --> 00:55:17.720 in that there's a bunch of timing element involved here. 00:55:17.720 --> 00:55:19.760 Because the ball takes time to travel. 00:55:19.760 --> 00:55:23.340 And also if you get hit by it, you die. 00:55:23.340 --> 00:55:25.500 Which, I mean, it's fine. 00:55:25.500 --> 00:55:26.900 It's a game mechanic 00:55:26.900 --> 00:55:31.050 But for Portal 2, we just thought, how can we improve on this idea? 00:55:31.050 --> 00:55:37.480 And the thing we came up with was using lasers instead of the energy balls. 00:55:37.480 --> 00:55:40.820 Lower the volume a little bit. 00:55:40.820 --> 00:55:43.190 So here you can see it it's the same level from Portal 1 00:55:43.190 --> 00:55:46.400 and you can even see the energy ball dispenser going away and being replaced 00:55:46.400 --> 00:55:49.025 by a laser because we want to make sure the player is 00:55:49.025 --> 00:55:51.320 like, GLaDOS is improving these mechanics now 00:55:51.320 --> 00:55:54.000 and got better versions of it. 00:55:54.000 --> 00:55:58.280 So the laser effectively is very similar to the energy ball. 00:55:58.280 --> 00:56:00.470 It goes in one and you want it-- 00:56:00.470 --> 00:56:04.850 it goes in over here and you want it to go to the receptacle over there. 00:56:04.850 --> 00:56:10.950 The big advantage here is that the reaction is instant. 00:56:10.950 --> 00:56:14.040 So if the player got the solution or not, it's instantaneous. 00:56:14.040 --> 00:56:17.380 You don't have to have situations where you place the exit portal 00:56:17.380 --> 00:56:20.690 and now you have to wait for the ball to go all the way across the level 00:56:20.690 --> 00:56:22.220 and see if it lines up or not. 00:56:22.220 --> 00:56:24.140 This way it just instantly does it. 00:56:24.140 --> 00:56:28.280 Plus it also opens up a bunch of different game play opportunities 00:56:28.280 --> 00:56:31.040 because now you can use multiple relays in the same level. 00:56:31.040 --> 00:56:33.440 You can have the cube that redirects the laser. 00:56:33.440 --> 00:56:37.110 So overall it felt like an improvement over the energy ball. 00:56:39.840 --> 00:56:44.380 And talking about lasers, so far we've been 00:56:44.380 --> 00:56:46.630 talking about a bunch of these smaller decisions we've 00:56:46.630 --> 00:56:51.640 made to solve these smaller problems as they kept coming up, like entering 00:56:51.640 --> 00:56:55.330 exiting portals, making sure things are lined up or not, 00:56:55.330 --> 00:56:57.792 improving on the specific game mechanics. 00:56:57.792 --> 00:56:59.500 But one of the things that you need to do 00:56:59.500 --> 00:57:01.810 when you're trying to make a whole game is 00:57:01.810 --> 00:57:07.900 to see how these mechanics come together and how you can combine them together 00:57:07.900 --> 00:57:09.160 to make a whole game. 00:57:09.160 --> 00:57:13.480 To make a few puzzles that increase into difficulty, complexity, 00:57:13.480 --> 00:57:15.760 and go towards some crescendo. 00:57:15.760 --> 00:57:21.510 And one of the ways we did that is by kind of using this kind of process 00:57:21.510 --> 00:57:23.290 that I'm going to go through. 00:57:23.290 --> 00:57:26.800 And we used it a couple of times both in Portal 1 and in Portal 2. 00:57:26.800 --> 00:57:30.280 And there's a few different mechanics that we used the cycle over and over 00:57:30.280 --> 00:57:31.030 for. 00:57:31.030 --> 00:57:35.770 And that's kind of how the entire game track is designed. 00:57:35.770 --> 00:57:39.220 So it starts off with an introduction, and the introduction 00:57:39.220 --> 00:57:40.740 is the puzzle we just showed you. 00:57:40.740 --> 00:57:43.739 That's the intro puzzle for lasers and it's really straightforward. 00:57:43.739 --> 00:57:45.030 It just shows you the mechanic. 00:57:45.030 --> 00:57:48.344 You go through one portal, come out the other, goes into the receptacle. 00:57:48.344 --> 00:57:49.510 It's really straightforward. 00:57:49.510 --> 00:57:50.860 Introduces the mechanic. 00:57:50.860 --> 00:57:53.080 Most people would get tripped up on this. 00:57:53.080 --> 00:57:56.620 From there, we then try to saturate the player with that same mechanic. 00:57:56.620 --> 00:57:59.920 We introduce different twists on that same-- 00:57:59.920 --> 00:58:01.630 without introducing a whole new mechanic, 00:58:01.630 --> 00:58:06.250 we just introduce different versions, different tweaks on that same idea. 00:58:06.250 --> 00:58:08.450 So this room still only has lasers. 00:58:08.450 --> 00:58:11.260 But now we've introduced relays and cubes. 00:58:11.260 --> 00:58:17.389 And you can experiment, figure out how to connect the three lasers together. 00:58:17.389 --> 00:58:19.180 Figure out how to move the cube, figure out 00:58:19.180 --> 00:58:22.000 how to move the laser through the portals. 00:58:22.000 --> 00:58:23.490 But still it's only lasers. 00:58:23.490 --> 00:58:25.630 Nothing super complex yet. 00:58:25.630 --> 00:58:26.920 Then we give you more of that. 00:58:26.920 --> 00:58:29.330 We give you more of just the same mechanic. 00:58:29.330 --> 00:58:33.930 Here there's two things firing lasers and two things you've got to connect. 00:58:33.930 --> 00:58:35.150 And so it's the same idea. 00:58:35.150 --> 00:58:38.710 It's like just using lasers, but not super complex. 00:58:38.710 --> 00:58:42.010 Just building on the complexity little by little. 00:58:42.010 --> 00:58:44.069 Followed by a puzzle that's like, OK, this 00:58:44.069 --> 00:58:46.360 is a puzzle that's going to teach you all about lasers. 00:58:46.360 --> 00:58:49.570 By now you've seen lasers in a few different ways. 00:58:49.570 --> 00:58:52.810 This one, once you get this, you understand how lasers work. 00:58:52.810 --> 00:58:56.620 You know everything there is to know about how lasers work. 00:58:56.620 --> 00:58:57.990 So this puzzle here-- 00:58:57.990 --> 00:59:01.280 excuse me-- that's two cubes and three things firing lasers, 00:59:01.280 --> 00:59:04.051 and on the other side of the puzzle there's 00:59:04.051 --> 00:59:05.800 three things-- you've got to connect them. 00:59:05.800 --> 00:59:09.680 And this puzzle is very difficult, but by this point, 00:59:09.680 --> 00:59:11.830 you've been slowly introduced to different ideas 00:59:11.830 --> 00:59:15.410 of how lasers work and this one is taking them all together. 00:59:15.410 --> 00:59:18.640 And then once we've done that, then we start combining them. 00:59:18.640 --> 00:59:20.700 Then we start taking, OK, now you've got a laser 00:59:20.700 --> 00:59:22.790 and a different cube and a bridge. 00:59:22.790 --> 00:59:25.700 And by this point you've seen a whole separate-- 00:59:25.700 --> 00:59:28.770 we've done the whole introduction, saturation, graduation track 00:59:28.770 --> 00:59:30.410 with bridges as well. 00:59:30.410 --> 00:59:32.980 So by this point, you go in there and, OK, I 00:59:32.980 --> 00:59:34.910 know how bridges, I know how lasers work. 00:59:34.910 --> 00:59:36.290 How do they work together? 00:59:36.290 --> 00:59:38.830 How do I combine them together? 00:59:38.830 --> 00:59:41.740 And then we start escalating from there. 00:59:41.740 --> 00:59:45.340 And then you go into this puzzle that has a bridge, has a laser, 00:59:45.340 --> 00:59:48.490 has a turret, has some cubes coming out, has a catapult, 00:59:48.490 --> 00:59:49.736 has a bunch of this stuff. 00:59:49.736 --> 00:59:51.610 But by the time the player gets here, they're 00:59:51.610 --> 00:59:53.800 not really overwhelmed by it because they 00:59:53.800 --> 00:59:56.650 have been introduced to all these mechanics separately and also 00:59:56.650 --> 00:59:58.370 smaller combinations of them. 00:59:58.370 --> 01:00:00.277 So that when they get to this point where 01:00:00.277 --> 01:00:02.110 there's a bunch of different mechanics, they 01:00:02.110 --> 01:00:04.340 know how they all work individually. 01:00:04.340 --> 01:00:08.020 And that's kind of the process that we use of slowly ramping up 01:00:08.020 --> 01:00:12.220 the difficulty, first with a single mechanic, then combining them. 01:00:12.220 --> 01:00:15.961 And then that's kind of how we take the individual smaller design elements 01:00:15.961 --> 01:00:18.460 and combine them together and turn them into the whole game. 01:00:20.934 --> 01:00:24.100 And now I think Dave is going to come back and talk some more about physics. 01:00:29.320 --> 01:00:32.780 DAVE KIRCHER: And after I cover these last four bits of physics, 01:00:32.780 --> 01:00:34.540 we're going to open up for questions. 01:00:34.540 --> 01:00:37.480 I know we have a whole miscellaneous section that we've outlined here, 01:00:37.480 --> 01:00:39.520 but that's more just buffer material. 01:00:39.520 --> 01:00:44.260 So I'm hoping you're going to put your spatial thinking caps back on. 01:00:44.260 --> 01:00:50.930 So how we handle portal transitions is there's two distinct methods. 01:00:50.930 --> 01:00:54.670 One is that we've got volumes here, which we call touch volumes or trigger 01:00:54.670 --> 01:00:55.570 volumes. 01:00:55.570 --> 01:00:58.690 And those are centered around the portal. 01:00:58.690 --> 01:01:02.177 So I've got my blue portal here and that was green volumes here. 01:01:02.177 --> 01:01:04.510 And you'll notice it's entirely in front of the portal-- 01:01:04.510 --> 01:01:05.620 that's important. 01:01:05.620 --> 01:01:07.780 And then we've got this yellow volume here. 01:01:07.780 --> 01:01:10.840 So the yellow volume is-- 01:01:10.840 --> 01:01:13.960 it's whole job is to tell us which objects in the world 01:01:13.960 --> 01:01:16.997 are just kind of close to a portal, and I'll come back 01:01:16.997 --> 01:01:18.580 to why that's important to the minute. 01:01:18.580 --> 01:01:21.490 But it separates us from having to think about objects 01:01:21.490 --> 01:01:25.204 that are way out in the world all over in the white space around here. 01:01:25.204 --> 01:01:26.620 We don't have to think about them. 01:01:26.620 --> 01:01:29.020 And we also know they're not objects behind the portal 01:01:29.020 --> 01:01:32.690 because we're only interested in stuff that happens in front of the portal. 01:01:32.690 --> 01:01:36.500 And this green volume here is where most of the magic happens. 01:01:36.500 --> 01:01:40.349 This volume says the objects in it are so close to a portal 01:01:40.349 --> 01:01:43.390 we need to think very hard about what they can do and what they can't do. 01:01:43.390 --> 01:01:47.260 We're going to let those objects start passing through the portal. 01:01:47.260 --> 01:01:50.650 And so we keep these objects in two separate lists. 01:01:50.650 --> 01:01:55.270 Objects that are in this green volume no longer intersect with any objects 01:01:55.270 --> 01:01:56.620 out in the white space out here. 01:01:56.620 --> 01:01:58.119 They don't have to think about them. 01:01:58.119 --> 01:01:59.890 They're kept in a completely separate list 01:01:59.890 --> 01:02:02.230 and they don't collide with them at all. 01:02:02.230 --> 01:02:04.720 They also don't collide with world geometry. 01:02:04.720 --> 01:02:05.960 I'll get to that in a bit. 01:02:05.960 --> 01:02:07.720 And then objects in this yellow volume are 01:02:07.720 --> 01:02:10.780 the only ones that the objects in the green volume have to worry about. 01:02:10.780 --> 01:02:14.370 So these are objects that are just kind of close to a portal. 01:02:14.370 --> 01:02:18.430 And so another important interaction with portals is ray casting. 01:02:18.430 --> 01:02:22.660 So we're only interested in rays that pass through the portal quad. 01:02:22.660 --> 01:02:25.445 So if a ray happens to just pass the portal plane, 01:02:25.445 --> 01:02:27.820 but not intersect the quad, we don't do anything with it. 01:02:27.820 --> 01:02:28.690 It's not special. 01:02:28.690 --> 01:02:30.689 We just treat it like any other ray in the world 01:02:30.689 --> 01:02:32.234 and let it do its merry thing. 01:02:32.234 --> 01:02:33.400 But we got this magenta guy. 01:02:33.400 --> 01:02:35.050 It intersects with the portal. 01:02:35.050 --> 01:02:39.400 So now we have to recast a new ray out the other orange portal which 01:02:39.400 --> 01:02:41.620 essentially gives us two ray segments. 01:02:41.620 --> 01:02:44.710 And if you think about that, if you were to write any piece of code that 01:02:44.710 --> 01:02:48.014 just did the ray casting and hand back two ray segments 01:02:48.014 --> 01:02:51.180 when somebody was expecting one, you're probably going to get weird results. 01:02:51.180 --> 01:02:53.551 So this means, the fact that this is happening, 01:02:53.551 --> 01:02:56.800 means that we have to go through every single system in the game that possibly 01:02:56.800 --> 01:03:00.380 casts a ray through a portal and fix every single one to understand. 01:03:00.380 --> 01:03:04.060 But if we give you back multiple segments, different things happen. 01:03:04.060 --> 01:03:06.755 Instead of assuming that this starting point goes directly 01:03:06.755 --> 01:03:09.130 to this end point, which doesn't even go in the direction 01:03:09.130 --> 01:03:12.070 it wanted to in the first place. 01:03:12.070 --> 01:03:14.950 And so at its core, remember how I told you 01:03:14.950 --> 01:03:17.590 every object had an origin, a single point that 01:03:17.590 --> 01:03:20.110 defines where it is in space. 01:03:20.110 --> 01:03:23.170 We use the ray casting to determine if an object that's 01:03:23.170 --> 01:03:25.700 in this green volume and just kind of moving around. 01:03:25.700 --> 01:03:27.699 We use a recast from one point where it was 01:03:27.699 --> 01:03:29.740 one frame to one point where it was another frame 01:03:29.740 --> 01:03:33.160 to see if it either passed through a portal or outside the portal 01:03:33.160 --> 01:03:36.070 because if it went over this way, we do nothing at all. 01:03:36.070 --> 01:03:38.020 If we went this way, we need to teleport it. 01:03:38.020 --> 01:03:39.970 So that's the basics of our handling. 01:03:44.860 --> 01:03:48.430 So how do we let objects pass through walls? 01:03:48.430 --> 01:03:51.040 This is one of the things I spent a whole lot of time 01:03:51.040 --> 01:03:54.141 on because we wanted our portal transitions to be very seamless. 01:03:54.141 --> 01:03:56.140 Remember in one of my first slides I showed you. 01:03:56.140 --> 01:03:57.181 It should be like a door. 01:03:57.181 --> 01:04:00.070 People expect to walk halfway through the door and just stand there. 01:04:00.070 --> 01:04:01.830 And how we do this is-- 01:04:01.830 --> 01:04:04.330 I'm going to talk about it a bit first. 01:04:04.330 --> 01:04:07.630 Whenever you place a portal, we take a snapshot of all the world geometry 01:04:07.630 --> 01:04:11.110 around you and create a very small representation of that 01:04:11.110 --> 01:04:12.790 and carve a hole in it. 01:04:12.790 --> 01:04:16.360 And we don't do this for the entire world because that takes way too long. 01:04:16.360 --> 01:04:19.780 And by way too long, I mean a quarter of a second. 01:04:19.780 --> 01:04:23.345 And in game terms, that's just way too long. 01:04:23.345 --> 01:04:25.220 I don't know if it was a quarter of a second. 01:04:25.220 --> 01:04:27.430 I remember originally that we had a problem where 01:04:27.430 --> 01:04:29.320 I think carving the mini-version took a quarter of a second, 01:04:29.320 --> 01:04:31.250 so it probably took several seconds. 01:04:31.250 --> 01:04:34.570 So I'm going to show you a scenario here where I've got a portal 01:04:34.570 --> 01:04:35.740 and it's going into-- 01:04:35.740 --> 01:04:40.510 it's going along this corridor gateway, gangplank thing. 01:04:40.510 --> 01:04:43.939 And it's going to go into this little classroom area. 01:04:43.939 --> 01:04:45.730 And as I go back around the wall, I'm going 01:04:45.730 --> 01:04:51.130 to show you a debug mesh of our collision representation. 01:04:51.130 --> 01:04:54.430 So in this debug representation, we've got these green lines. 01:04:54.430 --> 01:04:57.460 These green lines and then also these cyan lines-- 01:04:57.460 --> 01:04:58.960 or I'm probably mispronouncing that. 01:04:58.960 --> 01:05:02.020 I call them bluish, but my colleague has told me I need to call him cyan. 01:05:02.020 --> 01:05:03.370 [CHUCKLING] 01:05:04.529 --> 01:05:06.070 So I'm going to call them bluish now. 01:05:06.070 --> 01:05:11.420 So these green lines and the blue lines are in local space. 01:05:11.420 --> 01:05:13.990 So they're with the blue portal that we placed locally. 01:05:13.990 --> 01:05:15.910 And I know it's super hard to see, but there 01:05:15.910 --> 01:05:18.910 are a bunch of red lines over here and some magenta ones. 01:05:18.910 --> 01:05:23.140 Those are from the other portal that's in the classroom that 01:05:23.140 --> 01:05:26.420 are flipped and glued to the back of our local portal. 01:05:26.420 --> 01:05:28.960 So it's all in this local space and around this blue portal. 01:05:28.960 --> 01:05:33.470 We put some new stuff behind it and some new stuff in front of it. 01:05:33.470 --> 01:05:36.220 And so you may be asking yourself what the colors actually mean? 01:05:36.220 --> 01:05:42.670 Green here is representing a brush geometry, which most level editors, you 01:05:42.670 --> 01:05:47.050 can create walls and various shapes directly in the level editor. 01:05:47.050 --> 01:05:50.950 And at least in our terminology, we refer to these as brushes. 01:05:50.950 --> 01:05:55.920 So they're usually very simple convex shapes and super easy to deal with. 01:05:55.920 --> 01:05:58.660 And this bluish geometry is from what's known 01:05:58.660 --> 01:06:02.650 as a static prop, which is a model that somebody modeled in a model editor. 01:06:02.650 --> 01:06:04.690 So it's going to be arbitrarily complex, but it 01:06:04.690 --> 01:06:07.360 has to be made up of convex shapes. 01:06:07.360 --> 01:06:11.195 But we take a small snapshot of that and then carve it up. 01:06:11.195 --> 01:06:12.320 Sorry, I forgot to mention. 01:06:12.320 --> 01:06:15.640 So we call it a static prop because we are guaranteed it does not move. 01:06:15.640 --> 01:06:18.160 And that's very important because it's really easy to simulate things that 01:06:18.160 --> 01:06:18.600 don't move. 01:06:18.600 --> 01:06:19.266 They don't move. 01:06:22.860 --> 01:06:26.530 And the same is true of the red and magenta here. 01:06:26.530 --> 01:06:29.680 The red is the brush geometry on the paired portal side 01:06:29.680 --> 01:06:35.470 and the magenta is static props on the other side, which is mainly the desks. 01:06:35.470 --> 01:06:37.100 And as I'm looking through here. 01:06:37.100 --> 01:06:43.090 You can see just a small snapshot, and then you 01:06:43.090 --> 01:06:47.650 can see this magenta outline here of the desk mesh on the other side. 01:06:47.650 --> 01:06:50.860 It's important to know that that's not me looking at the mesh 01:06:50.860 --> 01:06:51.960 through the portal. 01:06:51.960 --> 01:06:53.710 That's the local space version and it just 01:06:53.710 --> 01:06:56.950 happens to line up the desk because we have to make sure everything lines up. 01:06:56.950 --> 01:06:59.116 Otherwise your physical interactions will seem weird 01:06:59.116 --> 01:07:01.000 if something is halfway in a portal and it's 01:07:01.000 --> 01:07:03.902 kind of not colliding with something or it's colliding with it wrong. 01:07:03.902 --> 01:07:05.860 As I walk through, you'll notice all the colors 01:07:05.860 --> 01:07:09.650 change because we switched spaces when I walk through in a second. 01:07:09.650 --> 01:07:13.720 So now all the colors are local space for this side. 01:07:13.720 --> 01:07:15.770 So, yeah, that is how we carve a hole. 01:07:15.770 --> 01:07:20.530 It's a very, very small area of the level that we carve a hole in. 01:07:20.530 --> 01:07:24.730 And so we're getting back to the volumes I showed you two slides ago. 01:07:24.730 --> 01:07:27.697 If we carve a small representation of the world, 01:07:27.697 --> 01:07:29.530 we have to know when the player is colliding 01:07:29.530 --> 01:07:31.540 with that versus the regular world. 01:07:31.540 --> 01:07:34.180 Because if they're colliding with the regular world, 01:07:34.180 --> 01:07:36.070 they're going to collide with the wall that's behind the portal 01:07:36.070 --> 01:07:37.695 and they're not going to go through it. 01:07:37.695 --> 01:07:40.599 So we have to use exclusively that carved version 01:07:40.599 --> 01:07:41.890 when they're close to a portal. 01:07:41.890 --> 01:07:44.680 And we do that-- we're using the same volumes I was talking about earlier. 01:07:44.680 --> 01:07:46.180 This is a 3D representation of them. 01:07:46.180 --> 01:07:48.195 And you'll notice that they have space-- 01:07:48.195 --> 01:07:50.320 a large amount of space above and below the portal. 01:07:50.320 --> 01:07:54.460 That's important because it's a 3D space instead of a 2D space. 01:07:54.460 --> 01:07:59.030 So as I enter the yellow space, I still collide with the world. 01:07:59.030 --> 01:08:03.010 I still collide with all the desks and things. 01:08:03.010 --> 01:08:06.010 Because I'm still-- while I'm exclusively in the yellow volume, 01:08:06.010 --> 01:08:07.814 I'm still colliding with the world. 01:08:07.814 --> 01:08:08.730 I'm going to show you. 01:08:08.730 --> 01:08:10.730 It's a bad example, but it's the video I've got. 01:08:10.730 --> 01:08:12.880 I'm going to hit this chair behind this desk 01:08:12.880 --> 01:08:14.620 because it's still in the real world. 01:08:14.620 --> 01:08:17.350 And then as I transition into the green volume, 01:08:17.350 --> 01:08:21.590 I am exclusively colliding with our carved version of it. 01:08:21.590 --> 01:08:24.880 Which-- that was a bad frame to cut. 01:08:24.880 --> 01:08:27.220 If I happen to look back in the portal-- 01:08:27.220 --> 01:08:28.990 which side is scrubbing? 01:08:28.990 --> 01:08:31.750 OK. 01:08:31.750 --> 01:08:34.510 Sorry. 01:08:34.510 --> 01:08:37.720 So if you happen to look inside the portal, you might be able to see it. 01:08:37.720 --> 01:08:39.886 There is-- I know it's super hard to see, I'm sorry. 01:08:39.886 --> 01:08:40.930 But we did carve a hole. 01:08:40.930 --> 01:08:43.730 There's no there's no geometry right here to stop us going in. 01:08:43.730 --> 01:08:45.729 And since we're exclusively using this new mesh, 01:08:45.729 --> 01:08:47.770 we're allowed to just go through that space. 01:08:51.020 --> 01:08:54.939 OK, so more importantly than static geometry, which 01:08:54.939 --> 01:08:57.189 doesn't move and is super easy to physically simulate, 01:08:57.189 --> 01:09:00.130 we have dynamic props and things that move. 01:09:00.130 --> 01:09:02.830 Specifically in this case, boxes. 01:09:02.830 --> 01:09:07.260 So the way we model this is very similar to how we did with geometry. 01:09:07.260 --> 01:09:09.310 We're going to be duplicating everything and I'm 01:09:09.310 --> 01:09:11.018 going to show you by walking in a portal. 01:09:11.018 --> 01:09:15.040 So this blue box that just appeared is my player. 01:09:15.040 --> 01:09:19.240 My player of physics object that's replicated from this orange portal 01:09:19.240 --> 01:09:21.649 to the backside of the blue portal. 01:09:21.649 --> 01:09:24.231 And this is using a system known as a physics shadow. 01:09:24.231 --> 01:09:25.689 At least that's what our system is. 01:09:25.689 --> 01:09:26.814 I'm not really a physicist. 01:09:26.814 --> 01:09:29.060 That's just what we call our representation of it. 01:09:29.060 --> 01:09:33.069 So I mean, I haven't dealt with many physics systems when I talk about that. 01:09:33.069 --> 01:09:36.220 So what a physics shadow does that's different 01:09:36.220 --> 01:09:39.700 than our rendering geometry is we're not allowed to actually teleport it 01:09:39.700 --> 01:09:42.220 from one frame to the next because if you teleport a physics 01:09:42.220 --> 01:09:44.700 object, then all sorts of interactions that intersect, 01:09:44.700 --> 01:09:46.410 they have no previous basis to go from. 01:09:46.410 --> 01:09:47.590 Of like how to solve that. 01:09:47.590 --> 01:09:50.950 They can't rewind time because they've suddenly teleported 01:09:50.950 --> 01:09:52.340 into an interpenetrating space. 01:09:52.340 --> 01:09:54.160 So all of our physics objects-- 01:09:54.160 --> 01:09:56.800 we give them a target of where they need to go. 01:09:56.800 --> 01:09:59.930 Sorry not all of our physics options are shadows. 01:09:59.930 --> 01:10:03.739 So just like the player volume and just the examples I'm about to give you. 01:10:03.739 --> 01:10:06.280 We told them where we want them to go and they try their best 01:10:06.280 --> 01:10:09.650 to apply forces and rotations to go there, but if it doesn't work, 01:10:09.650 --> 01:10:13.330 we're kind of SOL and they do their best. 01:10:13.330 --> 01:10:15.830 So I'm replicating that for the player over there. 01:10:15.830 --> 01:10:18.680 And we're also going to replicate it for the cubes in a second 01:10:18.680 --> 01:10:22.010 once I get around to placing them. 01:10:22.010 --> 01:10:24.760 And so it's important to note that we're not really 01:10:24.760 --> 01:10:27.910 solving the discontinuity in space because that 01:10:27.910 --> 01:10:31.000 would be way too hard, at least for a person of my skill level. 01:10:31.000 --> 01:10:34.240 What we're doing is we're saying each side has-- 01:10:34.240 --> 01:10:37.810 this cube over here is the master of it's physics and this cube over here 01:10:37.810 --> 01:10:39.550 is the master of its own physics. 01:10:39.550 --> 01:10:42.070 And this cube over here is just trying to replicate 01:10:42.070 --> 01:10:43.210 whatever this guy is doing. 01:10:43.210 --> 01:10:47.170 So they don't quite line up, but they work well enough. 01:10:47.170 --> 01:10:51.590 And in game development, good enough usually goes a long way. 01:10:51.590 --> 01:10:54.510 So as I'm using it, you might notice they don't quite work super well, 01:10:54.510 --> 01:10:57.010 but you can see that I've got this representation over here. 01:10:57.010 --> 01:11:00.550 I'm pushing it in my virtual version and it's all lining up kind of. 01:11:00.550 --> 01:11:03.740 And, yeah, that's how we do it in Portal. 01:11:03.740 --> 01:11:06.490 So I'm going to go ahead and tell you that I'm really glad that we 01:11:06.490 --> 01:11:09.531 didn't have levels with more than two cubes because if you try to do this 01:11:09.531 --> 01:11:12.280 with a train of cubes-- three or four-- 01:11:12.280 --> 01:11:13.360 it breaks down horribly. 01:11:13.360 --> 01:11:14.980 And this last little bit is me just showing you 01:11:14.980 --> 01:11:17.140 that we're not intersecting with anything in the back of it 01:11:17.140 --> 01:11:19.723 because we're not inside the green volume or the yellow volume 01:11:19.723 --> 01:11:21.089 because we're behind the portal. 01:11:21.089 --> 01:11:24.130 It's really important to manage your lists of what can interact with what 01:11:24.130 --> 01:11:28.900 when we're faking holes in space and overlapping space. 01:11:28.900 --> 01:11:32.480 I spent a whole lot of time on this. 01:11:32.480 --> 01:11:35.290 And I think that is the end of our physics material. 01:11:35.290 --> 01:11:38.250 So we had some more miscellaneous filler material, 01:11:38.250 --> 01:11:41.460 but it looks like we've ran over a little bit of our initial time. 01:11:41.460 --> 01:11:43.410 So we're going to open up to Q&A now. 01:11:43.410 --> 01:11:45.460 We might get to our miscellaneous material later. 01:11:45.460 --> 01:11:50.610 But, yeah, if anybody has got questions, now would be a good time. 01:11:53.482 --> 01:11:56.901 AUDIENCE: Could you talk a little bit about how lights interact with portals, 01:11:56.901 --> 01:12:00.720 or just lighting on objects and, like, will you get shadows from the portal? 01:12:00.720 --> 01:12:03.747 DAVE KIRCHER: So originally, I had a slide on that. 01:12:03.747 --> 01:12:05.580 TEJEEV KOHLI: The question was about lights. 01:12:05.580 --> 01:12:06.580 DAVE KIRCHER: Oh, sorry. 01:12:06.580 --> 01:12:07.410 Yes, sorry. 01:12:07.410 --> 01:12:11.460 The question was how lights interact with portals and shadows and things. 01:12:11.460 --> 01:12:15.069 So I'm going to preface with saying that most of this stuff I did a decade ago. 01:12:15.069 --> 01:12:17.610 So if I say something that's not true, I'm not trying to lie. 01:12:17.610 --> 01:12:19.230 I just don't remember it. 01:12:19.230 --> 01:12:22.080 So basically there was a time during Portal 1 01:12:22.080 --> 01:12:25.200 where we tried very hard to make light work through portals 01:12:25.200 --> 01:12:27.450 and we kind of settled on a cheap solution. 01:12:27.450 --> 01:12:30.990 Where we would define a point barely in front of one portal, 01:12:30.990 --> 01:12:33.780 see what lights were projecting what amount of color on that, 01:12:33.780 --> 01:12:37.170 and just kind of make it a massive sphere on the other side that 01:12:37.170 --> 01:12:38.880 would kind of do that. 01:12:38.880 --> 01:12:41.760 So the downside was is that you only noticed it 01:12:41.760 --> 01:12:45.150 in cases that were very high contrast, which is also the case in where 01:12:45.150 --> 01:12:46.200 it was the most broken. 01:12:46.200 --> 01:12:49.162 So we just don't do it. 01:12:49.162 --> 01:12:51.120 TEJEEV KOHLI: On Portal 2, we tried for a while 01:12:51.120 --> 01:12:54.330 to have the portals themselves project light on things 01:12:54.330 --> 01:12:56.610 and that was also kind of broken for a while. 01:12:56.610 --> 01:12:58.769 And then we just took it out. 01:12:58.769 --> 01:13:00.810 DAVE KIRCHER: Yes, so we just punted on that one. 01:13:00.810 --> 01:13:03.630 Too hard. 01:13:03.630 --> 01:13:05.139 TEJEEV KOHLI: Any other questions? 01:13:05.139 --> 01:13:06.633 Yeah, sure. 01:13:06.633 --> 01:13:08.632 AUDIENCE: What were the performance implications 01:13:08.632 --> 01:13:12.910 of having to draw on that stencil buffer multiple times? 01:13:12.910 --> 01:13:16.880 DAVE KIRCHER: So the question was what were the performance 01:13:16.880 --> 01:13:21.440 implications of having to draw multiple scenes with the stencil buffer. 01:13:21.440 --> 01:13:27.351 So it's very analogous having to just draw a more complex scene. 01:13:27.351 --> 01:13:29.100 You're just drawing more quads and things. 01:13:29.100 --> 01:13:31.080 On one of the slides in our miscellaneous section-- 01:13:31.080 --> 01:13:31.720 you know what? 01:13:31.720 --> 01:13:33.428 Why don't I just go ahead and jump to it? 01:13:35.800 --> 01:13:37.100 So it's very important. 01:13:37.100 --> 01:13:40.240 So when we're rendering things in a 3D space, 01:13:40.240 --> 01:13:41.770 we have what's known as a frustum. 01:13:41.770 --> 01:13:44.552 It's kind of a pyramid, which comes out from your camera. 01:13:44.552 --> 01:13:47.260 And you can use it as a very quick test to see if you should even 01:13:47.260 --> 01:13:48.950 bother rendering something at all. 01:13:48.950 --> 01:13:49.690 So I've got-- 01:13:49.690 --> 01:13:50.800 I'm going to use my side-- 01:13:50.800 --> 01:13:51.640 my sides. 01:13:51.640 --> 01:13:54.070 The sides are defined by the screen itself. 01:13:54.070 --> 01:13:56.620 So the screen that you're drawing has a top, has a bottom, 01:13:56.620 --> 01:13:58.810 so those project into space. 01:13:58.810 --> 01:14:01.904 So we take our one side we can say, OK, if an object is completely 01:14:01.904 --> 01:14:03.820 on the other side of this plane, we don't even 01:14:03.820 --> 01:14:05.200 need to bother trying to draw it. 01:14:05.200 --> 01:14:06.549 We can just skip it. 01:14:06.549 --> 01:14:08.590 And so one of the optimizations we have in Portal 01:14:08.590 --> 01:14:11.020 is that every time you look through a portal, 01:14:11.020 --> 01:14:14.990 we can find the frustum to a smaller space. 01:14:14.990 --> 01:14:18.160 I took the easy route in that I kept it as an object that 01:14:18.160 --> 01:14:20.830 still had four distinct sides. 01:14:20.830 --> 01:14:22.450 So sometimes it's a little bit broken. 01:14:22.450 --> 01:14:24.792 But in this case, you can see-- 01:14:24.792 --> 01:14:27.250 in this case, you can see I'm looking through a blue portal 01:14:27.250 --> 01:14:28.654 at this little button here. 01:14:28.654 --> 01:14:30.820 And I've got this-- it's probably impossible to see, 01:14:30.820 --> 01:14:32.740 but I've got this mesh coming out. 01:14:32.740 --> 01:14:35.800 This is the updated frustum of everything we try to draw. 01:14:35.800 --> 01:14:38.890 So you can see it mostly just encapsulates a little bit of level 01:14:38.890 --> 01:14:42.820 and the button itself, and that helps us not even attempt to draw 01:14:42.820 --> 01:14:45.140 the complete scene over and over again. 01:14:45.140 --> 01:14:49.030 But I don't think I ever did a performance analysis, 01:14:49.030 --> 01:14:50.590 so I can't give you concrete numbers. 01:14:50.590 --> 01:14:55.480 But it was better than trying to draw the entire scene over and over again. 01:14:55.480 --> 01:15:00.100 Because since we still had the depth buffer on our side, 01:15:00.100 --> 01:15:01.827 we had already drawn most of the screen. 01:15:01.827 --> 01:15:03.910 And then we also had the stencil buffer telling us 01:15:03.910 --> 01:15:06.430 not to even attempt to draw most of the pixels. 01:15:06.430 --> 01:15:10.540 It was not nearly as bad as trying to render the entire scene. 01:15:10.540 --> 01:15:13.487 But we did find that for the graphics cards of the day, which not even 01:15:13.487 --> 01:15:15.070 all of them supported stencil buffers. 01:15:15.070 --> 01:15:18.700 Some people that played Portal 1, they got textures. 01:15:18.700 --> 01:15:20.890 We found it was best to just limit to two recursions 01:15:20.890 --> 01:15:24.610 because we could do our depth, or we could do our recursion fake 01:15:24.610 --> 01:15:25.820 and it worked pretty well. 01:15:25.820 --> 01:15:27.611 And I don't think it was terribly expensive 01:15:27.611 --> 01:15:28.930 even for the cards of the day. 01:15:28.930 --> 01:15:31.490 TEJEEV KOHLI: I know there were cases during Portal 2 01:15:31.490 --> 01:15:34.000 when we were trying to make it work on consoles, 01:15:34.000 --> 01:15:35.450 there was a lot of proof tests. 01:15:35.450 --> 01:15:37.927 There were four cases, especially in co-op, 01:15:37.927 --> 01:15:41.260 when you're playing in split-screen with four portals on screen at the same time 01:15:41.260 --> 01:15:42.660 all looking at each other. 01:15:42.660 --> 01:15:46.420 It's like 16 views being rendered of the entire world at the same time. 01:15:46.420 --> 01:15:48.670 And there were these like weird edge cases where like, 01:15:48.670 --> 01:15:51.280 if you do that, you get two frames per second. 01:15:51.280 --> 01:15:52.574 Just don't do that. 01:15:52.574 --> 01:15:54.270 [LAUGHING] 01:15:54.830 --> 01:15:57.450 There was a few things in levels that had changed where-- 01:15:57.450 --> 01:15:59.440 like the corner case was the worst. 01:15:59.440 --> 01:16:01.840 Where if you have a wall like that and you 01:16:01.840 --> 01:16:05.830 can put a portal right next to each other on both sides of the corner. 01:16:05.830 --> 01:16:09.550 So we had a couple of cases where we had to actually change the levels 01:16:09.550 --> 01:16:11.720 to not have those cases. 01:16:11.720 --> 01:16:12.540 So you can't play-- 01:16:12.540 --> 01:16:16.070 so we just moved the corners apart like 16 units or whatever. 01:16:16.070 --> 01:16:19.930 So you can't always see both portals through both the views. 01:16:19.930 --> 01:16:23.050 So there was stuff like that we had to work through especially 01:16:23.050 --> 01:16:24.370 for consoles back in the day. 01:16:24.370 --> 01:16:28.210 Like we were working on PS3 360s. 01:16:28.210 --> 01:16:31.469 I'm sure now it's better, but it's been a long time since we've done that. 01:16:31.469 --> 01:16:33.760 DAVE KIRCHER: If I remember correctly, using stenciling 01:16:33.760 --> 01:16:36.476 was strictly less expensive than using textures, 01:16:36.476 --> 01:16:39.100 because you're still going to draw the same amount of geometry, 01:16:39.100 --> 01:16:43.260 but you have no texture cost whatsoever. 01:16:43.260 --> 01:16:44.760 Hopefully that answers most of that. 01:16:47.742 --> 01:16:50.724 AUDIENCE: How did you cover all of your bases for each level, 01:16:50.724 --> 01:16:52.495 so that a player could never get stuck? 01:16:52.495 --> 01:16:54.203 In the sense that if you fell off a cliff 01:16:54.203 --> 01:16:57.682 or maybe accidentally erased a portal, you could always find a way to go back 01:16:57.682 --> 01:16:59.569 or to keep progressing forward? 01:16:59.569 --> 01:17:01.360 TEJEEV KOHLI: The question was about how we 01:17:01.360 --> 01:17:04.730 covered our bases to make sure the players can't get stuck in levels 01:17:04.730 --> 01:17:07.310 if they do something bad. 01:17:07.310 --> 01:17:11.590 Mostly through play testing and then later on through bug testing. 01:17:11.590 --> 01:17:16.550 It's a lot of just trying to make sure that you can see parts of the level 01:17:16.550 --> 01:17:19.030 from different parts. 01:17:19.030 --> 01:17:23.000 Towards the later process of when we're getting closer to shipping, 01:17:23.000 --> 01:17:26.780 we do something called the greasy pig pass for the levels. 01:17:26.780 --> 01:17:30.667 Where we make sure the players can't literally get stuck on walls and stuff 01:17:30.667 --> 01:17:32.000 as they're walking through them. 01:17:32.000 --> 01:17:36.170 So we have a bunch of invisible geometry there 01:17:36.170 --> 01:17:39.670 that'll make smooth the collisions along stairs and along-- 01:17:39.670 --> 01:17:42.620 because especially in Portal 2, there's a bunch of these broken pieces 01:17:42.620 --> 01:17:45.560 and a bunch of foliage and broken parts of the levels 01:17:45.560 --> 01:17:48.590 that are tilted at weird angles and stuff. 01:17:48.590 --> 01:17:53.790 And it's like for the most part, we left them as is. 01:17:53.790 --> 01:17:57.320 But a lot of cases we had to go in and put invisible stuff 01:17:57.320 --> 01:17:59.810 everywhere to make sure that the wall might 01:17:59.810 --> 01:18:02.450 look like it's broken up into like 15 different pieces, 01:18:02.450 --> 01:18:04.830 but the player's just colliding with a flat plane. 01:18:04.830 --> 01:18:09.200 It's to make sure that those things don't happen where 01:18:09.200 --> 01:18:11.540 the players don't get stuck in spots. 01:18:11.540 --> 01:18:15.631 And there's also a bunch of level design work that goes around and making sure-- 01:18:15.631 --> 01:18:18.130 because we have to take care of the opposite as well, right? 01:18:18.130 --> 01:18:20.129 We have to take care of, well, we've got to make 01:18:20.129 --> 01:18:23.060 sure the player can see the exit portal from the start of the level 01:18:23.060 --> 01:18:25.810 so they can't just portal and portal and get to the end. 01:18:25.810 --> 01:18:30.900 And so doing that process helps with what you are asking as well. 01:18:30.900 --> 01:18:34.160 Because if you can make sure that the exploits aren't there, 01:18:34.160 --> 01:18:37.580 you're also getting rid of cases where the player can get themselves 01:18:37.580 --> 01:18:38.910 in a bad spot. 01:18:38.910 --> 01:18:43.260 And so it kind of works itself out through the course of development. 01:18:43.260 --> 01:18:45.290 You don't go in starting to make a puzzle 01:18:45.290 --> 01:18:48.050 or making a level with that in mind a whole lot. 01:18:48.050 --> 01:18:52.079 But as you start refining it, things get tweaked and things get tuned. 01:18:52.079 --> 01:18:54.620 Some things you might be have to tweak for like port reasons. 01:18:54.620 --> 01:18:56.530 Like this doesn't work on PS3. 01:18:56.530 --> 01:19:00.504 So you got to go, OK, I got to fix this and tweak the puzzle a little bit. 01:19:00.504 --> 01:19:02.420 But then once you tweak the puzzle, now you've 01:19:02.420 --> 01:19:04.211 got to do the whole testing all over again. 01:19:04.211 --> 01:19:06.980 Because all right, I can't just put a portal place on there 01:19:06.980 --> 01:19:10.100 because now you can solve the puzzle without doing any of it. 01:19:10.100 --> 01:19:11.930 So there's a bunch of work that has to go on from that sense. 01:19:11.930 --> 01:19:14.055 DAVE KIRCHER: And it's important to note that as we 01:19:14.055 --> 01:19:17.030 get closer to shipping a product, more and more of our dev team 01:19:17.030 --> 01:19:18.650 switches to play testing. 01:19:18.650 --> 01:19:21.170 And we have some very smart and mischievous people 01:19:21.170 --> 01:19:24.310 that that specific question of how do you make sure you don't get stuck 01:19:24.310 --> 01:19:25.284 is on the checklist. 01:19:25.284 --> 01:19:27.200 It was on my checklist at least of, like, I am 01:19:27.200 --> 01:19:28.370 going to make sure I can't get stuck. 01:19:28.370 --> 01:19:30.770 I'm going to sit in this level for about half an hour 01:19:30.770 --> 01:19:33.800 and think long and hard about how to get myself stuck. 01:19:33.800 --> 01:19:35.632 And if I can't do it, then pass. 01:19:35.632 --> 01:19:36.596 [CHUCKLES] 01:19:40.460 --> 01:19:43.435 AUDIENCE: Was there anything that you would have liked to have pursued, 01:19:43.435 --> 01:19:46.400 but didn't, due to either time constraints on shipping 01:19:46.400 --> 01:19:49.484 or the limitations of graphics cards of the day that you thought about, 01:19:49.484 --> 01:19:51.829 but for whatever reason, couldn't do? 01:19:51.829 --> 01:19:53.890 DAVE KIRCHER: The question was was there anything 01:19:53.890 --> 01:19:57.590 that we didn't pursue for various reasons before shipping? 01:19:57.590 --> 01:20:00.490 And I can't think of anything. 01:20:00.490 --> 01:20:03.310 I think I was pretty happy with what we produced. 01:20:03.310 --> 01:20:06.310 Most of the things I focused on were bugs 01:20:06.310 --> 01:20:09.607 that we shipped because once again, getting back into shipping mode, 01:20:09.607 --> 01:20:11.440 as you get closer to shipping something, you 01:20:11.440 --> 01:20:14.650 want to touch the code less and less and less. 01:20:14.650 --> 01:20:18.340 Even if you know that the fix is going to work 100%, it will definitely work, 01:20:18.340 --> 01:20:20.230 it might break something new. 01:20:20.230 --> 01:20:23.470 So I certainly have a small list of things that I wished I had fixed, 01:20:23.470 --> 01:20:24.860 but nothing that I wish I-- 01:20:24.860 --> 01:20:27.050 AUDIENCE: Basically, like, features like the sticky paint, for example. 01:20:27.050 --> 01:20:28.091 DAVE KIRCHER: Yeah, yeah. 01:20:28.091 --> 01:20:30.560 Yeah, I can't think of any features that-- 01:20:30.560 --> 01:20:32.650 TEJEEV KOHLI: There's stuff that we worked on that 01:20:32.650 --> 01:20:34.090 obviously didn't ed up shipping. 01:20:34.090 --> 01:20:36.400 Some of them we touched on over here. 01:20:36.400 --> 01:20:38.350 I don't know if sticky paint was something 01:20:38.350 --> 01:20:40.600 that we should have worked more on, though, 01:20:40.600 --> 01:20:43.930 because I feel like we spent a lot of time trying to get it to work. 01:20:43.930 --> 01:20:47.500 And the reasons for cutting it then are still valid now. 01:20:47.500 --> 01:20:50.380 So I'm saying if we were to go back, I don't think 01:20:50.380 --> 01:20:52.190 we would try to solve that problem. 01:20:52.190 --> 01:20:55.332 We'd probably come up with new problems to try to solve. 01:20:55.332 --> 01:20:57.040 We did have-- like another thing we tried 01:20:57.040 --> 01:21:02.640 was I think we tried it after the game shipped for like a DLC expansion was 01:21:02.640 --> 01:21:04.080 reflection paint. 01:21:04.080 --> 01:21:07.000 So it was paint that would reflect the different elements of the games 01:21:07.000 --> 01:21:10.534 like reflect lasers or reflect light bridges. 01:21:10.534 --> 01:21:11.950 And we didn't get too far with it. 01:21:11.950 --> 01:21:14.781 Again, it leads to a bunch of weird levels 01:21:14.781 --> 01:21:16.780 because you have to have all levels have angles. 01:21:16.780 --> 01:21:18.988 Because if you think about Portal, most of the levels 01:21:18.988 --> 01:21:20.950 are like 90 degree walls and stuff. 01:21:20.950 --> 01:21:24.170 And 90 degree reflections don't go anywhere. 01:21:24.170 --> 01:21:26.290 So we had to have-- 01:21:26.290 --> 01:21:29.950 make this super contrived looking levels with these weird 45 degree angles 01:21:29.950 --> 01:21:32.350 everywhere and they can reflect things. 01:21:32.350 --> 01:21:35.230 And then all the problems like, well, how often-- 01:21:35.230 --> 01:21:37.540 how many bounces do we allow and things. 01:21:37.540 --> 01:21:40.360 And also stuff just looked weird, like tractor beams reflecting off 01:21:40.360 --> 01:21:42.499 of walls just looked weird. 01:21:42.499 --> 01:21:45.040 There's probably other ideas that I can't remember right now, 01:21:45.040 --> 01:21:46.180 but there are-- 01:21:46.180 --> 01:21:52.030 a lot of them get cut short pretty quick because the flaws are really apparent 01:21:52.030 --> 01:21:52.989 pretty quickly. 01:21:52.989 --> 01:21:55.280 You might sit down and think, oh, this is a great idea. 01:21:55.280 --> 01:21:57.160 I'm going to go out and work on it. 01:21:57.160 --> 01:22:01.030 And then as you start working through it and testing it out with others, 01:22:01.030 --> 01:22:03.320 you start seeing all the problems. 01:22:03.320 --> 01:22:06.509 And those problems get apparent pretty quickly. 01:22:06.509 --> 01:22:08.050 And at that point, you make the call. 01:22:08.050 --> 01:22:10.790 Just be like, this is not worth pursuing anymore. 01:22:10.790 --> 01:22:15.200 We had some more game modes we were trying to work on. 01:22:15.200 --> 01:22:17.949 I think we had a competitive mode for a little bit we worked on. 01:22:17.949 --> 01:22:20.740 DAVE KIRCHER: We actually have a slide about that for a little bit. 01:22:20.740 --> 01:22:21.920 It didn't get fleshed out. 01:22:21.920 --> 01:22:25.689 But after Portal shipped, we immediately said 01:22:25.689 --> 01:22:27.480 to ourself what does multiplayer look like? 01:22:27.480 --> 01:22:29.830 And so the first thing we tried was deathmatch. 01:22:29.830 --> 01:22:31.207 Turns out that's a horrible idea. 01:22:31.207 --> 01:22:33.790 Everybody wants to just put portals under other people's feet. 01:22:33.790 --> 01:22:37.520 So you spend most of your time just completely disoriented or confused. 01:22:37.520 --> 01:22:40.930 And then I think we made a collect the coins kind of like, 01:22:40.930 --> 01:22:42.060 oh, do flings and things. 01:22:42.060 --> 01:22:44.268 But once again, everybody wanted to put their portals 01:22:44.268 --> 01:22:45.430 under other people's feet. 01:22:45.430 --> 01:22:48.220 So now we have co-op. 01:22:48.220 --> 01:22:51.189 TEJEEV KOHLI: The co-op was very successful, I think. 01:22:51.189 --> 01:22:53.230 And there's a bunch of other challenges that come 01:22:53.230 --> 01:22:56.720 with co-op that we had to work through. 01:22:56.720 --> 01:23:00.100 I think, yeah, we tried some more different competitive modes. 01:23:00.100 --> 01:23:03.730 We tried a time trial kind of mode, but they're doing it together. 01:23:03.730 --> 01:23:06.950 But that's effectively just playing two single player games at the same time. 01:23:06.950 --> 01:23:08.270 So there's not much interaction. 01:23:08.270 --> 01:23:10.870 Any time you let players interact in a competitive way in Portal, 01:23:10.870 --> 01:23:12.703 they just want to put portals on their feet. 01:23:12.703 --> 01:23:14.840 That's really all they want to do. 01:23:14.840 --> 01:23:17.930 It's fun for a bit, but not as the receiving end, right? 01:23:17.930 --> 01:23:20.980 It's not fun-- or they just want to keep bumping each other's portals. 01:23:20.980 --> 01:23:23.980 Like when they want to put their portal at exactly where the other guy's 01:23:23.980 --> 01:23:24.680 portal is. 01:23:24.680 --> 01:23:26.830 Like they walk in and they go in there instead 01:23:26.830 --> 01:23:29.120 of where they were supposed to go. 01:23:29.120 --> 01:23:30.170 It's fun for a bit. 01:23:30.170 --> 01:23:32.232 I'm not saying there's no merit there. 01:23:32.232 --> 01:23:33.910 DAVE KIRCHER: By "a bit," I think he means about five minutes. 01:23:33.910 --> 01:23:37.160 TEJEEV KOHLI: Yeah, by "a bit," that's the thing you look at, you're like, ah, 01:23:37.160 --> 01:23:37.820 that's funny. 01:23:37.820 --> 01:23:40.040 But then you realize there's no real-- 01:23:40.040 --> 01:23:42.850 at least in the mechanics we tried, there wasn't much depth to it. 01:23:42.850 --> 01:23:45.520 It's not something you could flesh out for a game mode. 01:23:45.520 --> 01:23:48.130 It's more of something you could do as a level-- 01:23:48.130 --> 01:23:49.960 as a gimmick once. 01:23:49.960 --> 01:23:55.060 But then there's not much reason to do that. 01:23:55.060 --> 01:23:58.090 The cost of doing that is really high, so you have to figure out 01:23:58.090 --> 01:24:00.070 do you want to spend a bunch of dev effort 01:24:00.070 --> 01:24:02.440 in making this gimmick that's going to get really old and lots of people 01:24:02.440 --> 01:24:04.180 are going to get annoyed or frustrated? 01:24:04.180 --> 01:24:07.040 So you just don't do that. 01:24:07.040 --> 01:24:08.626 In the back there. 01:24:08.626 --> 01:24:11.116 AUDIENCE: You mentioned that you could cache some stuff-- 01:24:11.116 --> 01:24:14.602 things in the pipeline for some of the lighting plots-- 01:24:14.602 --> 01:24:15.598 earlier. 01:24:15.598 --> 01:24:18.586 I'm wondering if there were any other kind of hardware hacks 01:24:18.586 --> 01:24:24.580 that you do in order to keep the targets that you want for the portal behavior? 01:24:24.580 --> 01:24:29.140 DAVE KIRCHER: So the question references how there were some pipeline 01:24:29.140 --> 01:24:32.670 restraints on the pixel queries. 01:24:32.670 --> 01:24:35.420 And if there were any hacks that we had to do to meet performance, 01:24:35.420 --> 01:24:36.290 I believe yes. 01:24:36.290 --> 01:24:37.998 TEJEEV KOHLI: And any other stuff we did. 01:24:38.959 --> 01:24:40.750 DAVE KIRCHER: Once again, I'm going to have 01:24:40.750 --> 01:24:43.000 to say that I did most of this stuff 10 years ago. 01:24:43.000 --> 01:24:45.979 I can't think of anything off the top of my head. 01:24:45.979 --> 01:24:47.020 There wasn't a whole lot. 01:24:47.020 --> 01:24:48.770 TEJEEV KOHLI: We did stuff with the paint. 01:24:48.770 --> 01:24:51.670 I don't know if we did a bunch of hacks, but one 01:24:51.670 --> 01:24:55.759 of the big hacks on the paint that we did was the paint that you're seeing 01:24:55.759 --> 01:24:57.550 is not the paint that's doing the painting. 01:25:00.160 --> 01:25:02.800 So I mean that's, like, nobody can tell. 01:25:02.800 --> 01:25:04.120 That's pretty good. 01:25:04.120 --> 01:25:08.470 But especially on multiplayer, the paint that the client is seeing 01:25:08.470 --> 01:25:11.530 is not the paint that the server is seeing. 01:25:11.530 --> 01:25:13.750 Because we couldn't transmit all that data, 01:25:13.750 --> 01:25:15.880 so they're both generating their own data. 01:25:15.880 --> 01:25:18.550 But then the server is the only one doing the actual painting, 01:25:18.550 --> 01:25:22.139 so all the blobs that the client is hitting in the world do nothing 01:25:22.139 --> 01:25:25.430 and the server blobs do the painting and then tell the client paint over there, 01:25:25.430 --> 01:25:27.040 paint over there. 01:25:27.040 --> 01:25:30.740 So that's the kind of thing-- because the network bandwidth is pretty limited 01:25:30.740 --> 01:25:33.640 and there's a lot of paint flying through the world. 01:25:33.640 --> 01:25:36.760 So we couldn't just transmit all the paint all the time, 01:25:36.760 --> 01:25:39.160 so they all generate their own paint. 01:25:39.160 --> 01:25:42.490 Blobs that are through the world, and then the painting 01:25:42.490 --> 01:25:45.190 itself happened on the server and then that gets transmitted. 01:25:45.190 --> 01:25:48.837 But the paint flying through the air is different on everyone, 01:25:48.837 --> 01:25:50.920 but it's random enough that you can't really tell. 01:25:53.276 --> 01:25:55.980 AUDIENCE: Is Half-Life 3 going to have portals? 01:25:55.980 --> 01:25:58.359 TEJEEV KOHLI: I don't know. 01:25:58.359 --> 01:25:59.400 DAVE KIRCHER: No comment. 01:25:59.400 --> 01:26:01.035 [LAUGHTER] 01:26:01.035 --> 01:26:03.010 Probably not. 01:26:03.010 --> 01:26:06.470 In all seriousness, after the initial Portal came out, 01:26:06.470 --> 01:26:09.940 one of the other experiments was not only what does multiplayer look like, 01:26:09.940 --> 01:26:13.325 but how fun is this in a Half-Life environment? 01:26:13.325 --> 01:26:17.350 And it turns out that the way that Half-Life is made, 01:26:17.350 --> 01:26:22.057 there are a whole lot of slightly scripted sequences to make things work. 01:26:22.057 --> 01:26:23.890 And so the way those levels are designed are 01:26:23.890 --> 01:26:25.930 fundamentally different than Portal levels 01:26:25.930 --> 01:26:27.790 and they basically just break down. 01:26:27.790 --> 01:26:30.910 So if there were portals in Half-Life, then Half-Life 01:26:30.910 --> 01:26:34.060 would seem a lot more like Portal. 01:26:34.060 --> 01:26:37.150 TEJEEV KOHLI: If you think about a Portal level, it's pretty constrained. 01:26:37.150 --> 01:26:38.890 The sight lines are pretty constrained. 01:26:38.890 --> 01:26:40.930 The level takes place in a box. 01:26:40.930 --> 01:26:42.260 You can't see really far. 01:26:42.260 --> 01:26:46.130 There's a lot of kinks in the walls so you can't see all the way to the end. 01:26:46.130 --> 01:26:48.320 Half-Life levels aren't designed like that at all. 01:26:48.320 --> 01:26:51.880 So you would just go in a level and make portals all the way to the exit 01:26:51.880 --> 01:26:54.550 and then skip all the game play. 01:26:54.550 --> 01:26:56.950 I mean there are probably mods that allow you to do that, 01:26:56.950 --> 01:27:02.050 but I think the games themselves and the mechanics are fundamentally 01:27:02.050 --> 01:27:05.470 different enough that I don't think they interact really well. 01:27:05.470 --> 01:27:07.720 Unless both of them change or one of them 01:27:07.720 --> 01:27:11.530 changes a lot so it's no longer the game you wanted. 01:27:14.297 --> 01:27:15.380 I think you were up first. 01:27:15.380 --> 01:27:16.390 Yeah. 01:27:16.390 --> 01:27:19.766 AUDIENCE: You mentioned that you had done, like, a student game project 01:27:19.766 --> 01:27:21.642 before you got hired by Valve? 01:27:21.642 --> 01:27:24.449 What was the story there? 01:27:24.449 --> 01:27:27.490 TEJEEV KOHLI: So the question was asking about our student game projects. 01:27:27.490 --> 01:27:34.560 So Dave worked-- we both went to a school in Redmond called DigiPen. 01:27:34.560 --> 01:27:35.830 Dave went there before I did. 01:27:35.830 --> 01:27:38.140 DAVE KIRCHER: I graduated in 2005. 01:27:38.140 --> 01:27:40.900 I worked on a game called Narbacular Drop. 01:27:40.900 --> 01:27:43.750 Which if you Google for it, it will be the only result 01:27:43.750 --> 01:27:47.836 because the name was chosen so that would be the only result on Google. 01:27:47.836 --> 01:27:49.210 If you could spell it, good luck. 01:27:49.210 --> 01:27:54.550 And so that was our senior project at DigiPen-- 01:27:54.550 --> 01:27:56.030 my team at the time. 01:27:56.030 --> 01:28:00.547 And so we ended up through a very convoluted long story showing 01:28:00.547 --> 01:28:02.380 that at Valve, and they hired us on the spot 01:28:02.380 --> 01:28:05.661 to basically recreate those mechanics for them. 01:28:05.661 --> 01:28:07.660 And that was actually-- there wasn't a whole lot 01:28:07.660 --> 01:28:10.701 of confidence at the time that would actually ship, but it became Portal. 01:28:10.701 --> 01:28:12.379 So it seemed like a good thing. 01:28:12.379 --> 01:28:14.920 TEJEEV KOHLI: Yeah, and I was part of a team that made "Tag-- 01:28:14.920 --> 01:28:17.890 The Power of Paint," the video I showed with a paint gun, and that 01:28:17.890 --> 01:28:22.480 was our team's junior project at DigiPen. 01:28:22.480 --> 01:28:26.290 And same thing, Valve saw it a couple of times 01:28:26.290 --> 01:28:32.320 and hired the entire team to come work on that mechanic at Valve. 01:28:32.320 --> 01:28:35.920 And then once we got there, it became obvious to try to integrate it 01:28:35.920 --> 01:28:39.310 into Portal 2 and that's how we start working on Portal 2 01:28:39.310 --> 01:28:41.851 and that's how the Portal 2 gels came about. 01:28:45.190 --> 01:28:49.483 AUDIENCE: The paints and gels which were introduced as a mechanic in Portal 2 01:28:49.483 --> 01:28:52.440 ended up being part of the story as well. 01:28:52.440 --> 01:28:55.850 Can you talk about how some mechanics end up affecting the story 01:28:55.850 --> 01:28:59.149 and how story elements end up affecting the mechanics? 01:28:59.149 --> 01:29:02.190 TEJEEV KOHLI: The question was about how the story and the game mechanics 01:29:02.190 --> 01:29:05.580 interact and how one affects the other. 01:29:05.580 --> 01:29:10.190 So the way at least in Portal 2, and I think Portal 1 was very similar. 01:29:10.190 --> 01:29:14.610 The way it kind of works with Valve is we don't really 01:29:14.610 --> 01:29:19.620 have an overarching design for a design doc for the game before we start. 01:29:19.620 --> 01:29:23.850 It's a lot of smaller things that we try to combine using similar techniques 01:29:23.850 --> 01:29:26.610 like what we discussed today. 01:29:26.610 --> 01:29:31.530 And the story kind of builds us out of using the same techniques. 01:29:31.530 --> 01:29:35.430 Because the way we kind of vet out most of our design decisions 01:29:35.430 --> 01:29:36.890 is by play testing. 01:29:36.890 --> 01:29:43.080 And the story follows a very similar plot but you don't really want one-- 01:29:43.080 --> 01:29:45.610 either one to override the other. 01:29:45.610 --> 01:29:50.100 Because if you see the game, like if I make a bunch-- 01:29:50.100 --> 01:29:52.530 if we have a team that made a bunch of puzzles 01:29:52.530 --> 01:29:55.750 for the game that haven't been very play tested. 01:29:55.750 --> 01:29:58.382 And then the writer comes in and does a bunch of writing for it 01:29:58.382 --> 01:30:01.590 and then you realize three weeks later that half these levels aren't shipping 01:30:01.590 --> 01:30:04.470 anymore because they didn't test well, then 01:30:04.470 --> 01:30:07.980 you made a bunch of dependencies that didn't really work. 01:30:07.980 --> 01:30:13.200 Portal was lucky in that the puzzles themselves are compartmentalized 01:30:13.200 --> 01:30:14.369 as you enter the elevator. 01:30:14.369 --> 01:30:17.160 Or you exit the elevator, you do a puzzle, and enter the elevators. 01:30:17.160 --> 01:30:19.560 So they're all pretty compartmentalized. 01:30:19.560 --> 01:30:25.320 And a lot of the writing that was done for it was essentially just jokes. 01:30:25.320 --> 01:30:31.890 So a lot of those jokes do fit in to most of the puzzles. 01:30:31.890 --> 01:30:35.640 So the puzzle can change and the joke can just be inserted into it. 01:30:35.640 --> 01:30:38.340 But for the overarching story of the game, 01:30:38.340 --> 01:30:41.340 I think that required a lot more collaboration. 01:30:41.340 --> 01:30:43.564 So the writers were on-site. 01:30:43.564 --> 01:30:46.230 They were Valve employees and they were sitting in the same room 01:30:46.230 --> 01:30:50.460 as us watching us play test, bouncing back and forth ideas. 01:30:50.460 --> 01:30:53.760 And we used-- we had GLaDOS for most of the game. 01:30:53.760 --> 01:30:58.980 And the voice artist was local, so we had her come in many times 01:30:58.980 --> 01:31:00.510 and record a bunch of lines. 01:31:00.510 --> 01:31:04.810 We also used some like fake online robot voice for a while, 01:31:04.810 --> 01:31:07.560 but those are hard to judge because the play testers almost 01:31:07.560 --> 01:31:09.240 never laugh at those jokes. 01:31:09.240 --> 01:31:12.600 Because the robot always doesn't really know how to speak them. 01:31:12.600 --> 01:31:16.426 But it sounds like a robot so it's not it's better than nothing. 01:31:16.426 --> 01:31:19.050 It's better than just putting text on the screen, which we also 01:31:19.050 --> 01:31:20.407 did for a while. 01:31:20.407 --> 01:31:23.490 So with the writing, there's two things that you're trying to test, right? 01:31:23.490 --> 01:31:26.900 You're trying to test out the individual's jokes, and a lot of them 01:31:26.900 --> 01:31:28.660 can be transported to any level. 01:31:28.660 --> 01:31:31.140 So they're not super dependent on the levels. 01:31:31.140 --> 01:31:33.067 But then once the story starts coming together 01:31:33.067 --> 01:31:36.150 and starts taking shape, at that point you're making changes to the levels 01:31:36.150 --> 01:31:37.680 to accommodate the story. 01:31:37.680 --> 01:31:41.070 And from that point on, you have to have a pretty good amount of confidence 01:31:41.070 --> 01:31:43.810 that these particular levels are going to ship in the game. 01:31:43.810 --> 01:31:47.070 And so that that starts happening I think fairly late 01:31:47.070 --> 01:31:49.482 into our dev cycle at least. 01:31:49.482 --> 01:31:50.940 There's always an overarching goal. 01:31:50.940 --> 01:31:54.330 There's always a goal of you're trying to capture Wheatley 01:31:54.330 --> 01:31:59.520 or you're trying to go kill GLaDOS, but the exact mechanics of how that happens 01:31:59.520 --> 01:32:02.880 doesn't come together until fairly late. 01:32:02.880 --> 01:32:05.940 Because you don't want to spend a bunch of time integrating 01:32:05.940 --> 01:32:09.480 your story and your levels without having a bunch of confidence 01:32:09.480 --> 01:32:13.350 that these levels are actually good enough to ship. 01:32:13.350 --> 01:32:15.810 Which we do have for a bunch of the game, 01:32:15.810 --> 01:32:18.770 but as new levels and new mechanics are being introduced, 01:32:18.770 --> 01:32:22.000 it all kind of goes haywire. 01:32:22.000 --> 01:32:26.070 So it's just mostly a pretty strong collaborative process 01:32:26.070 --> 01:32:29.220 between the writers and the designers and it all 01:32:29.220 --> 01:32:30.819 goes back to the play testing. 01:32:36.431 --> 01:32:38.306 AUDIENCE: Can you talk a little bit about how 01:32:38.306 --> 01:32:42.194 the sound interacts with portals, like in 3-D positioning 01:32:42.194 --> 01:32:44.150 of the audio sources? 01:32:44.150 --> 01:32:48.080 DAVE KIRCHER: So the question was how sound interacts with Portal. 01:32:48.080 --> 01:32:50.810 And my memory's a little fuzzy. 01:32:50.810 --> 01:32:53.150 I'm pretty sure we tried to replicate a little bit using 01:32:53.150 --> 01:32:55.850 just a simple-- basically the exact same solution as with our lighting. 01:32:55.850 --> 01:32:58.370 Where it's like we have a sample point in front of a portal and we 01:32:58.370 --> 01:32:59.786 have an emitter on the other side. 01:32:59.786 --> 01:33:01.730 I can't remember if we shipped that way. 01:33:01.730 --> 01:33:02.390 TEJEEV KOHLI: I think we did. 01:33:02.390 --> 01:33:03.181 DAVE KIRCHER: Yeah. 01:33:03.181 --> 01:33:05.950 TEJEEV KOHLI: I think there's a microphone or in-game microphone 01:33:05.950 --> 01:33:09.732 and an in-game speaker on the portals on both sides. 01:33:09.732 --> 01:33:11.690 So if you're on this side of the portal, you'll 01:33:11.690 --> 01:33:14.364 hear what's happening on the other side. 01:33:14.364 --> 01:33:15.780 Pretty sure that's how we shipped. 01:33:15.780 --> 01:33:17.540 DAVE KIRCHER: Yeah, but I don't think we made any special concessions 01:33:17.540 --> 01:33:20.280 to make it seem like it was going through a tunnel or anything like that. 01:33:20.280 --> 01:33:23.120 We just wanted to make sure you could hear what was going on. 01:33:23.120 --> 01:33:25.245 TEJEEV KOHLI: Not through the portals specifically. 01:33:25.245 --> 01:33:27.910 I know there was a bunch of stuff we did for the tractor beam. 01:33:27.910 --> 01:33:29.660 Like when you head to the tractor beam, it 01:33:29.660 --> 01:33:35.692 kind of fuzzles everything else around you and muddles the sound a little bit. 01:33:35.692 --> 01:33:37.400 But going through the portals themselves, 01:33:37.400 --> 01:33:40.600 I don't think there's anything specific we did there. 01:33:40.600 --> 01:33:42.600 At least not that I can-- it's been a long time. 01:33:42.600 --> 01:33:44.100 DAVE KIRCHER: It's been a long time. 01:33:47.303 --> 01:33:49.251 AUDIENCE: What were examples of puzzle games 01:33:49.251 --> 01:33:53.650 that inspired you when you making your games? 01:33:53.650 --> 01:33:55.062 TEJEEV KOHLI: Uh, Portal. 01:33:55.062 --> 01:33:57.392 [LAUGHING] 01:33:58.330 --> 01:34:00.602 The question was, what puzzle games inspired us 01:34:00.602 --> 01:34:01.810 when we were making our game? 01:34:04.730 --> 01:34:08.350 DAVE KIRCHER: I can't think of a strong inspiration. 01:34:08.350 --> 01:34:12.512 I'm mostly a code guy, so I didn't do a whole lot of the actual puzzle design. 01:34:12.512 --> 01:34:15.220 But when I'm thinking back, we didn't have a whole lot of sources 01:34:15.220 --> 01:34:21.160 to draw on because it was a fairly new concept in general. 01:34:21.160 --> 01:34:22.990 I can't think of any sources I drew on. 01:34:22.990 --> 01:34:25.570 I mean-- 01:34:25.570 --> 01:34:28.120 TEJEEV KOHLI: I wasn't kidding when I said Portal. 01:34:28.120 --> 01:34:32.010 When we were making Tag, I think Portal had come out a year 01:34:32.010 --> 01:34:37.034 or two earlier before that and was really good and a big success. 01:34:37.034 --> 01:34:38.950 And we were trying to learn from how they were 01:34:38.950 --> 01:34:40.539 teaching the players different things. 01:34:40.539 --> 01:34:42.580 And that's one of the biggest things we took away 01:34:42.580 --> 01:34:47.320 in our student game was how do you teach players different mechanics? 01:34:47.320 --> 01:34:49.810 And I think Portal did a really good job of that. 01:34:49.810 --> 01:34:53.320 By teaching by doing instead of by showing. 01:34:53.320 --> 01:34:55.510 So like the players doing all the stuff and then 01:34:55.510 --> 01:34:57.594 figuring it out instead of someone showing a video 01:34:57.594 --> 01:35:00.593 or just telling the player, hey, here's what do you do next, and then go 01:35:00.593 --> 01:35:01.300 and doing that. 01:35:01.300 --> 01:35:03.850 So we tried to take that at heart, and as we 01:35:03.850 --> 01:35:07.060 were doing in our game introducing new paints and new mechanics, 01:35:07.060 --> 01:35:09.820 doing it the same way where we introduce them in a way 01:35:09.820 --> 01:35:13.204 that the usage is obvious enough that the player will try it out. 01:35:13.204 --> 01:35:16.120 And when they try it out and it works, they feel really good about it. 01:35:16.120 --> 01:35:19.245 Because they feel like they figured it out instead of us doing all the work 01:35:19.245 --> 01:35:21.130 and showing them what to do. 01:35:21.130 --> 01:35:27.410 So a lot of that kind of was a specific thing that we took from Portal 01:35:27.410 --> 01:35:28.770 and trying to do it in our game. 01:35:31.934 --> 01:35:35.026 AUDIENCE: How many people did it take to create these two games, Portal 01:35:35.026 --> 01:35:38.530 and Portal 2, across the different functional units-- 01:35:38.530 --> 01:35:42.530 development, writers, and the rest? 01:35:42.530 --> 01:35:44.840 TEJEEV KOHLI: So the question was about how many people 01:35:44.840 --> 01:35:48.620 it took to make Portal and Portal 2. 01:35:48.620 --> 01:35:52.220 Portal 1 was a pretty small team for the most part. 01:35:52.220 --> 01:35:56.002 DAVE KIRCHER: So Portal 2 started as the seven people that worked on-- 01:35:56.002 --> 01:35:56.960 TEJEEV KOHLI: Portal 1. 01:35:56.960 --> 01:35:58.890 DAVE KIRCHER: Yeah. 01:35:58.890 --> 01:36:02.840 Sorry, Portal 1 started with the seven people 01:36:02.840 --> 01:36:05.870 that worked on Narbacular Drop directly transplanted. 01:36:05.870 --> 01:36:09.560 And then we started working fairly early with two writers. 01:36:09.560 --> 01:36:12.290 And we were leveraging other people at Valve 01:36:12.290 --> 01:36:15.260 to answer questions and help us hit the ground running as far 01:36:15.260 --> 01:36:16.670 as how to use the engine. 01:36:16.670 --> 01:36:20.840 But it was mostly just those nine people working day to day. 01:36:20.840 --> 01:36:22.580 And then Portal 2 ballooned quite a bit. 01:36:22.580 --> 01:36:25.470 TEJEEV KOHLI: Portal 2 was a much bigger team. 01:36:25.470 --> 01:36:30.050 By the time I joined Valve in 2009, I think there was already 01:36:30.050 --> 01:36:32.260 a pretty big Portal 2 team. 01:36:32.260 --> 01:36:34.700 They already had a field the mechanics figured out. 01:36:34.700 --> 01:36:38.660 The game was pretty different from what you see now, but at that point 01:36:38.660 --> 01:36:42.560 it was already maybe 10, 12 people. 01:36:42.560 --> 01:36:45.010 And then like it slowly increased. 01:36:45.010 --> 01:36:49.190 Like we were four or five that got hired for our paint game. 01:36:49.190 --> 01:36:50.390 So we joined that team. 01:36:50.390 --> 01:36:53.060 And then I think by the end of it, there were probably 01:36:53.060 --> 01:36:56.780 close to 40, 50 people working on it. 01:36:56.780 --> 01:37:02.210 That was towards the very end because we had to ship on two consoles and PC 01:37:02.210 --> 01:37:05.060 and we had a whole co-op mechanic. 01:37:05.060 --> 01:37:08.020 And there was a whole co-op campaign be worked on separately 01:37:08.020 --> 01:37:10.770 as well as a single player one. 01:37:10.770 --> 01:37:12.770 So it was a pretty big team by the end of it. 01:37:12.770 --> 01:37:14.640 Much bigger than Portal 1. 01:37:14.640 --> 01:37:18.170 And the game itself I think is much bigger than Portal 1 as well. 01:37:18.170 --> 01:37:20.630 I think the single player campaign itself is probably 01:37:20.630 --> 01:37:22.740 more than twice as long. 01:37:22.740 --> 01:37:26.950 And the campaign-- the co-op one is probably also that big. 01:37:26.950 --> 01:37:30.200 DAVE KIRCHER: I remember in Portal 1 we would have to do frequent integration 01:37:30.200 --> 01:37:34.030 testing and I think I got my play time on Portal 1 down to like 45 minutes 01:37:34.030 --> 01:37:36.330 and Portal 2 is several hours. 01:37:36.330 --> 01:37:37.660 TEJEEV KOHLI: Yeah. 01:37:37.660 --> 01:37:40.520 So it's a much bigger game, so it took a lot more people. 01:37:43.280 --> 01:37:46.030 AUDIENCE: How does the game engine that you used compare to Unity? 01:37:46.030 --> 01:37:50.650 Is it more straight-up C programming from scratch, 01:37:50.650 --> 01:37:53.687 or is it a lot of the drag-and-drop stuff you see? 01:37:53.687 --> 01:37:56.020 TEJEEV KOHLI: So the question is how did our game engine 01:37:56.020 --> 01:37:58.462 compare to something like Unity. 01:37:58.462 --> 01:38:02.870 For both Portal and Portal 2, we used Source, 01:38:02.870 --> 01:38:05.340 which is our in-house game engine. 01:38:05.340 --> 01:38:08.900 And it's very different from how Unity works. 01:38:08.900 --> 01:38:12.640 So the way Unity works is mostly like a really big editor. 01:38:12.640 --> 01:38:16.520 Like what you're seeing in the editor is the game essentially. 01:38:16.520 --> 01:38:18.430 Like all the entities and stuff are loaded. 01:38:18.430 --> 01:38:20.474 Obviously more stuff gets loaded at one time. 01:38:20.474 --> 01:38:22.390 But what you're seeing is what you're getting. 01:38:22.390 --> 01:38:27.390 Whereas the way Source works is it's got a bunch of these discrete tools that 01:38:27.390 --> 01:38:28.117 make stuff. 01:38:28.117 --> 01:38:30.700 So there's a level editor, which is where you make your level. 01:38:30.700 --> 01:38:35.080 And then you import that into the game and you run the game separately. 01:38:35.080 --> 01:38:38.320 And what you're seeing in a level editor is not what you see in the game 01:38:38.320 --> 01:38:41.910 because a lot of the entities and stuff don't translate to the editor. 01:38:41.910 --> 01:38:44.860 A lot of the lighting and stuff has to be pre-baked. 01:38:44.860 --> 01:38:48.680 Unity has some pre-baked lighting as well. 01:38:48.680 --> 01:38:50.690 But in the way it worked in Source-- 01:38:50.690 --> 01:38:55.330 Source I think is a combination of a bunch of discrete tools 01:38:55.330 --> 01:38:57.580 for each different aspect of the game. 01:38:57.580 --> 01:39:00.520 So I get a separate particles editor, separate model editor, 01:39:00.520 --> 01:39:08.370 separate editor for VO and the face poser, and the separate level editor. 01:39:08.370 --> 01:39:11.890 And then there's a game engine that takes the compiled versions of all-- 01:39:11.890 --> 01:39:15.040 compiled outputs of all those things and then puts them in the game engine 01:39:15.040 --> 01:39:16.660 and combines them together. 01:39:16.660 --> 01:39:20.530 And then all the code is pretty much exclusively C++. 01:39:20.530 --> 01:39:23.060 I don't think there's really anything else. 01:39:23.060 --> 01:39:26.620 There might be a couple a handful of things that are not, 01:39:26.620 --> 01:39:29.980 but all the tools are C++. 01:39:29.980 --> 01:39:34.720 All the game engine all the runtime code is all C++. 01:39:34.720 --> 01:39:40.420 Source 2 is a little bit different, but still going forward on that front, 01:39:40.420 --> 01:39:42.970 I'm not trying to do what Unity's doing. 01:39:42.970 --> 01:39:47.390 Because Unity is more of your running scripts-- 01:39:47.390 --> 01:39:52.480 C# scripts-- and then you're just compiling them while the editor's going 01:39:52.480 --> 01:39:54.760 and the rapid iteration and stuff. 01:39:54.760 --> 01:39:58.450 Source doesn't really have that same model of working. 01:39:58.450 --> 01:40:02.110 But the advantage is that we control all of it 01:40:02.110 --> 01:40:06.400 and then the ceiling for what we can produce 01:40:06.400 --> 01:40:09.620 is theoretically quite a bit higher. 01:40:09.620 --> 01:40:11.320 So there's tradeoffs to it. 01:40:11.320 --> 01:40:16.770 And also we make all our tools and all our engine stuff in-house 01:40:16.770 --> 01:40:19.999 and we're the primary customer for our games. 01:40:19.999 --> 01:40:21.790 So we're not trying to do what you Unity is 01:40:21.790 --> 01:40:26.560 doing and trying to service to anyone out there who wants to make anything. 01:40:26.560 --> 01:40:30.340 And Unity has thousands of people working on their engine 01:40:30.340 --> 01:40:36.120 and we have quite a few orders of magnitude less. 01:40:36.120 --> 01:40:39.530 But I think we are aware of all the tradeoffs we're making. 01:40:42.790 --> 01:40:44.850 We're not trying not to do what they're doing. 01:40:44.850 --> 01:40:47.410 We're just seeing-- and we're learning from them, too, 01:40:47.410 --> 01:40:50.500 and Source 2 has taken a few cues from stuff like Utility and stuff 01:40:50.500 --> 01:40:51.980 like Unreal. 01:40:51.980 --> 01:40:57.340 Trying to be more user friendly even to our own customers, internal employees. 01:40:57.340 --> 01:40:59.130 But it's not like-- 01:40:59.130 --> 01:41:02.570 the way of working is very different between Source and Unity. 01:41:10.786 --> 01:41:13.310 I think we're good. 01:41:13.310 --> 01:41:15.573 All right, well, thanks again for having us. 01:41:15.573 --> 01:41:18.870 [APPLAUSE] 01:41:20.022 --> 01:41:21.980 COLTON OGDEN: Thank you all so much for coming. 01:41:21.980 --> 01:41:24.729 So there's some extra pizza outside, but that was Portal Problems. 01:41:24.729 --> 01:41:26.790 So thank you very much.