Wall does not block vis Created 8 years ago2016-04-25 20:15:53 UTC by Kaner Kaner

Created 8 years ago2016-04-25 20:15:53 UTC by Kaner Kaner

Posted 8 years ago2016-04-25 20:15:53 UTC Post #329982
Hello people I'm here again with another topic.

It's true nowadays it is not necessary to optimize a goldsrc map as could it be 10 years ago, but I'm wondering the way that vis works in the game.

When I run the map with gl_wireframe 2, I can see the engine renders all the stuff inside the house and it is supposed that it don't have to be rendered because there are a roof and a wall to block the vis and create another leaf

This is what game is rendering, as you can see, the wall does not block anything.
User posted image
And this is a valve hammer top view, I marked in blue the walls of the house in order you can see the entries available to "see" the inner stuff of the house.
The player is marked as a dot.
User posted image
How can I block the rendering of the inside the house from outside? Where should I put a hint brush?

Thank You for answering!
Posted 8 years ago2016-04-25 23:22:39 UTC Post #329983
try compiling with vis -full, and if those objects are entities they are a bit harder to hide
Posted 8 years ago2016-04-25 23:39:31 UTC Post #329984
I've compiled with -full

hlvis.exe -full -texdata 524288 -lightdata 524288 -estimate %mapName%

so I don't understand why the engine load that :/
Posted 8 years ago2016-04-26 06:32:26 UTC Post #329985
Rendering is not based upon line of sight. Roughly, if the area the player is in can see the geometry it will render.

Assuming the doors are the only connections into the warehouse:

Your best bet is to do a little bit of redesign and make your doorways into that warehouse a bit "deeper" or have a short hallway of ~ 128 units before you enter the warehouse.

As designed, your only option is to add some hint brushes to make sure vis is cut properly around the doors.
Posted 8 years ago2016-04-26 08:40:59 UTC Post #329986
try other compile tools, would be interesting
Posted 8 years ago2016-04-26 09:54:04 UTC Post #329987
It's true nowadays it is not necessary to optimize a goldsrc map as could it be 10 years ago, but I'm wondering the way that vis works in the game.
I disagree, some players are still running on Windows XP with 1 core CPU and a few hundred of Mb of RAM and GPU that barely support "modern shaders" and OpenGL versions (3.X, 4.X), it's not my case, but I know some people who does (and they aren't lying, they sent me screenshots of their report with HWINFO32).

Even with fast computers, optimizing to the max can save precious FPS.

"People say that you should not micro-optimize. But if what you love is micro-optimization... that's what you should do." - Linus Torvalds (father of Linux), (2012-06-14). Audience Q&A following interview panel at Aalto University Center.

And I think this is true as well for any aspect of game development and not only programming (level design, art, modeling...)
Rendering is not based upon line of sight. Roughly, if the area the player is in can see the geometry it will render.
To be more precise, it's the PVS (Potential Visibility Set).

Please note that my explanations may be incorrect and anyone is free to correct me if I'm wrong (I'm not very good at explaining stuff so I'll try to do my best)

In all maps there is a BSP tree and every "leaf" of that tree represent a "collection of polygons" or an "area" in your map if you prefer. In other words, all those BSP leaves form a single BSP tree which is the map itself.

Every in-game frame, the engine will determine on which BSP leaf you are currently in and calculate which leaves you can actually see and those you may be able to see. Once that process is done, the rendering is done. Bruce mentioned it in his post and I'm gonna post it again for the record : entities are treated differently.

Something you can do is try to help the compilers delimit those leaves thanks to SKIP and HINT brushes. This excellent tutorial will explain you how it works.

A word of warning : don't abuse HINT/SKIP brushes and use it intelligently otherwise you will have the exact opposite effect of optimization, they are here to help but not replace the job of the compilers.

In the case of your map, I would try to cover the warehouse door on the left, the back door on the right and the ventilation shaft entrance at the rooftop (from the level of the roof to the "ceiling" of the shaft). This will separate the "inner" and "outer" parts of your map.

UPDATE : Another good tutorial by Andy posted here on TWHL about HINT/SKIP
Posted 8 years ago2016-04-26 11:14:55 UTC Post #329988
I've had success using hint brushes horizontally. Try extending a hint brush out from the roof line as well
Tetsu0 Tetsu0Positive Chaos
Posted 8 years ago2016-04-26 17:29:58 UTC Post #329989
I'm going to try everything and I will tell you about!

Thank you people for answers! :)
Posted 7 years ago2016-04-26 20:10:01 UTC Post #329990
From first screenshot, looks like poor optimization with hint brushes so far. The stuff behind the stacked red containers with ladder on the left shouldn't be rendered, easily fixed with hint brushes around that container. But it makes me wonder if the top leafs from inside are "leaked" through the above mentioned container side.
If you optimize around the container, i think it should be fine, if not i'd try what Tetsuo said and start by placing a horizontal hint brush across the map at the height of the container, in case there's a leak at roof height.

There's also the purplish looking brushes from 2nd screenshot which i believe is Hammer way of drawing func_walls? If those func_walls are "touching" any leaf that is visible from outside, you done goofed
A word of warning : don't abuse HINT/SKIP brushes and use it intelligently otherwise you will have the exact opposite effect of optimization, they are here to help but not replace the job of the compilers.
I've managed to finish my last goldsource map without any surface splitting from the compile tools by basically organizing my map in volumes, aka abusing the F out of hint brushes :P
Posted 7 years ago2016-04-27 02:04:34 UTC Post #329991
First test just putting an horizontal hint over the red container (Tetsu0).

I will keep testing all the other solutions you talked and I will tell you how it works :D
User posted image
User posted image
Thank you! :)
Posted 7 years ago2016-04-27 11:16:54 UTC Post #329992
Woah you cut your polys in half! Good work
Tetsu0 Tetsu0Positive Chaos
Posted 7 years ago2016-05-08 21:01:10 UTC Post #330074
Thanks for your comments. I've read the hint tutorials and what I've got from it is:

1. Every brush is rendered actually in two triangles.
2. The engine will load whatever could be seen from the triangle where the player is.
3. The hint brush is used to seal some area as if it was a world brush but you can go through it and you can't see it.
4. If at any point in the extension of the triangle where the player stands is visible the hint brush, then the sealed area will be cleared and the engine will load the corresponding brushes.

I'm still optimizing my map with hint textures, I'm trying to reach 600 wpoly as maximum in every place, but it is so hard.

I'm putting hint brushes horizontally crossing all the map, like sky but in a lower level, and I've done this several times, in every highs level (roofs, etc).

Moreover I put some hint brushes vertically and diagonally in some corners of the hallways in the same way as explain the tutorials you mentioned (Shepard62700FR)

The fact is I have dozens of hint brushes, maybe what I'm saying is crazy but is what I'm doing, so please tell me if I'm wrong or not.

In addition I noticed func_detail don't block vis and made me some leaks in some places and they are also loaded before by the enigne than world brushes.

Is there any recommended limit for putting hint brushes?

Finally I put some images for who want to give any idea, in this case is a view of the back door from the outside, is it possible to avoid to load all the inside of the house?

Game view:
User posted image
World Craft view:
User posted image
Thank You people for your suggestions, your comments are so helpful for me :)
Posted 7 years ago2016-05-11 14:20:05 UTC Post #330091
I'm still optimizing my map with hint textures, I'm trying to reach 600 wpoly as maximum in every place, but it is so hard.
I think 1000 wpolys is a good limit.
You must be logged in to post a response.