Snarkpit Articles


Obscure R_Speed Tweaks


MaxNodeSize, NULL, !, & @ Textures

For general tutorials on rspeeds, please read Hornpipe2's tutorial here on Snarkpit and the one on my website here.

These are a few tweaks that I've picked up over the years that can help get your rspeeds optimized. These are no replacement for good VIS blocking, avoiding face-splitting, and all the other general rules that you need to follow as a mapper which are detailed in the links above. However, they can let you get the most out of the engine, and can sometimes get an area with higher rspeeds under control.

Changing the MaxNodeSize Compile Parameter
This is a little-known compile parameter for hlbsp. I believe it changes maximum size of the "chunks" VIS breaks the map up into. From my experience, lowering it to 512 from the 1024 default seems to reduce "bleedover" from different areas, making VIS more accurate. Changing it to 512 made a significant difference for me on Monorail & Revenant, which are both big open maps.

The valid settings I have tried are 256, 512, 1024, & 4096. I have rarely had good results with 256 or 4096, but 512 is often better than the 1024 default. According to Banana, who shared this with me, 4096 is better for cramped maps and 512 is better for large, open maps.

You add this to hlbsp in your compile like any other parameter. For example:
-maxnodesize 512

Here are two screenshots I took on Monorail to compare:

vs


That is an extreme example of improvement, but it's worth at least trying this parameter for the gains it may afford. Note that in some areas of Monorail it actually made the rspeeds higher. However, these were low-traffic areas and the overall improvement across the map was considerable. So you need to compare the compiles carefully and see which setting is most to your benefit.

(Many thanks to Banana, an Action Half-Life mapper, from whom I learned this tweak. Note that Monorail is a map by BulletBait. I just retextured the map and did the final compile for him.)


Use World-Brush Water
Instead of the func_water entity, you can use what is called "World Water" instead. World water is a normal (non-entity) brush covered on all sides in a water texture (a texture whose name starts with an exclamation mark). If all sides of a normal brush are covered in a water texture, it will be created as water when you compile the map. You can set its wave height in Map Properties, and it has an opaque surface. It is also less laggy than entity-based water.

One thing not everyone knows is that World Water's surface blocks VIS. Because of this, it can lower your r_speeds- the brushes and surfaces underwater are not being drawn when you are above, and vice-versa. You can also use this as an opportunity to add more detail to underwater areas. The surface of the water also blocks light, but adding underwater lighting is a small inconvenience.

On Revenant this let me add more detail to the underwater pit without hurting rspeeds in the huge area above:



Note that Revenant was compiled with -maxnodesize 512, so it is also a good example of the first tweak I shared above. If you know the Half-Life engine, an area that open having only 500 wpoly is very unusual.


The NULL Texture
First of all, you need Zoner's Half-Life Tools (ZHLT) to use this tweak. They are now available at VERC. They come with a wad that has the NULL texture (named NULL). They are better than the default compile tools, so you should be using them anyway!

Basically, any face you place the texture named NULL on will not be rendered and will not add to r_speeds. This can be extremely useful on some maps where there are places (the tops of a roof, for example) that cannot be seen from the player's perspective. Using the Null texture, you can often remove a lot of faces that cannot actually be seen by the player, but are rendered anyway. Just make sure that the faces you apply it to cannot be seen, or the player will see a distortion where a texture should be!

Below is a screenshot of the area above the play area in my map Meatpit- no one can get up here or see up here, so I have applied the Null texture to most surfaces:


As you can see, that's an awful lot of faces that I was able to wipe out. The player will never know the difference, except that the map runs better!

Other places you can use the Null texture:
-on the rear faces of the outside "facades" that some maps have- ie areas that can be seen but not reached.
-the bottom/top of a brush that has been one-pixel spaced to avoid face-splitting.
-instead of the {invisible texture.
-to make "2D" signs, paintings, etc. on walls; make the sign one-pixel thick and cover the 4 side faces with the Null texture, it is almost impossible for players to notice this.


Using the @ Texture
Textures that begin with @ create a brush with special properties if you cover all faces of the brush with the texture. A brush is created that is
a) passable by players
b) blocks VIS

Don't get too excited, though. The downside is that while the player is within the brush a "house of mirrors" effect is created. This is noticeable even if the brush is 1-pixel thick. Because of this, I don't recommend using an @ texture unless you absolutely have to do so. The most common use of it is to create a curtain that is passable, to prevent the inside of a building from being drawn. Or, perhaps, a curtain between rooms. The window curtains in Noir by DeepQantus are done this way:



Note that you can rename & use any texture this way, it doesn't matter what size it is or what it looks like.

Obviously the bugginess makes this a problematic thing to use. The one good use I can think of is at a spot where a player is falling down from one area to another. This way they will fall through the brush so quickly they won't notice anything, and won't be able to stand in the brush to see the effect. I'm including it here because I expect someone else might find a more creative use for it, not because I recommend using it.

(Thanks to X-Tender for teaching me this tweak)

Again, none of these are a replacement for making a map with good VIS blockers and regular rspeed controls. They can achieve considerable gains, though, in some situations, and help optimize a map that is already well-made.


Post ReplyView Topic
Discussion
0 starsPosted by trepid_jesse on Wed Jan 17th 2007 at 5:46am

Taken from the ZHLT documentation.

"-maxnodesize #
Sets the maximum portal node size

This option tweaks the maximum size of a portal node. Setting it smaller will bsp the world into smaller chunks at the cost of higher r_speeds, but it can pay itself back in many cases with making vis either faster, or more accurate, or both."
0 starsPosted by Pvt.Scythe on Fri Dec 29th 2006 at 2:31pm

@-textures were a completely new thing for me. I didn't find any in the WADs I have so I assume this is something added after HL went to Steam. Heh. I guess old dog can learn something new after all. smiley
[author]
Posted by Jinx on Sun Dec 24th 2006 at 6:21pm

X-Tender called them that, too. But "translucent" means "semi-transparent"- ie light can get through but it's hard to see much detail. Kind of like stained glass or amber. Even the name trans-lucent suggests what it means, that light can pass through it. These @ brushes, on the other hand, are *opaque*.

I'll edit it with your suggestions in mind once I get back from X-mas with the family! ;D
0 starsPosted by G.Ballblue on Sun Dec 24th 2006 at 6:03pm

Couple notes:

The @ texture is also the equvilant of "Translucent". You also need to warn that playing with the maxnodesize command will influence your clipping and max leaf count. For the most part, you don't have to worry about those, but someone making a big map will most likely use maxnodesize to reduce their leaf count rather than r_speeds. A lower maxnodesize count usually results in more leaves, where higher ones -- to a certain limit -- result in less. I have also encountered the opposite of what you're saying: the higher my maxnodesize, the lower the r_speeds (usually).

Apart from that, good tutorial, nice and simple. smiley
Post ReplyView Topic