Last Update: March 31, 2019
This documentation applies to version 0.3 and prior.
For informations about the current version 0.4 see the external manual.
This program lets you generate Arcs from Goldsource map files. It works by dropping map or txt files onto the programs executable.
Map files will have to match certain criteria, see below for further informations.
Also since the tool can not read Goldsource WAD files, you will have to create custom text files, that contain the needed texture informations for the program to function properly. See the WAD folder for further information.
At the moment arcs can be generated by either dropping a map file or a previously created settings file (that has the same name as the mapfile) onto the program executable.
When dropping the map onto the exe, the program will use internal or external (default.txt in root folder) default settings for the arc generation process, instead of your own custom arc settings.
- The only command that is crucial to generate an ARC, is “rad”. Every rad command, stands for one arc object.
- You can generate multiple arcs from the same map-file. To do this, just add more than one rad command.
- The Order of the commands specifies to which arc object they belong.
- If there are e.g. 5 “rad”-commands, you only need to specify one optional command (offset, res, type, arc, obj).
The following arc objects then share the settings of the first arc, use default values or automatically generate them from previous values.
- If there are e.g. more “res”-commands than “rad”-commands, the redundant res-commands will be ignored.
- Commands can be commented out like this: “// rad 1024”
Setting File #1
rad 0 // Arc #2
arc 90 // Both arcs will only output 90 degree (25%) of the whole generated arc (360 deg)
offset 256 // Arc #2 will be 256 units wider than #1
res 24 // Arc #1 will have 24 sides
res 0 // Arc #2 will maintain the level of detail of the first Arc.
type 0 // Both arcs will use the “Pi” method for their construction
|rad||float||+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.
[rad = 0] original radius (y-coord)
[rad > 0] custom arc radius in game units
|offset||float||+/-0||[offset = 0] additional offset on top of radius in game units|
|res||integer||4-384||Number of arc sides. Minimum: 4.
[res = 0] Maintains “level of detail” from previous arc. Default number of sides if first arc: 8.
|type||integer||0-2||Construction type for the generated objects.
[type = 0] Pi Circle
[type = 1] Grid Circle
[type = 2] Path from path file (TBD)
|shift||integer||0-4||Horizontal texture shift mode.
[shift = 0] Nullshift
[shift = 1] Per Section
[shift = 2] Per Brush
[shift = 3] Per Brush Texture
[shift = 4] Aligned Left(Section)
|height||float||+0||Adds custom height to each section if greater than zero (stair steps).
[height > 0] Custom height is being added to each section.
|ramp||integer||0-2||Creates a ramp if height command is greater than zero.
[ramp = 0] OFF
[ramp = 1] Linear Ramp Mode
[ramp = 2] Smooth Ramp Mode
|round||bool||0/1||Rounds all coordinates to integer numbers.
[round = 0] OFF
[round = 1] ON
|tri||bool||0/1||Triangulation for 6 sided brushes with planar front and back-face.
Brushes which don’t match the criteria won’t be processed and exported.
[tri = 0] OFF
[tri = 1] ON
|obj||bool||0/1||Exports individual arcs as OBJ files.
[obj = 0] OFF
[obj = 1] ON
|arc||integer||0-360||Limits the section range for final file export.|
|ramptex||bool||0/1||Controls the method for texture alignment on ramps.
[obj = 0] Projected (like JACKs UV-Lock)
[obj = 1] Re-aligned rectangular
|p_reverse||bool||0/1||Reverses direction of a path.|
|p_cornerfix||bool||0/1||Fixes overlapping corners of a path extrusion object.|
|p_split||bool||0/1||Whether or not path objects are being split into smaller pieces on export.|
- Brushwork has to be horizontally aligned along the X-axis and can be anywhere on the map, but should be on the top side of the Y-axis. If some vertices of the map-brushes are below 0 on the Y axis, the source object will always be moved above 0 on the Y-axis for arc generation.
- Cutting Edges have to be planar.
- Slopes along the X-axis will lead to an invalid brush.
- Texture Rotations other than 0, 90, 180, 270, etc. will be automatically aligned to “World”.
- There can be Solid Entities and World Brushes in a Map file.
- Point Entities are being ignored.
Mesh criteria for arc generation:
- No sloped faces along the X-axis.
- Planar cutting edge faces.
Valid brush lengths:
Brushes can have any length on the X-axis.
Some valid brush profiles:
See section about triangulation.
Brushes can be anywhere on the map, but will be moved above 0 on the Y-axis before arc generation.
- On body faces (all faces along X-axis) only the texture rotations/alignments: 0,90,180 and 270.
- Cutting edge faces can have any rotation/alignment.
- Each face can have any Scale and Shift.
Solid entities are being supported by Map2Curve. It is advised to turn anything into a solid entity (e.g. func_detail or func_wall) for a better brush-handling in the editor.
Point entities are currently not supported but might be added in a future update.
- “rad 0” will use the original mesh position from the map file, as long as it is above 0. Otherwise, it is moved above 0 on the Y-axis before the arc is being generated.
- Each radius (rad) command in a Map2Curve setting file corresponds to one arc.
- A setting file can consists of only one rad command. Anything else will be filled with default values by the program.
- Each arc defined in a settings file will always use the same base mesh from the loaded map file.
- Resolutions for PI Circles are always divisible by 4. Everything else will be rounded by the program.
At the moment the minimum resolution is 4.
- Resolutions for GRID Circles must be 12, 24, 48, 96, 192 or 384 or the appropiate ID: 1(12)…6(384)
Currently there are 3 ways the program generates curves: Pi- and Grid-Circles and Grid Paths. Both have up- and downsides.
Curve Type Properties
|Pi Circle||0||4||384||8||equal||floating point|
|Grid Path||2||Properties depend on path…|
Pi Circle Properties
This uses pi to generate the contruction circles. This method will let you “arc” non-rectangular brushes (e.g. pipes), without the need of using triangles.
- Even length of each section
- Perfect circle
- The resulting floating point coordinates are not easy to work with (but can be compiled flawlessly in most cases and can be rounded to integer numbers)
Grid Circle Properties
This uses a special construction method, where the basic circle was rotated by 15 degrees, scaled to the nearest grid and then its vertices were snapped to the nearest grid. For a 12-sided circle with a radius of 128, this gridsize would be 32. By doing this, the resulting arc brushes won’t need any triangles to be planar either AND can even have integer coordinates, which can be handled a lot easier than floating point coordinates of course.
- The coordinates can be integer and are thus very comfortable to work with.
- Cutting edges are easier to work with.
- When arcing smaller brushes at high resolutions floating point coordinates (e.g. 0.5, 0.25, 0.125, 0.0625, etc.) are possible and can’t be rounded to integer numbers that easily without deforming the mesh and making the “Grid” type pointless.
- Not a perfect circle, rather oval.
- Sections don’t share the same length.
Grid Path Properties
See the section about grid path extrusion.
- The original generated vertice coordinates have floating point precision and are thus off grid.
- “Round 1” rounds these coordinates to integer numbers, which can be handled easier in an Editor because they are on grid.
Ramps are created by combining the commands height and ramp.
HEADS UP: Round vertices of sloped triangulated brushwork in case of compilation errors!
When transforming certain brushwork into ramps, it might be a good idea to round the vertices to integer numbers, since the compiler tools really don’t like sloped brushes with floating point coordinates, that are furthermore triangulated. They will probably completely mess them up, resulting in holes and other unlovely errors.
Snapping everything to grid will avoid this in some situations. Maybe not always though, didn’t test it.
- While height adds a custom height (32) to each section…
- …tri 1 splits up the brushes into wedges, which is crucial for the sloped brushes to be loaded flawlessly by a Goldsource map editor.
- ramp 1, in the end, creates the actual ramp, with a linear slope. Ramp 2 would create a smooth slope.
Ramp (Slope) Mode
- ramp 1 creates a linear slope.
- ramp 2 creates a smooth slope.
The ramp texture mode defines how textures are being aligned on ramp surfaces, which is not an easy situation for aligning textures in general.
The easiest way to do this is to project the textures onto the ramp from above. This way there will be a certain distortion, but the original shift is being preserved perfectly. You can observe this by using UV Lock in JACK editor.
Ramp Tex Mode
- ramptex 0 Textures are being projected onto the ramps surfaces from an upright angle.
- ramptex 1 Textures are being aligned rectangular on the ramps surfaces. Currently there is no horizontal texture shift available for this mode.
Demonstration of both modes
- Using Triangulation on an Arc is crucial for ramp generation! As of version 0.2a it is being applied automatically though.
- Triangulation will currently only work on brushes that have 5 or 6 faces (wedges and squares) and an upright front and/or back face!
Map2Curve reads texture information from imported brush faces and uses them to calculate the new generated textures, aka rotate them, re-scale them and move them horizontally along the respective brush/arc edges.
In Order to do this, source textures need to meet certain criteria in terms of texture rotations/alignments.
There are several ways textures can be arranged on the generated arc brushes horizontally:
- Shift 0 [Null] – Simply puts all horizontal texture shifts to “0”.
- Shift 1 [Per Section] – All faces of a section share the same shift that is based on the longest edge length of that section.
- Shift 2 [Per Brush] – All faces of a brush share the same shift that is based on the longest edge length of that brush.
- Shift 3 [Per Brush Texture] – All faces of a brush, that share the same texture, will have the same shift, based on the longest edge length of that brush-texture.
- Shift 4 [Align Left] – All faces of a section are aligned to the left corner of this section.
OBJ is a 3D model exchange format. It can be imported and/or viewed in potentially any available 3D software.
Exporting a generated arc or ramp to OBJ can have multiple reasons and benefits. You might want to use it as reference when animating scenes in an external 3D software, other than a classic Goldsource editor.
As of version 0.3 Map2Curve can extrude brushes along a path, that is made of path_corners and was created with a path tool such as the one in Hammer Editor. Since JACKs path editing tool is a lot easier to use, I can recommend it for this purpose.
Requirements for path extrusion
- To extrude something along a path you have to use “type 2” for this curve object.
- The path needs to be put in a separate map-file, that has the same name as the file, that contains the source brushes, but with a “_path1.map” added to it, where “1” specifies the ID of the curve object.
- The path also needs to be made of path_corner entities and must be created with a path tool.
- The direction in which the path is heading is relevant for the later brush align and can be reversed with “p_reverse 1”.
- The offset setting can be used on paths, too. It might break the mesh though, if being used in the wrong direction.
- Circular paths are not yet supported. If you want to create a circular extrusion from a path, you need to connect the last section yourself AND add one additional section, to create a correct loop.
Extrusion method explained
Currently there is only one method for the path extrusion feature. It is a rather simple method, that produces clean brushes, while still offering a good optical quality without the need of triangulation.
It is based on the align of the path sections. The source brushes cut faces are being rotated relevant to the path section align (left, right, up, down). Empty corners are simply being filled then, to create an uninterrupted extrusion.
Of course there are downsides to this method. It won’t create the best result in every situation. I have included a few settings that might help reduce these issues eventually.
Also it is not suited to extrude brushes, that need to have correct proportions to look authentic. This especially applies to anything that is man-made, while natural structures will still look good or at least okay.
Examples for natural looking path extrusions
Autofilling corners doesn’t always work. More precisely it will only be applied, when the path turns clockwise. There will be overlapping brushes at some point and mostly this won’t be a big deal. If necessary, “p_cornerfix 1” can be used to resolve this, but it should be kept in mind, that the resulting mesh will differ from the original path then.
Sometimes it can be very useful to reverse the paths direction. This might already resolve wrong extrusion. The source brush object might need to be flipped as well, to accomplish the result that was originally intended.
This controls whether or not the path is being exported as a whole or gets split up into many smaller pieces, depending on the orientation of the respective segment. This can be very helpful on long paths.
Note: For this to work at all, the source brush needs to be a solid entity. Otherwise only separate world brushes are being exported.