Differences

This shows you the differences between two versions of the page.

Link to this comparison view

addfoliagelayers [2017/05/24 14:27] (current)
Line 1: Line 1:
 +====== Adding extra foliage layers to your own map ======  ​
  
 +Game Version: ​ FS15 and later\\
 +GE Version: ​ ? and later
 +
 +----
 +
 +[[modding_tutorials|Modding Index]] | [[map_making|Map Making Tutorials]]
 +
 +----
 +
 +===== Intro =====
 +
 +At the bottom of this post you will find a youtube video showing '​Adding type 1 extra foliage layers'​
 +
 +[u][b]Index[/​b][/​u]
 +Programs you need
 +How the two different ways behave in the Giants editor
 +Adding type 1 extra foliage layers
 +Adding type 2 extra foliage layers
 +What the different parts of the code effect the way the foliage behaves and is displayed in game
 +How to make your own custom foliage   
 +
 +[b]Please note[/b] *This is only for map makers as you need to place the new foliage on the ground using the Giants editor, this does not replace the in game textures it adds new ones that then need to be added to the map*
 + 
 +This tutorial will show you how to add the extra foliage you have seen in other maps.
 +You will be shown the two different ways of doing this & the programs that you need to do this.
 +There will be a break down of the code to explain what each part does and how it effects the way the foliage is displayed in game. 
 +Also how to make you own custom foliage, I have made many not very good ones but they serve there purpose.  
 +
 +For this tutorial I will be using robbie'​s 'my blank starter map'
 +[url=http://​fs-uk.com/​mods/​view/​35390]http://​fs-uk.com/​mods/​view/​35390[/​url]
 +But this tutorial will work on any FS15 map
 +
 +
 +
 +===== Prep Work =====
 +
 +[u][b]Programs you need[/​b][/​u]
 +
 +Giants editor
 +[url=http://​gdn.giants-software.com/​editor.php]http://​gdn.giants-software.com/​editor.php[/​url]
 +Notepad++
 +[url=https://​notepad-plus-plus.org/​]https://​notepad-plus-plus.org/​[/​url]
 +Gimp
 +[url=http://​www.gimp.org/​]http://​www.gimp.org/​[/​url]
 +
 +[img]http://​gallery.fs-uk.com/​179379_28_06_15_9_18_23.jpeg[/​img]
 +
 +===== Full Details =====
 +
 +[b]1.[/b] Only one foliage layer can be placed in the same space.
 +Useful when placing extra grass types of foliage next to each other, you would not be able to cut this extra grass type. 
 +
 +[img]http://​gallery.fs-uk.com/​179379_27_06_15_9_08_26_1.jpeg[/​img]
 +
 +[b]2.[/b] Theses can be placed in the same space as each other.
 +Useful if you want to add flower looking foliage mixed within the grass, they can also be mixed in with the first method.
 +There are 5 different foliage types in the below image.
 +
 +[img]http://​gallery.fs-uk.com/​179379_27_06_15_9_08_26_0.jpeg[/​img] ​
 +
 +[img]http://​gallery.fs-uk.com/​179379_28_06_15_9_03_14_0.jpeg[/​img]
 +
 +Only add one new foliage layer at a time and fully test it before adding the next.
 +To start off with do not have the Giants editor & Notepad++ open at the same time when editing your map as they are both used to edit maps.
 +
 +[b]1.[/b] Find the new extra foliage .dds image file that you wish to add.
 +For this tutorial I will be using the ones from the '​Dorset'​s Big and Bold foliage pack'
 +[url=http://​fs-uk.com/​mods/​view/​36350]http://​fs-uk.com/​mods/​view/​36350[/​url]
 +Place the .dds image file of the new extra foliage into this folder
 +...\My Games\FarmingSimulator2015\mods\[b]YOUR MAP NAME[/​b]\map\textures\foliage\[color=red]foliage_flower_long_grass_diffuse.dds[/​color]
 +
 +In the example below I will be adding the extra foliage named [color=red]foliage_flower_long_grass_diffuse.dds[/​color]
 +
 +[b]2.[/b] Using Notepad++ open your map i3D file, if you are using robbie'​s 'my blank starter map' this will be named '​map01'​
 +Near the top of the page you need to add this line as shown in the image below it needs to placed in the same place as shown in the image. Under the <​Files>​ heading.
 +[code]<​File fileId="​1000"​ filename="​textures/​foliage/​foliage_flower_long_grass_diffuse.png"​ relativePath="​true"/>​[/​code]
 +
 +[img]http://​gallery.fs-uk.com/​179379_27_06_15_10_19_08.jpeg[/​img]
 +
 +In the above image I have also included how to search for the <​Files>​ heading in case its not displayed at the top on your maps i3D file.
 +As you will need to use the Notepad++ search function next.
 +
 +[b]3.[/b] Next using the Notepad++ search function search for <​Materials>​ below this line add the code below
 +[color=red][u][b]READ THIS NOW >>>​[/​b][/​u][/​color] Look at the code below and you will see this [color=red]'​customShaderId="​YOU NEED TO ADD YOUR NUMBER HERE">​[/​color]'​
 +To find this number in Notepad++ search for '​fruitGrowthFoliageShader'​ to the left there is a number <File fileId="##"​ put this number in place of the words "YOU NEED TO ADD YOUR NUMBER HERE"
 +[code]<​Material name="​flower_long_grass"​ materialId="​5000"​ ambientColor="​1 1 1" customShaderId="​YOU NEED TO ADD YOUR NUMBER HERE">​
 +      <​Texture fileId="​1000"/>​
 +      <​CustomParameter name="​alphaBlendStartEnd"​ value="​70 75 0 0"/>​
 +      <​CustomParameter name="​frequencyAndScale"​ value="​0.05 0.05 0 0"/>​
 +    </​Material>​[/​code]
 +
 +[b]4.[/b] Next using the Notepad++ search function search for </​FoliageMultiLayer>​ [b]above[/​b] this line add the code below.
 +[code]<​FoliageSubLayer name="​flower_long_grass"​ densityMapTypeIndex="​10"​ densityMapChannelOffset="​1"​ numDensityMapChannels="​1"​ materialId="​5000"​ cellSize="​8"​ viewDistance="​80"​ objectMask="​65520"​ atlasSize="​8"​ atlasOffsets="​0.125 0" numBlocksPerUnit="​1.8"​ width="​1.5"​ height="​0.8"​ widthVariance="​0.1"​ heightVariance="​0.2"​ horizontalPositionVariance="​0.5"/>​[/​code]
 +
 +[b]5.[/b] Save your work in Notepad++ and close the window, now using the Giants editor open your map.
 +Under '​Foliage Layer Painting'​ you should now see a new layer named '​flower_long_grass'​ to finish off you need to place some of the new foliage onto the ground keep it there and save your map and close the Giants editor.
 +What this does is the editor re numbers theses two numbers Texture fileId="​1000"​ and materialId="​5000"​ this is useful as you can then use the same two numbers again when adding your next extra foliage.
 +
 +[u][b]To add more foliage layers repeat the same steps as above making changes to the code in RED I have highlighted below.[/​b][/​u]
 +
 +[b]From Step 2[/b]
 +<File fileId="​1000"​ filename="​textures/​foliage/​[color=red]foliage_flower_long_grass_diffuse[/​color].png"​ relativePath="​true"/>​
 +
 +Name of your new .dds foliage image file
 +
 +[b]From Step 3[/b]
 +<​Material name="​[color=red]flower_long_grass[/​color]"​ materialId="​5000"​ ambientColor="​1 1 1" customShaderId="​[color=red]THIS NUMBER WILL ALWAYS BE THE SAME AS THE FIRST FOLIAGE YOU ADDED[/​color]">​
 +      <​Texture fileId="​1000"/>​
 +      <​CustomParameter name="​alphaBlendStartEnd"​ value="​70 75 0 0"/>​
 +      <​CustomParameter name="​frequencyAndScale"​ value="​0.05 0.05 0 0"/>​
 +    </​Material>​
 +
 +Change this to the name you would like to appear in the '​Foliage Layer Painting'​ drop down list within the Giants editor.
 +customShaderId="​ this will always be the same number as your first foliage layer your added
 +
 +[b]From step 4[/b]
 +<​FoliageSubLayer name="​[color=red]flower_long_grass[/​color]"​ densityMapTypeIndex="​10"​ densityMapChannelOffset="​1"​ numDensityMapChannels="​1"​ materialId="​5000"​ cellSize="​8"​ viewDistance="​80"​ objectMask="​65520"​ atlasSize="​8"​ atlasOffsets="​0.125 0" numBlocksPerUnit="​1.8"​ width="​1.5"​ height="​0.8"​ widthVariance="​0.1"​ heightVariance="​0.2"​ horizontalPositionVariance="​0.5"/>​
 +
 +Change this to the same name as you added in the above step 3
 +
 +[img]http://​gallery.fs-uk.com/​179379_28_06_15_9_03_14_1.jpeg[/​img]
 +
 +[b]1.[/b] Find the new extra foliage .dds image file that you wish to add.
 +For this tutorial I will be using the ones from the '​Dorset'​s Big and Bold foliage pack'
 +[url=http://​fs-uk.com/​mods/​view/​36350]http://​fs-uk.com/​mods/​view/​36350[/​url]
 +Place the .dds image file of the new extra foliage into this folder
 +...\My Games\FarmingSimulator2015\mods\YOUR MAP NAME\map\textures\foliage\foliage_cow_parsly_small_diffuse.dds
 +
 +In the example below I will be adding the extra foliage named foliage_cow_parsly_small_diffuse.dds
 +
 +[b]2.[/b] Using Notepad++ open your map i3D file, if you are using robbie'​s 'my blank starter map' this will be named '​map01'​
 +Using Notepad++ search function search for <​Files>​ below this line add the code below
 +
 +[code]<​File fileId="​1000"​ filename="​textures/​foliage/​foliage_cow_parsly_small_diffuse.png"​ relativePath="​true"/>​
 +[/code]
 +
 +[b]3.[/b] Next using the Notepad++ search function search for <​Materials>​ below this line add the code below
 +[color=red][u][b]READ THIS NOW >>>​[/​b][/​u][/​color] Look at the code below and you will see this [color=red]'​customShaderId="​YOU NEED TO ADD YOUR NUMBER HERE">​[/​color]'​
 +To find this number in Notepad++ search for '​fruitGrowthFoliageShader'​ to the left there is a number <File fileId="##"​ put this number in place of the words "YOU NEED TO ADD YOUR NUMBER HERE"
 +[code]<​Material name="​cow_parsly"​ materialId="​5000"​ ambientColor="​1 1 1" customShaderId="​YOU NEED TO ADD YOUR NUMBER HERE">​
 +      <​Texture fileId="​1000"/>​
 +      <​CustomParameter name="​alphaBlendStartEnd"​ value="​70 75 0 0"/>​
 +      <​CustomParameter name="​frequencyAndScale"​ value="​0.05 0.05 0 0"/>​
 +    </​Material>​[/​code]
 +
 +[b]4. [/b]Next using the Notepad++ search function search for </​FoliageMultiLayer>​ [b]below[/​b] this line add the code below.
 +
 +[code] <​FoliageMultiLayer densityMapId="​1001"​ numChannels="​1"​ numTypeIndexChannels="​0">​
 +          <​FoliageSubLayer name="​cow_parsly"​ numDensityMapChannels="​1"​ materialId="​5000"​ cellSize="​8"​ viewDistance="​80"​ objectMask="​65520"​ atlasSize="​8"​ atlasOffsets="​0.125 0" numBlocksPerUnit="​3"​ width="​1"​ height="​3"​ widthVariance="​0.5"​ heightVariance="​1"​ horizontalPositionVariance="​0.5"/>​
 +        </​FoliageMultiLayer>​[/​code]
 +
 +[b]5.[/b] Using Notepad++ search function search for <​Files>​ below this line add the code below
 +
 +[code]<​File fileId="​1001"​ filename="​map01/​cow_parsly_density.png"​ relativePath="​true"/>​[/​code]
 +
 +[b]6.[/b]  Save your work in Notepad++ and close the window
 +
 +[b]7.[/b] Within your map folder open the '​map01'​ folder, copy and paste the PNG file named '​rock_weight'​ rename the new file '​cow_parsly_density'​
 +
 +[b]8.[/b] Now using the Giants editor open your map.
 +Under '​Foliage Layer Painting'​ you should now see a new layer named '​cow_parsly'​ to finish off you need to place some of the new foliage onto the ground keep it there and save your map and close the Giants editor.
 +What this does is the editor re numbers theses three numbers Texture fileId="​1000",​ materialId="​5000"​ and File fileId="​1001"​ this is useful as you can then use the same two numbers again when adding your next extra foliage.
 +
 +[u][b]To add more foliage layers repeat the same steps as above making changes to the code in RED I have highlighted below.[/​b][/​u]
 +
 +[b]From Step 2[/b]
 +<File fileId="​1000"​ filename="​textures/​foliage/​[color=red]foliage_cow_parsly_small_diffuse[/​color].png"​ relativePath="​true"/>​
 +
 +Name of your new .dds foliage image file
 +
 +[b]From Step 3[/b]
 +<​Material name="​[color=red]cow_parsly[/​color]"​ materialId="​5000"​ ambientColor="​1 1 1" customShaderId="​[color=red]WILL ALWAYS BE THE SAME AS THE FIRST FOLIAGE YOU ADDED[/​color]">​
 +      <​Texture fileId="​1000"/>​
 +      <​CustomParameter name="​alphaBlendStartEnd"​ value="​70 75 0 0"/>​
 +      <​CustomParameter name="​frequencyAndScale"​ value="​0.05 0.05 0 0"/>​
 +    </​Material>​
 +
 +Change this to the name you would like to appear in the '​Foliage Layer Painting'​ drop down list within the Giants editor.
 +customShaderId="​ this will always be the same number as your first foliage layer your added
 +
 +[b]From step 4[/b]
 +<​FoliageMultiLayer densityMapId="​1001"​ numChannels="​1"​ numTypeIndexChannels="​0">​
 +          <​FoliageSubLayer name="​[color=red]cow_parsly[/​color]"​ numDensityMapChannels="​1"​ materialId="​5000"​ cellSize="​8"​ viewDistance="​80"​ objectMask="​65520"​ atlasSize="​8"​ atlasOffsets="​0.125 0" numBlocksPerUnit="​3"​ width="​1"​ height="​3"​ widthVariance="​0.5"​ heightVariance="​1"​ horizontalPositionVariance="​0.5"/>​
 +        </​FoliageMultiLayer>​
 +
 +Change this to the same name as you added in the above step 3
 +
 +[b]From step 5[/b]
 +<File fileId="​1001"​ filename="​map01/​[color=red]cow_parsly_density[/​color].png"​ relativePath="​true"/>​
 +
 +Change this to the same name as your new foliage
 +
 +[b]From step 7[/b]
 +Within your map folder open the '​map01'​ folder, copy and paste the PNG file named '​rock_weight'​ rename the new file '​[color=red]cow_parsly_density[/​color]'​
 +
 +Change this to the same name as you added in the above step 5
 +
 +[img]http://​gallery.fs-uk.com/​179379_28_06_15_9_11_14.jpeg[/​img]
 +
 +[code]<​Material name="​flower_long_grass"​ materialId="​5000"​ ambientColor="​1 1 1" customShaderId="​46">​
 +      <​Texture fileId="​1000"/>​
 +      <​CustomParameter name="​alphaBlendStartEnd"​ value="​70 75 0 0"/>​
 +      <​CustomParameter name="​frequencyAndScale"​ value="​0.05 0.05 0 0"/>​
 +    </​Material>​[/​code]
 +
 +[quote]<​CustomParameter name="​alphaBlendStartEnd"​ value="​[color=red][b]70 75[/​b][/​color] 0 0"/>​[/​quote]
 +This changes the draw distance of the foliage.
 +
 +[quote]<​CustomParameter name="​frequencyAndScale"​ value="​[color=red][b]0.05 0.05[/​b][/​color] 0 0"/>​[/​quote]
 +This changes how much the foliage sways in the breeze.
 +
 +[code]<​FoliageSubLayer name="​flower_long_grass"​ densityMapTypeIndex="​10"​ densityMapChannelOffset="​1"​ numDensityMapChannels="​1"​ materialId="​5000"​ cellSize="​8"​ viewDistance="​80"​ objectMask="​65520"​ atlasSize="​8"​ atlasOffsets="​0.125 0" numBlocksPerUnit="​1.8"​ width="​1.5"​ height="​0.8"​ widthVariance="​0.1"​ heightVariance="​0.2"​ horizontalPositionVariance="​0.5"/>​[/​code]
 +
 +Foliage image used in test.
 +[img]http://​img-eu1.fs-uk.com/​179379_17_02_16_12_26_56.jpeg[/​img]
 +There are four colours each one is a zone the results below will show you how each zone is displayed depending on the settings you use.
 +The image used is 512x128 each zone is 128x128 you would have a different image of your foliage displayed in each zone.
 +When adding your own foliage image make sure each image stays in its own zone and does not creep into the zone next to it.
 +In Giants Editor I placed the foliage using a square size 5 brush.
 +
 +[b][size=20pt]cellSize=[/​size][/​b] This changes the rotation of each bunch of plants as seen in the two images below I tested numbers 0,​2,​4,​6,​8,​10,​12,​14,​16 ​
 +
 +[img]http://​img-eu1.fs-uk.com/​179379_17_02_16_1_26_27_0.jpeg[/​img]
 +[img]http://​img-eu1.fs-uk.com/​179379_17_02_16_1_26_27_1.jpeg[/​img]
 +
 +
 +[b][size=20pt]atlasSize= & atlasOffsets=[/​size][/​b] These both work together, the numbers that you use here changes what image zones are displayed. Different numbers display different image patterns using the zones.  Here are a few examples the max number I used was 16. The number '​0'​ in red you do not need to change.
 +
 +[img]http://​img-eu1.fs-uk.com/​179379_17_02_16_2_08_17_2.jpeg[/​img]
 +[img]http://​img-eu1.fs-uk.com/​179379_17_02_16_2_08_17_1.jpeg[/​img]
 +[img]http://​img-eu1.fs-uk.com/​179379_17_02_16_2_08_17_0.jpeg[/​img]
 +
 +You need to make sure that none of you foliage bunches look like the image below where you have two half zones on the same side. (A better example of this is in the forth and fifth image above this one) 
 +
 +[img]http://​img-eu1.fs-uk.com/​179379_17_02_16_2_08_17_4.jpeg[/​img]
 +
 +[b][size=20pt]numBlocksPerUnit=[/​size][/​b] This is used to set how dense the foliage is displayed the higher number the more dense. I have tested numbers 0.25, 0.5, 0.75, 1 
 +
 +[img]http://​img-eu1.fs-uk.com/​179379_17_02_16_2_30_11_0.jpeg[/​img]
 +[img]http://​img-eu1.fs-uk.com/​179379_17_02_16_2_30_11_1.jpeg[/​img]
 +
 +[b][size=20pt]width= & height=[/​size][/​b] Both do as they say. You set how wide and tall your foliage is displayed. (no image needed)
 +
 +[b][size=20pt]widthVariance=[/​size][/​b] This adds a random affect to the width to your foliage bunches higher the number the bigger difference in bunches. ​
 +
 +[img]http://​img-eu1.fs-uk.com/​179379_17_02_16_2_54_58_0.jpeg[/​img] ​
 +
 +[b][size=20pt]heightVariance=[/​size][/​b] This adds a random affect to the height to your foliage bunches higher the number the bigger difference in bunches.
 +
 +[img]http://​img-eu1.fs-uk.com/​179379_17_02_16_2_54_58_1.jpeg[/​img]
 +
 +[b][size=20pt]horizontalPositionVariance=[/​size][/​b] This scatters the foliage higher the number the bigger the affect.
 +I have tested 0 to 5.
 +
 +[img]http://​img-eu1.fs-uk.com/​179379_17_02_16_2_38_15_0.jpeg[/​img]  
 +[img]http://​img-eu1.fs-uk.com/​179379_17_02_16_2_38_15_1.jpeg[/​img]
 +
 +[center][flash=200,​200]http://​www.youtube.com/​watch?​v=Q1Ml4t68CV4[/​flash][/​center]
 +
 +----
 +
 +Original Author: ​ Dorset | Date:  June 27, 2015
 +        ​
 +[[modding_tutorials|Modding Index]] | [[map_making|Map Making Tutorials]]