Swarm Overview Map

From Valve Developer Community
Jump to: navigation, search

Each Alien Swarm mission needs two overview map textures and a small file to describe how these textures relate to the game world. One of these textures is used for the in-game minimap, the other is used on the briefing screen. The in-game minimap version is typically very detailed, as the player will only see a small portion of it at a time; the area around their immediate location. The version used on the briefing screen can be a more abstract version, perhaps a rough blueprint including whatever details that IAF Intelligence managed to find out for that area.

Making these overview maps is unfortunately a complicated process.

Making the overview

The first stage of an overview map is taking a screenshot of the map viewed from above. To do this, you must:

  • 1) Make sure you're running at a resolution of 1024 by 768 and in -developer mode.
  • 2) Load up your map, pick a marine and start the mission.
  • 3) Enter these console commands:
    • asw_ClearHouse - removes all Swarm, so they don't show up on the minimap.
    • ent_remove_all env_fire - removes bright fires from the map so they don't show on the minimap.
    • asw_draw_hud 0 - removes the HUD
    • asw_hide_marine - hides the marine model
    • cl_leveloverview 10 - this changes the camera to a perspective free, top down view. 10 is the scale factor and is just a guess at first. (Note: This value will be inputted later as "Scale".)
    • asw_cam_marine_shift_maxx 12000 - these make the camera pan further when you move the mouse
    • asw_cam_marine_shift_maxy 12000
  • 4) Close the console and move the mouse around. Try to get the level centered nicely on the screen.
  • 5) If some parts of your map don't fit on the screen, or if there is a large amount of black around the edge, enter the cl_leveloverview command again but with a different scale. Try to get the best fit of your whole level on the screen. If you can't pan far enough, increase the shift ConVars mentioned above.
  • 6) You'll notice as you move the camera that numbers are being printed on the screen. These describe how the overview is calibrated and are very important. Now you have the map positioned how you want on the screen you need to note down these numbers. You need to know the pos_x, the pos_y and the scale. Once you have these numbers, DO NOT MOVE THE MOUSE. If you do, the camera will change position and the numbers will change.
  • 7) Wait until the numbers fade out, then F9 to save a .tga screenshot. NOTE: You are going to crop this image to 768x768, so make sure you leave enough space on the left and right sides to do so. You'll have eyeball this; it's a good idea to increase your cl_leveloverview scale enough so the full map fitsin an imaginary square in the middle.
  • 8) Open the console and type mat_fullbright 1 to make your level fully bright.
  • 9) Make sure your mouse cursor hasn't moved - then press F9 again to take a bright screenshot.
  • 10) Now you have two screenshots of your map, one fully lit and one dark. I find a mix of these two looks best for the minimap. So load these screenshots into Photoshop, putting one layer on top of the other. You might like to clean up any bad looking parts of the unlit version, such as large brushes you shouldn't see. You can adjust the blending of the two screenshots until you have a nice looking overview map (I suggest putting the lit version with a 90% fill, on top of the unlit version).
  • 11) CROP the canvas evenly in photoshop so you have a 768x768 image, cutting off the left and right sides (i.e. don't stretch your screenshots). Then resize this cropped image to 1024x1024.
  • 12) Save it as a .tga and import this as a texture, into materials/vgui/swarm/Overviews/ (using the Set as VGUI button, if you're using the Swarm texture importer, to get the .vmt options correct - if not, you'll have to look at one of the other overview textures to get the correct settings, or see below). When naming the texture, follow the convention of calling it [mapname]Overview, e.g. OfficeOverview or PlantOverview.
  • 12.5) To create the material from your .tga file, you need to create two files. [mapname]Overview.vtf, and [mapname]Overview.vmt. To create the VTF file, use VTFEdit to import your .tga file. Toggle "No level of detail" in the flags area, and save this as [mapname]Overview.vtf into your /materials/vgui/swarm/Overviews folder. Now in this folder create a new text document and use the following code:
"UnlitGeneric"
{
 "$basetexture" "vgui/swarm/Overviews/[mapname]Overview"
 "$ignorez" 1
 "$vertexcolor" 1
} 

Save this file, then change the file extension in Windows from .txt to .vmt. Follow this same procedure to add your [mapname]OverviewBriefing file.


  • 14) Make sure to turn mat_fullbright to 0 before loading the next map (changing it to zero with the map loaded can result in strange lighting on meshes).

Making the briefing overview

You should take the image you have in Photoshop and make a copy of it, that you can modify for the briefing map. As mentioned before, this should be a rough, blueprint style map. You can add mission relevant annotations and suchlike to it. The exact style for this texture hasn't been decided yet.

Once you have the texture how you want, import it into the same place as the normal overview, but add the word "Briefing" to its name.

Making the overview description file

Now you have your overview textures imported, you need to make a small text file describing the calibration numbers you noted down previously. To do this:

  • 1) Go to swarm/resource/overviews and make a new text file, named the same as your level, but with the extension ".txt". E.g. "Plant.txt" or "Office.txt".
  • 2) Load this .txt file up and input the values you noted down previously, following this format:
GAME
{
"pos_x" "-3688"
"pos_y" "-7159"
"scale" "8.0" //This is equal to the cl_leveloverview value you inputed when taking the screenshot.
"material" "vgui/swarm/Overviews/PlantOverview"
"briefingmaterial" "vgui/swarm/Overviews/PlantOverviewBriefing"
"mapyoffset" "-60"
"missiontitle"		"Plant"
"description"	"Get the power plant back online"
"image"		"swarm/MissionPics/OfficeMissionPic"
}

The last 3 properties describe the mission for the F1 and the Start Mission panel.

You may want to copy an existing .txt file from that folder and just change its values, to make sure you have the correct format.

  • 3) Make sure the "material" entry in that file is set to the filename of the minimap overview material you imported previously. The "briefingmaterial" entry should be set to the rough, blueprint, briefing style material you imported previously also.

Now, when you load the game up, the mission briefing screen should show your blueprint and the in-game minimap should show the nearby area, moving around accurately as you move about the level.

Check to make sure that the location of your marine is accurate - that is, so that the location in your actual level matches that on the overhead minimap. If it is off but the scale (cl_leveloverview value) is correct, you can adjust by "pos_x" and "pos_y" values, then reload your map and retest. (You should comment out [add "//", no quotations, in front of] the original "pos_x"/"pos_y" value, then enter a new value.) Eventually you should be able to fine-tune the position of your marine's "blip" on the overview map with your position on the map proper - but ONLY if the cl_leveloverview scale is accurate.