Roads and objects

This section of the guide is in a bit of a weird place, we don’t really want to explain all the steps for editing just yet, but putting it here means that once you load into the sample terrain in-game, you will have some understanding of which files actually control the stuff you see in-game.

Roads

For Arma 3 roads we use shapefiles, these are basically lists of points, with the roads automatically getting placed between those points by the Arma 3 game engine.

Arma 2 and DayZ roads use a completely different system, if you are working on a terrain for either those games you can skip this section and go to the Objects section of this page.

Using source files

This section implies you already have some road files that you will be using, but we’ll explain how the ID and ORDER database entries work as well.

Editing roads or creating roads from scratch without any source files will be handled in the Roads editing section.

To import roads go to File > Import > Shapes, go to the source folder and select roads.shp. tb roads wkt

Next you will get a window asking for projection like the one above, if you have roads shapefile file which is suitable for Arma 3 the WKT line box will be filled in, and you should keep this data. Make sure the by line(Advanced) radio button is checked, and check the use __Layers tag from dbf option and press OK.

Make sure you have the View Shapes button checked on the View Toolbar: tb_viewshapes

In the Layers Manager panel go to the Shapes tab, with our provided files you will have a number of different shape layers each containing some roads. Using different layers is not necessary for proper importing or exporting, but keeping them separated keeps them organized and will be used later to show your roads on the satmap.

Database

Next you want to select all roads, by dragging across the map area while holding left mouse button and dragging and then Right click one of the roads and click Database Properties. Our source data comes from the QGIS Plugin which automatically exports roads with the required entries filled in for this, but usually you would be required to set all of these values yourself. roads database

Each row in this table represents a single road. Each ‘road’ is a single line (On the map) that you create. If you want to make crossings, you’ll use different lines, if you want to have a different type of road, you’ll create a new line.

ID column / Road types

Which sort of road a line is, is controlled by the number in the ID Column (float datatype). This controls what type a road in-game is, for example a large asphalt highway, or a small dirt path.

Using the roads_polyline_1 as an example it has an ID of 3, which means that it will use Road0003 from the roadslib.cfg file.

Roadslib.cfg

The roadslib.cfg file controls which textures get used & which 2D map appearance belong to a road ID. This file is present in our sample map_data files at tag/tag_sample/roads/roadslib.cfg, below is a section of this file.

When the game loads your roads it will check which ID a road has in the shapefile database and pull the corresponding type from the roadslib.cfg, it will then render those on the terrain and in the 2D map using the shapefile points.

As an example the ID 3 in the shapefile database links to Road0003 in the roadslib.cfg, which uses the city_road texture files, resembling a road made out of concrete, it also uses the map parameter to determine the 2D map drawing style used for roads matching the ID.

  • The width parameter is how wide the engine will be. A higher number means the road will appear wider ingame.
  • The mainStrTex parameter is the texture used for non-end parts of a road.
  • The mainTerTex parameter is the texture used for the end parts of a road.
  • The mainMat parameter is the RVMAT material used for both of the above parameters.
  • The map parameter is how a road will appear on the map. Possible values with their usage on Altis are:
    • main road: a thick orange line, used for the main asphalt highway
    • road: White bordered line, used for asphalt roads
    • track: Beige line, used for concrete city roads and dirt roads
    • trail: Thin brown line, used as foothpath on Tanoa
    • hide: Hidden on the map
  • The aipathoffset is how far to the side the AI drives on this road. This is counted from the right side of the road, so for example a highway with mulitple lanes of 14 width, you want them to drive quite far on the side and use 1 as offset. For a dirt road of 8 where you want them to drive closer to the middle you’d use 3. This value also controls how the road line is filled in on the map, as seen inside the aiPathOffset notes in the Info box below.
  • pedestrianOnly = true; can be added if you want roads to be ignored for AI driving, use for small forest trails for example
  • The color[] is present in some roadslib files, but does not do anything in the release version of the game, it is used internally by Bohemia Interactive for terrain costmaps.
    class Road0003 { // City road
      width = 8;
      mainStrTex    = "a3\roads_f\roads_new\data\city_road_ca.paa";  // lowercase!
      mainTerTex    = "a3\roads_f\roads_new\data\city_road_end_ca.paa";
      mainMat       = "a3\roads_f\roads_new\data\city_road.rvmat";
      map           = "road";
      AIpathOffset  = 3;
    };
    class Road0004 { // Main road
      width = 8;
      mainStrTex    = "a3\roads_f\roads_new\data\main_road_ca.paa";  // lowercase!
      mainTerTex    = "a3\roads_f\roads_new\data\main_road_end_ca.paa";
      mainMat       = "a3\roads_f\roads_new\data\main_road.rvmat";
      map           = "road";
      AIpathOffset  = 3;
    };
Some notes on aiPathOffset and map appearence
Expand for more information

Order column

The ORDER value for each road controls which road gets rendered on top of other roads in the game. The lower number goes on top.

For example, when you have a dirt road cross a highway, you want the highway to be ‘on top’ so the highway shows normally and doesn’t get hidden under the dirth path. In this case you want the ORDER of the highway to be for example 10, and the dirt path to be 20.

The last column is __Layers and is entirely optional and is overwritten on export. It is used to split up the roads in different layers when importing and you shouldn’t set it manually.

Objects

We’ll discuss importing objects very briefly here because there’s not a whole lot to discuss. The actual method of placing objects is a quite advanced topic, but for organization sake we’ll keep the import procedure here.

Importing objects is done when you use an external tool to place objects on your terrain. These tools export lists of which object it is, their coordinates and similar data into a text format.

First you should make a new layer, this helps to keep track of which objects belong to which exported file. Go to Layers Manager > Objects Tab and click New in the bottom left. Give the layer a name like sample_import. Make sure you select the layer, then go to File > Import > Objects , click Pick Files and select the sample_objects.txt file from the source files.

The object file we provided is with absolute height, so click Advanced Options and then select Absolute and press Ok to import the objects.

That’s basically all there is to importing objects, but there’s one very important thing to note:

Relative vs Absolute

When importing objects you need to select Relative (Default) or Absolute for elevation mode.

Relative means that the object elevations in the .txt file are relative to the terrain.

Absolute means that their height at export is determined by sea level (Always 0 meters in arma).

Whether you have to import as Relative or Absolute is 100% dependent on how the file was exported. Some tools always export as Absolute (Plopper, OBTBH), others give both options.

With a Relative elevation object file it means that you can place objects on the terrain in the external tool, raise or lower the terrain, and then import the objects and they will stay at the same height relative to the terrain. If they were exactly at ground level before, then they will still be at ground level when you lower the terrain by 1 meter.

Absolute means that when you export the file in the external tool, then lower the terrain by 1 meter and import as absolute your objects will be floating 1 meter above the ground level.

Now a quite important note is that once imported all objects will always be Relative height. That means when you import an object file that uses absolute height, and adjust the height in buldozer or import a changed heightmap file, the objects will still follow the terrain height.

imported objects