hlfix is a tool that converts Worldcraft/VHE format files (.rmf) to standard .map files. In the process, it performs a number of geometric operations to fix common problems with brush geometry. hlfix is far more sophisticated than VHE's built-in map export feature. The purpose of this tool is to give map designers much greater flexibility in the type of geometry they use to build their maps.

home | technical information | RMF format

To begin with, hlfix outputs floating point coordinates to .map files as opposed to VHE which rounds all coordinates to integers. This alone solves a number of typical mapping problems. hlfix also performs three phases of geometry correction:

For a detailed description of exactly what hlfix does to your brushes and what constitutes valid input to hlfix, please read the technical information. It is highly recommended that all users of hlfix read and understand this document.


The current version of hlfix is 0.81b. Because hlfix is still in beta it may, for the time being, cause problems as well as solving them. However, with the help of the mapping community, I'm hoping that this will soon not be the case and that this tool will become a standard part of the compile chain.

05/05/03 - 0.81b changes:

02/05/03 - 0.8b changes:

29/04/03 - 0.71b changes:

hlfix081b.zip (148 KB)


hlfix <mapname>[.rmf] [options]

  -o <outfile>           Output file (default is <mapname>.map or <mapname>.rmf)
  -w <wadfile>           WAD list file (default is wad.txt)
  -r                     Output to RMF file instead of MAP file
  -nt                    Don't tesselate non-planar faces
  -nd                    Don't decompose non-convex solids
  -nu                    Don't unite coplanar faces
  -na                    Don't perform ANY geometry correction
  -v                     Process and output visible objects only
  -e <number>            Epsilon factor for numeric comparisons (default is 1.0)

NOTE: hlfix is a command line application. To use it, you will need some basic familiarity with the command prompt or "DOS prompt". This subject is beyond the scope of this site, but you can get started here. As an alternative, you can use Nem's Batch Compiler which supports hlfix using a custom specification file which can be downloaded in the "Specification Files" section.

Epsilon Factor

Certain numeric comparisons in hlfix require a "fuzziness" value in order to deal with inaccurate data that can be generated by VHE. The value of the -e parameter is a multiplier for this fuzziness value. If you find that hlfix is modifying geometry it shouldn't or producing unexplainable "Incomplete edge cycle" errors, try raising this value. If you find that hlfix is not modifying geometry it should or that your compiled maps have visible errors, try lowering this value. The base value (1.0) is one that testing to date has shown produces correct results all the time. This value may change as beta testing proceeds and ultimately, the user will not have to worry about this parameter.

WAD List File

The .wad files used in your map must be listed in a seperate text file (because they aren't listed in the .rmf file). This file must contain the full paths of the wad files used in your map, listed one per line. By default, hlfix looks for a file called wad.txt. It looks for the file in the same directory as the input file unless you specify a path when using the -w parameter. A utility is included with hlfix called makewad.exe which reads VHE's registry entries to generate a wad list file. The only reason hlfix needs the filenames for .wads is so those filenames can be written to the .map file. hlfix does not actually attempt to read any of the .wads as it currently does not perform any operations on textures themselves.

Error Messages

When hlfix tries to process an invalid brush, it will abort with an error message such as "Incomplete edge cycle". Unfortunately, these messages often don't make obvious exactly what is wrong with the brush. Just examine the brush in VHE and make sure it meets the requirements for valid input to hlfix.


Apologies for the crude makefile. I have only tested this with MinGW but it should build with any variety of GCC. The source is released under the Creative Commons Attribution Share Alike license.


RMF File Format

I've published the .rmf file format here.


hlfix was created by Jedediah Smith [homepage].