Post by Hook on Apr 2, 2018 14:47:25 GMT -6
Zones or Zoning:
By "Hook" - 7/18/02
IMPORTANT - The concept of zones ...
UT levels can be huge!
Many of our game levels are pushing 20,000 world polygons.
At any one time, the player only sees a tiny fraction of those 20,000 polygons, typically 100-200 polygons.
The game engine spends a significant amount of CPU time figuring out which 200 polygons, out of a potential 20,000, are visible in each scene. UT employs several techniques to speed up this "visible surface determination" process. Most of these techniques are automatic, requiring no designer intervention. However, one of the most powerful techniques, zoning, requires level designers to manually place invisible polygons called "zone portals" in their levels. Zones greatly accelerate the engine's visibility calculations, and they also enable designers to create many special effects that are specific to a region of space, such as ambient lighting or modified gravity.
A zone is an interior region of connected 3D space, for example a room, or a group of several complex, interconnected rooms.
By dividing your map up into zones, you gain several benefits:
1 - Speed. A well-zoned level typically speeds up the engine's "visible surface determination" process by over 100% in a complex map, compared to an unzoned level.
2 - Ambient lighting. Each zone can have its own ambient lighting value, which is added to the regular lighting on each surface. Ambient lights are very useful for outdoors areas, where pure black shadows are unnatural, as well as in diffuse environments where one would not expect dark shadows.
3 - Reverberation. Each zone can have its own audio reverberation properties.
(see a UT audio document for more information)
4 - Zone-based physics properties, such as friction and gravity.
5 - Water, Lava or other liquid.
Seeing zones ...
UnrealEd has a special mode that enables you to see all the zones in you map graphically, with each zone rendered in a distinct color. In UnrealEd, in the 3D viewport's menu, select "Zone/Portal view". You can also see this in the game by typing "RMODE 2" at the console.
In UnrealEd, zone portals are normally visible, and you normally can't see through them. To hide them, press the joystick button in the viewport, which turns on realtime updating (dynamic lighting) of the viewport. You should only use this for previewing your architecture, as this realtime updating slows down the rest of UnrealEd's user interface and can "crash" the editor in more complex maps.
Partitioning a level into zones ...
Mappers (Level designers) can partition their maps into zones by using special kinds of brushes, zone portals, to seal up regions of their maps and make them "water tight" so to speak.
There are two tools in UnrealEd that you need to use to create zone portals:
1 - The "sheet brush" tool. This is represented by the bottom brush builder icon on the toolbar, which lets you build a flat square polygon. You need to build zone portal polygons using this tool; you need to create polygons that are big enough to block the passages you are sealing up.
2 - The "add special brush" tool. This is represented by the solid green square icon on the toolbar, below the "add" and "subtract" buttons, which enables you to add a polygon to the world with special properties to it. When you click on the "add special brush" tool, a little dialog box comes up with several pull-down options.
Choose the "Zone Portal" pulldown option. Then position your sheet brush and click "add" when you're ready to add the portal.
To zone your map ...
First add a bunch of portal polygons (using the "sheet brush" tool to build them, and the "add special brush" tool to add them). Add these portal polygons "Sealing Up" areas water tight in your map. Place them in small passage ways between large areas for best results!
Next, bring up the "rebuilder" dialog and rebuild your map. The rebuilder will go through your map and detect regions of space which are sealed up "water-tight" and assign a unique zone to each region. You can go into the "Zone/Portal" view to verify, graphically, that your level is properly zoned.
If, in Zone/Portal view, you see that the engine hasn't recognized your zones, you have probably not made the portals "water tight". You need to add in enough portals that the separate zones are completely sealed-off from each other.
If, in the game, you see "hall of mirror" effects where you placed portals, make sure your portals completely seal up the regions of space they separate. If you have a portal that only partially fills up a passageway, you might see through it into nothingness.
Where to place zone portals ...
For special effects zones like water zones you will, of course, place the portals wherever you need the effect.
For zones whose purpose is only to speed up the engine, your goal is to divide your level up into zones while introducing portals whose overall area is as small as possible as I mentioned ealier. The smaller the portals, the less work the engine must do to process the portals. Therefore, we place our portals in passageways which naturally separate large areas, such as doorways and hallways. This approach causes the level to be divided up well, without adding too much portal area.
There is no benefit (and often a performance penalty) to placing portals in the middle of large rooms. These huge portals usually eat up more CPU time being processed than they save. Stick portals in doorways, hallways, and other narrow passages as I mentioned before.
Adding ZoneInfo actors to specify zone properties ...
If you want to assign individual properties to a zone, such as water, ambient lighting, or reverb, you need to add a "ZoneInfo" actor to the zone. You only need to do this if you want to assign custom properties to the zone!
If all you want is the speed advantage of portalization or zoning, you don't need to add ZoneInfo's.
In the class browser, expand the "Info" class and you'll see "ZoneInfo" right there. You can add the ZoneInfo actor anywhere in your zone; as long as it's in empty space and there aren't more than one ZoneInfo's in your zone, the ZoneInfo will work. For the engine to recognize your ZoneInfo actor, you need to rebuild your map again.
(See a ZoneInfo property sheet for a list of the ZoneInfo properties)
There are many cool adjustable parameters, such as friction, gravity, ambient lighting, pain, water, etc.
Water and translucent zone portals ...
To create a water zone, just set the ZoneInfo's bWaterZone variable to True. The UT physics code (in Pawn.uc and PlayerPawn.uc) automatically recognizes these water zones and transitions between walking and swimming physics modes.
Of course there are a number of pre-set ZoneInfos for your use such as WaterZoneInfo that you can select instead of altering a regular ZoneInfo actor.
To make transparent water, just select the zone portal's surface in UnrealEd, bring up the "Surface Properties" and turn its "Translucent" option on.
Caveats ...
A Map (level) can only have 64 zones maximum. If you create more than 64 zones, the game engine will merge some zones together, causing a loss of performance.
By "Hook" - 7/18/02
IMPORTANT - The concept of zones ...
UT levels can be huge!
Many of our game levels are pushing 20,000 world polygons.
At any one time, the player only sees a tiny fraction of those 20,000 polygons, typically 100-200 polygons.
The game engine spends a significant amount of CPU time figuring out which 200 polygons, out of a potential 20,000, are visible in each scene. UT employs several techniques to speed up this "visible surface determination" process. Most of these techniques are automatic, requiring no designer intervention. However, one of the most powerful techniques, zoning, requires level designers to manually place invisible polygons called "zone portals" in their levels. Zones greatly accelerate the engine's visibility calculations, and they also enable designers to create many special effects that are specific to a region of space, such as ambient lighting or modified gravity.
A zone is an interior region of connected 3D space, for example a room, or a group of several complex, interconnected rooms.
By dividing your map up into zones, you gain several benefits:
1 - Speed. A well-zoned level typically speeds up the engine's "visible surface determination" process by over 100% in a complex map, compared to an unzoned level.
2 - Ambient lighting. Each zone can have its own ambient lighting value, which is added to the regular lighting on each surface. Ambient lights are very useful for outdoors areas, where pure black shadows are unnatural, as well as in diffuse environments where one would not expect dark shadows.
3 - Reverberation. Each zone can have its own audio reverberation properties.
(see a UT audio document for more information)
4 - Zone-based physics properties, such as friction and gravity.
5 - Water, Lava or other liquid.
Seeing zones ...
UnrealEd has a special mode that enables you to see all the zones in you map graphically, with each zone rendered in a distinct color. In UnrealEd, in the 3D viewport's menu, select "Zone/Portal view". You can also see this in the game by typing "RMODE 2" at the console.
In UnrealEd, zone portals are normally visible, and you normally can't see through them. To hide them, press the joystick button in the viewport, which turns on realtime updating (dynamic lighting) of the viewport. You should only use this for previewing your architecture, as this realtime updating slows down the rest of UnrealEd's user interface and can "crash" the editor in more complex maps.
Partitioning a level into zones ...
Mappers (Level designers) can partition their maps into zones by using special kinds of brushes, zone portals, to seal up regions of their maps and make them "water tight" so to speak.
There are two tools in UnrealEd that you need to use to create zone portals:
1 - The "sheet brush" tool. This is represented by the bottom brush builder icon on the toolbar, which lets you build a flat square polygon. You need to build zone portal polygons using this tool; you need to create polygons that are big enough to block the passages you are sealing up.
2 - The "add special brush" tool. This is represented by the solid green square icon on the toolbar, below the "add" and "subtract" buttons, which enables you to add a polygon to the world with special properties to it. When you click on the "add special brush" tool, a little dialog box comes up with several pull-down options.
Choose the "Zone Portal" pulldown option. Then position your sheet brush and click "add" when you're ready to add the portal.
To zone your map ...
First add a bunch of portal polygons (using the "sheet brush" tool to build them, and the "add special brush" tool to add them). Add these portal polygons "Sealing Up" areas water tight in your map. Place them in small passage ways between large areas for best results!
Next, bring up the "rebuilder" dialog and rebuild your map. The rebuilder will go through your map and detect regions of space which are sealed up "water-tight" and assign a unique zone to each region. You can go into the "Zone/Portal" view to verify, graphically, that your level is properly zoned.
If, in Zone/Portal view, you see that the engine hasn't recognized your zones, you have probably not made the portals "water tight". You need to add in enough portals that the separate zones are completely sealed-off from each other.
If, in the game, you see "hall of mirror" effects where you placed portals, make sure your portals completely seal up the regions of space they separate. If you have a portal that only partially fills up a passageway, you might see through it into nothingness.
Where to place zone portals ...
For special effects zones like water zones you will, of course, place the portals wherever you need the effect.
For zones whose purpose is only to speed up the engine, your goal is to divide your level up into zones while introducing portals whose overall area is as small as possible as I mentioned ealier. The smaller the portals, the less work the engine must do to process the portals. Therefore, we place our portals in passageways which naturally separate large areas, such as doorways and hallways. This approach causes the level to be divided up well, without adding too much portal area.
There is no benefit (and often a performance penalty) to placing portals in the middle of large rooms. These huge portals usually eat up more CPU time being processed than they save. Stick portals in doorways, hallways, and other narrow passages as I mentioned before.
Adding ZoneInfo actors to specify zone properties ...
If you want to assign individual properties to a zone, such as water, ambient lighting, or reverb, you need to add a "ZoneInfo" actor to the zone. You only need to do this if you want to assign custom properties to the zone!
If all you want is the speed advantage of portalization or zoning, you don't need to add ZoneInfo's.
In the class browser, expand the "Info" class and you'll see "ZoneInfo" right there. You can add the ZoneInfo actor anywhere in your zone; as long as it's in empty space and there aren't more than one ZoneInfo's in your zone, the ZoneInfo will work. For the engine to recognize your ZoneInfo actor, you need to rebuild your map again.
(See a ZoneInfo property sheet for a list of the ZoneInfo properties)
There are many cool adjustable parameters, such as friction, gravity, ambient lighting, pain, water, etc.
Water and translucent zone portals ...
To create a water zone, just set the ZoneInfo's bWaterZone variable to True. The UT physics code (in Pawn.uc and PlayerPawn.uc) automatically recognizes these water zones and transitions between walking and swimming physics modes.
Of course there are a number of pre-set ZoneInfos for your use such as WaterZoneInfo that you can select instead of altering a regular ZoneInfo actor.
To make transparent water, just select the zone portal's surface in UnrealEd, bring up the "Surface Properties" and turn its "Translucent" option on.
Caveats ...
A Map (level) can only have 64 zones maximum. If you create more than 64 zones, the game engine will merge some zones together, causing a loss of performance.