Program Manuals

Graphical user interface

TBD

Command line program

Generating curves via drag and drop

M2C can be used without any preparations. Just drop map files onto the exe and it will try to generate a curved version of it IF your map meets the necessary requirements!
The results will be basic then. You can always change some settings in the Defaults.txt though.

Setting up curves directly in an editor

As of version 0.5 you can use special point entities info_curve, info_curve_export and info_detailobject) to setup your curves right inside a Goldsource editor (Hammer, Sledge, JACK).

3 FGD entities for Goldsource editors

Creating preset files for curve generation

To keep all settings in one file for repeated usage it is possible to create preset files for M2C.

Specify WAD files for proper texture alignment

To achieve perfect results in terms of texture alignment you will need to specify your used WAD files in WADList.txt, which is located in Map2Curve\WAD.

Map2Curve is able to obtain texture information directly from your WAD files. For this to work you have to use one of 2 methods:

Adding WAD files to Map2Curve:

  1. Open the WADList.txt in the WAD folder and add your WAD file paths (one per line).
  2. Alternatively you can paste copies of your WAD files into the WAD folder.

Valid file types

Valid files for M2C are Goldsource map files and M2C preset files, which are simple text files that contain valid commands and settings.
MyPresetFile.txt A M2C preset file!
MyMapFile.map A Goldsource map file!

How the filetype influences the generation process

Using preset files

Using a preset file will always make M2C use the settings from that preset file, that is if it contains any settings. It will use these settings on the map file, that matches the name of the preset file, IF it exists.
MyPresetFile.txt + M2C.exe =
1. M2C looking for MyPresetFile.map to generate a curve from the preset file settings IF those are valid and IF map file exists.
2. Else: Looking for Defaults.txt file DEFAULTS.txt to obtain settings.
3. Else: Using internal defaults for settings.

Using map files

When giving M2C map files to chew on, it will scan it for internal information from curve entities (info_curve) and then for an external preset file.
If no info_curve or preset file was found, then M2C will use default settings from either Defaults.txt or its own internal ones.

MyMapFile.map + M2C.exe =
1. Looking for info_curve entity in map file to obtain settings.
2. Else: Looking for preset file MyMapFile.txt to obtain settings.
3. Else: Looking for Defaults.txt file DEFAULTS.txt to obtain settings.
4. Else: Using internal defaults for settings.

Multiple files handling

M2C can process multiple files in a row. The files can be of a different type (map or txt).
MyMapFile#1.map MyMapFile#2.map MyPresetFile#1.txt

Preset Files

At the moment curves can be generated by either dropping a map file or a previously created preset file (that has the same name as the mapfile) onto the program executable.
Which one you use to start the generation process makes a difference!

Creating preset files

Name convention for preset files

Per default MyMapFile.txt is linked to MyMapFile.map

A preset file needs to have the same name as the input map file for M2C to know which belongs to which. This can be overridden by using the “source” command and specifying an alternative input map file path.

Overriding source map

source “C:\MyCustomSourceMap.map” // defines a custom source map

Now MyMapFile.txt is linked to MyCustomSourceMap.map

Specifying curves in a preset file

As there can be multiple curve objects defined in a preset file, M2C needs to know how many actual curve objects shall be created. The rad command that controls the curves radius is the indicator for that. Without any rad command in a preset file, the minimum amount of generated curves is 1.

rad 64 // Curve #1 is being defined with a custom radius of 64 game units
rad 512 // Curve #2 is being defined with a custom radius of 512 game units
rad 0 // Curve #3 is being defined with its original position

Preset file structure

Commands and their settings can be anywhere in a preset file. No special placement is necessary. As long as they are not commented out, they will be recognized as such.
As the preset file gets scanned for valid commands, their position of appearance defines to which curve object they belong.

Example #1 – Grouped

// these settings belong to curve object #1
rad 512
type 0
offset 64
res 16

// these settings belong to curve object #2
rad 1024
type 1
offset -128
res 24

Example #2 – Stacked

rad 512 // curve object #1
rad 1024 // curve object #2

type 0 // curve object #1
type 1 // curve object #2

offset 64 // etc…
offset -128

res 16
res 24

Setting inheritance

Most settings  of a curve object are being inherited by the following curve objects unless overwritten with another value.

If multiple curve objects were defined in a preset file and all of them are meant to share a certain setting, that setting only needs to be defined once. The following curve objects then share the settings of the first one, use default values or automatically generate a value from previous values (only works for “res”). Some commands don’t use this behaviour (e.g. Radius, Offset and Transformation commands).

rad 512
rad 256
rad 1024
rad 2000
type 1 // All of the 4 curve objects share the curve type “1”

Comments

Any other text than commands and respective values has to be commented out -> “// Comment”

rad 512
//offset 64 // this setting is going to be ignored

Command-List *outdated*

Input Output File Settings

Command Type Value Range Default Value Description
source string “UNSET” Custom input map file path (Info).
Example:
C:\MyMaps\MySourceMap.map absolute
“C:\My Map Folder\MySourceMap.map” absolute with spaces
target string “UNSET” Custom output map file path (Info).
Example:
C:\MyMaps\MyTargetMap.map absolute
append bool 0/1 0 Whether or not a generated curve gets appended onto an existing mapfile (Info).
0 : OFF – Overwrites target map completely.
1 : ON – Includes generated map into existing target map.
obj bool 0/1 0 Exports individual arcs as OBJ files (Info).
0 : OFF
1 : ON

General Curve Settings

Command Type Value Range Default Value Description
rad float >0 0 This specifies the arcs radius and is at the same time the “representative” for this arc. Each rad command stands for one arc, that is to be generated (Info).
0 : original radius (y-coord)
>0 : custom arc radius in game units
offset float +/-0 0 Additional offset on top of radius in game units (Info).
res integer 4-384 8 Number of curve sides (Info).
0 : Maintains “level of detail” from previous curve object.
type integer 0-2 0 Construction type for the generated objects (Info).
0 : Pi Circle
1 : Grid Circle
2 : Path from path file (TBD)
shift integer 0-5 5 Horizontal texture shift mode (Info).
0 : Nullshift
1 : Per Section
2 : Per Brush
3 : Per Brush Texture
4 : Aligned Left(Section)
5 : Per Group Texture
height float +0 0 Adds custom height to each section if greater than zero (Info).
>0 : Custom height is being added to each section.
ramp integer 0-2 0 Creates a ramp if height command is greater than zero (Info).
0 : OFF
1 : Linear Ramp Mode
2 : Smooth Ramp Mode
ramptex bool 0/1 0 Controls the method for texture alignment on ramps (Info).
0 : Sheared
1 : Square
round bool 0/1 0 Rounds all coordinates to integer numbers (Info).
0 : OFF
1 : ON
tri bool 0/1 0 Activates triangulation (Info).
Triangulation for for curve brushes. Brushes which don’t match the criteria will be assumed complex and triangulated less efficient (Info).
0 : OFF
1 : ON
range_start float 0-100 0 The lower limit of curve sections to export in percent (Info).
range_end float 0-100 100 The upper limit of curve sections to export in percent (Info).
bounds bool 0/1 0 Enables or disables a brush box that covers the generated objects, for an easier handling in a map editor (Info).
0 : OFF
1 : ON – Creates a bounding box for the entire generated curve object.

Advanced Curve Settings

Command Type Value Range Default Value Description
spike_height Integer >0 4 Default height for spike shaped brushes that occour when triangulating complex brushes (Info).
nulltex String NULL Default texture for faces that occour when triangulating brushes (Info).
skipnull bool 0/1 0 Brushes that only consist of NULL faces are being skipped during export (Info).
0 : OFF
1 : ON
gaps bool 0/1 0 Gap brushes are middle sections that can be used for various mapping purposes (Info).
0 : OFF
1 : ON
gaplen float >0 256 Controls the length of gap brushes (Info).
transit_tri bool 0/1 0 Triangulates the first and last brush of a curve object.
When combined with transit_round the resulting curve can be connected to another curve a lot easier or be modifed in another way (Info).
0 : OFF
1 : ON
transit_round bool 0/1 0 Rounds the coordinates of the first and last face vertices of a curve object so the resulting brushes can be connected to other brushwork easier.
Is usually being used along with transit_tri (Info).
0 : OFF
1 : ON

Spline Extrusion

Read more about spline extrusion here.

Command Type Value Range Default Value Description
path string “UNSET” Custom path to a file that has adequat information (e.g. path_corner) in it (Info).
Example:
C:\MyMaps\MyCornerMap.map absolute
“C:\My Maps\MyCornerMap.map” absolute with spaces
p_reverse bool 0/1 0 Reverses direction of a path (Info).
p_cornerfix bool 0/1 0 Fixes overlapping corners of a path extrusion object (Info).
p_split bool 0/1 0 Whether or not path objects are being split into smaller pieces on export (Info).

Transformations

Read more about transformations here.

Command Type Value Range Default Value Description
scale Float +/-0 0 Scaling for the final generated curve object.
Won’t affect point entities and currently only works for all axes at once!
scale_src Float +/-0 0 Scaling for the source map.
Won’t affect point entities and currently only works for all axes at once!
rot Float +/-0 “0 0 0” Rotation for the final generated curve object. Axis order is XYZ.
rot_src Float +/-0 “0 0 0” Rotation for the source map. Axis order is XYZ.
Currently doesn’t work as intended for detail objects when rotated around axes other than X!
move Float +/-0 “0 0 0” Transition for the final generated curve object.

Detail Objects

Read more about detail objects here.

Command Data Type Default Val Range Description
General settings
d_enable Integer 1 0/1 Turns this Detail Group on or off entirely.
d_pos Float 0 0-1 Controls the relative position of this DG along the curve section.
d_autopitch Integer 1 0/1 Turns automatic Y axis rotation (Pitch) on or off.
d_autoyaw Integer 1 0/1 Turns automatic Z axis rotation (Yaw) on or off.
d_autoname Integer 0 0/1 Turns automatic numbering of target and targetname keyvalues on or off.
d_separate Integer 0 0/1 Turns individual export of solid entities (brushes) on or off.
Randomize Y/X-Position and Z-Rotation
d_movey_rand Int/Float 0 -32 32 0/1 min max Moves objects along Y axis randomly within range.
d_rotz_rand Int/Float 0 180 -180 0/1 min max Turn objects around Z axis (Yaw) randomly within range.
d_pos_rand Int/Float 0 0 1 0/1 min max Randomizes position of objects along section within range.
Control/Randomize Export
d_draw Integer 0 x>0 Export every x-th element of this group.
d_skip Integer 0 x>0 Skip export of every x-th element of this group.
d_draw_rand Integer 0 0/1 Completely randomize the export of this groups elements.