Multi Terrain Angle Tutorial - PMC Farming Simulator 19

Warning About grleConverter Crash

2022-02-02T07:01:00Z Updated.

Note: this applies to both cultivator_density.gdm and terrainDetailHeight_density.gdm which is used for dump ground fruit type thing.

After you finish edits in below tutorial, GRLE converter will crash when you attempt to convert cultivator_density.gdm image. This means that yes you technically could just keep GIMP XCF source image for fields, but if at any time you need to bring GE cultivator_density edits back into GIMP... you are out of luck, it cant be done. So make sure you backup your original cultivator_densigy.png or better yet GIMP XCF image.

One example why you would need to bring GE edits back to GIMP is to patch utility pole holes into fields, or tweak some field edges which get too close to roads or buildings etc.

It is just a very bad idea to have yourself locked in this situation where you cannot freely convert GDM to PNG anymore. Advice is; don't do it.

Multi Terrain Angle Tutorial FS19

Default game config uses terrain textures in 45 degree angles. This tutorial increases that number to create more detailed ground textures (field textures). We are adding 3 more angle channels.

Open TERRAIN.i3d file in proper text editor. Search for <DetailLayer name="terrainDetail" string.

Change numDensityMapChannels="11" 11 to 16.

Change combinedValuesChannels="0 3 0;6 2 0;3 3 1" number section to "0 3 0;6 5 0;3 3 1", only one number change, 2 to 5 Smiley :)

Go to Farming Simulator 19 root, then to data\shaders\ directory, copy groundShader.xml file into your own terrain projects "maps\shaders" directory.

Open groundShader.xml in text editor and search for "angle = ceil(angle*3-0.0001)/4*3.14159;" string.

Change this line to "angle = ceil(angle*31-0.0001)/32*3.14159;" So angle*3 becomes angle*31 and 4*3 becomes 32*3.

Create modMap.lua script file:

ModMap = {}
local ModMap_mt = Class(ModMap, Mission00)

function ModMap:new(baseDirectory, customMt)
local mt = customMt
if mt == nil then
mt = ModMap_mt
end
local self = ModMap:superClass():new(baseDirectory, mt)

-- Number of additional channels that are used compared to the original setting (2)
local numAdditionalAngleChannels = 3;

self.terrainDetailAngleNumChannels = self.terrainDetailAngleNumChannels + numAdditionalAngleChannels;
self.terrainDetailAngleMaxValue = (2^self.terrainDetailAngleNumChannels) - 1;

self.sprayLevelFirstChannel = self.sprayLevelFirstChannel + numAdditionalAngleChannels;

self.ploughCounterFirstChannel = self.ploughCounterFirstChannel + numAdditionalAngleChannels;

return self
end

The line we edited was "local numAdditionalAngleChannels = 3;" so we ADD three more angle channels.

You can skip next step if you already have modMap.lua in your terrain, because modDesc.xml has already been edited.

Next open modDesc.xml in text editor and in <maps> property has line which says something like this:

<map id="PMC_Iowa_Garden_City_8km" className="Mission00" filename="$dataS/scripts/missions/mission00.lua" configFilename="maps/PMC_Iowa_Garden_City_8km.xml" defaultVehiclesXMLFilename="defaultVehicles.xml" defaultItemsXMLFilename="defaultItems.xml">

Change className from Mission00 to modMap and filename from $dataS/... to modMap.lua, below you see our example line with edited properties:

<map id="PMC_Iowa_Garden_City_8km" className="ModMap" filename="modMap.lua" configFilename="maps/PMC_Iowa_Garden_City_8km.xml" defaultVehiclesXMLFilename="defaultVehicles.xml" defaultItemsXMLFilename="defaultItems.xml">

Finally you need to re-save your terrain project so cultivator_density.gdm will be updated to 16 channels, here is how its done:

First convert cultivator_density.gdm image to PNG, then in TERRAIN.i3d edit cultivator_density.gdm to .png extension, then load terrain into GE and just save. To finish this shuffle, change TERRAIN.i3d cultivator_density.png back to original .gdm extension, now we are finally done, ugh Smiley ;)

All done Smiley :)