Advertisement
Guest User

portal stuff

a guest
Sep 16th, 2015
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.03 KB | None | 0 0
  1.  
  2. Dave Kircher <dave@valvesoftware.com>
  3. 9/24/14
  4.  
  5. to me
  6. My memory of portal physics is a bit fuzzy. So some of this might be less than useful or outright incorrect. And I have no particularly strong desire to refamiliarize myself with the system at the moment.
  7.  
  8. The bouncy behavior most definitely seems like the work of the penetration solver in the physics system. It acts as a backup system to normal collision events. It works by detecting when 2 solid hulls are intersecting each other. Which should be theoretically impossible, so we're already in a situation with no "correct" solution.
  9.  
  10. To separate them, we apply a separating force (the bounciness of the chairs) to each. And since the world is "static", all the force is applied to the dynamic object. I believe we have to immediately mark the two object as not colliding with each other during that period so they can actually move away from each other. And at some point (a full second maybe?), the solver just gives up. I believe, but I'm not sure, that it just marks the two objects as not colliding with each other forever.
  11.  
  12. Portals cause penetration problems all the time due to constantly changing which objects collide with each other. It does this because we're trying to get objects in front of a portal to pass through objects on the other side of a thin wall (and pass through the wall itself).
  13.  
  14. One of the core problems with maintaining those collisions is that we cannot properly solve for any concave shape, take a big letter "U" for example, that has one portion inside the portal, and one portion reaching behind the portal plane but outside the portal oval. If we were to imagine a large plank behind a thin wall behind the portal. We can easily imagine the case where the leg of the "U" inside the portal should not collide with the plank, but the leg outside the oval most definitely should collide with the portal. In portal we make the assumption that all objects are convex and that makes the intersection logic easier because we know that if any part of the object is intersecting the portal oval, then the rest of the object must be in front of the portal.
  15.  
  16. That still has the breakdown case of a portal at the edge of a wall. When the cube is visually cut in half, that's an indicator that the portal believes the object is intersecting the portal oval. The visual system can only apply a single plane with which to hide portions of the object.
  17.  
  18. When you bring the radio in from behind the portal plane. The collision system definitely believes the two objects should not collide. But as it transitions to being in front of the portal plane, the system changes its mind, but the two objects are already intersecting. So it immediately has to run the penetration solver on the two. But since the radio is held, it can't be forced out of the cube leading to an easy scenario for the solver to give up.
  19.  
  20. I'm not entirely sure why the solver gave up on trying to have the cube intersect with the world. But I believe it's rest by the loading of a save game which makes the cube solid again on the second part of the second video.
  21.  
  22. Anyway, I know that wasn't particularly useful, but that's sort of a brain dump of what's going on.
  23.  
  24. -Dave
  25.  
  26. -----Original Message-----
  27. From: norferzlo@gmail.com [mailto:norferzlo@gmail.com]
  28. Sent: Friday, September 19, 2014 8:55 PM
  29. To: Dave Kircher
  30. Subject: [Contact Form] I'm trying to understand a portal bug for speedrunning and hoped you could help
  31.  
  32. Hello,
  33.  
  34. There's a weird physics bug in Portal that we were wondering if you could shed a bit of light on. Here's a video of the effects: https://www.youtube.com/watch?v=gA0evdpi4_w
  35.  
  36. The cause of glitch happens when we edge glitch items (or place them on the edge of one portal tricking the game to thinking it's at both portals), and it can cause some very odd effects. A video showing the method we've used to cause this can be found here: http://www.youtube.com/watch?v=ZqCSvETsrR0&t=1m27s
  37.  
  38. As a member of the Portal speedrunning community, we're hoping to understand the causes and effects of this glitch more. We think that it is an extremely unique glitch and think it could create some interesting route changes in the run or just be pretty neat! :)
  39.  
  40. Thanks,
  41. -Portal Speedrun Community
  42.  
  43. Message sent via contact form at http://www.valvesoftware.com/email.php
  44. Senders IP address: 99.224.238.26
  45. Attachments area
  46. Preview YouTube video [Portal] Item Save Glitch Effects in Chamber 19
  47.  
  48. [Portal] Item Save Glitch Effects in Chamber 19
  49. Preview YouTube video 05 0 portals
  50.  
  51. 05 0 portals
  52.  
  53. Norferzllo . <norferzlo@gmail.com>
  54. 9/28/14
  55.  
  56. to Dave
  57. Hi, thanks a bunch for the response! We seriously weren't expecting one and we were shocked and ecstatic when there was a reply.
  58.  
  59. We don't mean to waste your time but we had some questions about other glitches. Even years after discovery, some of them still remain a mystery. We know the "how", but not the "why".
  60.  
  61. Some of the following glitches have a similar effect: they "teleport" you to a part of the map based on portal orientation and position. However, the methods about which to do the next three glitches vary.
  62.  
  63. 1. Large angle glitch. This is used in Chamber 19 to skip part of the map putting a portal on the angled surface and the opposite portal right above you (so you can stand). Then while crouching, we jump then let go of everything in a very fast manner and it warps us to another part of the map. This actually messes up collision (we fall out-of-bounds) unless we shoot a portal before doing the inputs.
  64.  
  65. Example: https://www.youtube.com/watch?v=Zoz-iFL3DC0&feature=youtu.be&t=10m30s
  66.  
  67. 2. Acute angle glitch. This allows us to skip the glass in escape_01 (instead of having the turret shoot it for us), and sometimes it puts us out-of-bounds. Check out the following video for an example and a bit more info in the description. Example:
  68. https://www.youtube.com/watch?v=YtWIkXeHxD0
  69.  
  70. 3. Vertical angle glitch. This is the one out of the three that we have zero idea how or why it works. The only way we've gotten it is randomly while playing the game and going through portals. This is super important and probably the one we care about most to understand because it could save a lot of time in different areas. Here are three examples:
  71. http://youtu.be/D-K65f3Fi4M?t=15s
  72. http://www.twitch.tv/xeiz/c/4499829
  73. https://www.youtube.com/watch?v=DI8xnxwlTlM
  74.  
  75. 4. This one is a bit different: Save Glitch. We shoot a portal on the edge of a surface, stand slightly behind it (edge glitch, the game thinks we have gone through the portal but our camera hasn't causing our portals to fire from the top of the other portal), then save+load. For some reason, the game sort of preserves the edge glitch but we are able to move around. If we are behind the portal we saved on top of, our portals fire from an invisible body that mimics our camera's movement but from the top of the other portal. If we are in front of the portal we saved on our body is put back to where our camera is and we fire normally. How the game decides where we can walk and where we will fall through the floor isn't really known. Going in the proximity of the portal (like directly in front of it) deactivates the glitch. Here's an example: https://www.youtube.com/watch?v=2BtRYchi_4U
  76.  
  77. 5. Do you know of any Source Engine/Portal oddities that haven't been explored yet? We would like to think that we've found almost everything there is to find in the past 7 years, but who knows. We didn't make the game :p
  78.  
  79. Sorry for the billion questions and for pestering you again, but it's really interesting to find out the details of these glitches that still largely remain a mystery. It means a lot to us and could potentially help with future speedruns. While we are breaking the game that you had a part of making, it keeps us playing every day even 7 years after release. There's a reason why some of us have 1000+, or even 2000+ hours in this game. Thanks again!
  80.  
  81. -The Portal Speedrun Community
  82. Attachments area
  83. Preview YouTube video Portal - No OoB in 13:09
  84.  
  85. Portal - No OoB in 13:09
  86. Preview YouTube video "Acute Angle Glitch"
  87.  
  88. "Acute Angle Glitch"
  89. Preview YouTube video Ch 01 Faster Than PDI
  90.  
  91. Ch 01 Faster Than PDI
  92. Preview YouTube video Weird LAG thing in GLaDOS Chamber
  93.  
  94. Weird LAG thing in GLaDOS Chamber
  95. Preview YouTube video save glitch demo
  96.  
  97. save glitch demo
  98.  
  99. Dave Kircher <dave@valvesoftware.com>
  100. 9/29/14
  101.  
  102. to me
  103. Firstly, I need to say that these bugs are complicated enough that I could easily be wrong in my analysis. So don’t rely on this too much.
  104.  
  105. Most of these look like they’re bad results from what we call “unstuck” code. And Portal has a strong need to run that code frequently due to one largely unresolved problem in the player representation.
  106.  
  107. The player in all source games is using what’s known as an Axis-Aligned Bounding Box. Which means that the box never rotates. No matter how much you turn or do flips, the box is always aligned along the cardinal axes. X&Y along the floor are equal in size, and vertical Z is much bigger than X or Y. I forget the exact dimensions, but it’s something like 32x32x96 when the player is standing I think. And the Z shrinks when the player is crouching, I don’t think it goes down to the same as X or Y. I believe it’s closer to 48.
  108.  
  109. In any case. When both portal normals (the direction the portal is facing) are aligned along either X or Y. The player’s AABB going into one portal exactly matches the relative AABB coming out, so all the collision detection works really well. But as soon as non-aligned normals come into play, or one portal has it’s normal significantly aligned with Z while the other is not, then the player’s AABB going into one portal will be a significantly different relative shape than the one when they come out.
  110.  
  111. I say relatively because the player will have the exact same AABB no matter where they are, but the collision within a portal bubble that represents the collideables at the exit side will be necessarily rotated by the portal’s teleportation matrix. Those rotated collideables are aligned to the cardinal axes differently than they would be if the player walked up to the other portal and interacted with them directly.
  112.  
  113. Hopefully I’m explaining that clearly. Moving on.
  114.  
  115. So when a player enters a portal on the floor that exits on a wall. For all intents and purposes, their collision box suddenly changes shape and we need to resolve that. We resolve that with the “unstuck” code. It’s somewhat similar to the penetration solver I mentioned last time, but is used when immediate results are needed. The system starts tracing out lines from each corner of the player’s bound box, trying to find the area it thinks is the least stuck, and moves the player a little bit that way. It keeps repeating that process until the player isn’t stuck anymore.
  116.  
  117. If it fails horribly, the panic solution is to force the player back through the portal because we know their AABB legitimately walked into the portal on that side, so there must be room for them.
  118.  
  119. The player collision code in Portal 2 has better solutions to ensure we don’t need to run “unstuck” code as often, but it still happens from time to time. If you’ve ever seen a coop game have a player instantly die when the players are walking through portals near each other, that’s the panic portion of the “unstuck” code running.
  120.  
  121.  
  122. So, on to individual analyses. Once again, I could be very wrong. These are nontrivial bugs.
  123.  
  124. 1. I’m not familiar enough with the level to figure out the relationship between the portals and where the player ended up. But the fact that the player starts off wedged into the ceiling and is trying to teleport to an angled surface indicates there’s probably an unstuck failure going on. I’m not sure if that leads into a teleportation bug afterwards.
  125.  
  126. 2. It looks like the player teleports, the unstuck code panics and forces them backwards through the portal. But for some reason I’m not sure about, it looks like it teleports them backwards twice. As you can see at the end of the video when the player backs into the portal. The outline of the back of the blue portal is in the same relative position to the player as the orange portal was before they teleported. So there’s definitely a portal transformation at work here.
  127.  
  128. 3a. The first example probably has something to do with the moving portal. I *think* we have code that forces a held cube to the same side as the hold player to help with that level, maybe I’m remembering wrong, maybe we tried that and cut it before shipping due to other bugs. Maybe the cube got brought over to the blue side causing a collision and the solution was to push the player back through (possible double teleport?).
  129. 3b. The second example looks like the same result as #2. The player must have been forced backward twice. I'm really not sure why the unstuck code would run here since the two portals are axis aligned. Possibly a side effect of glitching the level triggers? That's really just a guess though. It definitely looks like the orange->blue transform was applied while the player was on the blue side, but I’m unsure why.
  130. 3c. Totally a guess. But this looks like the unstuck code again. The blue portal looks like the bottom is awfully close to the incinerator. Close enough that when the player enters the orange portal near the bottom, their AABB gets stuck in the incinerator, then forces them backwards twice.
  131.  
  132. 4. If you watch the commentary (for that very level I believe), you'll hear me talk about creating a physics bubble around the portal. Each time you place a portal we look at all the nonmoving geometry around it and make a copy of that geometry with a hole cut behind the portal. It looks like the player is walking on a copy of the floor. The logic for copying geometry gathers an area far larger than it needs which accounts for being able to walk down the exit hallway a little bit.
  133. When save/load aren't in effect. The game uses a trigger volume around the portal to determine when entities should start and stop interacting with that particular portal's physics environment.
  134. Loading a save game has to do it's best to figure out if a player is in a portal or not. And that code runs independently from the code that determines if an object is touching a trigger volume.
  135. I believe in this case, the portal has determined the player should use it's physics bubble, but the trigger system has decided that the player is not “touching” the portal volume. So when the player walks away, nothing is informing the portal of that and the player is still in its physics bubble.
  136.  
  137.  
  138. Once again, all of that is based on initial observation of what’s going on. Fixing bugs usually comes with a twist or surprise between what we initially think is going on and what’s actually going on. And I don’t recall ever seeing a “double teleport backwards” as I’ve been referring to it here. So I’m not sure why that’s happening. Anything I could come up with would be 100% uninformed wild speculation. So I’m going to keep that to myself.
  139.  
  140. Hopefully all that provides something useful.
  141.  
  142. -Dave
  143.  
  144. From: Norferzllo . [mailto:norferzlo@gmail.com]
  145. Sent: Sunday, September 28, 2014 5:34 PM
  146. To: Dave Kircher
  147. Subject: Re: [Contact Form] I'm trying to understand a portal bug for speedrunning and hoped you could help
  148.  
  149. 1. Hi, thanks a bunch for the response! We seriously weren't expecting one and we were shocked and ecstatic when there was a reply.
  150. 2.
  151. 3. We don't mean to waste your time but we had some questions about other glitches. Even years after discovery, some of them still remain a mystery. We know the "how", but not the "why".
  152. 4.
  153. 5. Some of the following glitches have a similar effect: they "teleport" you to a part of the map based on portal orientation and position. However, the methods about which to do the next three glitches vary.
  154. 6.
  155. 7. 1. Large angle glitch. This is used in Chamber 19 to skip part of the map putting a portal on the angled surface and the opposite portal right above you (so you can stand). Then while crouching, we jump then let go of everything in a very fast manner and it warps us to another part of the map. This actually messes up collision (we fall out-of-bounds) unless we shoot a portal before doing the inputs.
  156. 8.
  157. 9. Example: https://www.youtube.com/watch?v=Zoz-iFL3DC0&feature=youtu.be&t=10m30s
  158. 10.
  159. 11. 2. Acute angle glitch. This allows us to skip the glass in escape_01 (instead of having the turret shoot it for us), and sometimes it puts us out-of-bounds. Check out the following video for an example and a bit more info in the description. Example:
  160. 12. https://www.youtube.com/watch?v=YtWIkXeHxD0
  161. 13.
  162. 14. 3. Vertical angle glitch. This is the one out of the three that we have zero idea how or why it works. The only way we've gotten it is randomly while playing the game and going through portals. This is super important and probably the one we care about most to understand because it could save a lot of time in different areas. Here are three examples:
  163. 15. http://youtu.be/D-K65f3Fi4M?t=15s
  164. 16. http://www.twitch.tv/xeiz/c/4499829
  165. 17. https://www.youtube.com/watch?v=DI8xnxwlTlM
  166. 18.
  167. 19. 4. This one is a bit different: Save Glitch. We shoot a portal on the edge of a surface, stand slightly behind it (edge glitch, the game thinks we have gone through the portal but our camera hasn't causing our portals to fire from the top of the other portal), then save+load. For some reason, the game sort of preserves the edge glitch but we are able to move around. If we are behind the portal we saved on top of, our portals fire from an invisible body that mimics our camera's movement but from the top of the other portal. If we are in front of the portal we saved on our body is put back to where our camera is and we fire normally. How the game decides where we can walk and where we will fall through the floor isn't really known. Going in the proximity of the portal (like directly in front of it) deactivates the glitch. Here's an example: https://www.youtube.com/watch?v=2BtRYchi_4U
  168. 20.
  169. 21. 5. Do you know of any Source Engine/Portal oddities that haven't been explored yet? We would like to think that we've found almost everything there is to find in the past 7 years, but who knows. We didn't make the game :p
  170. 22.
  171. 23. Sorry for the billion questions and for pestering you again, but it's really interesting to find out the details of these glitches that still largely remain a mystery. It means a lot to us and could potentially help with future speedruns. While we are breaking the game that you had a part of making, it keeps us playing every day even 7 years after release. There's a reason why some of us have 1000+, or even 2000+ hours in this game. Thanks again!
  172. 24.
  173. 25. -The Portal Speedrun Community
  174. Attachments area
  175. Preview YouTube video Portal - No OoB in 13:09
  176.  
  177. Portal - No OoB in 13:09
  178. Preview YouTube video "Acute Angle Glitch"
  179.  
  180. "Acute Angle Glitch"
  181. Preview YouTube video Ch 01 Faster Than PDI
  182.  
  183. Ch 01 Faster Than PDI
  184. Preview YouTube video Weird LAG thing in GLaDOS Chamber
  185.  
  186. Weird LAG thing in GLaDOS Chamber
  187. Preview YouTube video save glitch demo
  188.  
  189. save glitch demo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement