Steamroller Arma 3 Road Converter
ianbanks |
Steamroller automatically converts Arma 2 road networks to shapefiles for use with
Arma 3’s new road technology. It was originally written in 2014, and has since been used by
the authors of many popular Arma 2 maps to update their road networks for Arma 3 map releases. You can download it from here:
Steamroller works by: Loading an 8WVR (unbinarized) format .wrp. The source .wrp file is
specified in the configuration: Note that in configurations, backspaces must be escaped. If the unbinarized .wrp file is not available, any binarized .wrp
can be converted to 8WVR using Mikero’s tools. The objects in the map are filtered by comparing the .pbo path
of each object against a list of prefixes. One or more prefixes sections
in the configuration supply the list of prefixes: The generated log file (placed in the destination directory) includes a
list of .pbo path directories that were excluded by the
filter. All .p3d files in these directories will
be ignored for the process of building roads: The filter is designed to increase the speed of road generation. Including
directories that do not contain roads is harmless, but will increase the
time required to generate shapefiles. One or more search_path directories are then used to locate the
.p3d files corresponding with road pieces. Multiple
paths can be specified in the configuration: If any .p3d path aliases have been specified in the configuration,
they are applied to the paths of the filtered .p3d files: Again, backslashes must be quoted. This feature is only needed when copy of the original road model is
not available, and where a road model with identical memory points is
available. Most custom roads were designed to be exactly the same
dimensions as the Arma 2 (CA) roads, and therefore most maps with custom
road pieces can be converted by adding the Arma 2 samples to the search
path and adding aliases to the samples. For each .p3d file found in the map and in a search_path
directory, the model is loaded and checked for the following road memory
point: Any .p3d files that are found in the included directories that are
not roads are also reported in the log file: These models are ignored for the purpose of generating the shapefile. layer rules place road segments into a specific layer. For example: Any segments that match a layer rule are placed into the layer in a shapefile. remove rules are to delete segments that shouldn’t be converted.
Typically these will be bridge segments or other non-flat models that
are not appropriate for use in Arma 3 road files: Once road models are loaded and assigned to layers, the memory points
of each road segment instance are placed into a spatial index and then
"snapped" to adjacent road segments. The memory points don’t need to be
exactly aligned; a threshold (the snap_threshold) is used to determine
how close points must be. The default value for snap_threshold can be changed in the configuration: Road segments that snap are joined into continuous shapefile roads
based on layer assignments. Any glue segments are assigned to the
roads that connect to them (for example, in a "T" junction, part of the
junction is assigned to the through road, and the other part is assigned
to the branching road. Any coincident points from road centrelines are removed. The threshold
for coincident points is coincident_point_threshold, which is the minimum
distance between points in meters. The shapefile roads are then simplified using
Douglas-Peucker simplification. The level of simplification is set by: The simplification guarantees that for any simplified line segment
in the output road, the points of the original road fall no
more than simplification_threshold meters from the simplified road
centerline. Having the simplification threshold too small will cause many small segments
to be generated which will result in visual artefacts in game. Roads are
smoothed by the game using curve fitting, so only a few segments even on highly
curved roads are required. The shapefiles and a log are written out. The files are written to a
directory specified by: The file names are based on the source .wrp name, and includes: After conversion, the shapefiles can be loaded into Terrain Builder or a GIS package and viewed and edited. This is an example of Chernarus’ roads after conversion, with each of the layers shown in a different colour: And this is an example of Takistan’s roads after conversion: Note that any shapefiles or other data derived from materials released under Bohemia Interactive’s
Public Data licences would also almost
certainly be subject to the same licence conditions. The following is an example job file for upgrading Chernarus roads: To specify the shapefile layers that roads should be placed on, the following ca.jobinclude file is
referenced in the above job file:
Using Steamroller
source "C:\\Working\\CA\\Chernarus\\chernarus.wrp"
prefixes
{
include "ca\\roads_e\\roads"
include "ca\\roads_pmc"
include "ca\\roads2"
}
Objects from the following directories were ignored:
ca\buildings
ca\buildings2\a_advertisingcolumn
ca\buildings2\a_citysign
...
search_path "P:\\"
search_path "C:\\Working\\Map_Objects"
aliases
{
"ibr\\ibr_rn\\s10 100.p3d" "ca\\roads2\\asf1_10 100.p3d"
"ibr\\ibr_rn\\s10 25.p3d" "ca\\roads2\\asf1_10 25.p3d"
}
The following models do not have any road memory points and were ignored:
ca\roads2\dam\dam_barrier_40\dam_barrier_40.p3d
ca\roads2\dam\dam_conc\dam_conc_20.p3d
ca\roads2\dam\dam_conc\dam_concp_20.p3d
layer "asf1"
{
include "^ca\\\\roads2\\\\asf1_"
}
layer "asf2"
{
include "^ca\\\\roads2\\\\asf2_"
include "^ca\\\\roads_e\\\\roads\\\\asf2_"
}
glue
{
include "^ca\\\\roads2\\\\kr_"
include "^ca\\\\roads_e\\\\roads\\\\kr_"
}
remove
{
include "^e76_roads\\\\(betonblock|bridge1|channel)\\\\"
}
snap_threshold 1.5
simplification_threshold 0.5
destination "C:\\Working\\Steamroller Output\\"
Conversion Examples
Example Configuration
search_path "P:\\"
snap_threshold 1.1
simplification_threshold 0.5
coincident_point_threshold 1.1
source "P:\\CA\\Chernarus\\chernarus.wrp"
destination "P:\\new\\new_chernarus\\data\\"
#include "ca.jobinclude"
prefixes
{
include "ca\\roads_e\\roads"
include "ca\\roads_pmc"
include "ca\\roads2"
}
glue
{
include "^ca\\\\roads2\\\\kr_"
include "^ca\\\\roads_e\\\\roads\\\\kr_"
}
layer "runway"
{
include "^ca\\\\roads2\\\\runway_"
}
layer "invisible"
{
include "^ca\\\\roads2\\\\road_invisible"
include "^ca\\\\roads_e\\\\roads\\\\road_invisible"
}
layer "asf1"
{
include "^ca\\\\roads2\\\\asf1_"
}
layer "asf2"
{
include "^ca\\\\roads2\\\\asf2_"
include "^ca\\\\roads_e\\\\roads\\\\asf2_"
}
layer "asf3"
{
include "^ca\\\\roads2\\\\asf3_"
}
layer "city"
{
include "^ca\\\\roads2\\\\city_"
}
layer "grav"
{
include "^ca\\\\roads2\\\\grav_"
}
layer "mud"
{
include "^ca\\\\roads2\\\\mud_"
}
layer "path"
{
include "^ca\\\\roads2\\\\path_"
include "^ca\\\\roads_e\\\\roads\\\\path_"
}
layer "bridge"
{
include "^ca\\\\roads2\\\\bridge\\\\"
}
layer "asf10"
{
include "^ca\\\\roads_e\\\\roads\\\\asf10_w10_"
}
layer "asf12"
{
include "^ca\\\\roads_e\\\\roads\\\\asf12_w12_"
}
layer "dirt12"
{
include "^ca\\\\roads_e\\\\roads\\\\dirt10_w10_"
}
layer "dirt7"
{
include "^ca\\\\roads_e\\\\roads\\\\dirt7_w7_"
}
layer "dirt2"
{
include "^ca\\\\roads_e\\\\roads\\\\dirt2"
}
layer "dirtrunway"
{
include "^ca\\\\roads2\\\\runwayold_80_dirt"
}