Difference between revisions of "Swarm Mapping basics"

From Valve Developer Community
Jump to: navigation, search
m (The Camera Angle)
(some cleanup, and added about water needing to be structure_seal)
 
Line 1: Line 1:
Alien Swarm maps are required to be open top corridors and rooms, with plenty of room left for the camera above and to the sides of every location. The easiest way to achieve this is to have a large empty box in which your level resides. For example:
+
== Structure ==
  
[[Image:Swarm-MappingBasics1.jpg]] [[Image:Swarm-MappingBasics2.jpg]]
+
Alien Swarm maps are required to be open top corridors and rooms, with plenty of room left for the camera above and to the sides of every location.
  
{{warning| there are 6 func_brush used to make a giant room that encompass's the entire map shown in screenshot}}
+
The easiest way to achieve this is to surround your entire map with six brushes which form a large, empty box:
  
A large space like this is however very inefficient, both for compiling times and for runtime performance. Some things should be done to speed this up:  
+
[[Image:Swarm-MappingBasics1.jpg|400px]] [[Image:Swarm-MappingBasics2.jpg|400px]]
  
1) Make sure any large surfaces that the player doesn't need to see lit up are given the texture '''tools/ToolsNoLight''', this black texture will skip any light calculations on that surface, speeding up VRAD a lot.  
+
A large space like this is however very inefficient, both for compiling times and for runtime performance. Make sure any large surfaces that the player doesn't need to see lit up are given the texture '''tools/ToolsNoLight''', this black texture will skip any light calculations on that surface, speeding up VRAD a lot.  
  
2) All world brush geometry in your level will turn into func_detail during map compile to speed up the VBSP part of map compile.&nbsp; Because of this you will need to seal your level in a different way.&nbsp; The large box that your level resides in will need to be made into a func_brush entity with the name "structure_seal".<br>
+
=== All detail ===
  
[[Image:Swarm-sealbrush.jpg]]  
+
All world brush geometry in your level will turn into [[func_detail]] during map compile to speed up the VBSP/VVIS processes. Because of this you will need to [[Leak|seal]] your level in a different way. The large box that your level resides in will need to be made into a [[func_brush]] entity with the name "structure_seal".
 +
 
 +
[[Image:Swarm-sealbrush.jpg]]
 +
 
 +
{{note|Water brushes must also be structure_seal entities.}}
  
 
Basic example maps that show this concept are in:  
 
Basic example maps that show this concept are in:  
Line 19: Line 23:
 
For more information on compile settings see [[Swarm Mapping Compile Settings]]  
 
For more information on compile settings see [[Swarm Mapping Compile Settings]]  
  
== The Camera Angle ==
+
== Camera Angle ==
  
 
The camera in Alien Swarm has a 60 degree tilt that gives a better perception to the level and helps with immersion, but it does make it harder to aim and can also cause visibility problems if your level isn't designed with this in mind. Most common visibility problem is player getting obscured by the south facing wall in game.  
 
The camera in Alien Swarm has a 60 degree tilt that gives a better perception to the level and helps with immersion, but it does make it harder to aim and can also cause visibility problems if your level isn't designed with this in mind. Most common visibility problem is player getting obscured by the south facing wall in game.  
Line 29: Line 33:
 
[[Image:Swarm-Southwalls01.jpg]] [[Image:Swarm-Southwalls02.jpg]] [[Image:Swarm-Southwalls03.jpg]]  
 
[[Image:Swarm-Southwalls01.jpg]] [[Image:Swarm-Southwalls02.jpg]] [[Image:Swarm-Southwalls03.jpg]]  
  
Also remember that playing with the tilt makes walking towards the south less visible and feels less natural than walking to the north, so try to bear this in mind when designing the flow direction of your map.<br>
+
Also remember that playing with the tilt makes walking towards the south less visible and feels less natural than walking to the north, so try to bear this in mind when designing the flow direction of your map.
 
 
== Dynamic Lights<br> ==
 
  
Use env_projectedtexture entities if you want to have dynamic lights in your map. You can also parent them to moving objects. (-&gt; bring up the properties of your env_projectedtexture and tick 'Always Update' in the 'Flags' tab)<br>
+
== Dynamic Lights ==
  
[[Image:Moving dynamic light.jpg]]<br>
+
Use [[env_projectedtexture]] entities if you want to have dynamic lights in your map. You can parent them to moving objects, but make sure bring up the entity properties and tick 'Always Update' in the 'Flags' tab if you want do so.
  
 +
[[Image:Moving dynamic light.jpg]]
  
 +
Since they are expensive, the game will only render one active projected texture at all times. If you have overlapping env_projectedtextures you get bad looking results (shadows popping on/off).
  
Since they are expensive the game will only render one active flashlight at all times. If you have overlapping env_projectedtextures you get bad looking results (shadows popping on/off).  
+
FOV determines the angle/spread of the flashlight, FarZ the length. Tweak those numbers if you run into problems.  
  
FOV determines the angle/spread of the flashlight, FarZ the length. Tweak those numbers if you run into problems.<br>
+
[[Image:Dynamic lights.jpg]]
  
[[Image:Dynamic lights.jpg]]<br>In general: <br>
+
In general:
  
* Only use a few dynamics lights per map. (We used 6 in Landing Bay, for instance)<br>
+
* Only use a few dynamics lights per map. (We used 6 in Landing Bay, for instance)  
* Make sure the FarZ number isn't too big. Values between 400 and 800 usually work pretty well. <br>
+
* Make sure the FarZ number isn't too big. Values between 400 and 800 usually work pretty well.  
  
 
== Player Start Points ==
 
== Player Start Points ==

Latest revision as of 17:15, 26 June 2011

Structure

Alien Swarm maps are required to be open top corridors and rooms, with plenty of room left for the camera above and to the sides of every location.

The easiest way to achieve this is to surround your entire map with six brushes which form a large, empty box:

Swarm-MappingBasics1.jpg Swarm-MappingBasics2.jpg

A large space like this is however very inefficient, both for compiling times and for runtime performance. Make sure any large surfaces that the player doesn't need to see lit up are given the texture tools/ToolsNoLight, this black texture will skip any light calculations on that surface, speeding up VRAD a lot.

All detail

All world brush geometry in your level will turn into func_detail during map compile to speed up the VBSP/VVIS processes. Because of this you will need to seal your level in a different way. The large box that your level resides in will need to be made into a func_brush entity with the name "structure_seal".

Swarm-sealbrush.jpg

Note:Water brushes must also be structure_seal entities.

Basic example maps that show this concept are in:

...\alien swarm\sdk_content\mapsrc\ExampleAddon\maps\tutorial

For more information on compile settings see Swarm Mapping Compile Settings

Camera Angle

The camera in Alien Swarm has a 60 degree tilt that gives a better perception to the level and helps with immersion, but it does make it harder to aim and can also cause visibility problems if your level isn't designed with this in mind. Most common visibility problem is player getting obscured by the south facing wall in game.

  • Make sure your walls are ~ 160 units in height. This height works best for camera visibility while being high enough to make the levels feel like they have walls.
  • Tilt your south walls (by using the vertex tool in hammer, for instance). This allows the camera more visibility over the south wall.
  • Add enough low decoration to all your south walls to prevent the player from getting close up against the wall.

Swarm-Southwalls01.jpg Swarm-Southwalls02.jpg Swarm-Southwalls03.jpg

Also remember that playing with the tilt makes walking towards the south less visible and feels less natural than walking to the north, so try to bear this in mind when designing the flow direction of your map.

Dynamic Lights

Use env_projectedtexture entities if you want to have dynamic lights in your map. You can parent them to moving objects, but make sure bring up the entity properties and tick 'Always Update' in the 'Flags' tab if you want do so.

Moving dynamic light.jpg

Since they are expensive, the game will only render one active projected texture at all times. If you have overlapping env_projectedtextures you get bad looking results (shadows popping on/off).

FOV determines the angle/spread of the flashlight, FarZ the length. Tweak those numbers if you run into problems.

Dynamic lights.jpg

In general:

  • Only use a few dynamics lights per map. (We used 6 in Landing Bay, for instance)
  • Make sure the FarZ number isn't too big. Values between 400 and 800 usually work pretty well.

Player Start Points

A finished Alien Swarm map must have 8 info_player_start entities for the marines to spawn at. While building you might want to just use 1, so you can easily move it around the level to test different parts without having to run across the map each time.