Fix for Flipped Triangle


(MadJack) #1

Alright… Got that nasty error and decided to track it down…

NOTE: This applied to me and hopefully it’s always the same problem. I’ve checked q3map2’s code and I think that it’ll solved that warning.

First, when clipping, make sure “Clipper tool uses Caulk” is enabled in the Preferences dialog box. Though it IS enabled on my Radiant, it seems it doesn’t always do so…

Now when you clip some terrain and if two triangles are sitting next to each other AND each have a texture (other than “nodraw” [caulk, nodraw, etc] I guess, or that would be seen in the world) you wil get that warning. From what I could experienced, the sides of the triangle has the be the exact same thing. Meaning they should be attached to the same coordinates/units. Same width and height as far as I could tell.

Anyway… I had the problem and I regioned off where the problem was, compiled, got the flipped warnings, fixed the textures, compiled and no more warnings. Just to be certain, I compiled the whole map, only bsp though and still Joy!

Since there was some discussion about that not long ago, I thought to share the info if I found a way to fix it. So… There ya go! :smiley: :banana:

:drink:


(ratty redemption) #2

@MadJack, well done! :slight_smile:

this ties in with what some of us have had with terrain, especially clipping terrain around buildings… can you test further by deliberately trying to create the conditions you think are causing the problem?

I suspect you have solved this, but it would be useful to know it`s consistent.


(MadJack) #3

Ratty, not really hard since I know exactly the brushes I have to use (the same ones that were giving me the problems).

Now, I think someone else than me should try to prove me wrong :stuck_out_tongue: Seriously though, I think I’ll wait a bit until someone gets that prob and from there we’ll try it that way I think.

If anyone wants to try it, try it this way:

Select all your terrain (CTRL-ALT Left-click), Copy (CTRL-C), make a new map, Paste (CTRL-V). Save and close the map. Open the map but in a text editor and Search for “common/terrain”. F3 to continue search (yeah, it’ll take a LONG time :D) each brush shouldn’t have more than ONE terrain texture! The rest should be caulk or caulkterrain… Select the whole first line where you get the double terrain, Copy, open the original map, CTRL-F and paste the first line found previously and hit Ok. Make sure the rest of the brush is the same (making a backup right now wouldn’t be a bad idea). If you’ve found the same brush, leave one of the two terrain texture alone and replace the other one with caulk or caulkterrain. (I found that most times, the REAL terrain will be the first one in a brush) Load the map in radiant to see if you changed the right one. (if not you’ll see a terrain surface with a caulk on top). At that point, it’ll be easier to replace it in radiant by hiding the other triangles around it until you find the side that has the terrain (don’t forget to look UNDER :))

Save, bsp it… Hopefully no more flipped triangles.

I’m sure there could be a faster way but with real big terrain I think it’d be faster that way… One way or the other, it’s much better than redoing AND recutting the whole damn thing! :smiley:

EDIT:

Addendum :smiley:

If you think you know the area where the problem is, simply region off some of it, save as a region and use the region to search for a double terrain. Much faster than going through ALL terrain. Even if it’s more than one are, making small regions will be far easier. Though if you don’t have a clue where it is… The first part will take a very long time but eventually, you’ll find it.

That’s if I’m right. :eek3:


(MadJack) #4

Ratty… Frankly I think the problem is not really us. I think the problem lies with Radiant. If the option to caulk with clipper is On it should leave the textures as they are and new faces caulked. Period. It has to be broken…

(Didn’t want to use the post above to keep it clean)


(ratty redemption) #5

I agree, the preference option “clipper tool uses caulk” is very buggy, personally I`ve not trusted it and prefer to check all terrain I cut, by hiding caulk and flying the camera around under the terrain, so any wrongly textured “hidden” faces should become visible… I still occasionally miss some though.

is it possible for one of you coders to write a plugin for radiant, that checks that no terrain brushes have more then one textured face? …I`m sure that would be quicker then a human manually hunting for it :slight_smile:


(MadJack) #6

That’s one way to go at it too. I dont use that filter because it confuses the bejesus outta me… I would prefer if I’d see something around the tunnel instead of seeing through it. I mainly use filter to move something out of my field of view.

Probably because I"m not used to do it this way, I just walked around with caulk filtered out and nothing except false alarms… lol

I have to admit that’s it a good trick and I shall try it once in a while :slight_smile:


(ratty redemption) #7

I usually have caulk filtered, mainly as it impacts heavily on the fr in terrain maps, since it`s drawing hundreds more faces, then just the terrain tex face.


(red) #8

I opened the map in wordpad and went through 400 brushesh, I think i missed one cos i got 1 error still, but i dont care. Lets see if this helps now, i tried to compile before and it was compiling for over 2hour when i hit cancel. fingers crossed.

edit:
Now counting PassagePortalFlow again, and taking hella lot of time… :confused:


(SteelRat) #9

Red, it sounds to me you got a lot of structural brushes…try making them detail and see what happens to your compile time.

BTW - Nice trick MadJack, I’ll try it next time it happens to me!


(MadJack) #10

Thanks SteelRat. :smiley:

There’s something I just thought about those flipped triangles. If you used the clipper on terrain to carve out something, don’t forget that when BSP’ing it, the process WILL cut those tris. So in radiant, it might not look as a flipped triangle candidate but after the BSP it might be.

In my current project I have a tunnel entrance that goes into the terrain. I did a very stupid thing by having it at an angle instead of going straight to 0 / 90 / 180 / 270 degrees. So I ended up with lots of weird angles and I had to leave some of those cut tris with a side textured to make the inside of the tunnel. Before I applied the above technique (Hiding/filtering caulk then caulking the sides (because of improperly caulked clipped brushes)) I had lots of flipped triangles. After going through it all, I ended up with only 3. I have to leave it like that so the inside of the tunnel is properly textured.

@ red: BSP shouldn’t take more than 5-10 mins MAX. As steelrat said, you probably have way too much structural brushes or not enough detail (if any).