├── Meshes ├── 608.map ├── 6082830.dmesh ├── 608.mmap ├── 6082730.dmesh ├── 6082730.mesh ├── 6082730.pmesh ├── 6082731.dmesh ├── 6082731.mesh ├── 6082731.pmesh ├── 6082830.mesh ├── 6082830.pmesh ├── 6082831.dmesh ├── 6082831.mesh ├── 6082831.pmesh ├── 6082730.mmtile ├── 6082731.mmtile ├── 6082830.mmtile └── 6082831.mmtile ├── SDL2.dll ├── Tests.exe ├── Tests.pdb ├── DroidSans.ttf ├── RecastDemo.exe ├── RecastDemo.pdb ├── TestCases ├── raycast_test.txt ├── movement_test.txt └── nav_mesh_test.txt └── README.md /Meshes/608.map: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Meshes/6082830.dmesh: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /SDL2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/SDL2.dll -------------------------------------------------------------------------------- /Tests.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/Tests.exe -------------------------------------------------------------------------------- /Tests.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/Tests.pdb -------------------------------------------------------------------------------- /DroidSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/DroidSans.ttf -------------------------------------------------------------------------------- /Meshes/608.mmap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/Meshes/608.mmap -------------------------------------------------------------------------------- /RecastDemo.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/RecastDemo.exe -------------------------------------------------------------------------------- /RecastDemo.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/RecastDemo.pdb -------------------------------------------------------------------------------- /Meshes/6082730.dmesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/Meshes/6082730.dmesh -------------------------------------------------------------------------------- /Meshes/6082730.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/Meshes/6082730.mesh -------------------------------------------------------------------------------- /Meshes/6082730.pmesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/Meshes/6082730.pmesh -------------------------------------------------------------------------------- /Meshes/6082731.dmesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/Meshes/6082731.dmesh -------------------------------------------------------------------------------- /Meshes/6082731.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/Meshes/6082731.mesh -------------------------------------------------------------------------------- /Meshes/6082731.pmesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/Meshes/6082731.pmesh -------------------------------------------------------------------------------- /Meshes/6082830.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/Meshes/6082830.mesh -------------------------------------------------------------------------------- /Meshes/6082830.pmesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/Meshes/6082830.pmesh -------------------------------------------------------------------------------- /Meshes/6082831.dmesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/Meshes/6082831.dmesh -------------------------------------------------------------------------------- /Meshes/6082831.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/Meshes/6082831.mesh -------------------------------------------------------------------------------- /Meshes/6082831.pmesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/Meshes/6082831.pmesh -------------------------------------------------------------------------------- /Meshes/6082730.mmtile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/Meshes/6082730.mmtile -------------------------------------------------------------------------------- /Meshes/6082731.mmtile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/Meshes/6082731.mmtile -------------------------------------------------------------------------------- /Meshes/6082830.mmtile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/Meshes/6082830.mmtile -------------------------------------------------------------------------------- /Meshes/6082831.mmtile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stoneharry/mmaps-for-custom-maps/HEAD/Meshes/6082831.mmtile -------------------------------------------------------------------------------- /TestCases/raycast_test.txt: -------------------------------------------------------------------------------- 1 | s Tile Mesh 2 | f nav_test.obj 3 | rc 45.133884 -0.533207 -3.775568 47.078232 7.797605 14.293253 0xffef 0x0 4 | rc 52.979847 -2.778793 -2.914886 50.628868 -2.350212 13.917850 0xffef 0x0 5 | rc 45.209217 2.024442 1.838851 46.888412 7.797606 15.772338 0xffef 0x0 6 | rc 45.388317 -0.562073 -3.673226 46.651001 7.797606 15.513507 0xffef 0x0 -------------------------------------------------------------------------------- /TestCases/movement_test.txt: -------------------------------------------------------------------------------- 1 | s Solo Mesh 2 | f movement.obj 3 | pf -100.539185 -1.000000 54.028996 62.582016 15.757828 52.842243 0x3 0x0 4 | pf -100.539185 -1.000000 54.028996 -1.259964 -1.000000 50.116970 0x3 0x0 5 | pf -100.539185 -1.000000 54.028996 1.598934 -1.000000 23.528656 0x3 0x0 6 | pf -100.539185 -1.000000 54.028996 3.652847 -1.000000 -5.022881 0x3 0x0 7 | pf -100.539185 -1.000000 54.028996 -39.182816 8.999985 -24.697731 0x3 0x0 8 | pf -100.539185 -1.000000 54.028996 -66.847992 -1.000000 -28.908646 0x3 0x0 9 | pf -100.539185 -1.000000 54.028996 -90.966019 -1.000000 -3.219864 0x3 0x0 10 | pf -43.394421 -1.000000 13.312424 -90.966019 -1.000000 -3.219864 0x3 0x0 11 | pf -43.394421 -1.000000 13.312424 -36.447182 3.999992 -25.008087 0x3 0x0 12 | pf -43.394421 -1.000000 13.312424 26.394167 15.757812 -13.491264 0x3 0x0 13 | pf -43.394421 -1.000000 13.312424 -4.140746 6.944923 4.888435 0x3 0x0 14 | pf -43.394421 -1.000000 13.312424 -73.532791 -1.062469 23.137051 0x3 0x0 15 | pf -43.394421 -1.000000 13.312424 -72.902054 7.996834 15.076473 0x3 0x0 -------------------------------------------------------------------------------- /TestCases/nav_mesh_test.txt: -------------------------------------------------------------------------------- 1 | s Solo Mesh 2 | f nav_test.obj 3 | pf 18.138550 -2.370003 -21.319118 -19.206181 -2.369133 24.802742 0x3 0x0 4 | pf 18.252758 -2.368240 -7.000238 -19.206181 -2.369133 24.802742 0x3 0x0 5 | pf 18.252758 -2.368240 -7.000238 -22.759071 -2.369453 2.003946 0x3 0x0 6 | pf 18.252758 -2.368240 -7.000238 -24.483898 -2.369728 -6.778278 0x3 0x0 7 | pf 18.252758 -2.368240 -7.000238 -24.068850 -2.370285 -18.879251 0x3 0x0 8 | pf 18.252758 -2.368240 -7.000238 12.124170 -2.369637 -21.222471 0x3 0x0 9 | pf 10.830146 -2.366791 19.002508 12.124170 -2.369637 -21.222471 0x3 0x0 10 | pf 10.830146 -2.366791 19.002508 -7.146484 -2.368736 -16.031403 0x3 0x0 11 | pf 10.830146 -2.366791 19.002508 -21.615391 -2.368706 -3.264029 0x3 0x0 12 | pf 10.830146 -2.366791 19.002508 -22.651268 -2.369354 1.053217 0x3 0x0 13 | pf 10.830146 -2.366791 19.002508 19.181122 -2.368134 3.011776 0x3 0x0 14 | pf 10.830146 -2.366791 19.002508 19.041592 -2.368713 -7.404587 0x3 0x0 15 | pf 6.054083 -2.365402 3.330421 19.041592 -2.368713 -7.404587 0x3 0x0 16 | pf 6.054083 -2.365402 3.330421 21.846087 -2.368568 17.918859 0x3 0x0 17 | pf 6.054083 -2.365402 3.330421 0.967449 -2.368439 25.767756 0x3 0x0 18 | pf 6.054083 -2.365402 3.330421 -17.518076 -2.368477 26.569633 0x3 0x0 19 | pf 6.054083 -2.365402 3.330421 -22.141787 -2.369209 2.440046 0x3 0x0 20 | pf 6.054083 -2.365402 3.330421 -23.296972 -2.369797 -17.411043 0x3 0x0 21 | pf 6.054083 -2.365402 3.330421 -1.564062 -2.369926 -20.452827 0x3 0x0 22 | pf 6.054083 -2.365402 3.330421 16.905643 -2.370193 -21.811655 0x3 0x0 23 | pf 6.054083 -2.365402 3.330421 19.289761 -2.368813 -6.954918 0x3 0x0 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Generating correct pathfinding data for maps 2 | ## Introduction 3 | 4 | This guide describes how to generate and debug map, vmap, and mmap data correctly for maps using TrinityCore, patch 3.3.5. 5 | 6 | ## Glossary 7 | 8 | | Term | Definition | 9 | | ------------- | ------------- | 10 | | maps | Contains basic data to calculate the games heightmap, underwater areas, fatigue areas, area information, etc. | 11 | | vmaps | Vector maps - used to determine line of sight information, visibility between objects. | 12 | | mmaps | Movement maps - used for pathfinding. | 13 | 14 | ## Generating the data 15 | 16 | TrinityCore provides tools for extracting, assembling, and building the data required. The tools are not designed to process custom data, so you must place your data emulating the Blizzlike layout: 17 | 18 | - Place all your map data in: `Data\patch-4.MPQ` 19 | - Place all your DBC (DBfilesClient) data in: `Data\{locale}\patch-{locale}-4.MPQ`, e.g: `Data\enUS\patch-enUS-4.mpq` 20 | 21 | You must run the tools in order. You should run them from command prompt or powershell such that you can review the output of the programs. The map and vmap tools must be run from your WoW directory. 22 | 23 | ### Map Extractor 24 | 25 | First run the `mapextractor.exe`. This tool also extracts DBC and Camera information, but only the map data is required for vmaps and mmaps. 26 | 27 | Watch the map extractor tool output to ensure it does pick up and process any custom maps you have. 28 | 29 | This will produce the `maps` directory. 30 | 31 | ### VMap extractor 32 | 33 | Next run the `vmap4extractor.exe` and then the `vmap4assembler.exe` tools. Again, ensure it picks up and processes your custom maps by reviewing the logs. 34 | 35 | This will produce the `vmaps` output directory. It also produces the `buildings` directory, but buildings is temporary data that can be deleted. 36 | 37 | ### MMap extractor 38 | 39 | Next run the `mmaps_generator.exe`. This takes the map and vmap data as inputs and generates the `mmaps` directory. 40 | 41 | This program has a lot of possible arguments that can be provided: https://github.com/TrinityCore/TrinityCore/tree/3.3.5/src/tools/mmaps_generator/Info 42 | 43 | There are some hardcoded configurations for Blizzlike maps within the code. You may need to play with the settings for your custom map, but this is not recommended unless you know what you are doing. These configurations were only reached after extensive testing. 44 | - https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/tools/mmaps_generator/MapBuilder.cpp#L1116 45 | 46 | The tool also has a internal version that it stamps generated mmap data with. When you run the tool, if the data already exists with the current version then it will skip that map. This is designed such that you can run the tool each emulator update and it will only generate mmap data that has changed, but also means it is harder to iterate on a custom map being designed. You will need to delete existing mmap data for your custom map if you want to regenerate the pathfinding with map edits. 47 | 48 | Also note that the tool has been reported to not support map IDs that are > 999. 49 | 50 | ## Debugging issues 51 | 52 | ## Maps Issues 53 | 54 | Typically maps data should extract fine. The only thing to be wary of is checking if it does actually detect your custom map, because if it is missed at this stage then all the downstream tools will also not contain it. 55 | 56 | ## VMaps Issues 57 | 58 | We only typically see issues here if the WMO / M2 cannot be parsed for some reason. 59 | 60 | ## MMaps Issues 61 | 62 | This is where we frequently see issues. Movement maps can be generated vastly differently depending on the map and tool version. The settings that can be configured can also effect how it is generated. 63 | 64 | The best way to debug movement map data is with the use of a tool called Recast Debug. However you can also: 65 | - Use the command `.gps` to check maps, vmaps, and mmaps data exists for your current location. 66 | - Use `.mmap` commands to debug pathfinding in game. 67 | 68 | ### Recast Debug 69 | 70 | Recast debug allows us to view and test the pathfinding mesh from outside of WoW. 71 | 72 | I have attached a version that has TC support to this repository. 73 | 74 | You need to run the mmaps tool with the `--debugOutput true` argument to generate the debug data for Recast Debug. 75 | 76 | Inside the Recast Debug `Meshes` folder you need to provide: 77 | - The `.map` file 78 | - The `.mmap` file 79 | - The `.dmesh` file 80 | - The `.mesh` file 81 | - The `.mmtile` file 82 | - The `.pmesh` file 83 | - The `.mmtile` file 84 | - The `.obj` file 85 | 86 | ![MeshesFolderScreenshot](https://i.imgur.com/Iv4NsHa.png) 87 | 88 | When opening Recast Debug, on the rop right under `Sample` select `Tile Mesh`. TrinityCore only supports Tile Mesh. 89 | 90 | Under `Input Mesh` select the `.obj` for the tile you want to debug. 91 | 92 | Ensure `TrinityCore Configs` is selected. 93 | 94 | You need to reselect the obj in Tile Mesh after enabling TrinityCore configs, otherwise the white hitbox is not 533.33f square as that is calculated only on load (it will use the obj boundaries instead). 95 | 96 | On the left panel, select `Test Navmesh`. 97 | 98 | Finally, on the bottom right, select `Load mmtile`. 99 | 100 | ![LoadedMmtile](https://i.imgur.com/dNbxS5t.png) 101 | 102 | Everything within the white box is the tile. As long as your meshes folder contains neighbouring tiles, they will also be displayed outside of the white box for completeness. In the above screenshot we can see the WMO spans multiple tiles (ADTs). 103 | 104 | The red area indicates where pathfinding has successfully been loaded. We can right and left click to preview how pathfiding would be calculated between two locations. 105 | 106 | ![PathfindingPreview](https://i.imgur.com/8g9mMm7.jpeg) 107 | --------------------------------------------------------------------------------