Precision farming is a mod for Farming Simulator 19 by Giants Software (developers of FS19).
HOWTO add it to your custom terrain. In below tutorial we use CLASS and TERRAIN to designate our "maps" and terrain names. You are using your own class name for terrain so you need to replace TERRAIN with the name you are using.
Edit TERRAIN.i3d, find the line with infolayer name farmland.
For us its the following but for your terrain it will be different:
<InfoLayer name="farmland" fileId="209" numChannels="6"/>
Now copy-paste this line to a new line, then edit it as follows:
<InfoLayer name="soilMap" fileId="99999" numChannels="3"/>
In above example farmland infolayer fileID was 209, search this 209 from files section. Actually it would be easier to just search it by "_farmland.grle" string, but whatever you find easiest. In our case 209 is this:
<File fileId="209" filename="CLASS/TERRAIN_farmland.grle"/>
Now copy-paste this line to a new line, then edit fileID to 99999 and _farmland to _soilmap like this:
<File fileId="99999" filename="CLASS/TERRAIN_soilmap.png"/>
Please note that you need to use PNG instead of GRLE as file extension here.
Save and close TERRAIN.i3d file.
Create 8 bit grayscale RGB 0,0,0 black image with 1024 x 1024 pixel resolution, save it as PNG to TERRAIN_soilmap.png file name.
Start GIMP, press CTRL-N for create a new image, use image size width 1024 and height 1024. Fill the image with RGB 0,0,0 black color by using change foreground color dialog then pressing CTRL-, (control and , keys together) or use menu edit -> fill with FG color. Then export image as PNG using SHIFT-CTRL-E or File -> export as and use TERRAIN_soilmap.png file name.
Colors for soilmap PNG are as follows:
RGB 0,0,0 Loamy Sand
RGB 1,1,1 Sandy Loam
RGB 2,2,2 Loam
RGB 3,3,3 Silty Clay
Those RGB colors are basically "shades of black", you cant really see other than plain black image, thats why you should first create GIMP XCF colorful image using extreme colors which are easy to see and paint, then replace these colors with the above grayscale RGB values. HOWTO create detailed colorful image is explained in GIMP Paint Precision Farming Soil Types Tutorial page.
TERRAIN_soilmap.grle is 8 bit grayscale image. GRLE is saved out from Giants Editor.
Start Giants Editor and load TERRAIN.i3d file, in short start editing your terrain heh.
Select infoLayer paint tool. Then select info layer painting and info layer soilMap. Now you can paint the different soil types into your TERRAIN_soilmap image.
If you already painted this image in full using GIMP, then you can skip all the giants editor painting.
Bit settings for each soil type are (do NOT use bit 2):
Loamy Sand none
Sandy Loam 0
Silty Clay 0 1
Giants Editor save and exit. Now TERRAIN_soilmap.grle file has been saved, you should delete TERRAIN_soilmap.png image as its not used anymore.
Edit TERRAIN.xml and add the following code:
<precisionFarming> <soilMap filename="maps/CLASS/TERRAIN_soilmap.grle"/> </precisionFarming>
You can add that to the bottom of the xml file just before ending </map> line.
Save TERRAIN.xml and close it.
Before you can do first in-game test you need to edit TERRAIN.i3d one more time with text editor. Search for TERRAIN_soilmap.png string, change that to TERRAIN_soilmap.grle file extension. Now you are ready to in-game test it.
Test in-game, check LOG for any errors.