[Tutorial] Areaportals - All you need to know

Discussion in 'Tutorials & Resources' started by Psy, Nov 2, 2009.

  1. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    Well, they also use a crapload of props...
     
  2. Psy

    aa Psy The Imp Queen

    Messages:
    1,705
    Positive Ratings:
    1,465
    Grazr is right. Look at these.

    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
     
    • Thanks Thanks x 1
  3. grazr

    aa grazr Old Man Mutant Ninja Turtle

    Messages:
    5,436
    Positive Ratings:
    3,550
    Areaportal's also stop player models from being rendered, you can consider this as well, especially for high traffic area's. Although i'm not sure about particle effects.
     
  4. Vander

    Vander L8: Fancy Shmancy Member

    Messages:
    507
    Positive Ratings:
    109
    Great tutorial! Thank you for taking the time to do it.
     
    • Thanks Thanks x 1
  5. The Political Gamer

    aa The Political Gamer

    Messages:
    4,468
    Positive Ratings:
    1,680
    Um a bunch of the pictures are not working. :(
     
  6. JSTProductions

    JSTProductions L1: Registered

    Messages:
    31
    Positive Ratings:
    10
    You should mention that only world brushes can seal Areaportals.
     
  7. Bob Ross

    Bob Ross L3: Member

    Messages:
    105
    Positive Ratings:
    9
    will this help to drasticaly improve portal flow?
     
  8. Psy

    aa Psy The Imp Queen

    Messages:
    1,705
    Positive Ratings:
    1,465
    Not really. Areaportals do split visleafs which can make VVIS take longer but for a good cause. When a large amount of time is spent on portalflow this is due to bad mapping technique and a lack of planning ahead to work in favour of how VIS works.
     
  9. scswift

    scswift L1: Registered

    Messages:
    4
    Positive Ratings:
    0
    From a programming standpoint, I think it's interesting how the engine takes the portal's convex polygon and wraps it in a 2D axis-aligned bounding box on the screen for the actual clipping. They must do this as well for the bounding boxes of the props.

    Comparing two screen-space rectangles to see if they overlap is much cheaper (and easier to code) than testing a 3D bounding box against a convex screen-space polygon.

    Of course you end up including a few props here and there which aren't actually visible through the portal, but that is an acceptable tradeoff.
     
  10. grazr

    aa grazr Old Man Mutant Ninja Turtle

    Messages:
    5,436
    Positive Ratings:
    3,550
  11. Psy

    aa Psy The Imp Queen

    Messages:
    1,705
    Positive Ratings:
    1,465
    They seem fine to me. Hmm.
     
  12. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    All player collision boxes are also AABB, used for testing if players are touching one another and for weapons like rockets, huntsman, and melee attacks. The flamethrower's normally-invisible projectiles are too.
     
  13. andriod

    andriod L1: Registered

    Messages:
    7
    Positive Ratings:
    0
    sorry if this sounds noob, im new to mapping.

    So it will only merge if it has the same dimensions and position, and by linking them you have to name them the same.

    Now my questions:
    To close a certain room off you would have to link them, and to link they have to have the same name, right?
    So if the above is true say you have more than 2 exits from the room, then you would have to name 3 areaportals the same, correct?
     
  14. Psy

    aa Psy The Imp Queen

    Messages:
    1,705
    Positive Ratings:
    1,465
    Each areaportal would need a unique name if it is to be linked and controlled by a func_door. You don't need every areaportal in an area to be linked and so they can just remain open.
     
    • Thanks Thanks x 2
  15. Boylee

    aa Boylee pew pew pew

    Messages:
    1,068
    Positive Ratings:
    630
    You're my hero Psy. Areaportal merging was killing my map and this is the only tutorial I've found that covers it. Expect arbitrary thanks for any random post you make for the next few days. :lol:
     
  16. Mr Egg

    Mr Egg L1: Registered

    Messages:
    31
    Positive Ratings:
    0
    Yeah, Aeraportals seem great and all, they seem easy to put in place but... How does that work ?? ><" I mean I can use them but what does it do, exactly ?
     
  17. Boylee

    aa Boylee pew pew pew

    Messages:
    1,068
    Positive Ratings:
    630
    errrrr, did you even read the tutorial?
     
  18. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    They designate large zones of the map and tell the engine: "If the player isn't actually inside this part of the map, take more time than normal to only draw the stuff they can see through the doorway, because in this case the extra processing power is worth it to avoid extra crap."
     
  19. temion

    temion L2: Junior Member

    Messages:
    77
    Positive Ratings:
    4
    Amazing tutorial. Pretty much just doubled the FPS on my current project.
     
  20. radarhead

    aa radarhead Hands out ratings like cheap cigars

    Messages:
    993
    Positive Ratings:
    527
    I didn't understand areaportals at all before reading this... I thought they just stopped stuff from rendering behind them when closed. Literally the best areaportal tutorial out there!