why portal flow is taking to long?

Discussion in 'Mapping Questions & Discussion' started by ricardojvc6, Aug 25, 2009.

  1. ricardojvc6

    ricardojvc6 L6: Sharp Member

    Messages:
    268
    Positive Ratings:
    64
    i'm wondering why portal flow is taking to too much time is there any help like videos to help because of this i quit for making manny maps because i tought there no repairing
     
    Last edited: Aug 25, 2009
  2. JoshuaC

    JoshuaC L7: Fancy Member

    Messages:
    446
    Positive Ratings:
    145
    Portal flow taking a long time usually means your map could use some optimization.
     
    • Thanks Thanks x 1
  3. grazr

    aa grazr Old Man Mutant Ninja Turtle

    Messages:
    5,436
    Positive Ratings:
    3,561
    First step: convert any detail geometry into func_detail, func_lod or func_brush
    second step: add hint-skip brushes.

    additionally, go to map>Load Portal file in hammer to see how your visleaf's were contstructed without going ingame and having to type in sv_cheats and r_drawvisleafs. Loads of small blocks are bad, especially if they are at unusual angles.
     
    • Thanks Thanks x 2
    Last edited: Aug 25, 2009
  4. ricardojvc6

    ricardojvc6 L6: Sharp Member

    Messages:
    268
    Positive Ratings:
    64
    well i think that should help thx :)
     
  5. Sgt Frag

    Sgt Frag L14: Epic Member

    Messages:
    1,443
    Positive Ratings:
    294
    I'd actually recommend loading the portal file BEFORE adding hints. Then you actually know where they are needed. But you need to do a full vis compile first (don't do lighting), a fast vis won't give you accurate results.

    Then learn how hints work and implement them based on how your full vis comes out.

    Adding hints willy nilly will not only have bad effects on performance but will add more vis_leafs which in turn will slow down the compile process.
     
  6. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    One other thing to watch out for is that if you have huge outdoor spaces VVIS may take a while with the boxes it creates inside those, but func_viscluster can help speed this up.

    (It only speeds up VVIS, It won't speed up the actual in-game performance, and if used incorrectly will harm in-game performance.)
     
  7. ricardojvc6

    ricardojvc6 L6: Sharp Member

    Messages:
    268
    Positive Ratings:
    64
    it apears small medium large cubes how to do i know what is good and its bad and how to place the vis leafs in places what are good and are bad
     
  8. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    Go here:
    http://optimization.interlopers.net/

    Chapters 4 and 5 are what you want to look at. The boxes themselves are normal--you'll always have some--but the goal is to avoid creating lots and lots of weird tiny boxes, because this makes the "can box X see box Y" calculations take a long time.

    func_detail is a method to tell the system to not bother trying to calculate whether a brush fully blocks things behind it. Like the bars in a prison cell door, a thick pillar in a lobby, or a bookshelf along the wall, etc. It doesn't directly affect whether or not the player can see through it with their eyeballs, whether they can shoot it, or whether they can stand on it, it just tells the computer not to bother paying attention to it the same way it does with walls/floors.
     
    • Thanks Thanks x 1
    Last edited: Aug 25, 2009
  9. grazr

    aa grazr Old Man Mutant Ninja Turtle

    Messages:
    5,436
    Positive Ratings:
    3,561
    Loading the portal file before hand is a good idea to see the damage. But,

    Long portal flow is a result of the computation of what can be seen from where more than how many leafs are being created. The time is put into the mathematics involved in resolving said inneficient leafs. Not that you should place hints 'willy nilly', but 'willy nilly' hints would negligably effect compile time (relavent to your system capabilities). The worst result would be an increased file size. As long as your computer isn't 8+ years old, hundreds of hints wont really make a whole lot of difference to the compile time.

    Whilst you seem to grasp the mechanics of hints, you don't seem to understand the process of vvis.exe.
     
    • Thanks Thanks x 1
    Last edited: Aug 25, 2009
  10. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    Having too many tiny visleaves is a problem for VVIS, but for the actual in-game engine... the main issue would be memory use rather than CPU power, if anything.

    IIRC, the output of VVIS is a huge hash table of visleaves:
    • X can see W,Y,Z
    • Z can see X
    • W can see X, U
    • U can see W
      ... And so on.

    This is--by design--a relatively fast thing for your computer to look up every time you enter a new visleaf. Having the visleaf landscape be unnecessarily-detailed (that is, lots of visleaves, not lots of func_detail) isn't that big of an in-game performance hit. The hash table scales pretty well, so it would show up as a relatively-minor increase in memory usage.*


    Summary:
    • Having lots of visleaves (or a few highly-connected ones) slows down VVIS, but doesn't harm in-game performance anywhere near as much.
    • The opposite problem--enclosing your entire map in a func_viscluster or func_detailing all your walls--is extremely easy on VVIS, but very hard on your in-game performance.
    • Could hint-brushes "willy nilly" harm gameplay speeds? Yes, but by a relatively small amount compared to other sources of performance issues. Could they harm VVIS speeds? You'd have to place a lot of them.


    *Assuming your "many tiny visleaves" aren't parts the player would put their body into, which would have a bigger effect since it would trigger more lookups.
     
    • Thanks Thanks x 2
    Last edited: Aug 25, 2009
  11. ricardojvc6

    ricardojvc6 L6: Sharp Member

    Messages:
    268
    Positive Ratings:
    64
    i have put all stairs roofs func_detail but nothing changes what i can do to change the vis leafs it apears the leafs the same
     
  12. Psy

    aa Psy The Imp Queen

    Messages:
    1,705
    Positive Ratings:
    1,466
    Show use a screenshot of your map in Hammer with all func_details turned off.
     
  13. ricardojvc6

    ricardojvc6 L6: Sharp Member

    Messages:
    268
    Positive Ratings:
    64
  14. Psy

    aa Psy The Imp Queen

    Messages:
    1,705
    Positive Ratings:
    1,466
    Woah. You need to func_detail that pyramid for a start.
     
  15. sniprpenguin

    sniprpenguin L6: Sharp Member

    Messages:
    266
    Positive Ratings:
    126
    Yeah, start with that pyramid as Psy said, then go in and func_detail all of those stairs! And remember that changes to the visleafs showing won't change unless you recompile your map.
     
  16. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    Huh? The pyramid itself doesn't look that bad to me. Just put a horizontal hint brush through the area at its apex-height to keep it from projecting upwards, or detail the top mini-pyramid to leave a flat roof. It's certainly big enough to be a legitimate vision-blocking item. (I may also just be jaded after working with the 2fort spiral ramp ceilings.)

    I'd focus on the stair steps. Look at the last few pictures in this link to see how to do it.

    Like sniprpenguin said, you need to re-run the VBSP step and then reload the portal file in order to see changes in the blue portal lines.

    _____________

    As a side note, the map looks a bit too much on the "large and open with long long hallways" side.
     
    Last edited: Aug 25, 2009
  17. ricardojvc6

    ricardojvc6 L6: Sharp Member

    Messages:
    268
    Positive Ratings:
    64
    right i func_detailed the pyramid there is stairs what are func_detailed too and roofs too just know i need to optimize it with skip hint areaportal and occuluder well i need help where to put it
     
  18. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    Did you read through that Interlopers.net optimization guide?

    IMO you may want to hold off on more than basic optimizing if you think you'll be making significant layout changes in the future.

    If VVIS is still the annoying part, try putting a few func_viscluster blocks to group up, to enclose the bulk of that empty air in the central yard.
     
    Last edited: Aug 25, 2009
  19. JoshuaC

    JoshuaC L7: Fancy Member

    Messages:
    446
    Positive Ratings:
    145
    Really when you're starting out you only need to worry about learning how to use func_detail properly. Hints, Areaportals, and Occluders are tricky to set up and can mess the map up bad if used improperly.
     
  20. grazr

    aa grazr Old Man Mutant Ninja Turtle

    Messages:
    5,436
    Positive Ratings:
    3,561
    Is unfortunatley a relative term. Particularly when we're talking about a real map scenario or for a 'for the sakes of arguement' one. If you're using hints properly then one shouldn't be abusing hint brushes and subsequently portal flow time. The point of hints are to get the most efficient leaf setup. Adding them willy nilly was interprited as unnecassery inclusion of hints for portals already efficient, and thus no change would be made to portal count at all.

    The portal file will mostly help you find inefficient leaf setups around holes such as windows or doors, or missed detail geometry/generally complicated geometry (such as your stairs).

    Determining more advanced usage of hints in open terrain is up to player tenacity and inginuity.