Displacement Leaking

Mapster

Newbie
Joined
Feb 16, 2005
Messages
357
Reaction score
0
I have started working on a cave for the half-life 2 episode 2 engine using the displacements; but my map keeps on pointing out leaks in my map where the displacements seem to be leaking. The entity's that are pointing to the displacements point to the center of the displacement so i am taking it the displacements don't act as "walls" which block out the outside area.
I have looked around for tutorials on google for 2 days trying to sort this out, does anyone have an idea on what i could do so i don't have to put a box around my map to stop it from leaking?

Cheers,
Mapster

PS: Sorry for starting 2 topics.
 
Displacements do not seal the world, and therefore require regular brush geometry to seal the world in a level. I will show an example level with a single displacement brush:

Here is our room. This is what the room should look like from above, in Hammer, with a single displacement brush, five regular brushes (one unseen, this has yet to be sealed properly), and an info_player_start.

This is what that same room would appear like from underneath without the room being sealed properly. Note that only the visible parts of the displacement should be set as a displacement surface, and the rest should be invisible.

This is what the same room should look like underneath when it is sealed properly. (The missing NODRAW brush was the only mistake.)

A displacement brush is similar to a brush entity, and it cannot seal the level. A difficult level -- where the room may be entirely displacement brushes -- requires at least one regular brush for each displacement brush underneath it (top or bottom) or "outside/beside" it (sides) which all come together to seal the level in the same manner that a regular room is sealed. They should not clip into or through the displacement brushes, and must have no gaps, and may not be a brush entity.

If I've left something out (though I'm fairly sure I didn't), others please feel free to correct me.
 
So i don't really have any choice but to cover the map with another box?
 
You don't have to make a giant box around your whole cave level, that'd probably be bad for VIS actually as I don't think displacements block VIS. But you could make outer nodraw brushes similar to the design of your cave layout, so you still get a pretty good leaf layout. But yeah, you do have to use nodraw brushes to seal the leaks, it'd be like if you had a detailed hallway where the walls and ceilings were func_details - you'd have to put nodraw brushes just outside them to seal them from the void.

caveleafsmr9.png


If you put a big box around that whole thing, entities and whatnot near the end of the cave would be rendered at the very beginning of the cave, since displacements don't block vis. I'm kinda new to source mapping but I'm almost positive all that is right, but someone correct me otherwise

EDIT

Actually, my first image is a little too wasteful, so I just wanted to update it. It creates too many unneeded leafs because of the diagonal brushes. You DO need separate leafs for the different parts of your cave to hide stuff the player wouldn't be able to see anyways, but making all those little diagonal brushes close to walls like I made in the first image just would make too many pointless leafs that wouldn't help anything by existing. I was going to just replace my old image, but then I decided to leave the old one up too for comparison, so you can see what I'm talking about. Here's the more optimal layout - I'm pretty sure, again I'm sorta new. Hope it helps a little though, good luck with your cave :)

caveleafs2gf0.png
 
I put a box around my map and it did take about 10x longer to compile. I did not like it and the game kept on crashing every time i tried going back into game when it's alt-tabbed but it didn't give an error pointing to the map.
That wouldn't be because of the displacements would it?
 
If you literally put a nodraw box encasing your map, as in, encasing your entire map, then yeah that will increase compile times and it's really inefficient. The compile tools think that allllll that empty space inside that box is space in your map, so it's included in the compiling calculations. This is like... painting your whole room with solid red paint, instead of just painting a little model car in your room red. You want to just compile your map, not all the empty space around your map AND your map, just like you should only want to paint the little car, not everything in your room, know what I mean?

If you have a cave section, you need to make nodraw hallways outside of your cave tunnels to seal it off, but not one big box. Calhoun's post explains it and my other post showed you how to do it (I think, lol)
 
Look at the pictures above. As far as the game goes, the yellow walls decide what can be seen. Things that cannot be seen are not rendered and dont affect the framerate. In your case your entire map is in a big yellow box which makes the game believe that everything is infact in sight. Therefore EVERYTHING is rendered which is wayyy to much and thats why your game crashes.
 
Don't put your map inside a box. Think of it more as putting a square tube around your cave tunnel system.

Use normal Hammer brushes and texture them in NODRAW. This will seal the map without using texture memory.

Release's second picture is exactly how to do it.
 
So by adding in these corridors around the map, it's creating the vis leaves thus reducing the lagg?
 
Think of it as 'what the game can see' from the player's view. Displacements and brush-based entities are invisible, so do not block 'what the game can see'. This means the game has to draw everything inside the walls of your box.

If you make the 'corridor', the game will only 'be able to see' up until a wall. It can't see behind it, so it knows it doesn't need to load the textures, the models and the brush geometry on the other side. These means when you go into different areas of your map the stuff way behind you will be free to be unloaded from your PC's memory and the stuff 'the game can see' will be loaded up.

(That's a really simple way of describing it. But generally it's how it is.)
 
Acutually, if you want to check what will be rendered in hammer then use the visgroups to hide all entities, displacements, water brushes and oither transparent brushes.

What you see is what VIS will work with.
 
Yeah thats kind of what i was asking before. I have only just found out how they work and have tested it on a few maps so i know how the hint+skip brush works.
 
Hope you also know the correct use of them. Badly placed hints will derease FPS!
 
Back
Top