Grass-clutter configuration – DayZ

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "Terrain Terrain ==Overview== Any terrain in DayZ has an option to use grass-clutter generated on '''terrain sur...")
 
m (Text replacement - "Category:DayZ:Terrain_Editing" to "{{GameCategory|dayz|Terrain Editing}}")
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:DayZ:Editing|Terrain]]
{{TOC|side}}
[[Category:DayZ:Terrain_Editing|Terrain]]
==Overview==
Any terrain in DayZ has an option to use grass-clutter generated on '''terrain surfaces''' (look at [[DayZ:Surfaces|surfaces]] guide to get more info about the surfaces).
Any terrain in DayZ has an option to use grass-clutter generated on '''terrain surfaces''' (look at [[DayZ:Surfaces|surfaces]] guide to get more info about the surfaces).
 
==Defining a clutter model==
 
== Defining a clutter model ==
 
In order to define a clutter model, you need to have a p3d of clutter model prepared first (if you want to learn more about the creation of clutter models for DayZ, take a look at [[DayZ:Grass-clutter modelling|grass-clutter modelling]]).
In order to define a clutter model, you need to have a p3d of clutter model prepared first (if you want to learn more about the creation of clutter models for DayZ, take a look at [[DayZ:Grass-clutter modelling|grass-clutter modelling]]).
 
Each clutter model has a game config definition that has to be present in class ''Clutter'' within your ''CfgWorlds'' entry. Take a look on following example:
Each clutter model has a game config definition that has to be present in class ''Clutter'' within your ''CfgWorlds'' entry. Take a look on following example:
 
<syntaxhighlight lang="c++">
<syntaxhighlight lang="cpp">
class CfgWorlds
class CfgWorlds
{
{
    class CAWorld;
class CAWorld;
    class YourTerrain: CAWorld
class YourTerrain: CAWorld
    {
{
        /* .. */
/* .. */
        /* clutter definition */
/* clutter definition */
        class DefaultClutter;
class DefaultClutter;
        class Clutter
class Clutter
        {
{
            class YourClutter1: DefaultClutter
class YourClutter1: DefaultClutter
            {
{
                model = "path\to\cluttermodel.p3d";
model = "path\to\cluttermodel.p3d";
                scaleMin = 0.9;
scaleMin = 0.9;
                scaleMax = 1.3;
scaleMax = 1.3;
                noSatColor = false;
noSatColor = false;
            };
};
        };
};
        /* end of clutter definition */
/* end of clutter definition */
        /* .. */
/* .. */
    };
};
};
};
</syntaxhighlight>
</syntaxhighlight>
 
When you are facing the task of creating a new clutter definition, you should also have your terrain defined somewhere, so what is really key in here is the clutter definition part. Here, you can notice that each model in data represents one class with chosen classname (which will be used in later parts of this guide). Inside this class, you can notice several parameters:
When you are facing the task of creating a new clutter definition, you should also have your terrain defined somewhere, so what is really key in here is the clutter definition part.
Here, you can notice that each model in data represents one class with chosen classname (which will be used in later parts of this guide).
Inside this class, you can notice several parameters:
* '''model''' - Specifies a path to the custom clutter model (p3d).
* '''model''' - Specifies a path to the custom clutter model (p3d).
* '''scaleMin''' - min scale in which this model can appear in the world.
* '''scaleMin''' - min scale in which this model can appear in the world.
* '''scaleMax''' - max scale in which this model can appear in the world.
* '''scaleMax''' - max scale in which this model can appear in the world.
* '''noSatColor''' - Defines whether this clutter model should have its colors modified by the satellite image (color taken from it at particular world position of the clutter model).
* '''noSatColor''' - Defines whether this clutter model should have its colors modified by the satellite image (color taken from it at particular world position of the clutter model).
 
==Connecting clutter models to surfaces==
 
== Connecting clutter models to surfaces ==
 
Individual clutter models are connected with terrain surfaces using top-level ''CfgSurfaceCharacters'' game config class (top-level meaning it has to be outside of ''CfgWorlds'' or in fact any other class). Take a look at following game config example:
Individual clutter models are connected with terrain surfaces using top-level ''CfgSurfaceCharacters'' game config class (top-level meaning it has to be outside of ''CfgWorlds'' or in fact any other class). Take a look at following game config example:
 
<syntaxhighlight lang="c++">
<syntaxhighlight lang="cpp">
class CfgSurfaceCharacters
class CfgSurfaceCharacters
{
{
    class SurfaceCharacter
class SurfaceCharacter
    {
{
        probability[] = {0.14, 0.03, 0.05};
probability[] = { 0.14, 0.03, 0.05 };
        names[] = {"YourClutter1","YourClutter2","YourClutter3"};
names[] = { "YourClutter1", "YourClutter2", "YourClutter3" };
    };
};
    /* insert more surface characters classes here */
/* insert more surface characters classes here */
};
};
</syntaxhighlight>
</syntaxhighlight>
 
This config basically defines a group of clutter models and in what probability certain clutter model can show up. Numbers in probability array do not necessarily needs to be added to 1.0, it all depends on how much empty space you want in-between individual clutter models that will be generated (empty space in between can also be introduced by increased ''clutterGrid'', see below).
This config basically defines a group of clutter models and in what probability certain clutter model can show up.
Numbers in probability array do not necessarily needs to be added to 1.0, it all depends on how much empty space you want in-between individual clutter models that will be generated (empty space in between can also be introduced by increased ''clutterGrid'', see below).
As mentioned in the [[DayZ:Surface|surfaces]] guide, the class names in ''CfgSurfaceCharacters'' are specified in selected ''CfgSurfaces'' entries (character parameter). This link will tell the game to generate selected clutter models (from the group) at all places with selected terrain surfaces (using the character parameter).
 
As mentioned in the [[DayZ:Surfaces|surfaces]] guide, the class names in ''CfgSurfaceCharacters'' are specified in selected ''CfgSurfaces'' entries (character parameter).
==Configuring clutter on your world==
This link will tell the game to generate selected clutter models (from the group) at all places with selected terrain surfaces (using the character parameter).
 
 
== Configuring clutter on your world ==
 
You can configure clutter generation itself in your CfgWorlds entry by changing following parameters:
You can configure clutter generation itself in your CfgWorlds entry by changing following parameters:
 
* ''clutterGrid'' - defines the density of generated clutters (size of square in meters where single clutter model is present).
* ''clutterGrid'' - defines the density of generated clutters (size of square in meters where single clutter model is present).
* ''clutterDist'' - defines a base distance in meters for clutter rendering. This base distance is modified by the Terrain Detail setting in graphics options in the game (singleplayer). In multiplayer, this settings is fixed to medium (by default) so everyone has the same grass rendering distance.
* ''clutterDist'' - defines a base distance in meters for clutter rendering. This base distance is modified by the Terrain Detail setting in graphics options in the game (singleplayer).<!--
-->In multiplayer, this settings is fixed to medium (by default) so everyone has the same grass rendering distance.
==Tips and tricks==
 
 
== Tips and tricks ==
 
* Avoid scaling clutter models too much (or in fact even creating tall clutter models) - clutter cannot be rendered past certain distance meaning game does not have any way to hide player characters (or other things) that would normally would not be visible from the close-up (because of the tall clutter).
* Avoid scaling clutter models too much (or in fact even creating tall clutter models) - clutter cannot be rendered past certain distance meaning game does not have any way to hide player characters (or other things) that would normally would not be visible from the close-up (because of the tall clutter).
* Clutter rendering is very performance-heavy and it is recommended to not to use high clutterDist values (150 and more) nor lower than 1.0 clutterGrid values.
* Clutter rendering is very performance-heavy and it is recommended to not to use high clutterDist values (150 and more) nor lower than 1.0 clutterGrid values.
* While making smaller clutter models can feel more natural (along with folding them down while walking), keep in mind that it will require more of them to fill up the players surroundings. It is generally recommended to keep clutter model size around 1-2 meter size.
* While making smaller clutter models can feel more natural (along with folding them down while walking), keep in mind that it will require more of them to fill up the players surroundings. It is generally recommended to keep clutter model size around 1-2 meter size.
{{GameCategory|dayz|Terrain Editing}}

Latest revision as of 01:18, 25 April 2023

Any terrain in DayZ has an option to use grass-clutter generated on terrain surfaces (look at surfaces guide to get more info about the surfaces).


Defining a clutter model

In order to define a clutter model, you need to have a p3d of clutter model prepared first (if you want to learn more about the creation of clutter models for DayZ, take a look at grass-clutter modelling).

Each clutter model has a game config definition that has to be present in class Clutter within your CfgWorlds entry. Take a look on following example:

class CfgWorlds
{
	class CAWorld;
	class YourTerrain: CAWorld
	{
		/* .. */
		/* clutter definition */
		class DefaultClutter;
		class Clutter
		{
			class YourClutter1: DefaultClutter
			{
				model = "path\to\cluttermodel.p3d";
				scaleMin = 0.9;
				scaleMax = 1.3;
				noSatColor = false;
			};
		};
		/* end of clutter definition */
		/* .. */
	};
};

When you are facing the task of creating a new clutter definition, you should also have your terrain defined somewhere, so what is really key in here is the clutter definition part. Here, you can notice that each model in data represents one class with chosen classname (which will be used in later parts of this guide). Inside this class, you can notice several parameters:

  • model - Specifies a path to the custom clutter model (p3d).
  • scaleMin - min scale in which this model can appear in the world.
  • scaleMax - max scale in which this model can appear in the world.
  • noSatColor - Defines whether this clutter model should have its colors modified by the satellite image (color taken from it at particular world position of the clutter model).


Connecting clutter models to surfaces

Individual clutter models are connected with terrain surfaces using top-level CfgSurfaceCharacters game config class (top-level meaning it has to be outside of CfgWorlds or in fact any other class). Take a look at following game config example:

class CfgSurfaceCharacters
{
	class SurfaceCharacter
	{
		probability[] = { 0.14, 0.03, 0.05 };
		names[] = { "YourClutter1", "YourClutter2", "YourClutter3" };
	};
	/* insert more surface characters classes here */
};

This config basically defines a group of clutter models and in what probability certain clutter model can show up. Numbers in probability array do not necessarily needs to be added to 1.0, it all depends on how much empty space you want in-between individual clutter models that will be generated (empty space in between can also be introduced by increased clutterGrid, see below).

As mentioned in the surfaces guide, the class names in CfgSurfaceCharacters are specified in selected CfgSurfaces entries (character parameter). This link will tell the game to generate selected clutter models (from the group) at all places with selected terrain surfaces (using the character parameter).


Configuring clutter on your world

You can configure clutter generation itself in your CfgWorlds entry by changing following parameters:

  • clutterGrid - defines the density of generated clutters (size of square in meters where single clutter model is present).
  • clutterDist - defines a base distance in meters for clutter rendering. This base distance is modified by the Terrain Detail setting in graphics options in the game (singleplayer).In multiplayer, this settings is fixed to medium (by default) so everyone has the same grass rendering distance.


Tips and tricks

  • Avoid scaling clutter models too much (or in fact even creating tall clutter models) - clutter cannot be rendered past certain distance meaning game does not have any way to hide player characters (or other things) that would normally would not be visible from the close-up (because of the tall clutter).
  • Clutter rendering is very performance-heavy and it is recommended to not to use high clutterDist values (150 and more) nor lower than 1.0 clutterGrid values.
  • While making smaller clutter models can feel more natural (along with folding them down while walking), keep in mind that it will require more of them to fill up the players surroundings. It is generally recommended to keep clutter model size around 1-2 meter size.