Slashdot Mirror


Examining Portal's Teleportation Code

Gamasutra is running a story deconstructing the mechanics of Portal's teleportation programming. They present a snippet of Portal's code and a downloadable demo. They ran another article in this series earlier this year with an analysis Mario Galaxy's unique take on physics. We've discussed the development of Portal in the past. "Teleport mechanics in video games are nothing new. Puzzles from the original Gauntlet were memorable -- and more than likely, that wasn't the first game to use teleportation as a gameplay mechanic. The difference between Portal and all those that came before it is that Portal's teleportation acts as a frictionless tube between point A and point B. Physics are still hard at work inside the frictionless tube. Instead of simply repositioning an object from point A to point B, the player enters point A with full velocity and exits point B with the same speed, but moving in a new direction." Update: 8/26 at 19:37 by SS: Dan notes that the code was not directly from Portal; it was written to approximate Portal's physics.

33 of 278 comments (clear)

  1. Frictionless tube? by Anonymous Coward · · Score: 5, Funny

    Your mom has a frictionless tube.

    First post?

    1. Re:Frictionless tube? by Chris+Burke · · Score: 5, Funny

      For friction to be present, the object being inserted into the tube must be large enough to touch the sides. That must be your problem.

      --

      The enemies of Democracy are
    2. Re:Frictionless tube? by jollyreaper · · Score: 4, Funny

      For friction to be present, the object being inserted into the tube must be large enough to touch the sides. That must be your problem.

      THAT'S WHAT SHE SAID! -er, shit. *self pwn*

      --
      Kwisatz Haderach
      Sell the spice to CHOAM
      This Mahdi took Shaddam's Throne
    3. Re:Frictionless tube? by noundi · · Score: 2, Funny

      Your internet has a series of frictionless tubes. *high fives Ted Stevens*

      --
      I am the lawn!
  2. Portal by CaptainPatent · · Score: 4, Funny

    Regardless it's a lot better than quantum teleportation.

    --
    Well, back to rejecting software patent applications.
    1. Re:Portal by ElizabethGreene · · Score: 4, Funny

      First thought: "Hey, if it can work within or near the event horizon of a black hole we could time travel!".

      Second thought: "Wound this violate one of the laws of thermodynamics?"

      Third thought: "I need a life."

    2. Re:Portal by beav007 · · Score: 2, Funny

      It's not the execution, it's the cake.

      Note that, in Portal, execution and cake seem to be linked...

    3. Re:Portal by grahamd0 · · Score: 2, Funny

      It's not the execution, it's the cake.

      I didn't want him to think of me as a liar.

  3. But... by i.r.id10t · · Score: 5, Funny

    But... can they telefrag?

    I just love the sound of 2 bodies trying to occupy the same space at the same time in the morning... or afternoon... or evening...

    --
    Don't blame me, I voted for Kodos
    1. Re:But... by Anonymous Coward · · Score: 1, Funny

      I just love the sound of 2 bodies trying to occupy the same space at the same time in the morning... or afternoon... or evening...

      And stop peeking into our windows, you're creeping my wife out.

  4. Too verbose by Anonymous Coward · · Score: 5, Funny

    >>Physics are still hard at work inside the frictionless tube. Instead of simply repositioning an object from point A to point B, the player enters point A with full velocity and exits point B with the same speed, but moving in a new direction."

    Should be "Speedy thing goes in; speedy thing comes out."

    1. Re:Too verbose by elrous0 · · Score: 5, Funny

      My ex-girlfriend used to use that exact phrase all the time.

      --
      SJW: Someone who has run out of real oppression, and has to fake it.
  5. Ahoy, GlaDOS! by Stanistani · · Score: 4, Funny

    I want to see the nautical version, Porthole.

    1. Re:Ahoy, GlaDOS! by Darth_brooks · · Score: 4, Funny

      I'm waiting on the hot grits version, Portman

      --
      There are some people that if they don't know, you can't tell 'em.
    2. Re:Ahoy, GlaDOS! by Underfoot · · Score: 3, Funny

      I want to see the white water version, Portage.

      --
      I mentioned tinker-toys once in a post - now I'm modded down for life.
    3. Re:Ahoy, GlaDOS! by Captain+Splendid · · Score: 4, Funny

      I'm waiting on the drunken lawyer version, Port

      -Rowley Birkin, QC

      --
      Linux, you magnificent bastard, I read the fucking manual!
    4. Re:Ahoy, GlaDOS! by Anonymous Coward · · Score: 5, Funny

      The grits are a lie :(

    5. Re:Ahoy, GlaDOS! by MobileTatsu-NJG · · Score: 4, Funny

      I'm waiting on the drunken lawyer version, Port

      I'm waiting for the Wii version, P.

      --

      "I like to lick butts!" by MobileTatsu-NJG (#32700246) (Score:5, Informative)

    6. Re:Ahoy, GlaDOS! by shadwstalkr · · Score: 2, Funny

      I'm waiting for the Wii version, P.

      I'm waiting for the Scrabble version, Portmanteau.

  6. The code by anomnomnomymous · · Score: 2, Funny

    The code is a lie!


    Ok, sorry...

    --
    When you shoot a mime, do you use a silencer?
  7. Re:M.C.Escher has good OLD examples of the concept by Anonymous Coward · · Score: 1, Funny

    Speaking of, whens he gonna put a new album out?

  8. Next step? by Aranwe+Haldaloke · · Score: 4, Funny

    Porting Portal's portal code?

    1. Re:Next step? by saboola · · Score: 5, Funny

      I'm not a portal porter
      I'm a portal porter's son
      And i'm only porting portal
      Till the portal porter comes

  9. Re:WTF by kestasjk · · Score: 5, Funny

    It didn't answer the main question for me: How does the code which accelerates players downwards work?

    It must be using some kind of vector mathematics for mapping acceleration onto velocity, and velocity onto position, but I'll be damned if I can figure out how they expressed that in an algorithm.

    --
    // MD_Update(&m,buf,j);
  10. Re:It would have been more fun by Underfoot · · Score: 1, Funny

    We need a Pratchett based online FPS! Dwarf Bread for weapons; you can play as a Gollum; Discworld based physics.

    That would be super-sweet!

    --
    I mentioned tinker-toys once in a post - now I'm modded down for life.
  11. Re:It would have been more fun by Punko · · Score: 2, Funny

    Dwarves on Discworld don't fight golems. They fight trolls. This is why the internet needs more dwarves.

    --
    If only we could fall into a woman's arms without falling into her hands
  12. Re:It would have been more fun by xouumalperxe · · Score: 4, Funny

    multi-hundred pound canon

    Omnianism has loads of holy books, but I don't think even those collected amount to several hundred pounds.

  13. Re:M.C.Escher has good OLD examples of the concept by Chris+Burke · · Score: 4, Funny

    Speaking of, whens he gonna put a new album out?

    Are you talking about M.C. Escher who designed the crazy staircase house? Or David Bowie, who lives there?

    --

    The enemies of Democracy are
  14. Re:Ahhh by MobileTatsu-NJG · · Score: 1, Funny

    I got a great blow-job last weekend. It was like she was making out with my dick.

    It was wonderful.

    And when you were done, did you type 'afk' and light a cigarette?

    --

    "I like to lick butts!" by MobileTatsu-NJG (#32700246) (Score:5, Informative)

  15. Re:WTF by billsnow · · Score: 3, Funny

    velocity is the correct term. even though the moving object changes direction within the 3 dimensional space, the vector value must be retained in relation to the plane of the original portal and translated to the plane of the new portal. don't feel bad; as an engineer, i'm accustomed to correcting physics majors on such topics.

  16. Re:Portal Physics 101 by Atzanteol · · Score: 2, Funny

    Sooo... Speedy thing goes in, speedy thing comes out?

    --
    "Ignorance more frequently begets confidence than does knowledge"

    - Charles Darwin
  17. Asteroids anyone? by mfnickster · · Score: 3, Funny

    Didn't Asteroids have prior art on this..? :)

    --
    "Slow down, Cowboy! It has been 3 years, 7 months and 26 days since you last successfully posted a comment."
  18. Re:Ahhh by yanyan · · Score: 2, Funny

    +1, Touche.