Unturned

Unturned

Not enough ratings
Unturned - Foliage asset files
By Tiway
This guide will help you make a .asset file for placing foliage in the Unturned editor as some old foliage do not have the necessary asset files.
   
Award
Favorite
Favorited
Unfavorite
What is a foliage asset file?
Intro

Since the editor update (3.22.9.0), foliage requires asset files in order to be placed or baked on a map.
The asset file is a sort of tool/preset used to place or bake specific foliage, or a group of foliage elements.

Long story short
- There are 2 types of foliage asset files : Single foliage files and Collections.
- Single foliage asset files are not the same for resources and details.
- It is simpler to upload your asset files along your main bundles to avoid any issue.

"Technical" stuff in detail

About resources (trees/bushes/metal nodes):

Asset files come in addition to the main foliage files (Unturned/Bundles/Trees); this means the asset file is only needed to place or bake the resource. Once placed on a map, players will see it even if they do not have the asset file, as long as the have the main resources bundles (.dat file and Unity prefab stored within a unity3d or a masterbundle).

About details (grass/pebbles):

Asset files are needed in order to load the details; a player that does not have these files for a particular foliage won't load them.

Considering this, it is better to upload all the asset files along your other bundles.

Single foliage files and collections

There are two kinds of foliage asset files :
- The single asset file which is linked to a single asset
- The collection asset file which is a group of single asset files

Vanilla asset files names end with either "_Foliage" or "_Collection" depending on which type they are.
You can also see this in the foliage section of the editor; the paint and exact tools allow you to either place assets or collections.
Single foliage assets - Resources
Single foliage assets files for resources are used to place a specific resource (tree, bush or metal node) using the exact or brush tool.

How to make an asset file for placing resource?

- You will have to copy a vanilla asset file and paste it in your own bundles.
If you have no Bundles folder, you can create one in a vanilla map folder like Washington (Tutorial won't work for some reason); you can store your asset files there in any hierarchy.

Vanilla asset files for resources can be found in "Unturned\Bundles\Assets\Landscapes\Foliage\Resources". For this section, I will copy Bush_8_Foliage.asset.

- After pasting the file in your own Bundles, you will need to give it a custom name; this name is the one you will see in the foliage tab of the editor :


- Once renamed, you will have to open it using any text editing software (I recommend using Notepad++).


- The GUID in Red is your asset file's ID and has to be unique. You will have to generate a new one (the game will not generate any itself); You can use this website to generate a GUID[guidgenerator.com] (You will need to uncheck "Hyphens").

- The section in Green has many settings you can tweak but these do not seem to change a lot in the editor (If you have more information on this, I will be happy to learn about it).

- The GUID in Blue is your resource GUID, you will not have to generate one since the resource you are referring to via this asset file should already have one.
A resource GUID can be found in its .dat file; for example, the Green Maple Tree's GUID is 63cb368c94b14000aabc5325b048cfa3 (Unturned\Bundles\Trees\Maple_0).



- The obstruction Radius (in Yellow) is the minimum radius Resources will be painted from the center of an object. In my example, my resource won't be painted closer than 4 meter from any object.
Single Foliage Asset - Details
Single asset files for details are used to load; place and bake Details.

They are more complicated to make than resources asset files since they refer to the detail via a masterbundle path instead of GUID.

How to make an asset file for loading and placing Details?

- You will have to duplicate an existing detail foliage file and paste it in your own Bundles.
Vanilla asset files can be found in :

Unturned\Bundles\Assets\Landscapes\Foliage\Pebbles
Unturned\Bundles\Assets\Landscapes\Foliage\Logs
Unturned\Bundles\Assets\Landscapes\Foliage\Grass (only the ones ending with "_Foliage")

For this section, I will take the Peaks_Brambles_00_Foliage.asset as an example.

- Once pasted, you will need to give your asset file a custom name (same as the Resources asset file; this name will display in the foliage tab of the editor).

- You will then have to open it with any text editing software to change a few things :


- The GUID in Red is your asset file's GUID and has to be custom generated. The game will not generate one (same as for the resource asset file).

- The Green section has all sorts of setting for the detail (size and rotation mostly).

- The Blue section indicates the mesh of the detail; the mesh will not be the same depending on your detail (Grass/Tall Grass/Pebble/Custom mesh detail);
If you are using a vanilla mesh; I recommend duplicating a foliage asset file that is close to what you want to create in the end.

- The Yellow section indicates which material should be applied to the chosen mesh.

- The Purple section has even more settings for your detail; I do not recommend tweaking those though.
Collections
Collection are groups of foliage elements which are extremely useful for painting several resources or details at once or baking a foliage group on a specific material.

How to make a Foliage Collection?

- First, you will need an asset file for each foliage your collection will be using : collections refer to other asset files and not to resources directly.

- As always, it is way easier to duplicate an existing collection. Collections can be found in Unturned\Bundles\Assets\Landscapes\Foliage\Grass; their name always end with "_Collection".

For this section, I will duplicate Washington_Grass_00_Collection.asset.

- Once pasted in your custom Bundles folder and renamed with a custom name; you will have to edit it using any text editing software :


- The Red GUID is your Collection's GUID and has to be generated (the game will not generate one).

- The collection contains a list of assets identified by their GUIDs (Asset files GUIDs)
On the image above, one of the assets is highlighted in a blue rectangle :

  • The lines that start with // are comments that won't affect the collection.
  • You can change an asset's weight so it has more chance to spawn than the other (the asset's density is also taken into account)
  • You can add or remove assets from the list, but you will need to duplicate or delete everything inside the blue rectangle (starting with "{", ending with "}" )
  • You do not need comas ( "," ) between each asset

How to use a collection?

You can paint the collection using the paint tool or exact tool (random each time between each foliage) or you can link your collection to a material to bake it automatically.

Useful Tip : You can replace a vanilla material with a custom material that uses that material's texture (you basically duplicate its asset file, rename it and give it a custom GUID), and assign your custom collection to it.

This can save you a lot of time painting your resources or details by hand if the vanilla baked foliage of a material you are using does not suit your needs.
1 Comments
sm1leey Aug 25, 2024 @ 5:40am 
<3