Best way to optimize a map with clipping? *solved*

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
User avatar
monaster
Posts: 532
Joined: Mon Apr 28, 2008 1:52 pm

Best way to optimize a map with clipping? *solved*

Post by monaster »

Is anyone here who's dealt with this problem before and can now give me a good advise? Since I'm - once again - have somewhat reached a few limits with one of my maps (this time regarding portal and cluster limits) I started clipping and turning some of my brushwork into detail. I was wondering what method would be best, since I wanted to keep as much realism as possible, meaning that I at least need to playerclip any decorative stuff so that players could get stuck there. So turning the decorative stuff (like heaters or AC systems) into detail and then weaponclippin this area is the best solution I suppose.
But I'd loved to see the weapon marks being displayed as realistic as possible, thus only clipping the decorative stuff in player clip and leaving the heaters and AC things structural would be even better. Only problem with this method could be that I don't really simplify my map's structure just with player clip because there are still too many portals created (so the before mentioned weapon marks could be displayed in detail)? Am I mixing things up right now? Or, if I'm right with the assumption that player clipping structural brushes isn't helpful at all in this situation and I should better use weapon clip around detail brushes: is there maybe even a better way to simplify my map's structure to avoid q3map2 crashing because of MAX_MAP_VISIBILITY errors?
Is that stuff even comprehensible to you?

EDIT:Added *solved* to title.
Last edited by monaster on Fri Aug 06, 2010 3:11 pm, edited 1 time in total.
If you are caught on a golf course during a storm and are afraid of lightning, hold up a 1-iron. Not even God can hit a 1-iron.
-Lee Trevino, golfer who actually has been struck by lightning.
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Re: Best way to optimize a map with clipping?

Post by Silicone_Milk »

Player/Weapon/All/Monster/Metal Clips have no say in visibility calculations so MAX_MAP_VISIBILITY is not affected.

Brush type (structure vs detail) does however. You really shouldn't be using structural brushes for anything but the most basic hull of your map. Everything else should be detail. I'll provide shots on an edit showing how what and why.

You should be looking in to hint brushes. I need to find the manual on them that shows how to use them properly but basically it lets you control how the vis portals are sliced up so you can optimize the vis on your map.

EDIT:
Ok images are up. I have three examples to show concerning the vis.

Here's what I mean by making only the basic hull structural. In this shot there are white angled brushes that act as some trim for the room and a darker brown brush that acts as the structure of the room.

Notice that the white brushes are cutting the vis in odd ways and adding more cells than are necessary. They don't help determine if the next cell is visible or not. They just add more work for the game to deal with.

Image

Second, notice these larger white brushes in the room. These are also structural but they should be detail! This is because they don't block the ability to see in to the next room. They don't define the dimensions (how wide/tall/deep the room is) of the room so they should be made detail. Otherwise we get this little clusterfuck of cells as seen in this shot:

Image

Lastly, here's a shot after making all the white brushes in to detail brushes and compiling. Note how the compiler used about 1/20th of the cells needed to get the same exact result (not drawing the bottom room when inside the first room because... well, it can't be seen from there).

The splits highlighted in red are caused by the automatic splitting every 1024 grid units by the compiler (starting at 0,0,0). The split highlighted in black are caused by a structural brush creating the doorway. Otherwise things would be simpler still.

Image

In a nutshell, when optimizing for vis, think on a large scale. Think in terms of area. "Does this brush define how wide/deep/tall my room is?" If the answer is yes, make it structural. Otherwise, make it detail.
Last edited by Silicone_Milk on Sat Apr 10, 2010 3:42 am, edited 1 time in total.
User avatar
monaster
Posts: 532
Joined: Mon Apr 28, 2008 1:52 pm

Re: Best way to optimize a map with clipping?

Post by monaster »

Great promises and information.
I thought clipping structural brushes could create a much more simple collision hull around complex brushwork, thanks to you I've grown wiser. I'm looking forward to your screenshots! As for the hinting: don't spend too much time searching that hint tut, I know how useful that common texture can be (just haven't used it yet) and obsidian's as well as the other guy's tut has been mentioned here not too long ago, plus I've saved them a few months ago, so I can post the respective links here easily (till monday).
If you are caught on a golf course during a storm and are afraid of lightning, hold up a 1-iron. Not even God can hit a 1-iron.
-Lee Trevino, golfer who actually has been struck by lightning.
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Re: Best way to optimize a map with clipping?

Post by Silicone_Milk »

They *do* create a simpler collision hull around complicated brushes which is a good thing.

However, they deal with collision. Collision has nothing to do with visibility.

GTKRadiant 1.4 doesn't work on Windows 7 x64 (can't save, q3map2 gets pissed, etc..) and GTKRadiant 1.5, as usual, fights me every single step of the way trying to do even the most simple tasks with it.
User avatar
Foo
Posts: 13840
Joined: Thu Aug 03, 2000 7:00 am
Location: New Zealand

Re: Best way to optimize a map with clipping?

Post by Foo »

One tip with the clip brush is that any other brushes that are entirely contained within a single clip brush, will be discarded by the AAS compiling process. This means that to make your bot file as simple as possible, you surround multiple brushes with a single clip wherever possible.

You could take this to the extreme and block out great big chunks of the level to get a tiny AAS and bots that play great, but of course you have to balance this against keeping a natural feel in the level, and not spending hours and hours laying clips for a minor benefit.
User avatar
Foo
Posts: 13840
Joined: Thu Aug 03, 2000 7:00 am
Location: New Zealand

Re: Best way to optimize a map with clipping?

Post by Foo »

Silicone_Milk wrote:GTKRadiant 1.4 doesn't work on Windows 7 x64 (can't save, q3map2 gets pissed, etc..)
you can get 1.4 working by setting the compatability options to Disable visual themes, and launch with administrative priveledges.

For the file saving, you can save over a file that already exists, you just can't make a fresh save. So you can create a blank file with notepad and call it whatever.map, then start working, or you can copy an existing map to a new file, and load it up from there.

It's a hassle, but outside of that the program works fine.

Oh and q3map2tools runs OK here? What's the issue you're having?
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Re: Best way to optimize a map with clipping?

Post by Silicone_Milk »

I already have it set to run as admin and have disabled visual themes. Running in Windows XP SP2 compatibility (which is what my old machine ran)

I'll try the blank map thing to see if that works. Thanks. :)

EDIT:
That's a big negative on that. Still the same error

Saying no brush selected.

Oddly enough, hanging around for a minute waiting for autosave to save the file *works* and I can compile it.

I'm wondering why autosave works but Save and Save As.. don't.
User avatar
Foo
Posts: 13840
Joined: Thu Aug 03, 2000 7:00 am
Location: New Zealand

Re: Best way to optimize a map with clipping?

Post by Foo »

Silicone_Milk wrote:I already have it set to run as admin and have disabled visual themes. Running in Windows XP SP2 compatibility (which is what my old machine ran)

I'll try the blank map thing to see if that works. Thanks. :)

EDIT:
That's a big negative on that. Still the same error

Saying no brush selected.

Oddly enough, hanging around for a minute waiting for autosave to save the file *works* and I can compile it.

I'm wondering why autosave works but Save and Save As.. don't.
You have to open the blank file in radiant, then us the regular 'Save' (not save as) to save it to the same file. Any change to the file name, or trying to save to a different map file (even if it exists) won't work and will result in 'no brush selected'.

XP compatibility isn't necessary and might be causing you more issues.
jal_
Posts: 223
Joined: Mon Mar 24, 2008 4:13 pm

Re: Best way to optimize a map with clipping?

Post by jal_ »

Foo, you should also keep in mind that collision is not just solid/notsolid stuff. Opacity is also collision. So if you put a clip surrounding a group of solid brushes you are'nt simplifying visibility data. You are, speeding up solid tracing tests, but the amount of data is bigger.

In any case, MAX_MAP_VISIBILITY errors aren't a collision issue. They are generated by having too many strutural brushes. Just make everything you can detail. Even when you have walls subdivided horizontally to display several textures you can make them detail and put a big caulk brush coplanar to them.
User avatar
monaster
Posts: 532
Joined: Mon Apr 28, 2008 1:52 pm

Re: Best way to optimize a map with clipping?

Post by monaster »

Even if these wall brushes subdivided horizontally border on the void making this a combination of one side textured "normally" and 11 (remaining 5 sides plus the completely coplanar caulk brush with 6) caulked?

About the 2 promised tuts dealing with hint:

http://quake3world.com/forum/viewtopic. ... l+obsidian
http://tremmapping.pbworks.com/Understa ... %20Brushes
If you are caught on a golf course during a storm and are afraid of lightning, hold up a 1-iron. Not even God can hit a 1-iron.
-Lee Trevino, golfer who actually has been struck by lightning.
skinNCNmaster
Posts: 344
Joined: Wed Jan 29, 2003 8:00 am

Re: Best way to optimize a map with clipping?

Post by skinNCNmaster »

put a structural caulk box around the entire map, then make everything detail.

hints are a touchy subject some do it some ways some other ways.. they're tricky to do really well and must be layed with precision corners. they are laid out in fans diagonally to create triangles of vertical spacial "draw zones" so then render is constantly looking fo the next hint area to determine which triangles to include as you move. t unctions and overdraw can also weigh heavy or light in regards to this subject matter... entirely long walls or floors where 70 percent of the texture is around the corner...AND being drawn anyway.. determining factors for some brush modification AFTER the hints are placed. i can get you started with a half dozen hint brushes if you hand me the file..

as for your weapon effects, its a balance of weapon clipping the things you want marks on, and player clipping anything you might get snagged on or should not or do not want to access, and bot clipping the entire map into square corridors so the bots play it, the dont care about geometry, though tey do, and thats the issue... basicaly you create a "simple map" within te map, made of bot clip, and with a few extensions, another one of player clip, for the players might want to go places where bots would get stuck or confused... and weapon clipping is like creating a second skin for a thiing, which also simplifies game draw if for example you have a bevel with a square depression which is small all along the edge of a trim, clipping it for weapon one thirds the draw calculations....

:D
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Best way to optimize a map with clipping?

Post by obsidian »

skinNCNmaster wrote:put a structural caulk box around the entire map, then make everything detail.
Uhhhh.... no.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
skinNCNmaster
Posts: 344
Joined: Wed Jan 29, 2003 8:00 am

Re: Best way to optimize a map with clipping?

Post by skinNCNmaster »

lol i know im rusty forget that part lol
User avatar
monaster
Posts: 532
Joined: Mon Apr 28, 2008 1:52 pm

Re: Best way to optimize a map with clipping?

Post by monaster »

obsidian wrote:
skinNCNmaster wrote:put a structural caulk box around the entire map, then make everything detail.
Uhhhh.... no.
:olo: :olo: :olo: Had to re-read that to realise the stupidity in it. Great, man!

Silicone_Milk, Foo, jal_ and skinNCNmaster, thanks for your great suggestions, that was exactly what I wanted to know, pat yourself on the shoulder and have a cup o' tea or wodka depending on your lifestyle. No, seriously, thanks a lot.

[EDIT:Corrected jal's nick.]
If you are caught on a golf course during a storm and are afraid of lightning, hold up a 1-iron. Not even God can hit a 1-iron.
-Lee Trevino, golfer who actually has been struck by lightning.
skinNCNmaster
Posts: 344
Joined: Wed Jan 29, 2003 8:00 am

Re: Best way to optimize a map with clipping?

Post by skinNCNmaster »

well though actually.. i WAS right... if you map was something like leafland.. which had only a couple of actual brushes... olo its a structural box... and a pile of patches.. lol
User avatar
monaster
Posts: 532
Joined: Mon Apr 28, 2008 1:52 pm

Re: Best way to optimize a map with clipping?

Post by monaster »

Been experimenting on some of my projects with detail and the results are great.
Let's see if I got it right, I made up a detail explanation, can anyone read through this if there's something wrong with it? If it's correct, that might help others to have a big part of this thread combined in one picture.

Image

Additionally I have some questions on this topic once again to finally be able to optimize my maps.
Like you told me before, detail has some very specific advantages. But are there any disadvantages as well?
What I'm concerned about in detail (what a pun :rolleyes: ) is: If you turn your map (a huge indoor complex with many small rooms on three floors) completely into detail AND build a second map hull out of caulk brushes so that you have a minimum of brushes for all the walls, ceilings and floors (just like in the picture above with the green lines), because otherwise you would have up to a dozen of brushes for one wall due to different textures used for it, *deep breath* is there any bad effect on:
lighting
bot behaviour
FPS
to be expected and thus anything that has to be considered to avoid possible problems?

I can almost certainly rule out any FPS problems since the early versions of my map with completely empty rooms had no bad effect on frames whatsoever, but I'm unsure about the rest (lighting, bots).
Also, is it of any good use to cover the already detailled brushes (like chairs, lamps, computers, window frames, desks) in simplified player/weaponclip brushes?
Sorry for the whole lot of probably dumb questions.

EDIT: Fixed img link.
Last edited by monaster on Wed Dec 21, 2011 3:16 pm, edited 1 time in total.
If you are caught on a golf course during a storm and are afraid of lightning, hold up a 1-iron. Not even God can hit a 1-iron.
-Lee Trevino, golfer who actually has been struck by lightning.
User avatar
monaster
Posts: 532
Joined: Mon Apr 28, 2008 1:52 pm

Re: Best way to optimize a map with clipping?

Post by monaster »

Seems my questions really are dumb, noone answering or commenting the screenshot. :tear:
If you are caught on a golf course during a storm and are afraid of lightning, hold up a 1-iron. Not even God can hit a 1-iron.
-Lee Trevino, golfer who actually has been struck by lightning.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Best way to optimize a map with clipping?

Post by obsidian »

From a visual/bot/lighting/etc. standpoint, detail brushes works exactly like normal brushes. The only thing that is different when you flag a brush as detail is that you are telling the vis stage to ignore those brushes from creating additional splits in the BSP tree. Everything that doesn't require vis will just regard detail brushes as normal brushes (bots/light/etc.). The only downside can be if you don't use it correctly and convert too much/too little to detail, you might get a FPS hit as everything in your map is drawn at the same time.

BTW, filter detail (ctrl + D) to toggle on and off detail brushes so you can keep track of what you converted to detail and what you haven't.

To get Silicone_Milk's pretty portal colours to show up in Radiant, you'll need to compile with -vis -saveprt. Then in Radiant, use the Plugins > prtview > load function to load the prt into the editor for a visual inspection of your portals.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
dONKEY
Posts: 566
Joined: Mon Oct 15, 2001 7:00 am

Re: Best way to optimize a map with clipping?

Post by dONKEY »

Monaster,
Structural brushes in 99% of cases should be caulk. Detail brushes should sit over the top of them. Structural caulk should not extend beyond the visible textured surfaces of detail brushes or you will have visible hall of mirrors effects in game. If a detail wall is flat, say made up of a 32 unit brush, and a 256 unit brush, made from caulk and textured on the visible side, a 286 unit all caulk structural brush should be directly on top of it. Overlapping structural and detail caulk brushes is not an issue, and in many ways good practice. Remember ONLY the textured faces form tris in game. Quite often I overlap detail caulk brushes but make sure the textured faces of the brushes do not, and meet adjacent textured faces vertex to vertex. It looks a mess in the editor, but optimises the map for compile.
A Q3 map these days is basically 3 maps.
A detail brush and patchwork map, a caulk structural map and a clip brush map.
From experience, the original alpha build often forms the basis of the caulk structural map. It far easier to change layouts when you are still blocking things out and not worrying about optimising the level for tris count. Once you reach the stage of cutting up brushes into triangle to avoid overdraw it gets really hard to change layout, so this really needs to be nailed down tight first.
Layout, game play, vis control should be the first task. Change it all to caulk, then build the detail map over the top.
User avatar
monaster
Posts: 532
Joined: Mon Apr 28, 2008 1:52 pm

Re: Best way to optimize a map with clipping?

Post by monaster »

Thanks to both of you, very comprehensive descriptions, especially that
From a visual/bot/lighting/etc. standpoint, detail brushes works exactly like normal brushes.
and that
Remember ONLY the textured faces form tris in game. A Q3 map these days is basically 3 maps. A detail brush and patchwork map, a caulk structural map and a clip brush map.
, that's exactly what I needed to know to understand that optimization thing.
Until someone comes up with even more special ideas to *see title* I'll change the subject to solved. Thanks again for everyone being involved! You sure helped me and others a lot!
If you are caught on a golf course during a storm and are afraid of lightning, hold up a 1-iron. Not even God can hit a 1-iron.
-Lee Trevino, golfer who actually has been struck by lightning.
Post Reply