Grass-clutter configuration – DayZ

From Bohemia Interactive Community
Revision as of 00:18, 25 April 2023 by Lou Montana (talk | contribs) (Text replacement - "Category:DayZ:Terrain_Editing" to "{{GameCategory|dayz|Terrain Editing}}")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.