Fortress Forever

Fortress Forever (https://forums.fortress-forever.com/index.php)
-   Mapping (https://forums.fortress-forever.com/forumdisplay.php?f=13)
-   -   How to optimize maps with big open spaces? (https://forums.fortress-forever.com/showthread.php?t=15088)

Lt Llama 03-14-2008 09:21 AM

How to optimize maps with big open spaces?
 
Mr Hint Brush Noob reach out for help :confused:

Most tutorials on hint brushes shows simple examples with corridors with
T-junctions and doors. But how about an outdoor map with lots of hills and props? I want to add hint brushes to a map I'm working on, but I wan't to do it right.

I had to add a huge building in the middle of my map to block vis but as you can see from mat_wireframe 2 a lot of stuff is rendered inside the building which you can't see.

http://i196.photobucket.com/albums/a...ree_b10011.jpg

http://i196.photobucket.com/albums/a...ree_b10014.jpg

So I got 2 questions about this.

1. Should I cover the inside of the walls with hint brushes?

2. Anywhere I look all the props are rendered by vis, even if hills are in the way. Can and should I add hint brushes inside the displacements to solve this? All displacements have nodraw brushes under them as it is now.

But to make it real simple for a hint brush noob like me, is this a correct assumtion?:

If mat_wireframe 2 renders things you can't see you can and should block those areas with hint brushes

p.s. Plz don't mention area portals :P Not right now anyway.

Crazycarl 03-14-2008 06:35 PM

Quote:

Originally Posted by Lt Llama
But to make it real simple for a hint brush noob like me, is this a correct assumtion?:

If mat_wireframe 2 renders things you can't see you can and should block those areas with hint brushes

It's not correct, at least not in the way you are thinking. Before you can use a hint you must understand visleafs. All the space in your map is broken up into boxes called visleafs during compile. During the vvis part of the compile, all the leafs (leaves?) are tested for each other for line-of-sight(LOS) and the results are stored in the map. This is to save the game from having to do real-time visibilty testing, which is a huge load on the CPU. All it has to do is look at what leaf the player is in, then render everything that can be seen from that leaf.

The problem is that's not very precise. Sometimes the leafs are very big and extend to where it has line-of-sight into another area of the map. (Typing mat_leafvis 1 in the console gives you a visual of the leaf you are in.) The purpose of a hint face is to force all leafs to get clipped off so that the above does not happen.

Look at this. in an outdoor map the leafs tend to extend all the way up to the sky, as in the left image. What this means is that when you stand on one side of the hill, what's rendered is identical to what would be rendered if you were up in the sky. The engine considers the two forts to have LOS to each other, even though they really don't.
http://img219.imageshack.us/img219/4622/hintyfs2.gif
If you use a hint like I've illustrated, you limit the height of the leafs on the ground, where the player is likely to spend most of his time. Now there's no way for the forts to have LOS each other.

(FYI a portal is the name for a side of a leaf. They don't have anything to do with areportals. Vis actually tests portals for LOS, not the whole leaf at once. You don't need to know this)

Crazycarl 03-14-2008 06:38 PM

Also if your only problem is preventing props from being rendered, an occluder might be what you need. However those don't help to hide map geometry.

Lt Llama 03-14-2008 07:22 PM

Thx, that made it much clearer, and it was not like I thought it was. The problem here is, as you can see a boxy fort on a hill surrounded by a lower landscape. The players are supposed to get up to the top, and thats where the main battling are done. Instead of covering the insides of the walls with hints, as I thought, is it then better to just add a huge horisontal hint brush below the topmost hill, as the players who are below don't have LOS to the other lower hills on the other side?

Crazycarl 03-14-2008 09:50 PM

That would help a lot. It's good to just pick two areas that should be seperated, and focus on boxing them out. If you set out trying to prevent EVERYTHING from being rendered unnecessarily, you will fail.

For any hill you think you might be able to use for vis-blocking purposes, the first thing you need to do is put a nodraw-textured wall inside it. It can be any thickness, but make it as tall as you can without it sticking out of the displacement. If it sticks out a tiny bit it's ok, but keep in mind that players and bullets can collide with it. Then hide the displacements and start with your hints, keeping in mind which areas you are trying to hide from which.

Horizontal hints work for the problem of seeing over (or under) walls, but it's also possible to see around walls, in which case you can use vertical hints using the same principal. Hints also can be diagonal. There's no reason they have to be straight.

If you can't get the hints working as well as you want (and depending on how your map is designed maybe you can't)I think func_occluders are going to be your best bet, since I think most of your FPS drop is going to be caused by props and player activity.

cownaetion 03-14-2008 10:29 PM

Nice post Carl, real informative. Actually learned something useful today for once :)

Mr. Happy 03-14-2008 11:23 PM

You should also look into occluders, might be more appropriate since those screenshots make it hard to see the structure of your map.

Occluder's are usefull if you have alot of models being rendered when they shouldn't, and hints can't take care of it.

Dr.Satan 03-15-2008 03:40 AM

This thread is very helpful...you guys rock!

I'm adding it to Geokill's mapping resources thread.

Lt Llama 03-15-2008 09:34 AM

Yea, this was awsome. I'll try and make three versions. One without hints and occluders, one with hints and one with hints and occluders. I wanna see the differance. And yea Carl, at some of the hills the leaves stretch to the top of the skybox. The landscape was made with dispgen and it covers the area under the displacements with nodraw brushes, so thats covered. I'll let you know the results of my experiments :).

Crazycarl 03-15-2008 05:46 PM

:) One thing about occluders is they take up some CPU time because they have to check each model for visibility in real-time. Occluders can be turned on and off in the console with r_occlusion so you can easily compare the FPS with them on and off.

http://developer.valvesoftware.com/wiki/Func_occluder

BlisTer 03-15-2008 05:53 PM

When mapping you just have to keep in mind to shape your leaves in such a way that the leaf you are in cannot see leaves it's not supposed to see.

http://developer.valvesoftware.com/w...t_example6.PNG

Lt Llama 03-23-2008 11:05 PM

Occluders
 
Sorry, took longer time than expected to fix the 3d skybox so havent gotten around to optimising until now. I put my first bets on using func_occluders as Crazycarl suggested and that turned out ok with an fps boost of around 20.

Started adding func_occluder brushes at the spots I thought was the largest problem areas but it ended up not working very well, so I just slapped in a couple of huge occluders just to see the differance.

func_occluders in Hammer

http://i196.photobucket.com/albums/a.../occluders.jpg

Occluders of this size might get the server on its knees, but have to test it. They work quite well, and you don't notice much the models coming and disappearing in the line of sight. (the func_occluders are the yellow intersecting huge brushes. Trigger texture on both sides which means they occlude from both sides.)

mat_wireframe 2 on the map without occluders

http://i196.photobucket.com/albums/a...ooptim0004.jpg

As you can see all models are drawn, even those beyond the hills.

fps on the map without occluders

http://i196.photobucket.com/albums/a...ooptim0005.jpg

Not much to write home about :)

mat_wireframe 2 & r_visocclusion 1 on the map with occluders

http://i196.photobucket.com/albums/a...luders0009.jpg

Wohoo, models beyond hills are gone.

r_visocclusion 1 on the map with occluders

http://i196.photobucket.com/albums/a...luders0010.jpg

With r_visocclusion 1 it colors occluded models in green boxes, not occluded ones with red boxes.

My fps on the map with occluders

http://i196.photobucket.com/albums/a...luders0011.jpg

From 31 to 59 fps was a giant leap for my old computer :).
Intel 4 - 2.66, 1 GB ram, Geforce MX 4000.
I guess this is concidered low end today, or low medium.

Anyway, experiments will continue next with hint brushes.

Thx again for the help in the rigth direction.

Nuk3m 04-11-2008 11:08 PM

Alright, I have read through this thread, and still cannot wrap my noob head around hint brushes. I understand kind of what you are saying above, my problem is, in my map, the main room visleaf can see into the outside visleafs, ah i dont know how to explain. take a look at my mat_wireframe 1

http://www.nuk3m.net/murderball/mdberror.jpg

it is not only drawing the side room, but also the yard.

Sidd 04-12-2008 12:12 AM

Is that a hole in the ceiling directly in front of you?
The yard leaf could extend all the way from ground to sky. If the leaf you are in can see the upper part of this yard leaf, it has to draw the whole of it.

A hint brush in the right place would force this big yard leaf to be split into two pieces. A top half which you can see, and a bottom half which you cannot, and therefore does not get drawn.

I might be totally off track as I can't really see what's going on, but it seems like a horizontal hint level with the top of the whole will do the trick.

Crazycarl 04-12-2008 02:16 AM

I can never tell what's going on in these wireframe shots. It's like just a bunch of lines, lol. But I think I can remember how murderball is laid out. That's the front door behind your crosshair, right? I believe there should be a wall right in front of that that serves for vis-blocking. Make sure it's impossible to draw a straight line from the yard, past that wall, and into the base without touching any walls (hint: I use the clip tool to check line-of-sight in Hammer. It's good at drawing straight lines). The problem is either the front door or the sky, as Sidd said.

Wireframe is good for finding problems, but mat_leafvis is more useful at diagnosing. When you find yourself in a leaf that's rendering more than you think it should, use noclip and fly to each corner of the leaf to try and find where it extends too far. If the leaf you're in seems reasonable in size, go to the area that's rendering and inspect the leafs there. One of them will be able to take the hint. :)

Crazycarl 04-21-2008 03:14 AM

Nukem: now that I've got a good look at your map, I can tell you that hint brushes will do you absolutely no good. This is because the player has a straight view out the front door, into the yard, and into the other bases. You've changed all the walls which, in the original map, served to block visibility.

That's ok, though, because it gives me a chance to talk about func_areaportalwindow. This handy entity can stop entire portions of a map from being rendered based on how far you are from it. It's like a door that "opens" when you approach and "closes" when you move far away.

There are some big limitations though. The first is technical. You must seal off an area completely for an areaportal to work. That is, if you put one in the front door of a house, you have to put one in the back door and all the windows and the chimney as well. Thus you define the outside as area 1 and inside as area 2.

The second is an important consideration in multiplayer games. When an areaportal is closed, you can't see anything behind it (That's the point). It looks like a blank wall. So if you have a sniper standing right behind one, he's at a huge advantage, because he can see everyone but they can't see him until they get close. So you shouldn't put one at any potential sniper spots. A glass window is a good place to use one, or you can put one around the corner from the entrance, so no one sees it until they are close enough to see through it anyway.

Aardvark uses these (It's why the big flagroom window goes opaque when you are on the other side of the yard), and I believe dropdown does too(the fog is there to hide the effect). I know exactly where you might use these in murderball. Let me know if you are interested.

Nuk3m 04-22-2008 06:16 AM

I am, at the moment however I am occupied with other things I want to tweak around the map. Once I come around to this stage I will contact you.

Dr.Satan 04-22-2008 02:13 PM

carl, you should start a new thread a do a mini tutorial on this...I know that personally I would love to know what this is and how it works.

GeoKill-----> 04-22-2008 02:21 PM

http://www.snarkpit.net/editing.php?...ame=HL2&id=143
http://developer.valvesoftware.com/wiki/Areaportal

Sh4x 05-18-2008 03:22 PM

Quote:

Originally Posted by Crazycarl
Nukem: now that I've got a good look at your map, I can tell you that hint brushes will do you absolutely no good. This is because the player has a straight view out the front door, into the yard, and into the other bases. You've changed all the walls which, in the original map, served to block visibility.

That's ok, though, because it gives me a chance to talk about func_areaportalwindow. This handy entity can stop entire portions of a map from being rendered based on how far you are from it. It's like a door that "opens" when you approach and "closes" when you move far away.

There are some big limitations though. The first is technical. You must seal off an area completely for an areaportal to work. That is, if you put one in the front door of a house, you have to put one in the back door and all the windows and the chimney as well. Thus you define the outside as area 1 and inside as area 2.

The second is an important consideration in multiplayer games. When an areaportal is closed, you can't see anything behind it (That's the point). It looks like a blank wall. So if you have a sniper standing right behind one, he's at a huge advantage, because he can see everyone but they can't see him until they get close. So you shouldn't put one at any potential sniper spots. A glass window is a good place to use one, or you can put one around the corner from the entrance, so no one sees it until they are close enough to see through it anyway.

Aardvark uses these (It's why the big flagroom window goes opaque when you are on the other side of the yard), and I believe dropdown does too(the fog is there to hide the effect). I know exactly where you might use these in murderball. Let me know if you are interested.

Just for the record, ff_dropdown only uses the "Z clip plane" or something like that (cant remember the exact name) which is a property of the fog. So let's say I put the fog to end at 5000, then I put the clip plane right after that so it clips everything that you can't see anyways. I had to use fog cause the front of the base is so wide open and you can see deep into it even from far away.

ff_aardvark uses the areaportals tho.


All times are GMT. The time now is 10:18 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.