Map Optimization/3D Skybox Issues

Any aspects of level design for the Source engine.

Map Optimization/3D Skybox Issues

Postby Barbieque on Sat Jun 09, 2012 3:01 pm

Hello guys, sorry to make another topic first of all.

I created a island map but I realised that it has some FPS issues I have optimized the map with no draw brush and func_detail i'm not sure what is causing the FPS drop and I really need some advice.

Here is a screenshot of the map it has a lot of displacements (don't mind the sky box by the way it's screwed up)

http://cloud.steampowered.com/ugc/56094 ... C1DEFFDCA/

The map lags more when I make the trees a prop_dynamic which is a shame because the shadows of prop_dynamic look much better, the map has 90 FPS+ on prop_dynamic and 120+ on prop_static and I know that this is not a PC issue because my PC is a beast it can run high quality games.

I would also like to know why there is a line between the water and the 3d sky box water because they are aligned correctly as far as my knowledge.

But my main question is why I am getting such low FPS in my map is there something wrong? because I only get 120+ FPS I'm pretty sure that's to low for a map?

Thank's a lot, great forum and very helpful by the way. :)
Barbieque
Dumpling
Dumpling
 
Joined: Thu Jun 07, 2012 4:39 pm

Re: Map Optimization/3D Skybox Issues

Postby stoopdapoop on Sat Jun 09, 2012 8:47 pm

There are about 1 million and one reasons why your fps could be bad.

here's where I usually start. bind a key that toggles wireframe mode, it helps you see where extra shit is being drawn. You'll probably notice that the fps is a lot worse when looking in certain directions from certain spots, and if you kick it into wireframe view you can see what's actually being rendered.
Code: Select all
bindtoggle i "mat_wireframe"


that will make it so that whenever you press "i" everything will show up as wireframes.

another bind I like using is
Code: Select all
bind p "+showbudget"


This is a perfect place to start because it shows you exactly where your frametime is being spent. the vast majority of the bars should be really really tiny, almost nil, but see if anything takes longer than usual. it's important that you turn of multicore rendering while you're using showbudget, because if you don't, then a bunch of stuff will get lumped into the threaded endframe. Also make sure that wireframe is not enabled or else your results will be trash.

If you don't want to hold "p" to show the budget panel, you can just type "+showbudget" into console and it will stay up until you either press p or type "-showbudget" into console. Keep in mind that the show budget panel actually takes a bit of CPU its self, so your framerate will drop a little, and the bar for VGUI might be a little longer than the rest for that reason.

Also make sure you're compiling with full VIS, don't compile with fast because it will rape your performance, If your vis takes too long to compile, that's a good hint that you need to work on your hint brushes and control visibility a little better.

So go in game, take screenshots of your Showbudget panels from places where the framerate is pretty bad, then post them here and we'll try to figure out where to go from there. Also take the screenshots from the playable area, don't take them from high up in the sky, framerate from those positions is mostly irrelevant, and will most likely be improved when you fix up the playable area.
I'm Brown
Image
User avatar
stoopdapoop
Veteran
Veteran
 
Joined: Sun Aug 21, 2005 2:14 am
Location: Ann Arbor, MI

Re: Map Optimization/3D Skybox Issues

Postby Barbieque on Sun Jun 10, 2012 2:16 pm

Hello, thanks for the reply

The main area that has FPS drops is the middle tower which I will show a picture of below.

The FPS improves if I make my models prop_static but not good enough for people with bad PC's and if I use prop_dynamic which has much nicer shadows the FPS is around 90 and for prop static around 130.

And yes my last compile took about 2 hours by compiling with Normal so I know there is an issue but I just can't find it that's why I need help!

Here are some screenshots of the showbudget command, by the way multicore rendering was off not sure why the text goes into each other.

http://cloud-2.steampowered.com/ugc/560 ... 50B895BF9/
http://cloud.steampowered.com/ugc/56094 ... 928ACDF69/
http://cloud.steampowered.com/ugc/56094 ... 61C930A16/

Thanks a lot!
Barbieque
Dumpling
Dumpling
 
Joined: Thu Jun 07, 2012 4:39 pm

Re: Map Optimization/3D Skybox Issues

Postby stoopdapoop on Sun Jun 10, 2012 6:46 pm

This may be simpler than you think

"unaccounted" ususally means you have Vsync enabled, and that most of the frametime is being spent just waiting for for your monitor to refresh.

Vsync is trash, you should turn it off and never turn it on again, ever, in any situation. since Vsync lets you get up to 120fps it leads me to believe that you have a 120hz monitor, so it might not be as bad for you as it is for people with normal displays, but it can still raise your frametime by as much as 8.3333... milliseconds a frame if you're getting less than 120 fps. And your GTX 460(you do have a GTX460, don't you?) should be able to do better than that on that scene.

if vsync isn't on, then it could be your "fps_max" I think that it's 300 by default, but yours might have gotten lowered by a config or something. set it back up to 300 if it isn't already.

It's easier to talk about performance using "frametime" than it is using "fps". So just keep in mind that frametime is the inverse of fps, the higher your frametime the lower your fps.

also, in this screenshot...
Image

I see that your "dynamic light rendering" floater is wayyyyyyyyyyyyyy far to the right, indicating that in a previous frame you spent 11milliseconds of frametime JUST on switching dynamic lights. That's longer than all other elements in the scene combined... then multipled a few times. In fact, it's almost taking up as much time as Vsync is, so if you turn off vsync and get rid if your dynamic lights, you'll more than double your framerate in many areas. Pretty good for such little work, eh?

You have to get rid of the flickering lights though, this is not optional. So you need to go through your map, and removed any named light, then remove any kind of flicker than any of them may have. This is good general advice too. Most of the time people overuse dynamic lighting(and any use is really an overuse in source), it's because they're doing something silly or ugly, like putting blinking lights around flames or something. You'll notice that valve maps never have blink lights.

An easy way to do this is to just click the "view entities in map", or whatever button found in one of the dropdown menus in hammer. I can't remember the exact name for it since I haven't mapped in a while, but it's in there. Then scroll down to the "lights" click on the first one, then shift click on the last one in the list, then hit alt enter, it'll bring up the info for every light, and stick it into one box. change the entity name, and change the flicker dropdown to "none". Then do the same thing for the other light entities you use, like light spot or whatever.

The reason for this is that in older versions of source (before alienswarm) any time you had a "dynamic light" it would stress your CPU and Ram because you'd have to swap out a large chunk of the lightmaps in the scene every time the light changed. This takes a long time and doesn't use the power of your GPU, so you become massively CPU and Ram limited. This also means that the larger your dynamic lights, the longer it takes to swap them because you need to swap more "luxels" which are basically pixels in the lightmap, which are texels in the scene... but the terminology isn't important. This also means that how frequently you change them also affects performance, so if your dynamic lights light up a large area AND they flicker a lot, then you're in for a whole world of hurt.

The plus side to removing those dynamic lights is that your lighting will look a little better, in order to mitigate some of the impact that dynamic lights have on framerate, valve made it so that dynamic lights don't bounce when compiling VRAD. And you want some light bounce, it looks nice.

Your framerate after you make these changes should be pretty good, but if you want to get you compile time down, then you'll need to do me a favor.

Go into hammer, and turn off visibility for everything except for regular old everyday brushes. Then take screenshots of the map from different angles and post them here, I'll help you cut down the number of VISleaves, which will help performance and can cut compile Vis time down to a couple of minutes (or seconds). Also be sure to "load portal file" in one of the dropdown menus, and take a couple more screenshots with the portal file loaded. It should fill your map with a bunch of ugly blue lines.

Since Players in TF2 can jump pretty high, and because TF2 maps are pretty open, there aren't too many optimization techniques that you can use to get a lot of performance back. It mostly comes down to cutting down visleaves and hinting out the right above tall buildings. Which I'll help you do.

Also, the showbudget panel is too small by default (no idea why valve did this) you can use the "budget_panel_height" and "budget_panel_width" command to make it taller and wider. The size is defined in pixels, so it's resolution dependent.

Performance and optimization is kinda my thing. I wish more people would ask why their maps were running poorly and try to fix it, as you are, instead of just releasing ugly maps that run like shit on supercomputers.
I'm Brown
Image
User avatar
stoopdapoop
Veteran
Veteran
 
Joined: Sun Aug 21, 2005 2:14 am
Location: Ann Arbor, MI

Re: Map Optimization/3D Skybox Issues

Postby Barbieque on Sun Jun 10, 2012 8:28 pm

Hello once again, thanks a lot for your help, very much appreciated!

My VSync was disabled already and by the way my GPU is GTX 560 :P

I removed the flickering lights it helped the FPS a bit and I gotta agree with you they were pretty ugly which I haven't realised until you pointed it out, my FPS currently hangs around 130+ but if I use prop_dynamics on the trees for better shadow detail it drops down to 90 at the middle tower and at the rest 100+ but I'm assuming that using prop_dynamic is a bad idea? i'm not sure if you were talking about the shadow trees or just the light entities in general anyhow I removed the flickering ones anyway.

Well my map now runs on 130+ with prop_static on the trees but is it possible to get better shadow detail using prop_static because I know I had to cut my displacement into pieces but it really screws up the beautiful displacements which is a shame!

The performance increased a little bit but I did what you told me to but I am not really sure any more if it's just supposed to be like this, I made simple surf stages and they never had any FPS issues maybe I overdid this map :/ not really sure.

Would it also be easier for you to look at the map? only if you would like to though because i'd still like to learn how to advance optimize maps!

Anyhow here are the screenshots with portal file loaded (I hope this is what you meant/wanted)

http://i.imgur.com/ZahpJ.png
http://i.imgur.com/ZNWZx.png

I'm not really sure where to go from here but your advice has helped me quite a bit which I appreciate a lot and I respect the fact that this is your part of hammer editor!

Thanks for helping me out I couldn't have done it my self even if the optimization was a bit!
Last edited by Barbieque on Mon Jun 11, 2012 5:19 pm, edited 1 time in total.
Barbieque
Dumpling
Dumpling
 
Joined: Thu Jun 07, 2012 4:39 pm

Re: Map Optimization/3D Skybox Issues

Postby stoopdapoop on Sun Jun 10, 2012 8:51 pm

Yeah, I'll look at the map. send me the vmf and the bsp (because I want to look at it without having to compile it the first time. you can pm it to me if you'd prefer.

Also what your portalfile screenshots tell me is that most of the the map is rendering most of the time, even if it's not really potentially visible. The way Vis works is that it tests to see which visgroups are visible from your current visgroup. Since your groups extend way into the sky, it basically means that they can all see each other.

But that leaves a huge looming question, why is your "unaccounted" graph so long? It clearly states that most of your time isn't going into rendering, but something else instead. If Vsync isn't on and your fps max isn't limiting your framerate, then something funky has to be going on. Even though making your props static helped you, I'm willing to bet that a much bigger gain will come from a different optimization.

As far as the shadows go, you could try adding -staticproppolys to your vrad parameters if you haven't already.
I'm Brown
Image
User avatar
stoopdapoop
Veteran
Veteran
 
Joined: Sun Aug 21, 2005 2:14 am
Location: Ann Arbor, MI

Re: Map Optimization/3D Skybox Issues

Postby Barbieque on Sun Jun 10, 2012 10:48 pm

Alright i'm going to PM you the files, I have put them in a ZIP file.

Well I was pretty sure there was something going on because i'm pretty sure a FPS around 100 isn't good but I my self am really wondering what it is and this is not the proffesional part of me in Hammer that's why I came here to ask for some help and gladly you came to help me which ofcourse I appreciate a lot for putting a bit of time into helping people.

However I my self have no experience with vis leafs and the portal file but I do get your explanations a bit all I know is how to simply optimize a map and how to find problems but I just couldn't do it for this one because this is the first big map I have created in all honesty.
Barbieque
Dumpling
Dumpling
 
Joined: Thu Jun 07, 2012 4:39 pm

Re: Map Optimization/3D Skybox Issues

Postby Barbieque on Tue Jun 19, 2012 9:03 pm

Meh, I haven't had a reply for a long time, i'm not sure why but is there any chance that anyone could help me with this issue?
Barbieque
Dumpling
Dumpling
 
Joined: Thu Jun 07, 2012 4:39 pm

Re: Map Optimization/3D Skybox Issues

Postby Epifire on Wed Jun 20, 2012 2:50 pm

Yeah only thing I can really relate right now is the whole map being drawn. I have been working on a mod dealing with the same issue. If you were not worried about people jumping on top of buildings one thing I would suggest is dropping a sky box brush clear down to the roof on some of these buildings. One thing I keep in mind for that, is what can the player actually over this building? Will they notice the cutoff if I put a brush over this?

One thing that I have seen a lot in TF 2 maps that is a great tactic, is to have your players travel through some buildings between crossroads of the map. What this does is it allows the level designer to create a kind of gate so that the rest of the level does not render at the same time. Not sure how area portals work in multiplayer otherwise, I would suggest them and occluder brushes as well.
Image
User avatar
Epifire
May Contain Skills
May Contain Skills
 
Joined: Fri Mar 25, 2011 8:54 pm
Location: Kansas... where tumble weeds are entertainment.

Re: Map Optimization/3D Skybox Issues

Postby Barbieque on Thu Jun 21, 2012 10:20 pm

Alright, i'll try that, thanks.
Barbieque
Dumpling
Dumpling
 
Joined: Thu Jun 07, 2012 4:39 pm

Re: Map Optimization/3D Skybox Issues

Postby Barbieque on Fri Jun 22, 2012 1:42 am

That unfortunately did not help, well I really can't figure out the problem my self and not sure what I should do now...
Barbieque
Dumpling
Dumpling
 
Joined: Thu Jun 07, 2012 4:39 pm

Return to Hammer Editor Help

Who is online

Users browsing this forum: Bing [Bot]