Difference between revisions of "Dota 2 Maps"

From Valve Developer Community
Jump to: navigation, search
(Mapping notes: Changed .vtf -> .vmt)
 
(30 intermediate revisions by 6 users not shown)
Line 1: Line 1:
There are no official tools to create Dota 2 maps, although the community has hacked together a number of tools to compile Dota 2 maps that work.
+
''Note: Since the release of the [[Dota 2 Workshop Tools]] this section is now irrelevant to Dota 2 map creation.''
  
 +
There are no official tools to create Dota 2 maps, although the community has hacked together a number of tools to compile Dota 2 maps that work.
  
=== Configuring Alien Swarm SDK ===
+
Dota 2 is based on some scrapped ideas of Alien Swarm and the first program base is based upon the Alien Swarm SDK. This means that the Alien Swarm SDK, with some small tweaks, can be used.
  
Follow Steps 1 through 6 in Cyborgmatt's [http://www.cyborgmatt.com/2013/11/dota-2-model-viewer-guide/ Model Viewer Guide]
+
A list of [http://developer.valvesoftware.com/wiki/Dota_2_Map_Entities Dota 2 Map Entities] can be found [http://developer.valvesoftware.com/wiki/Dota_2_Map_Entities here].
  
Download AlienSwarm SDK.
 
  
Go to SteamApps\Common\alien swarm\swarm\ and edit the gameinfo.txt.  Add the game content you extracted to the search path  (similar to step 6 in cyborgmatt's tutorial). 
+
== Configuring Alien Swarm SDK ==
  
=== Configuring Hammer ===
+
Start by installing AlienSwarm SDK, either by following [steam://install/640 this link] or by going to the Tools tab in your Steam Library.
  
To properly build a Dota 2 map, you need the following tools:
+
=== Extracting the VPK ===
  
* [http://d.pr/f/B4nf UpVersion.exe by Penguinwizzard]
+
Download [http://nemesis.thewavelength.net/index.php?p=26 GCFScape], you need this to extract your VPK files. If it is bugging, get the x86 files, those are fine working on x64 systems.
  
* [https://github.com/RoyAwesome/dota2fgd Work in progress FGD]
+
Start the program and open '''pak01_dir.vpk''' in:
  
Download both of these and extract them into the bin folder from above.  
+
  ''\Steam\SteamApps\common\dota 2 beta\dota\''
  
Open Hammer, and select Tools -> Options...
+
Rightclick on "root" and click on "Extract...". These files should be extracted here:
  
Remove the AlienSwarm .fgd file and add the dota 2 fgd from above.
+
''\Steam\SteamApps\common\Alien Swarm\swarm\addons\''
  
Create a new map.  Select 'Run Map'.  Hit 'Expert'.  Create a new config 'Dota 2'.  For the first command, we want to run BSP, so hit New, then 'cmds' and select 'BSP Program' and copy the BSP parameter line from default.  Second command we want to run is 'UpVersion', so hit new 'New' then 'Cmds'.  Select 'Executable' and find 'UpVersion.exe' in the directory you put it.  Add '$path\$file.bsp' to the parameters.  Finally, we want to copy the final .bsp file to the dota 2 maps directory, so hit New, then in Cmds select 'Copy File'.  The params are '$path\$file.bsp "path\to\dota2\maps"'
+
When it has finished extracting rename the "root" folder to "Dota2Extract", you should now have a folder structure looking like this:
  
=== Mapping notes ===
+
''\Steam\SteamApps\common\Alien Swarm\swarm\addons\Dota2Extract\''
 +
 
 +
=== Other necessary files ===
 +
 
 +
Now go to
 +
''\Steam\SteamApps\common\dota 2 beta''
 +
 
 +
and copy the “'''bin'''” and “'''platform'''” folders into
 +
 
 +
''\Steam\SteamApps\common\Alien Swarm\swarm\addons\Dota2Extract\''
 +
 
 +
 
 +
 
 +
Now you're only missing a few more files. [https://github.com/RoyAwesome/dota2fgd Download this full branch] and [http://moddota.com/builds/UpVersion/UpVersion.exe UpVersion.exe] and copy them to this folder:
 +
 
 +
''\Steam\SteamApps\common\Alien Swarm\swarm\addons\Dota2Extract\bin\''
 +
 
 +
=== Setting up your SearchPaths ===
 +
 
 +
Open this file
 +
 
 +
''\Steam\SteamApps\common\Alien Swarm\swarm\gameinfo.txt''
 +
 
 +
with a text editor and replace the contents with
 +
 
 +
"GameInfo"
 +
{
 +
        "game" "Alien Swarm"
 +
        "title" "    " // asw - leave this blank as we have a texture logo
 +
        "type" "multiplayer_only"
 +
        GameData "swarm.fgd"
 +
        InstancePath  "tilegen/instances/"
 +
 +
        SupportsDX8    0
 +
 +
        "FileSystem"
 +
        {
 +
                "SteamAppId" "630"
 +
                "ToolsAppId" "211"
 +
 +
                "SearchPaths"
 +
                {
 +
                        "Game" "|gameinfo_path|."
 +
                        "Game" "swarm_base"
 +
                        "Game" "platform"
 +
                        "Game" "|gameinfo_path|addons\Dota2Extract"
 +
                }
 +
        }
 +
}
 +
 
 +
== Configuring Hammer ==
 +
 
 +
=== Options ===
 +
 
 +
Start the Alien Swarm SDK, select Hammer World Editor and let it open up.
 +
Now go to "Tools" -> "Options" and add the "dota2.fgd" from
 +
 
 +
''\Steam\SteamApps\common\Alien Swarm\swarm\addons\Dota2Extract\bin\dota2.fgd''
 +
 
 +
Since Hammer is an old piece of software, it has very low render distances. You should increase the render distance. Otherwise you'll just see colored boxes everywhere, since Dota 2 maps are quite large.  Go to "3D Views" and increase the Model Render Distance and the Detail Render Distance. If you have a really slow pc, you may lower this value to get better perfomance.
 +
 
 +
=== Running a map ===
 +
Create a new map and save it as test.vmf. <br>
 +
Now go to File -> Run Map and Hit 'Expert' in the [http://i.imgur.com/oHosYCQ.png bottom left corner].  <br>
 +
Press edit and create a new config called 'Dota 2'. 
 +
 
 +
 
 +
<u>'''For the first command, we want to run BSP'''</u>
 +
 
 +
Hit New, then 'Cmds' and select 'BSP Program'. Add the paramaters:
 +
 
 +
''-alldetail -game $gamedir $path\$file''
 +
 
 +
 
 +
<u>'''Second command we want to run is 'UpVersion''''</u>
 +
 
 +
Hit 'New' then 'Cmds'.  Select 'Executable' and find 'UpVersion.exe' in
 +
 +
''\Steam\SteamApps\common\Alien Swarm\swarm\addons\Dota2Extract\bin\''
 +
 
 +
and add the parameters
 +
 
 +
''$path\$file.bsp $path\$file.$ext $path\$file.pbm''
 +
 
 +
 
 +
<u>'''Finally, we want to copy the .bsp file to the dota 2 maps folder'''</u>
 +
 
 +
Hit 'New' then 'Cmds' select 'Executable' and point to this exe: C:\Windows\System32\xcopy.exe and add  the parameters
 +
 
 +
'' $path\$file.bsp "F:\Program Files (x86)\Steam\SteamApps\common\dota 2 beta\dota\maps" /y''
 +
 
 +
== Mapping notes ==
  
 
* Maps are a much larger scale in Dota 2 than they are in other Source games.  Units are around 48 units wide, towers are 128x128x320 units tall.   
 
* Maps are a much larger scale in Dota 2 than they are in other Source games.  Units are around 48 units wide, towers are 128x128x320 units tall.   
Line 40: Line 131:
 
=== Building the NavMesh ===
 
=== Building the NavMesh ===
  
Required Tool: [http://d.pr/f/w1AS GNVTool 1.0 by Penguinwizzard]
+
Required Tool: [http://moddota.com/builds/GNVTool/GNVTool.exe GNVTool 1.0 by Penguinwizzard]
 +
'' This is slightly out of date; I've added most of the 6.80 update stuff, especially for dumping, but note that it does not yet support adding the new non-freewalkable markers, so broodmother will still be able to go anywhere. -Penguinwizzard''
 +
 
  
 
This tool converts netpbm formats to valve's GNV format.  It also converts GNV to pbm files.
 
This tool converts netpbm formats to valve's GNV format.  It also converts GNV to pbm files.
  
netpbms are 1 bit bimap files. The size of your bitmap must be your world size divided by 64.  The bitmap deminsions must be divideable by 8 or the navmesh will be sheared. Dota 2 uses white for walkable, and black for not walkable
+
netpbms are 1 bit bitmap files. The size of your bitmap must be your world size divided by 64.  The bitmap dimensions must be divisible by 8 or the navmesh will be sheared.
 +
Dota 2 uses black for walkable, and white for not walkable.
  
 
Usage: 'GNVtool.exe tognv source.pbm target.gnv offsetx offsety'
 
Usage: 'GNVtool.exe tognv source.pbm target.gnv offsetx offsety'
  
Offsetx|y are always negative and 1/2 the demensions of your bitmap.   
+
Offsetx|y are always negative and 1/2 the dimensions of your bitmap.   
  
 
[http://netpbm.sourceforge.net/doc/directory.html list of software that support pbm files or converts to pbm format]
 
[http://netpbm.sourceforge.net/doc/directory.html list of software that support pbm files or converts to pbm format]
Line 94: Line 188:
 
=== Additional Notes ===
 
=== Additional Notes ===
  
The func_brush named "structure_seal" should be nodraw.
+
The func_brush named "structure_seal" should be nodraw (no skybox required).
 
Select a hero by typing "jointeam goodguys/badguys"
 
Select a hero by typing "jointeam goodguys/badguys"
 +
 +
== Special Mapping Notes ==
 +
 +
There are limitations and a rulesets for maps in Hammer and their calculation in Dota 2.
 +
 +
=== Overlays ===
 +
 +
If you try to decompile and recompile the main map, dota.bsp, you'll notice that it ends up not working in VBSP, because there are too many overlays. The limit on overlays was raised from 512 to 8192 for Dota 2, and we're working on a workaround for this issue.
 +
 +
=== Fog of War Calculation ===
 +
 +
While the limitations in height are nearly non-existant, but there are only five heights considered as different heights in the Fog of War calculation. Starting from you 0-point in z-axis, they're increasing in 128 units, so the max-height is 512 Units. Everything above will be considered as one height.
 +
 +
Calculation of different height is simple: '''x∈n;128*(x-1);1>=x>=5'''
 +
On this way we can always refer on 5 different heights. In example the heights for Dota.bsp are 1 - river; 2 - Midlane height; 3 - highground base; 4 - wardspots (like defensive radiant wardspot); 5 - the edge of the map.
 +
 +
If you're **higher** then 512 units the heightmap will continue to increase, but the player-camera still sits on the same place. So gets a unit closer to the camera and the total Field of View gets smaller. If you're getting below 0 on the z-axis, the camera will follow that height as it should be.
 +
 +
== Maps ==
 +
 +
[https://github.com/Z-Machine/Flatgrass Flatgrass] by Z-Machine
 +
 +
[https://github.com/ash47/Frota Frota] by Ash47 - An addon that comes with Arena of the Dark Rift, Deadlock, Frostivus, Riverofsouls, and Runehill.
 +
 +
[https://github.com/Z-Machine/RiverOfSouls River of Souls] by Z-Machine

Latest revision as of 03:17, 29 October 2014

Note: Since the release of the Dota 2 Workshop Tools this section is now irrelevant to Dota 2 map creation.

There are no official tools to create Dota 2 maps, although the community has hacked together a number of tools to compile Dota 2 maps that work.

Dota 2 is based on some scrapped ideas of Alien Swarm and the first program base is based upon the Alien Swarm SDK. This means that the Alien Swarm SDK, with some small tweaks, can be used.

A list of Dota 2 Map Entities can be found here.


Configuring Alien Swarm SDK

Start by installing AlienSwarm SDK, either by following this link or by going to the Tools tab in your Steam Library.

Extracting the VPK

Download GCFScape, you need this to extract your VPK files. If it is bugging, get the x86 files, those are fine working on x64 systems.

Start the program and open pak01_dir.vpk in:

\Steam\SteamApps\common\dota 2 beta\dota\

Rightclick on "root" and click on "Extract...". These files should be extracted here:

\Steam\SteamApps\common\Alien Swarm\swarm\addons\

When it has finished extracting rename the "root" folder to "Dota2Extract", you should now have a folder structure looking like this:

\Steam\SteamApps\common\Alien Swarm\swarm\addons\Dota2Extract\

Other necessary files

Now go to

\Steam\SteamApps\common\dota 2 beta 

and copy the “bin” and “platform” folders into

\Steam\SteamApps\common\Alien Swarm\swarm\addons\Dota2Extract\


Now you're only missing a few more files. Download this full branch and UpVersion.exe and copy them to this folder:

\Steam\SteamApps\common\Alien Swarm\swarm\addons\Dota2Extract\bin\

Setting up your SearchPaths

Open this file

\Steam\SteamApps\common\Alien Swarm\swarm\gameinfo.txt

with a text editor and replace the contents with

"GameInfo"
{
        "game"		"Alien Swarm"
        "title"		"    "	// asw - leave this blank as we have a texture logo
        "type"		"multiplayer_only"
        GameData	"swarm.fgd"
        InstancePath   "tilegen/instances/"

        SupportsDX8     0

        "FileSystem"
        {
                "SteamAppId"	"630"
                "ToolsAppId"	"211"

                "SearchPaths"
                {
                        "Game"	"|gameinfo_path|."
                        "Game"	"swarm_base"
                        "Game"	"platform"
                        "Game"	"|gameinfo_path|addons\Dota2Extract"
                }
        }
}

Configuring Hammer

Options

Start the Alien Swarm SDK, select Hammer World Editor and let it open up. Now go to "Tools" -> "Options" and add the "dota2.fgd" from

\Steam\SteamApps\common\Alien Swarm\swarm\addons\Dota2Extract\bin\dota2.fgd

Since Hammer is an old piece of software, it has very low render distances. You should increase the render distance. Otherwise you'll just see colored boxes everywhere, since Dota 2 maps are quite large. Go to "3D Views" and increase the Model Render Distance and the Detail Render Distance. If you have a really slow pc, you may lower this value to get better perfomance.

Running a map

Create a new map and save it as test.vmf.
Now go to File -> Run Map and Hit 'Expert' in the bottom left corner.
Press edit and create a new config called 'Dota 2'.


For the first command, we want to run BSP

Hit New, then 'Cmds' and select 'BSP Program'. Add the paramaters:

-alldetail -game $gamedir $path\$file


Second command we want to run is 'UpVersion'

Hit 'New' then 'Cmds'. Select 'Executable' and find 'UpVersion.exe' in

\Steam\SteamApps\common\Alien Swarm\swarm\addons\Dota2Extract\bin\

and add the parameters

$path\$file.bsp $path\$file.$ext $path\$file.pbm


Finally, we want to copy the .bsp file to the dota 2 maps folder

Hit 'New' then 'Cmds' select 'Executable' and point to this exe: C:\Windows\System32\xcopy.exe and add the parameters

$path\$file.bsp "F:\Program Files (x86)\Steam\SteamApps\common\dota 2 beta\dota\maps" /y

Mapping notes

  • Maps are a much larger scale in Dota 2 than they are in other Source games. Units are around 48 units wide, towers are 128x128x320 units tall.
  • If an entity is outside the bounds of the map, it crashes the game with no error.
  • AlienSwarm converts all brushwork into func_detail, so you need to seal the map with a func_brush named structure_seal. The brush should be textured nodraw.
  • Required entities include: info_player_start_goodguys, info_player_start_badguys, ent_dota_game_events, env_global_light.
  • Models require a shader that is not provided in Hammer. In your extracted gamedata, open every .vmt file and replace "GlobalLitSimple" with "VertexLitGeneric". A tool such as Notepad++ can do this quickly.

Building the NavMesh

Required Tool: GNVTool 1.0 by Penguinwizzard This is slightly out of date; I've added most of the 6.80 update stuff, especially for dumping, but note that it does not yet support adding the new non-freewalkable markers, so broodmother will still be able to go anywhere. -Penguinwizzard


This tool converts netpbm formats to valve's GNV format. It also converts GNV to pbm files.

netpbms are 1 bit bitmap files. The size of your bitmap must be your world size divided by 64. The bitmap dimensions must be divisible by 8 or the navmesh will be sheared. Dota 2 uses black for walkable, and white for not walkable.

Usage: 'GNVtool.exe tognv source.pbm target.gnv offsetx offsety'

Offsetx|y are always negative and 1/2 the dimensions of your bitmap.

list of software that support pbm files or converts to pbm format

paint.net pbm export plugin

You can view your navmesh in game by doing 'dota_gridnav_show 1'

Visual Guide to GNVTool

Making a Minimap

Minimaps require a few files in a few places.

You will need VTFEdit to convert an image into a .vtf file

First is the overview screenshot. This can be created in a number of ways (Valve paints theirs, other people have taken screenshots). Once a suitable image is found, Open VTFEdit, select Import, find your image, and save it as MAPNAME.vtf. Also, go to 'Tools' and click 'Create VMT'. In the Options tab, for shader, select UnlitGeneric and check the boxes 'Translucent' and 'Vertex Alpha'. Save it as MAPNAME.vmt.

Put both of these files in a folder named materials/overviews in your dota (or addon) directory.

Next, create a new textfile named MAPNAME.txt. This is a Key Value file denoting where the bounds of the minimap lie. The structure is as follows:

MAPNAME // Change this key to your map's name
{
	material "overviews/MAPNAME" //path to the VTF and VMT above.  Note that the file extension is missing here
	
        //Coordinates to the upper left corner of your map
        pos_y 2560
	pos_x -2560


	scale 5.000 //Minimap scale.  Smaller the map, smaller the number. 
	rotate 0 //Minimap rotation.  This should always be 0.  
	zoom 1.0000 //Minimap zoom.  This should always be 1 unless your texture is larger than the playable bounds of your map.  
}

Put this file in your resource/overviews folder in your dota (or addon) directory


Additional Notes

The func_brush named "structure_seal" should be nodraw (no skybox required). Select a hero by typing "jointeam goodguys/badguys"

Special Mapping Notes

There are limitations and a rulesets for maps in Hammer and their calculation in Dota 2.

Overlays

If you try to decompile and recompile the main map, dota.bsp, you'll notice that it ends up not working in VBSP, because there are too many overlays. The limit on overlays was raised from 512 to 8192 for Dota 2, and we're working on a workaround for this issue.

Fog of War Calculation

While the limitations in height are nearly non-existant, but there are only five heights considered as different heights in the Fog of War calculation. Starting from you 0-point in z-axis, they're increasing in 128 units, so the max-height is 512 Units. Everything above will be considered as one height.

Calculation of different height is simple: x∈n;128*(x-1);1>=x>=5 On this way we can always refer on 5 different heights. In example the heights for Dota.bsp are 1 - river; 2 - Midlane height; 3 - highground base; 4 - wardspots (like defensive radiant wardspot); 5 - the edge of the map.

If you're **higher** then 512 units the heightmap will continue to increase, but the player-camera still sits on the same place. So gets a unit closer to the camera and the total Field of View gets smaller. If you're getting below 0 on the z-axis, the camera will follow that height as it should be.

Maps

Flatgrass by Z-Machine

Frota by Ash47 - An addon that comes with Arena of the Dark Rift, Deadlock, Frostivus, Riverofsouls, and Runehill.

River of Souls by Z-Machine