• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Extract heightmap / navigation grid

Status
Not open for further replies.
Level 3
Joined
Feb 7, 2009
Messages
42
Is it possible to extract the heightmap or a navigation grid of a melee map to a file outside the editor?

I`m doing a research on AI navigation, and i`m looking for existing heightmaps / navigation grids to perform tests for my research. It would be great if it were possible to use wc3 / sc2 maps.

File format could be any texture, or text with a bunch of numbers. I can find my way around these.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Is it possible to extract the heightmap or a navigation grid of a melee map to a file outside the editor?
Yes it is.

The .w3e file contains the terrain mesh data. Since it is vertex based any surface is the result of interpolating the 4 neighbouring vertexes. Water layer is also managed by this file, however this is nothing more than athletics.
The .wpm file contains the static (no destructables/buildings) pathing map. This file is fairly simple to read as outside a small header each unit of pathing is represented by a single byte. I think a tile is either 2 or 4 units of pathing wide, I am not sure.
 
Level 3
Joined
Feb 7, 2009
Messages
42
Looks promissing. Is there a way to get the destructibles as well? I think trees are considered destructibles? They kind of have a big role in the navigation scenario, so it would be nice to have them too.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Of course, but the war3map.doo only contains doodad placements with reference to the object type, not the object type definitions themselves (to obtain the respective pathing maps). Those would be in war3map.w3d for custom data or Doodads\Doodads.slk for standard data (wc3's main mpqs), although the Doodads\Doodads.slk could be overwritten in a map as well. Both the war3map.w3d and Doodads\Doodads.slk use paths to texture files, which must then be retracted from map/game, too.

edit: The ground height map does not have any gameplay purpose, by the way. It's only about cliffs and ramps.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Is there a way to get the destructibles as well?
No anywhere as easily. It involves reading the .doo file to find the placement of the destructables. However in order for these to translate into pathing modifications the destructable object data has to be loaded which involves parsing slk files located inside the game mpq and then applying the custom object data file located inside the map. The actual pathing stamps used by the destructables have to be sourced from the various game data MPQ files as well as from the map archive (for correctness) and are all in .tga form.

Same applies for buildings such as marketplace and tavern which would need completely different files being parsed in a similar way.
 
Status
Not open for further replies.
Top