This article describes all the options for ZHLT compilers. In addition to these parameters, the improved ZHLT Custom Build compilers use some additional ones. You can read about them in one of the previous articles about the improved version of ZHLT. This article is a translation of the official document that comes with the ZHLT. Article taken from:
http://alexnd.narod.ru/. We thank the author for the excellent translation!
Each of the four compilers has both its own parameters and 9 common ones that apply to any of the compilers.
Content:
- 1. HLCSG (8 parameters + 9 general)
- 2. HLBSP (6 parameters + 9 general)
- 3. HLVIS (2 parameters + 9 common)
- 4. HLRAD (25 parameters + 9 general)
- 5. Parameters common to all compilers (9 parameters)
1. HLCSG
Launch example: hlcsg.exe -estimate -nowadtextures karta.map
-nowadtextures
Include all textures used in the final map file (.bsp). This option is useless with the parameter input
-wadinclude and is left only for backward compatibility.
-wadinclude file
Include textures from the specified .wad file in the final map file (.bsp). This option allows you to include textures from the specified .wad file in the final (.bsp) file. Allows the use of partial name matching, is not case sensitive, and is able to recognize not only file names, but also folder names. If you need to insert multiple texture files, you must specify several parameters
-wadinclude, one for each texture file. Only textures actually used in the map will be inserted into the .bsp file.
-noclip
Do not create a "boundary" area for the map. Maps in Half-life, like Quake1, have 4 closed areas (hulls) used by the game engine: 1 area is visible (for drawing visible areas of the map), and 3 areas are restrictive (to limit the movement of players on the map). This option allows you to disable the creation of restrictive areas on the map, making it "airy". The player will not only be able to walk through walls, but also fall through the ground (if gravity is turned on). Useful for saving time during test compilation. You can only observe changes made on the map in Spectator mode.
-onlyents
Update the value of object parameters from the source (.map) in the finished map (.bsp) This option updates objects in an already created map (.bsp file). In most cases, however, objects cannot be edited. Adding or removing an object can disorganize other objects, ruining brush objects, especially triggers.
-noskyclip
Disable automatic map limiting to the sky. By default, hlcsg limits the space available to the player with brushes with a CLIP texture, and also removes all polygons outside the map or "inside" the sky, which speeds up program execution
hlvis And
hlrad.
-tiny #
Set the minimum brush area, less than which brushes are removed. Surfaces with a small area are removed during compilation. The default threshold is 0.5 square "unit" (the unit of measurement in Half-Life, the Worldcraft/Hammer editor). It is quite dangerous to remove surfaces in this way, as the map may become unusable and errors LEAF PORTAL SAW INTO LEAF or
HALL-OF-MIRRORS (mirror corridor - the effect when a player goes beyond the boundaries of the map in observer mode).
-brushunion #
Set a threshold for messages about intersecting brushes. This option is provided for debugging purposes. Its value sets the percentage of the volumes of intersecting brushes, upon reaching which a warning is issued. A fairly high value (95% or higher) is a good place to start, as lowering this setting results in hundreds or even thousands of messages. For each intersection of brushes, information about the brush numbers and the percentage of overlap is displayed. This option is disabled by default; Enabling it significantly slows down hlcsg.
-hullfile
Upload your own file with information about restrictive areas. Loads its own file with information about bounding areas. The file consists of 3 lines with 3 numbers each, which indicate the size of the area along the X Y Z axes. This option is given to the authors and mappers of certain Half-life mods, so you shouldn't worry too much about it.
2. HLBSP
Launch example: hlbsp.exe -estimate karta.map
-leakonly
Run HLBSP only to search for leaks (LEAK error). If you know that the card has holes (LEAK), use this option to search for holes and create a special file with information about the holes (.pts file).
-subdivide #
Set the size of the surface divider. Surfaces in Half-life are divided into polygons of the size specified in this parameter (in units). The default and maximum value of the parameter is 240. However, improved ZHLT Custom Build compilers allow you to increase this parameter, but this almost always causes all sorts of errors :) This was the case, at least, until version ZHLT Custom Build 1.7. It is usually not a good idea to decrease this parameter, as this will increase r_speeds.
-maxnodesize #
Set the maximum portal size. This setting changes the maximum portal size. Reducing it leads to the map being divided into more portals and, as a result, to an increase in the r_speeds value. However, r_speeds can actually be reduced by faster or more accurate calculation of visible areas on the map during vis execution.
-notjunc
Do not break brushes into smaller ones when they touch (T-connections) (not for final compilation). This option is for debugging/tuning and should not be used during normal compilation.
-noclip
Do not process bounding region (not for final compilation). This option is a continuation of the option
-noclip in the compiler
hlcsg. It tells hlbsp that hlcsg compiled the map with the option
-noclip and that bounding regions should not be processed since they are not present in the .bsp file.
-nofill
Don't "fill in" the outside world (ignores LEAK leaks) (not for final compilation). This option allows you to avoid "filling" the void on the "outside" of the card, resulting in all outer surfaces being preserved. You shouldn't run a lighting calculation on a map compiled this way, although vis will work fine.
3. HLVIS
Launch example: hlvis.exe -estimate -full karta.map
-fast
Accelerated analysis (not for final compilation). Accelerated analysis of visible areas on the map is convenient for quickly examining the map being created. However, the value of r_speeds leaves much to be desired, as does the number of object polygons (epoly - entity polygons). The map can be "lit" using hlrad, but the quality of lighting and compilation time of the lighting of such a map will suffer. The map you are developing should be compiled regularly with a full visibility analysis, as a faster analysis may prevent you from noticing a sudden increase in the full analysis time, which indicates a poor architecture and a large resulting r_speeds value.
-full
Full analysis. This parameter uses an additional block for calculating visible areas on the map, which reduces the number of errors compared to conventional analysis (hlvis without parameters). Compilation time increases by about 30%. The r_speeds value remains approximately the same, with some decreases in some places on the map, and increases in others (mainly due to elimination of errors in the analysis).
4. HLRAD
Launch example: hlrad.exe -estimate -chart -extra -smooth 100 -dscale 1 -bounce 4
karta.map
-sparse
Use the algorithm with a matrix with limited memory. Hlrad breaks the map into many blocks - patches, from which a matrix is subsequently created to calculate the lighting on the map. Initially, the matrix algorithm is limited to 65535 "patches" or blocks. The memory usage of this algorithm grows exponentially as the number of patches increases (the required memory in bytes is calculated as the number of patches squared divided by 16). This hlrad parameter enables a matrix compression algorithm, which, due to the additional use of the processor, allows you to overcome the limit of 65535 patches, and also reduce the RAM requirement to 10% of the amount required for a conventional matrix algorithm.
-nomatrix
Disable the use of the matrix completely Due to the fact that the use of a "truncated" matrix (parameter
-sparse) leads to data compression; precise synchronization of processes is required, which is difficult to achieve on machines with more than 2 processors. Option
-nomatrix was added to solve this problem. However, the addition of "opaque brush objects" in ZHLT 2.2 greatly impacted the performance of this lighting compilation method to the deterioration. This method does not imply the use of a matrix at all, and therefore does not require memory to store such a data structure.
Enable more accurate lighting calculations (9 point oversampling). Allows you to compile a map with the most realistic and beautiful lighting.
-bounce #
Set the number of "reflections" of light. This parameter sets the number of times the light is reflected. By the time this operation is performed, all the data has already been pre-calculated, so the additional number of reflections will not take much time. Increasing the number of reflections smooths out shadows and illuminates dark areas of the map in a more realistic way.
-ambient r g b
Set the illumination of the surrounding world (from 0.0 to 1.0, r g b). This option sets the minimum "brightness" of each map surface so that none of them are completely black. The parameters correspond to red, green and blue with values from 0.0 to 1.0.
-maxlight #
Set the maximum light intensity. This setting is used to limit the brightness in well-lit areas, making the map darker.
-circus
Enable 'circus' mode to detect unlit areas. This is a debug option that replaces all black dots on any surface with a random bright color. For calculations, only direct illumination is taken into account and reflected light is ignored.
-nopaque
Disable blocking of light by objects. This is a debugging option that allows you to disable blocking light by objects (casting shadows) that have their glow flags set (2). Blocking light by objects slows down hlrad, so this option is useful for debug/staging compilation.
-smooth #
Set the smoothing threshold (in degrees). By default, hlrad illuminates each surface separately, resulting in visually distinct surfaces in the finished map. If the angle between two surfaces is less than that specified in this parameter, the lighting calculation will be done using smoothing technology (simulating a smooth transition - roundness - between surfaces).
-chop #
Set patch size for regular textures. Each surface is divided into a grid with a step equal to the patch size. The resulting blocks are used to calculate surface lighting. By increasing the patch size you can speed up hlrad execution and reduce memory requirements, but this will lead to a loss of quality on the finished map (uneven, angular, unrealistic shadows). Reducing the patch size, on the contrary, will lead to better lighting of the map, but will require more computer resources.
-texchop #
Set the patch size for glowing textures. Glowing surfaces (textures are described in lights.rad and emit light) are broken into blocks of a different size than regular surfaces. Typically, the block size should be half the block size of a normal surface (
-chop) to make the lighting look good. Enabling the -extra option automatically sets the value of this option to half the value of -chop.
-notexscale #
Don't resize patches when changing texture sizes. By default, hlrad uses texture scale data when creating meshes and dividing surfaces into illuminated patches. This option disables patch scaling for scalable textures, which almost always results in more patches since many maps have wall textures that are 2-3 times larger.
-coring #
Set the minimum lighting threshold. This option controls the amount of illumination required on the surface so that it is not completely black.
-dlight #
Set the maximum brightness of direct (non-reflected) light. This option is similar to the -maxlight option, except that it allows you to "normalize" the light instead of "cutting" excess brightness.
-nolerp #
The nolerp option disables blending of reflected light values for nearby patches (uses the closest value instead). Added by the author for internal testing of the map lighting code.
-dscale #
Set the multiplier for lighting. Due to a bug in the original qrad lighting compilation program, the direct lighting calculation was done twice during compilation. To create the most realistic maps, it is necessary to perform this calculation only once, however, due to the fact that for a long time maps were created with this parameter specified manually, it was left in this version of the compilers. Using a value of "1" will produce the most realistic shadows and lighting. However, since this setting is mutable, it has several other uses. So, using a value of "0" will completely remove direct lighting from the map and leave only reflected light. Thus, we were able to check the quality of only reflected light (the opposite of the parameter
-bounce 0). Using values of 3-4 will create a very strong contrast between shadows and highlights, which can be useful on maps with deserts or arctic ice.
-fade #
Set the darkness level for all lights on the map (higher values result in less light spread). This parameter is a coefficient to the dimming calculation formula (1/[square of distance]). With it you can adjust the distance over which direct light spreads on the map. Individual lighting objects can have their own dimming values. This parameter only affects direct lighting, since reflected light always has a dimming formula (1/[square of distance]).
-falloff #
Set the formula for calculating shading (1 = 1/distance, 2 = 1/[square distance]). This option allows you to change the shade calculation formula.
-scale #
Set the multiplier for the final lighting on the map. This setting affects the final values of light sources after all lighting calculations have been completed. Decreasing this parameter darkens the map, increasing it brightens it.
-gamma #
Set the global color value. This option affects the final compiled data by adding color correction.
-sky #
Determine the effect of sunlight on shaded surfaces. Many surfaces on the map face the sky but are in the shadow of other objects. This option controls how much "solar" ("sky") illumination should be added to the shaded surface.
-lights filename.rad
Specify a file with glowing textures manually (.rad file). One .rad file can be added manually, in addition to the automatically used lights.rad and <map_name>.rad files
-noskyfix
Disable global application of the light_environment object. ZHLT 2.1 added an easier-to-use sky lighting system using the light_environment object. According to the new rules, only one light_environment object is required on the map, and its location does not matter - the entire sky begins to emit light. The -noskyfix option disables this behavior and uses the old algorithm, when different areas of the map required separate light_environments objects to properly illuminate the outer areas of the map.
-incremental
Use or create a file with lighting data on the map. This is a handy debugging option for tweaking map lighting, especially for slow machines with limited system memory. Lighting compilation steps such as BuildVisLeafs, MakeScales and SwapTransfers can be skipped on the second and subsequent runs of hlrad using this option. Using a lighting data file requires simple, straightforward operations:
- Start hlrad as usual by enabling the option -incremental. The map will be compiled and illuminated normally; in addition, a file with lighting data (up to several tens of megabytes in size) will be created.
- Point lighting objects (light, light_spot, light_environment) can be changed in any way (moved, changed brightness, color, etc.)
- Object values are updated to the .bsp file using the hlcsg compiler with the option -onlyents.
- Run hlrad as usual again with the parameter -incremental. It is necessary to keep exactly the same parameter values -extra, -chop #, -texchop
#,
-notexscale #. Other parameters can be changed as desired.
-dump
Save patch information for hlrad debugging. This is an option for ZHLT developers to save information about patches created during the blocking phase of the map and checking the correctness of such division.
5. General parameters
-texdata #
Changes the maximum memory size allocated for textures (in KB). Half-life was built with a 2MB texture memory limit, just like Opposing Force. ZHLT utilities have a default limit of 4MB. This amount of memory allocated for textures can be quite large when combined with model textures, on-screen graphics, etc., especially for owners with older video maps like Voodoo 1 and 2.
-chart
Shows bsp statistics. This option causes programs to display bsp statistics before writing to a file. It is most useful to use this option with programs
hlrad And
hlvis. The ripent utility always displays a statistical chart.
-low /
-high
Runs a low/high priority program. Setting the priority to low (-low) is very convenient because you can run several other applications at the same time without compilers significantly impacting system performance. Recommended to use if you have sufficient RAM.
-nolog
Do not create report files. This option disables the automatic generation of report (.log) and error message (.err) files.
-threads #
Manually specify the number of processes. This option is used to specify the number of processes, mainly on non-Windows operating systems when it is not possible to automatically determine the number of processors. On Windows machines, this option allows you to specify fewer processes than the available number of processors.
-estimate
Shows the estimated compilation time. This parameter replaces the standard progress indicator (10...20...) with an indicator with the estimated compilation time, the amount of work completed and the amount remaining to complete. Time prediction is often inaccurate, but in general this indicator is more detailed than the standard one.
-verbose
Compile with additional messages. Most utilities will display "minor" messages and information if you set this option. With the development of utilities version 2.x, such messages related to the operation of the utilities themselves are displayed when the parameter is enabled
-dev, while mapping-related messages are displayed when the option is enabled
-verbose.
-noinfo
Do not show utility settings. ZHLT 2.1 added the ability to display the current configuration of each utility before starting work. The settings table shows the current value and default value of each parameter. Due to the large amount of text information, this can cause compilation problems in, for example, Worldcraft, as the latter sometimes freezes with a large amount of text scrolling in its compilation window.
-dev #
Compile with developer messages enabled. Internal debug messages in ZHLT utilities are regularly added to the toolkit. This parameter allows you to adjust the degree to which such messages are displayed, and has values ranging from 0 (do not show) to 6 (show even redundant messages). This option is practically not used, except at the request of the developer to diagnose the user's computer.