Invalid solid structure?

Discussion in 'Mapping Questions & Discussion' started by trees, Jul 28, 2017.

  1. trees

    trees L1: Registered

    Messages:
    42
    Positive Ratings:
    7
    I'm doing some preparation for the 72hr jam, trying to figure out how to make this piece of geometry I have in mind. There's going to be a control point on a roof, surrounded by angled windows of sorts. I've used the vertex tool to make a piece of the windows, but it's causing a problem in the Alt+P dialog, saying it's an invalid solid structure. Picture here:
    http://imgur.com/a/YzYhy

    Also, trying to clip the brush into smaller parts (to make window frames) causes some of the vertexes to move off grid.

    Any ideas what's causing the problem?
     
  2. turtleboy666

    aa turtleboy666

    Messages:
    63
    Positive Ratings:
    37
    From the pictures it's a little hard to tell but invalid solids are usually created when you accidentally make a concave brush. I would try to make the shape with the clipping tool first (i.e. starting from a rectangular brush) and making sure that you use cuts of easy to work with ratios. The vertex tool makes it very easy to create difficult and invalid geometry so I would try to avoid it if possible.
     
    • Thanks Thanks x 1
  3. iiboharz

    aa iiboharz Meme Queen

    Messages:
    707
    Positive Ratings:
    1,030
    Yeah, brushes' faces have to be completely planar, they can't be concave.
     
    • Thanks Thanks x 1
  4. Da Spud Lord

    aa Da Spud Lord L0: Crappy Member

    Messages:
    663
    Positive Ratings:
    468
    The vertex tool is powerful, but it's also really easy for someone who doesn't know what they're doing to create an invalid structure, which is why it's best to avoid it where possible until you're comfortable with Hammer and you're ready to learn advanced stuff. I'll try my best to explain what I've learned from playing around with it, but I can't get any screenshots ATM because I'm not on my computer, and my knowledge may be incomplete or wrong, so feel free to take what I say with a grain of salt.

    There are two ways to create an invalid solid with the vertex tool: either creating a concave solid, or creating a solid with an invalid face. A concave shape is a shape with a part that collapses into itself. Here's a picture:
    [​IMG]
    The shape on the left is a concave shape because it has a part of it that collapses in on itself. The shape on the right is convex, which is the opposite of concave- it has no parts that collapse in on itself. In geometric terms, concave shapes have at least one internal angle that is greater than 180 degrees, while every internal angle in a convex shape is less than or equal to 180 degrees. If you translate these shapes into the 3D world of Hammer, the shape on the left would be invalid, while the shape on the right would be perfectly valid. Luckily, this problem can usually easily be remedied by cutting your concave solid into 2 or more convex solids. This problem is also easier to avoid in the first place.

    Creating a solid with an invalid face is the more difficult problem to avoid. An invalid brush face is one that Hammer cannot figure out what plane it is on (if you've studied planes in geometry you'll know what I mean); in other words, the brush face is not flat. When I say flat, I don't mean it has to line up to the grid. I mean that if you were to take the brush face and line it up to the grid, it would be entirely flat, with no curves or anything. This problem can usually be avoided with two techniques: selecting and moving multiple adjacent vertices together, and using caution and foresight when using the vertex tool. Always ensure your brush faces are flat. It can be difficult to find or fix an invalid brush face without looking closely at each brush face individually, which is why it may be better to just delete the invalid solid and recreate it with the above tips in mind. Additionally, triangular brush faces cannot be invalid, so you may find those useful if you can't seem to vertex manipulate a brush without making it invalid.

    This page on the Valve Dev Wiki talks about what I've just talked about in more complex terms.
     
    • Thanks Thanks x 1
    • Agree Agree x 1
  5. trees

    trees L1: Registered

    Messages:
    42
    Positive Ratings:
    7
    Thanks for the replies, they've been helpful! I didn't actually know this thing about concave/convex brushes. However, I'm still having trouble visualizing how exactly my brush is concave... On cp_gorge last point there's windows in the ceiling with brushes that are pretty much the same shape as mine, yet they seem to be valid?

    Look, I'll upload the .vmf file. If someone could have a quick look and see if they can make the brush work, I'd be grateful.
    http://s000.tinyupload.com/index.php?file_id=62410321919038084918

    The problem's basically this. If you vertex edit this off-grid corner up to the brush intersection/whatever, it becomes an invalid solid. Then if you open alt+P and click 'fix problem', it pops off grid again.
    http://imgur.com/a/cn5ds
     
  6. Da Spud Lord

    aa Da Spud Lord L0: Crappy Member

    Messages:
    663
    Positive Ratings:
    468
    Like I said, there's multiple ways a brush can be invalid- having a concave brush is only one of a few ways you can create an invalid brush.

    I won't be getting back from my trip until tomorrow, but I'll take a look at it tomorrow or Sunday if nobody else does.

    Try selecting other, adjacent vertices and moving them as a group instead of moving one vertex individually- moving a single vertex individually will almost always result in an invalid solid, the second type I mentioned (unless you're dealing with triangular brush faces).

    If that doesn't work, just delete and recreate the brush. Try to make sure it doesn't go off-grid in the first place.
     
    • Thanks Thanks x 1
  7. trees

    trees L1: Registered

    Messages:
    42
    Positive Ratings:
    7
    Yeah, I tried remaking the brush. It was still invalid, but seems like lowering the CP platform ~32 hu and making the slope less steep fixes it. Weird. Maybe I'll just have to work around that.
     
  8. Tumbolisu

    aa Tumbolisu  I ⌄ I 

    Messages:
    937
    Positive Ratings:
    905
    The problem is that the arch tools round their vertices to be on the 1-grid. By making an angled brush that connects two differently sized arches you are bound to get a non planar surface.
    When you lower the height difference, hammer won't notice this problem as easily and during the compile it will just try to somehow fix it [which can cause some vertices to go to unexpected places]
    The best option is to clip the brush into two triangles. After all, a triangle literally can't be non planar.
     
    • Thanks Thanks x 1
  9. trees

    trees L1: Registered

    Messages:
    42
    Positive Ratings:
    7
    This is like, way over my head, but thanks for the explanation! :D
    I wonder what's so different about the windows on cp_gorge then? Aren't these brushes non-planar too (if I understand that word correctly)?
    http://imgur.com/a/O2kSG
     
  10. Da Spud Lord

    aa Da Spud Lord L0: Crappy Member

    Messages:
    663
    Positive Ratings:
    468
    Those windows are likely made of multiple brushes.
     
    • Thanks Thanks x 1
  11. Tumbolisu

    aa Tumbolisu  I ⌄ I 

    Messages:
    937
    Positive Ratings:
    905
    There is an even more difficult method of making valid circular structure that you wouldnt even begin to understand if you dont know what "planar" means.
    Planar, btw, means that a set of points are all on a perfect plane. Just because you make a plane from 4 points doesn't mean that they are all truly on a plane. Hammer will show you a surface but if you look at it from the right angle you might start to see things getting weird.

    Here the other method if you are interested:
    https://tf2maps.net/threads/roundhouse.20580/
     
    • Thanks Thanks x 1
  12. iiboharz

    aa iiboharz Meme Queen

    Messages:
    707
    Positive Ratings:
    1,030
    Brushes by default are made of quads, try making your surface out of tris. (A shape with 3 sides, not 4.)
     
    • Thanks Thanks x 1
  13. trees

    trees L1: Registered

    Messages:
    42
    Positive Ratings:
    7
    This did the trick. Thanks!
    Here's what I made:
    http://imgur.com/a/gkrOj

    But:
    http://imgur.com/a/D6ley
    The brushwork became really messy. There's these tiny brushes in the top left and bottom right corner. Could this be done in a smarter way?
     
  14. iiboharz

    aa iiboharz Meme Queen

    Messages:
    707
    Positive Ratings:
    1,030
    There's probably a cleaner way to do it, just make sure it stays on grid!
     
    • Thanks Thanks x 1
  15. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,217
    Hmm, I'm not sure what went wrong here. In theory, a slanted trapezoid where the upper corners are on the same level and the lower ones are also on the same level should always be planar, no matter what else is going on with it. Shouldn't matter how the dome is rotated, how many sides it has, etc.
     
  16. turtleboy666

    aa turtleboy666

    Messages:
    63
    Positive Ratings:
    37
    You only need three triangles to make a trapezoid, but four could also work:
    [​IMG]

    Pocket, since he used the vertex tool he probably accidentally moved one corner out of the plane, especially since it's not axis-aligned.
     
  17. Lampenpam

    aa Lampenpam

    Messages:
    1,019
    Positive Ratings:
    337
    I can make them with two triangles

    [​IMG]
     
    • Agree Agree x 1
  18. turtleboy666

    aa turtleboy666

    Messages:
    63
    Positive Ratings:
    37
    Nice lol it's still early here