Creating a working mini-map for CS:GO: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎Intro and Basics: Added a link to CS:GO)
Line 19: Line 19:


== Make the raw overview image ==
== Make the raw overview image ==
<ol>
<li>Start the game. Click '''Options''' and switch to the '''Video''' tab. Change '''Resolution''' to "1280x1024" pixels and the '''Aspect Ratio''' to "Normal".</li>
<li>Load the new level with the map <code><mapname></code> [[console command]] and enable <code>"sv_cheats 1"</code>.</li>
<li>Join a team.</li>
<li>Turn off bots in the map.<code>"bot_quota 1"</code> using the [[console]].</li>
<li>Bind the "[[screenshot]]" command to a key, etc. <code>"bind p screenshot"</code> using the [[console]].</li> This is important, as using the default screenshot key (F5) will take a compressed [[JPEG]] rather than a raw [[TGA]].
<li>Remove any HUD elements with console commands <code>"cl_drawhud 0"</code> and <code>"hidepanel all"</code>.</li>
<li>Remove disturbing world effects like skyboxes (<code>"r_skybox 0"</code>), fog (<code>"fog_override 1"</code> and <code>"fog_enable 0"</code>), props (''optional:'' <code>"r_drawstaticprops 0"</code>), etc.</li>
<li>Turn off player clipping.<code>"noclip"</code> using the [[console]]. Then move to a position where you can see the whole level from above.</li>
<li>Switch to orthographic mode with the console command <code>"cl_leveloverview ''x''"</code>, where ''x'' is the scale factor.</li>
<li>Set <code>"cl_leveloverviewmarker 1024"</code> to show a red helper line on the right. You will need to briefly toggle <code>cl_drawhud 1</code>, line it up, and then toggle the HUD off again.</li>
{{note|Several people have commented that the red line does not appear when doing this at 1280x1024 resolution.  If you don't see the red line, read the [[#No red line?|No red line]] section below.}}
[[Image:dust2_overview.jpg|200px|thumb|Sample level overview (de_dust2)]]
<li>You can move around while ''cl_leveloverview'' mode is on. You are still in spectator mode and moving, so move the arrow keys to change the position. Now change scale so the map fits into the square defined by the red line. The right edge of your map should be on the left of the red line, anything to the right of the red line will be chopped off in a later step. Check the attached screenshot  to see how this step looks in <code>de_dust2</code> running under Counter-strike:Source.</li>
<li>The current projection data (position and scale) will be updated in the console, eg "Overview: <code>scale 6.00, pos_x -2651, pos_y 4027</code>".</li>
<li>Once everything is perfect, take a screenshot (using the key you bound to "screenshot") and '''write down''' the projection data values. You will need them in a later step.</li>
</ol>
== Create the .DDS ==
== Create the .DDS ==
== Create the overview script ==
== Create the overview script ==
== Conclusion ==
== Conclusion ==

Revision as of 10:26, 22 July 2013

Intro and Basics

Some mods (Counter-Strike:Source, Day of Defeat:Source) have a mini-map mode, that shows a level overview and projects players and objects on that map. An overview map is an image made from in-game screenshots and must be created once a new map is finished.

Counter-Strike:_Global_Offensive also has a mini-map feature. From the player's point of view, the mini-map behaves the same in game as in previous versions of Counter-Strike. But from a developer point of view quite a few things have changed from creating a level overview in Counter-Strike: Source.

The big differences are:

  1. In CS:GO the map overview is referred to as the "radar."
  2. CS:GO doesn't use VTFs and VMTs for the radar.
  3. In CS:GO radar files are saved as a ".DDS" file.
  4. There are only two necessary files to get a basic mini-map working the '.DDS" and a ".txt". The ".DDS" serves as the map overview image, and the ".txt" tells the Source engine how to display the overview.

To compare the differences in finer detail, read: Level_Overviews and see how to make a level overview for Counter-Strike: Source.

Make the raw overview image

  1. Start the game. Click Options and switch to the Video tab. Change Resolution to "1280x1024" pixels and the Aspect Ratio to "Normal".
  2. Load the new level with the map <mapname> console command and enable "sv_cheats 1".
  3. Join a team.
  4. Turn off bots in the map."bot_quota 1" using the console.
  5. Bind the "screenshot" command to a key, etc. "bind p screenshot" using the console.
  6. This is important, as using the default screenshot key (F5) will take a compressed JPEG rather than a raw TGA.
  7. Remove any HUD elements with console commands "cl_drawhud 0" and "hidepanel all".
  8. Remove disturbing world effects like skyboxes ("r_skybox 0"), fog ("fog_override 1" and "fog_enable 0"), props (optional: "r_drawstaticprops 0"), etc.
  9. Turn off player clipping."noclip" using the console. Then move to a position where you can see the whole level from above.
  10. Switch to orthographic mode with the console command "cl_leveloverview x", where x is the scale factor.
  11. Set "cl_leveloverviewmarker 1024" to show a red helper line on the right. You will need to briefly toggle cl_drawhud 1, line it up, and then toggle the HUD off again.
  12. Note.pngNote:Several people have commented that the red line does not appear when doing this at 1280x1024 resolution. If you don't see the red line, read the No red line section below.
    Sample level overview (de_dust2)
  13. You can move around while cl_leveloverview mode is on. You are still in spectator mode and moving, so move the arrow keys to change the position. Now change scale so the map fits into the square defined by the red line. The right edge of your map should be on the left of the red line, anything to the right of the red line will be chopped off in a later step. Check the attached screenshot to see how this step looks in de_dust2 running under Counter-strike:Source.
  14. The current projection data (position and scale) will be updated in the console, eg "Overview: scale 6.00, pos_x -2651, pos_y 4027".
  15. Once everything is perfect, take a screenshot (using the key you bound to "screenshot") and write down the projection data values. You will need them in a later step.

Create the .DDS

Create the overview script

Conclusion