
Relic's Introduction to Map Optimaztion
For UnrealED 3.0 / UT2003-2004
This tutorial will cover basic various ways to optimize your map for performance and faster frame rate.
Advanced optimization methods will be covered in another tutorial.
How Unreal handles polygon drawing
Have you ever opened a map and seen all of those green textured Zone Portal brushes and wonder what the heck they were? Those brushes partition the map into 'chunks' that Unreal will render as you enter them. Without the use of zone portals, Unreal will render your entire map in the background - even objects that are not seen behind walls. In conjunction with zone portals comes zoneinfo actors, found in the actor class browser under info > zoneinfo. This actor can be used to give a specific location in your map a name. They can also be used to create fog volumes in a particular area if needed. The idea can be confusing, so let's see some examples. Open your UnrealED editor and let's look at BR-Anubis. Do not use the Realtime Preview button. Navigate into the ball spawn area using your perspective 3D viewport. You should see this...
The author has used a different texture for his zoneportals. The zoneinfo actor is in the middle of the room. To get a better picture of what the zoneportals do, here is a picture of the same area of the map using the console command 'rmode 1' in the game. rmode 1 allows you to view the level in wireframe view - with no textures.
Notice that NONE of the geometry or staticmeshes beyond the zoneportals are being drawn/rendered. The only things that will be drawn are objects that are in the player's line of sight. Everything else will be culled (hidden). If you were to approach one of the archways, the objects ahead would start to come into view. This keeps frame rates low, because the UT engine is not trying to draw the entire map. Next we'll look at proper ways of creating zones in your maps. First, though, here are some other very useful rmode commands that can help you examine your map in-game.
rmode 1 = wireframe view
rmode 2 = map zones view
rmode 3 = BSP cuts
rmode 4 = ? staticmesh usage ?
rmode 5 = normal dynamic light view
rmode 6 = textured / unlit mode
rmode 7 = dynamic light usage
rmode 8 = depth complexity
Creating Zones
As a rule of thumb, when making zones, there are 2 rules to follow. First, make your zone brushes from sheets, not 3D polys like cubes or cylinders. Doing so can cause strange HOM (hall of mirrors) effects in your map or BSP errors. Secondly, only use zoneportal brushes where rooms connect. Doorways, hallways, windows are good examples. Placing a zoneportal in the middle of a large room will achieve nothing, as everything in the room is more than likely still visible to the player ... plus it will probably cause a HOM effect. Note that just about any subtractive or additive brush will cull polygons behind it when using a zoneportal in that area...with a few exceptions. If you have transparent textured brushes that can be seen through, like water or glass, these will behave differently. Solid, opaque staticmeshes also work with zoneportals to hide polys behind them. Let's have a look at a map I am currently working on zoning. The following room is made up of subtractive and additive brushes. It's a room with an archway leading to the flag room. The actual archway/wall is a staticmesh. We do not need to use the intersect/deintersect tools. Sure, it can make the map look pretty...but it also creates more polygons for the engine to render. So my advice is to keep it simple and try to use basic 4 sided sheets. We only need to cover the OPENED area that can be seen through. In the example below, a 512x512 sheet will nicely cover the hole in the archway. You'll want to use a different texture for your zoneportal brushes just to make them more visible in the editor. You can make your own if you want to personalize your map, as I have done...or there is a default texture you can use in the texture package 'wm_textures.utx'.
In the above picture, I have created a sheet builder brush
that is 512x512 and placed it in the middle of the archway. it extends
past both sides, the top, and the bottom. MAKE SURE that the brush
covers ALL of the open spaces. With your builder brush in place, go to
your texture browser and open the package 'wm_textures' and select the
green zoneportal texture, or use your own personalized one.
Now select the 'Special Brush' tool in your left toolbar
. In the dropdown menu, choose 'ZonePortal'.
Note the flags set for this brush - it will be an invisible brush in the game,
and is flagged as a portal. Simply click the OK button and you should see
a brush creatd like the one below in your doorway.
If you have other doors or openings connecting to the room, including windows or cuts in ceilings for skyboxes, add zoneportal brushes in those areas too, and in the same manner. A note about windows and ceilings, or anything that shows the skybox/fakebackground. If these areas are not zoned, they will ' leak ' into other parts of your map - even if it's on the other side of the level ! Example: in this map I had problems with the zoneinfo actors, which we will cover next. I had zoned all of my doors and hallways, but forgot the windows. Even though I had labeled the zone ' blue base ' when I entered that area in the game, it said that I was in the ' blue jumppad ' room (it's behind the above archway in my map). The problem was, there is a hole in the ceiling above the blue jumppad in my map that was not zoned. So it leaked into the blue base windows. Confused? Let's move on to using zoneinfo actors.
If you have ever hit the F1 key during a game you have probably noticed that UT knows where your teammates are located. Use of zoneinfo actors and zoneportals makes this possible. In the figure below, I have used BR-Anubis as an example again. This time we are in the red courtyard. Every doorway or opening leading to the courtyard, INCLUDING the sky/ceiling, has been zoned. The zoneinfo actor is in the middle of the room.
In the zoneinfo properties, under the ZoneInfo tab, the location name can be entered. This is how UT knows where you and your teammates are located...valuable information in a team game like CTF or BR. Remember, if your room is not totally zoned off, the zoneinfo actor will probably not work correctly. To add one in your map, go to the actor browser and expand the Info actor. Highlight the zoneinfo actor, then you can right click in your map and add one where needed.
Other advanced methods can also greatly increase your maps performance - and will be covered in the next tutorial. These include: using fogging - using antiportals - making staticmeshes - modifying collision properties.