DIF/Map2Dif/Overview

From TDN

Contents

Map2Dif Overview

The map2dif tool can be used to convert interior geometry .map files into Torque .dif and perform several major functions. It can perform CSG operations on the map brushes to produce polygons, build a portal tree used for visibility testing, produce a BSP tree used for collision, produce lightmaps based on lighting information in the map, aggregate multiple static LODs, and more.

Essentially map2dif takes a map file as an argument, processes it, and produces a Torque .dif file. By default the .dif is located in the same directory as the .map file. In order to process the map, the textures used in the map need to be loaded. Map2Dif searches for those textures starting in the textures dir, which is by default the directory of the .dif file, then in it's parent directory recursively until it reaches the interiors root. Map2dif will load either .jpg, or .png version of the textures specified in the map.

Map2Dif loads the textures to determine the width and height of each texture. This information is used to calculate polygon texture mapping information stored in the .dif file. If a texture's size should later be changed, all interiors using that texture would have to be re-processed.

Download the latest version

GarageGame's DIF Page.

Current Features

  • Formats: Quake 1, Quake 2, Quake 3 (non-brushdef version), Valve220 (Quake Army Knife, WorldCraft, Radiant, GLB, maya2map, and more...)
  • Brush validator.
  • Tries to insure only good brushes make it into the map conversion.
  • better error messages.
  • Upped and/or removed some of map2dif's hardcoded limits.
  • Allowed completely enclosed interiors.
  • Console.log outputted for extra information and to help track issues.
  • Non-power of two texture error reporting (instead of crashing).
  • General code cleanup and bugfixes.
  • No brush limits.
  • Upped winding limits.
  • Backwards compatible with Tribes2.

Resources

Map2Dif Support Forums
Map2Dif Tutorials