i3d XML Documentation

Layers

Estimated reading: 4 minutes 101 views
XML
<Layers>
        <LayerAttributes>
          <LayerAttribute name="color" type="float_linearRGB" />
          <LayerAttribute name="softness" type="float" minValue="0" maxValue="1" />
          <LayerAttribute name="materialId" type="enum" enumValues="field:0;dirt:1;grass:2;sand:3;sound:4;leaves:5;gravel:6;asphalt:7;" />
          <LayerAttribute name="aiDriveCost" type="float" minValue="-1" maxValue="100" />
        </LayerAttributes>

For a Farming Simulator map, many of the layers have different roles and may be a bit complicated to understand, since many of these are to be considered as terrain layers, which are mainly layers affecting a map’s terrain.
Some of these layers can be modified inside GIANTS Editor, and some layers are simply vanilla layers when you make a New Mod From Game… inside the editor.

Some layers can be modified inside the editor, using the Layer Manager (right-click terrain), while other layers can be modified with other tools available at GDN https://gdn.giants-software.com/downloads.php

A typical layer example is this one: paintable asphalt (dusty variation).

XML
<Layer name="asphaltDusty01" detailMapId="5" normalMapId="6" heightMapId="7" displacementMapId="8" unitSize="2" displacementMaxHeight="0.125" blendContrast="0.2" porosityAtZeroRoughness="0.9" porosityAtFullRoughness="0.25" firmness="1" viscosity="1" firmnessWet="1" weightMapId="4" attributes="0.137 0.129 0.116 0 7 4"/>

To go into the depth of this string, here’s some of the data we can break down:

  • layer name (unique name)
  • detail map Id (unique) 5
  • normal map Id (unique) 6
  • height map id (unique) 7
  • displacement map id (unique) 8

All these IDs point to the files listed in the top section of the i3d XML. All other parameters are considered “experimental”; you can test them and see how they affect the terrain.

Pro tip: If you want a texture to cover more units of the terrain, you can adjust unitSize from 2 to 5, for example. The downside of that is that the sharpness of the texture will decrease, and you may also see a more pixelated ground texture. The upside is that you can either change the unitSize again or change the texture size in a 2D image editor (Paint.net) from 1024×1024 pixels to 2048×2048 pixels. Any ground texture must be a power of two anyway.

A “power of two” texture means an image whose width and height pixel dimensions are mathematical powers of two (e.g., 32, 64, 128, 256, 512, 1024, 2048, or 4096).

detail map id

XML
<File fileId="5" filename="$data/maps/mapAS/textures/terrain/asphaltDusty01_diffuse.png"/>

normal map id

XML
<File fileId="6" filename="$data/maps/mapAS/textures/terrain/asphaltDusty01_normal.png"/>

height map id

XML
<File fileId="7" filename="$data/maps/mapAS/textures/terrain/asphaltDusty01_height.png"/>

displacement map id

XML
<File fileId="8" filename="$data/maps/mapAS/textures/terrain/asphaltDusty01_displacement.png"/>