It is currently Tue Nov 21, 2017 1:32 am


Post a new topicPost a reply Page 1 of 1   [ 10 posts ]
Author Message
 Post subject: Tutorial: Increasing map performance
PostPosted: Thu Nov 17, 2005 7:40 pm 
Hero Member
Hero Member
User avatar

Joined: Mon Sep 05, 2005 7:23 pm
Posts: 521
Increasing your maps performance 101

This tutorial will guide you through the basics of improving the performance of your map. These tips will help to boost your FPS and make your map run more smoothly, even on lower end systems. This tutorial will help boost your maps performance in 3 easy steps: 1) simplify your lighting, 2) add vis portals, and 3) simplify your brushwork.

1. Lighting. In Quake 4, lights must be used sparingly. The more lights, the more detail the engine has to draw, and the lower the FPS. To make a functional map, you must minimize the amount of lights and lower the detail of those lights.

a) ambient light - a light that casts light on the whole level evenly. This can be very useful for cutting down on the number of lights while keeping your level well lit enough to be able to see. To make an ambient light, create a light, and expand the light box to contain the entire level on all axes. Hit 'J' to bring up the light editor. Uncheck all of the boxes except for 'Cast Diffuse', then click the color box and select a dark color - not quite black, but a darkish gray should suffice. Now click the texture box, scroll down, and select 'lights/ambientlight_nofall' from the menu.

Image

Hit apply, and test your map. You should have ambient light. Mess around with the color a bit untill you get the effect that you want. Dont make the light too bright or your map will look washed out.

b) light detail level - Lights in q4 can be set to have a certain detail level - the lower the level, the better the performance. But a detail level too low, and your textures will look shitty. The trick is to have enough high detail lights to bring out the detail in the textures, but not have so much detail as to ruin the performance of the map. The main lights for a room or an area - ones that hit multiple surfaces - should be pretty high detail, as should your ambient light. Smaller lights that light only a small area, or hit only a few textures, should be low detail. Ambient lights can be as high as 9 or 10, whereas small lights that only hit a few surfaces can be as low as 1 or 2. To adjust the detail level of a light, select your light and hit the 'J' key. In the Detail Level box, change the number to any number between 1 and 10.

Image

Play around with the levels to see how things look under certain lighting. Its up to you to determine how much detail your willing to lose to increase your performance.

c) r_showlightcount - a command that can be typed into the console while playing to show the number of lights that hit a certain surface - the fewer lights the better. You will see the textures dissapear, and a bunch of bright colors come up, each color representing a different amount of lights that hit a given surface.
Black - 0 lights hitting the surface
Red - 1 light hitting the surface
Green - 2 lights hitting the surface
Blue - 3 lights hitting the surface
Cyan, Pink, or White - 4 or more lights hitting a surface.

Image
The above image is the jump pad area of a sample map

Image
This is the same map, from the same angle, with the r_showlightcount command on. The green and red surfaces are just fine - but you can notice a problem area in the upper left corner, where multiple lights are hitting some of the surfaces.

Usually, you do not want more than one or two lights hitting a surface. Its okay to have some surfaces that are hit with 3 or 4 lights, but most of your surfaces should not have this many lights hitting them. Some walls that stretch over a large area will have a number of lights affecting them simply because of the amount of area these walls take up. You can fix this to some extent by breaking up the walls into sections.

Thanks to Finko for the r_showlightcount command and tips.

2. Vis Portals

A vis portal is a shader that helps the engine separate areas within a map. The more separate areas your map has, the greater the likelihood of the engine being able to distinguish these areas, and only draw the areas which you are either in, or can see directly. In a map with no vis portals, the engine will draw the entire map at once, which severely cuts down on the performance. Vis portals should be across all doorways and areas that divide sections of the map.

Image

Start with a thin nodraw brush (textures/common/nodraw) and texture one face with the vis portal texture (textures/editor/visportal). Fit the brush across your entrance, not leaving any gaps, and having the side with the visportal texture facing the open hall or room (basically, the visportal side should not be against the wall). You may want to turn off curves(ctrl-c) and detail brushes(ctrl-d), as they do not block visibility, thus do not help in separating an area. Vis portals should extend to structural brushes in order to be effective.

3. Brushwork and patches


a) Complex Brushwork - Complex brushwork should be limited for a couple reasons. For one, it creates more faces that will be drawn, and more potential for multiple lights hitting surfaces. Secondly, it tends to create complex shadows which take up a lot of resources for the engine to render. Try to keep the brushwork simple, and make good use of the textures.

b) Patches - Patches (or curves) are not really curves - they are brushes with many, many flat faces, that resemble curves. Since they have so many faces, it takes a lot more effort from the engine to draw them. Use curves sparingly, and, if possible, replace curves with multiple-sided brushes.

Some useful commands:
r_showprimitives 1 - This will show you the r_speeds on your map. In quake3, 10-15k was about as high as you wanted to go in most areas. In q4, 65-70k seems to be the norm.

r_showtris 1,2 or 3 - shows the triangles being drawn at any given time. 3 will show you everything not cut by the engine (probably the most useful for determining whats being drawn).

com_showfps 1 - shows your FPS. FPS is different on everyones computer so you cant really use it to gauge how well your map will perform on other peoples computers, but its useful for determining whether or not changes you have made have affected the FPS in a positive way.

Sources:
http://www.map-center.com/modules.php?n ... pic&t=4505 - Lighting techniques and brushwork
http://www.doom3world.org/phpbb2/viewtopic.php?t=13335. - Info on alight detail levels
http://www.gamedesign.net/node/1186 - Ambient light tutorial

Thanks to Finko and Lukin for tips and links!

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 8:37 pm 
Hero Member
Hero Member
User avatar

Joined: Mon Sep 05, 2005 1:56 am
Posts: 1440
A note on the patches. When you create a patch, select it, then hit 'S' for the surface inspector. There, you can adjust the curve's subdivisions. Depending on the size of the patch, you can knock it down pretty low and still get a nice effect. The default setting is kind of high.

The railings in D3 are basically diamonds, but you'd never know it by seeing them in the game.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 9:27 pm 
Full Member
Full Member
User avatar

Joined: Thu Sep 08, 2005 4:32 am
Posts: 129
Great tips!! Thanks!!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 21, 2006 10:07 pm 
Jr. Member
Jr. Member
User avatar

Joined: Thu Oct 06, 2005 8:07 pm
Posts: 51
don't Yall see it strange?
first they improve graphics up to dynamic light
then we do as much as possible to cheat the engine and gain fps

they made smthng we dont use, so why they did it for? and I dont believe they didnt supposed such situation

imho would be much easy to make a mod for q3 with q4 weapons. And no problems with map creating & editing & fps gaining

finally I say that: fps is life. So why play q4 if we get it's main thing - dynamic light - down :?:

plz don't get me wrong, this situation just bothers me, that's all :(

_________________
hand in hand with twisted delirium


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 03, 2006 4:11 pm 
Hero Member
Hero Member
User avatar

Joined: Mon Sep 05, 2005 7:23 pm
Posts: 521
Well I need to revise this tutorial. Lighting will get you into much more trouble than the amount of sides on a brush.

So, go ahead and make cylinders all you want, what you really need to keep an eye on in terms of performance is your lighting.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 03, 2006 11:31 pm 
Newbie
Newbie

Joined: Thu Mar 02, 2006 6:22 am
Posts: 9
oh the lighting tip was EXCELLENT! I didn't know you could strectch the boxes on lights....i always just added a light variable and set the value high enough to cover the intended area (thats how i did it in q3 and this is my first map in q4)

I'm doing a war map at night and used your tips to create a bluish ambient light that covers the whole map and its PERFECT.

But I really would like to know which way is better...a cylnder (sometimes with caps) or a brush with say, 16 sides? I WOULD prefer brushes as they are easier to work with.

btw, is it a big NO NO to delete one of two caps when you cap a patch/cylinder? In many instances I only need one side capped (if at all) and so I have been deleting the one that's up against the ceiling and hence no one will see it. Didnt have a problem in q3 but in q4 I'm getting these "missing other triangle" or some such thing. the map still compiles but i get that error during the compile.

_________________
Every man dies. Not every man REALLY LIVES!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 06, 2006 2:15 am 
Sr. Member
Sr. Member
User avatar

Joined: Mon Sep 05, 2005 1:35 am
Posts: 494
Something is amiss. You should be able to add lights in addition to your ambient. Maybe the 3D view is just not refreshing the way you think it should? Select a light (any light currently affecting geometry that is in your 3D view) and change its size by stretching its box a little and hit F4 again twice to see if the display refreshes.

_________________
http://mhgaming.com


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 06, 2006 7:47 am 
Jr. Member
Jr. Member
User avatar

Joined: Thu Oct 06, 2005 8:07 pm
Posts: 51
.. or light item is outside of cubic clipping area

_________________
hand in hand with twisted delirium


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 06, 2006 5:08 pm 
Hero Member
Hero Member
User avatar

Joined: Mon Sep 05, 2005 7:23 pm
Posts: 521
the_nookie wrote:
.. or light item is outside of cubic clipping area


Yup. 95% Chance thats the issue. Turn off cubic clipping and then try render mode again.

Render mode will not draw any light whose source is outside the clip area, even if the lit area extends into it.

As for multi-sided brushes vs cylinder, I think brushes look better, but I dont think there is a significant performance difference in terms of which one you use, so use either :) And no, there is no issue with deleting brush caps.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 07, 2006 12:27 am 
Sr. Member
Sr. Member
User avatar

Joined: Mon Sep 05, 2005 1:35 am
Posts: 494
For development, make a completely seperate q4 install folder. Seperate from the install you connect to servers with.

_________________
http://mhgaming.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 10 posts ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
twilightBB Style by Daniel St. Jules of Gamexe.net