What hint brushes do - small explanation

Post anything to do with editing Nexuiz here. Whether its problems you've had, questions, or if you just want to show off your work.

Moderators: Nexuiz Moderators, Moderators

Postby divVerent » Fri Jan 25, 2008 7:38 am

Just open the map in GtkRadiant...
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby Ronan » Fri Jan 25, 2008 11:13 am

... or read the old Capturecity Optimized thread made by divVerent :wink:
Ronan
Alien trapper
 
Posts: 292
Joined: Tue Mar 20, 2007 10:25 pm
Location: France

Postby PinkRobot » Tue Dec 30, 2008 2:46 pm

I came here planning to read up about hint brushes. Well the reading is still no problem, but the initial post has lost its images which makes the whole thread a bit useless.

divVerent has told me he does not have these images any longer. Is there anybody out there who does? Did someone perhaps save the whole page including the images?
Now with new shiny avatar.
PinkRobot
Alien trapper
 
Posts: 443
Joined: Fri Jul 21, 2006 7:06 pm
Location: #brlogetc

Re: What hint brushes do - small explanation

Postby TVR » Sat Feb 21, 2009 6:51 pm

divVerent wrote:What are hint brushes? There have been many myths about these, from "useless" via "impossible to understand" to "when you do it wrong, the map will come out all black". However, I will explain the truth about them here now.

Hint brushes are a tool to help q3map2 calculate visibility of maps in an efficient way. They cause more splits in the map, meaning more areas for visibility testing. Why are they needed? Why can't q3map2 do it on its own?

Let me explain it in 2D on the following simple map:

Image

We have two big "rooms", separated by two walls that form a hallway that connects the rooms. When we compile this map, q3map2's tries to separate the maps into "clusters" for visibility calculation purposes. For each cluster, it stores which other clusters it can see. How the clusters are separated, usually comes from extending existing structural (not detail) planes on the map:

Image

[compilation simulated with CSG Subtract]

Here, the green cluster can see the yellow one, as the right part of the red cluster has a line of sight to the left part of the blue one. The renderer uses the list to know what to render - so when the player and the object stand in the indicated places, the object will get drawn even if it can theoretically not be seen by the player! In other words, q3map2's approach to do visibility calculation isn't perfect and needs help from you - the mapper.

What you now do is create a hint plane (that is, a brush that has common/hint on one face and common/skip on all others). The hint plane will be set so it goes exactly through the corners of the walls. I'll just show the actual hint face on my example:

Image

When we now run q3map2's BSP and VIS stage again, it will divide the map into parts like this:

Image

Now the yellow area no longer has a line-of-sight connection to the green area, and the object will be skipped from the player's view point! Even when the [first] player is in the blue area, the second player won't get rendered. Looks like we've won... but wait, one thing got worse. Let's move the players a little...

Image

From the cyan area, the object will now get rendered as cyan's top left can see blue's top left. This was not possible before.

So the map got WORSE! How to fix it... you guess it: MORE hint planes:

Image

It will now get divided like this:

Image

which, thanks to the added areas, is a better configuration than you got previously. But actually, q3map2 may have already added the portals I manually hinted here. In the engine, r_drawportals can show you how the portals ACTUALLY are generated.



Conclusion:
  • a hint brush contains one common/hint plane. All other faces shall be common/skip.
  • hint brushes force a subdivision in the BSP tree
  • typically, you want to place hint brushes so they slightly touch two corners, and extend to the walls behind the corners; but it usually won't help if you make a hint brush that's just an extension of an existing structural face, as these ALREADY serve the same way
  • you may need to also add extra hint brushes to compensate for performance losses when using hint brushes
  • how exactly you need to put hint brushes on your map is not always easy to decide. On capturecity for example, I got a huge optimization by putting hint brush pyramids on the rooftops (so what's on the roof isn't rendered when looking from below) and around the car models (so they don't get rendered unless they are REALLY in view). This case here was just a very simple example. I don't think there are existing algorithms to generate a good hint brush configuration, so you have to experiment with it and do it by hand.
  • use r_drawportals 1 to actually view how the map is subdivided. Use r_useportalculling 0; r_showtris 1; r_showdisabledepthtest 1 to see what's actually rendered in game, so you see what you can optimize.
  • for testing performance, record a demo of jumping a bit around on the map. Play the demo as timedemo with different compiles if your map to see how performance changes when using hint brushes
TVR
Alien trapper
 
Posts: 404
Joined: Fri Jun 01, 2007 12:56 am

Previous

Return to Nexuiz - Editing

Who is online

Users browsing this forum: No registered users and 1 guest