• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Level Design BSP Holes and tears How to find them; how to get rid of them.

Divinehammer

Grizzled Veteran
Mar 9, 2006
1,397
6
Sunny, Obamalot
I have come to realize the real importance of staying on the grid. So now I am looking for BSP Holes and tears and they are getting frustrating alot of them could be from stairs that I have rotated or something some of them are buildings. I really only have 3 but I can solve one and a new hole appears on the same building just in a different place. Does anyone have a method to go about looking for these or one that will make them stick out?
So far my method is to delete a building i think is the problem and then do a full build and see if the BSP holes go away. Then I know which building I need to work on or take a closer look. So I was hoping people could share there methods here that they have used. Is there a way to select a bunch of BSP and and have the vertices snap to the grid all at once instead of having to select each vert and snap? I appreciate the help.
 
Nasty problem.

My recommendation would be:

1. Use the groups to group each building.
2. Create a "Construction shack" map to work on the buildings.
3. Move all the buildings to the construction shack.
4. Iterate through each building, fix it up in the construction shack and, when finished, move it to your final map. Build and test.
 
Upvote 0
Thanks could you explain Groups to me a bit I have seen that but I dont know how it is used or what it does. This map was all learning and next map all buildings will be built in the construction shack first and then moved over. What does moving all of them to the shack at once do? Wouldnt I want to move them one at a time and straighten them up and all? and then move them back to the Map? Also these holes disappear when I do a BSP rebuild but appear when I do a Full build, whats up with that?
 
Upvote 0
You can group a set of objects by providing them with a similar group name. An object (bsp, mesh) can belong to multiple groups. You can select the an entire group at once.

I'm assuming we want to a complete house cleaning here. In that vein, it's best to move all the buildings to the construction shack and so start with a clean slate. Review each building and, when it's considered clean, move it back to the main map. Build the main map back up to it's current state building by building.

You can do it by moving one building at a time to the construction shack, but you could miss problems that way.
 
Upvote 0
I copied this out of another thread:

Do you speak German?
I wrote an anti-BSP-hole tutorial for our site at www.unrealed.eu. It contains all possible reasons for BSP-Holes known to me plus ways to fix them and tips for finding the faulty brushes that caused them. It also contains a small number of over simplified bullsh!t diagnoses that are often given to newbies when the answering pros are too lazy to respond correctly or they believe it themselves.
Without wanting to brag I can say that its an interesting read for anyone who has ever struggled with BSP-Holes.

You can read it here (if you can read German):
http://www.unrealed.eu/tut/tutorial/ued3-bsp_holes/bsp_holes.htm
 
Upvote 0
Here's what I usually do:

- Forget the full rebuilds, just do the geometry.
- Turn off staticmeshes with 'W'.
- Select all lights/playerstarts/etc., group them, and hide them.
- Save your map as BlahMapBSP or something.
- Once you have just the BSP brushes in view start deleting them in large chunks (like entire buildings), starting with the most likely culprits.
- After deleting a large section rebuild geometry and see if the BSP error is gone.
- If the error remains, continue deleting large portions of BSP and rebuilding geometry.
- If the error appears to be gone, reload your BlahMapBSP file, and go straight to the last section/building you deleted and delete it again.
- Eventually, through process of elimination, you should narrow your search down to a few offending brushes.
- Once you find the bad brush rebuild or recreate it.

If your map is really large do what DingBat suggested and use a construction map to speed things up. Also, if the errors are coming back after a full rebuild you could try deleting everything except the BSP, then save the map as BlahMapTest or something and go from there. Nasty problem indeed, and I know from first-hand experience. :eek:
 
Upvote 0
Well DrGuppy you said forget the full rebuilds but that is just the thing when I just do a geometry everything looks great no holes then I go to a full BLD and holes appear so it is a false sense of being correct. I will use some of your ideas though. I am looking for most likely culprits at the moment. It seems like things that cause this the most are anything made in the 2d editor especially jagged holes in walls. Also spheres of any type cause problems it seems. I thought that there was something on here about using different views to see overlapping brushes or something? Not sure though. Thanks.
 
Upvote 0
Ok, but you can still do a fairly fast Rebuild All by deleting all statics, terrain, playerstarts, etc. (go to Build > Build Options and uncheck 'Define Paths' as well) and just working with the BSP until you find the problem. Once you find the problematic brush just reload a previous version that has everything back in and then find that same brush.

As for the 2d Editor try to keep the shapes as simple as possible. Often it is better to use multiple simple shapes to form a complicated piece of geometry than to try to combine that same shape into a single brush.
 
Upvote 0
I have come to realize the real importance of staying on the grid.

So now I am looking for BSP Holes ...

... stairs that I have rotated or something ...

... I can solve one and a new hole appears ...

Also these holes disappear when I do a BSP rebuild but appear when I do a Full build, whats up with that?

Also spheres of any type cause problems it seems.

- Staying on grid helps the CSG build process to more successfuly create the final sets of triangles, collision and lightmap data without (hopefully) encountering errors.
Off-grid brushes are more likely to create extra or excessive thin sliver faces, have problems with slightly submerged surfaces, issues with slight angular sides, etc.

However, certain brush shapes and boolean operations can cause issues on the total construct for what would otherwise seem to be a valid design.
Other problems can arise from the fact that UnrealEd's build process will usually split triangles to facilitate better BSP database sorting/culling (these are called "Cuts").

IMHO any mapper using CSG should read up on exactly what the construction process is, before constructing anything, as it can help considerably to pre-plan the layout so that you don't walk into design flaws themselves.
Here is just one page from Wikipedia on CSG (Constructive Solid Geometry). There are lots of pages you can find through Google regarding CSG use in video game engines.


- Locating BSP problems in the CSG can be very difficult. Not only may there be actual visible issues, but you essentially have to go around and shoot at or jump at every play-area surface to make sure it has collision, and walk along every standard path (floor/hall) to check for invisible collision errors that might be lurking somewhere along a hallway.

There are some good tutorials on CSG errors.
I recommend reading the ones from my mapper friend Hourences.
BSP Errors
Semi-solid Brushes
Also see this UnrealWiki page on BSP Holes.
It is a bit messy, so take it or leave it for some of its comments.


- Both stairs and rotation of CSG brushes are leaning towards being bad. :)
Stairs, especially the Curved and Spiral, should not be used unless necessary. They are bad for creating CSG build issues. Better luck is usually found replacing all stairs with Staticmeshes (which is actually a good idea for something I should add to my RO mesh library, a variety of lightmapped staticmesh stairs).

Rotation of CSG brushes can be a bad thing, as any rotation does throw all of the brush vertices off-grid.
Even with Rotation Snap ON and rotating to 90, 180, 270 degree values, all of the vertices will now be off grid.

Personally, I always create CSG as standard cubes, never rotate unless I absolutely have to, and usually create each brush independantly. And vertex editing for changing the brush shape.


- Fixing one CSG build error often leads to another, since changing brush location, brush order, etc. causes the CSG build to change, which can lead to issues on other boolean operations.


- A BSP Build only performs the boolean operations on the CSG Brushes, it does not perform all of the final build functions such as lightmapping, etc. So you cannot rely on a BSP Build only to give a valid representation of the completed build.


Be aware that there is a lot of false information regarding the UnrealEd CSG construct out there in tutorials etc., as many of the "mappers" who wrote them do not fully understand what is occuring inside of this portion of a game engine.

For example, "deleting and re-creating" a brush to fix BSP errors is not ever necessary, unless you wish to actually change the actual shape of the brush beyond what vertex-editing can do.
Re-creating a brush of the identical dimensions in the same location simply puts that brush at the end of the CSG construct list order.
This same function can be performed with less work simply by right-clicking on the brush, and changing its Order to Last.

Don't rely on CSG Build versus Build All to determine where any errors may be, you require a Build All to see the actual final construct.

Don't rely on a non-Zone-Portal'ed CSG construct to determine that there are or are not any errors.
Until the map is fully Zoned and all of the Zone Portals are in place, you cannot tell how the build will split up the construct, and whether holes/errors/Cuts will or will not be in specific locations.
And after adding all of the ZonePortals, if you did not do this as the last step in the CSG construction, all ZonePortals should be set to Order Last. Note however that I have seen this kill maps, so be sure to make a backup before setting all of the ZP's order to last.

Use SemiSolid brushes where you can for surfaces that the player will not be walking directly on (SemiSolids often lose faces or collision when booleaned by Solids). SemiSolids can often resolve issues with forced triangle creation from Solids, however, it does result in more total triangles in the construct.
Solids always force removal of internal solid-space faces, coplanar hidden faces, and triangles are constructed from each brush vertex across other brush surfaces. SemiSolids do not.

Use the Zone/Portal View mode to see where the CSG surfaces and BSP Cuts are occuring across surfaces in the map, such as floors and walls.
You can encounter errors/holes/collision by Cuts passing through surfaces that you do not want it to do so, for example across a floor at an angle and through a wall.
This can be solved by numerous methods depending on the design. For example, Cuts running through floors and into walls can often be changed by forcing a new subtract/add coplanar brush pair into the floor (perhaps a good spot for an area-rug anyway, and don't just submerge an add brush, use a subtract followed by an add). Or if a wall or stairs are causing triangle creation or Cuts to occur across a floor, you may be able to raise the stairs 1UU above the floor (floating) so that it doesn't force triangle creation across the floor (at the expense of more total triangles).

Some people use off-map construction areas to build various complex brushes that are then brought over into the map area. This can be helpful when building specific objects. And allows you to use Intersection to obtain a single final brush.
However, unless you retain the construction area, you lose the ability to modify the original design if need be.


- You never want to use CSG Spheres, they are "BSP-hell" and are guaranteed to cause issues.
Always use StaticMeshes for spheres, hemi-spheres, or other rounded or more-angular shapes.

Basically, if you are using the Stairs brushes, especially the Curved or Spiral, or Spheres, or BSP Terrain, you are pretty much guaranteed to have problems.
These shapes should always be done with StaticMeshes instead.
 
Last edited:
Upvote 0
I think you did it. i would have never have thought that I needed to make curved stairs Statics but that seemed to take care of the last few problems that I had. Thanks! I am using CSG spheres to simulate some damage so we will see how they work. I think that I have found all of my BSP problems for the moment but I am still play testing. I expect to have a beta out tonight or tomorrow. Thanks.
 
Upvote 0
Well I was wrong it got alot of them but I have since found a few persistent ones and so far my methods have turned up nothing yet. I have made alot of corrections though so I dont think that it is necessarily one brush but multiples that could be causing the problem.
Question:
If I have a brush with a tear or hole in it( in my case a roof) If I delete the brush and recreate it in the same spot coudl taht solve the problem. Does this put the brush at the end of the build sequence or something?
 
Upvote 0
If I have a brush with a tear or hole in it( in my case a roof) If I delete the brush and recreate it in the same spot coudl taht solve the problem. Does this put the brush at the end of the build sequence or something?

Like I said in my post above, there is no need to delete it, simply right-click on it and choose Order -> Last. That moves it to the end of the order build.
You can even use the Order popup menu to swap brushes in the build chain, etc.

Unless a brush actually became corrupt (which I've only seen occur by people directly messing with properties they shouldn't), you don't have to delete it and re-create it.

Since it is a roof, if it is angular, that could be the problem.
The more complex the CSG in a map becomes, it usually eventually starts messing up on the more complex boolean layouts such as angles, submerges, etc.
 
Upvote 0
Oops guess I missed that part or forgot. The roof is angular and created in 2d Editor. I also have some other complex shapes created in the 2d editor should I just make those Statics one is a building? one is a curving retaining wall but deleting it seems to have little effect. But you are saying that maybe anything that is complex and made in 2d editor I should make into a Smesh if it is out by itself like rubble pieces? Thanks for the help
 
Upvote 0
Any CSG that you convert to StaticMesh loses its per-pixel shadow capabilities, so it doesn't look as good (in UE2.5).

If you are suspecting a bad brush design in an area as causing problems, you can back up the map, convert the suspect brush into a StaticMesh and if the issue goes away then you can either change the original CSG layout at that location to see if that helps, or leave the brush as StaticMesh if it looks good enough (best for StaticMeshes is to create them properly in Max/Maya instead of converting, plus you can tesselate them to get better lighting).

Personally I never use the 2D Shape editor as it is easy to create brushes that are too difficult for the engine to boolean successfully.
I always just edit standard cubes into the shape that I want, keeping things on grid so that vertices are properly lined up, watching surface creation, and swapping around vertex order/direction to fix triangulation issues where faces don't build.
 
Upvote 0
I found one of my big problems some how in using deintersect the brush was created with a dangling vertice like a square with 5 sides one was just hidden under all the rest and you could move it around it was like a sheet attached to a cube. Weird. Alot of problems went away when I got rid of that brush. Another was a 2deditor complex brush touching another additive brush(not overlapping) So I am on the road to being done for sure. I could put it out this weekend but there are some changes I want to make though so we will see how that goes tonight.
 
Upvote 0
...some how in using deintersect...

Why were you using Deintersect?

Intersect and Deintersect should almost never be used. I believe I mentioned this before somewhere here on these forums... :)

When that operation is performed, it slices through the entire map CSG construct and any cuts in the other CSG areas are imposed onto the final brush shape during the operation, usually causing extra faces, floating vertices, and often other problems are caused such as BSP errors when the brush is used in the final build.

These two operations must be used carefully and with certain guidelines.
For example, if a mapper is using Intersect to create a complex brush shape from a group of brushes, a separate construction area should be used to perform the operation in. This is a secondary subtraction cube placed elsewhere outside of the main world subtraction (far away if possible). This is done to prevent the operation from messing up the final brush.
 
Upvote 0
Unfortunately you shouldn't even use it for that. :)

Any of the tutorials that state you should deintersect every brush before Adding to make it "fit" the location are wrong. It sounds good in theory, but the UE CSG Construct doesn't work that way.
You shouldn't do that.

When creating walls and such, your other CSG brushes should already be on-grid and multiples-of-a-power-of-two value (ie. multiples of 8 or 16), so it should be easy to set the Red Builder Brush to the proper size from the brush dialogs, ie. a 192 UU ceiling height.

When you deintersect every Add brush before adding it, the deintersected result often is changed by the surrounding triangulation and BSP Cuts, which results in extra faces being created and even orphan vertices or open edges.
And these ultimately lead to slower rendering and can also result in eventual BSP Errors during build.
 
Upvote 0
Re: Intersecting/Deintersecting:
IMO, and this is basically what Dingbat also said, If you are going to use to make a 1-Brush structure, do all your BSP work in a builder level.. it's nothing but a large empty cube and you build your object in the middle of space there.

This should circumvent any of the BSP cut issues DG outlined.

They are useful tools, just you must be careful of how you use them.


One other cause of BSP holes I've encountered over the years is Vertex misalignment if you vertex edit one side of your brush.. this creates can create concave faces.. and I believe it's a universal truth in game engines, Concave == Bad. (or at least it is in UE)..

So if you ever vertex edit, check in all 3 views (top, side, front) that you don't have any verticies that are misaligned when they should be straight.
 
Upvote 0