Surfaces – DayZ

From Bohemia Interactive Community
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.


Overview

Surfaces in DayZ can be divided into two types:

  • Terrain surfaces - used on terrain.
  • Roadway surfaces - used in roadway LOD of individual models.

Surface definitions are used for a number of things within the game such as:

  • Physics (vehicle simulation params)
  • Sounds (bullet impacts, foot steps, interior gun echoes, car wheels,..)
  • Visuals (bullet impacts, grass-clutter definition)
  • Gameplay (medical system, definition of exterior/interior, water flag and definition of liquid type)

Default surfaces in the game are located at dz\surfaces (addons\surfaces.pbo). This folder contains game configuration (definitions) along with actual texture data used by the terrain or roadway faces.

Whenever facing the problem of creating a new surface, consider what default surfaces have to offer as adding a new surface can bring its own challenges.

Adding a new surface type

Both types (terrain and roadway) are based on a texture located somewhere in data. This texture is mapped either on the terrain (through rvmats in layers folder of your terrain) or in a roadway LOD of a model. Once such texture is present and used in data, you can proceed to the game config definition.

To make things a bit easier in the game config, I recommend you to set a dependency on already mentioned DZ_Surfaces addon in CfgPatches and use DZ_SurfacesInt / DZ_SurfacesExt base classes. Please keep in mind that interior and exterior does not mean roadway and terrain, both surface types can be interior or exterior, all depends on how you define it in the game config.

It is also recommended to look at the values of the default surfaces in DZ_Surfaces addon to get an idea how your custom surface values should look like.

class CfgPatches
{
  class yourcustomsurfaces
  {
    units[] = {};
    weapons[] = {};
    requiredVersion = 0.1;
    requiredAddons[] = {"DZ_Surfaces"};
    author = "yourname";
    name = "addonname";
    url = "websitelink";
  };
};
class CfgSurfaces
{
  class DZ_SurfacesInt; // for interior surface
  class DZ_SurfacesExt; // for exterior surface

  class yoursurfacename: DZ_SurfacesExt
  {
    files = "actualtexturename*";

    friction = 0.98;
    restitution = 0.55;
    vpSurface = "Asphalt";

    soundEnviron = "road";
    soundHit = "hard_ground";

    character = "cp_concrete_grass";

    footDamage = 0.117;
    audibility = 1.0;
	isDigable = 1;
	isFertile = 1;

    impact = "Hit_Concrete";
    deflection = 0.1;
  };
};

And as usual, an explanation of all relevant parameters:

  • files - Actual link between this surface definition and texture filename. Supports * and thus name does not have to be complete (in case of handling multiple textures by one surface definition). If linked texture is used on the terrain, its considered as a terrain surface, otherwise its roadway surface.
  • friction - Coefficient of friction.
  • restitution - Coefficient of restitution is related to the amount of the original kinetic energy that is "restored" to the object(s) after collision (see https://www.youtube.com/watch?v=fn_xanuLJiE for more info).
  • vpSurface - Defines parameters for vehicle simulation. Available values are:
* "Asphalt"
* "Dirt"
* "Grass"
* "Forest"
* "Gravel"
* Take a look into Vehicle surfaces section of this page to get more info on how to configure new types of vehicle surfaces.
  • soundEnviron - Defines a sound controller that is going to be used on this surface type (only applies to vehicles in DayZ). Available values are:
* "road"
* "rock"
* "dirt" 
* "grass"
  • soundHit - Defines a sound effect played when bullet hits the surface.
* "hard_ground"
* "soft_ground"
* "metal"
* "metal_plate"
* "glass"
* "glass_armored"
* "wood"
* "plastic"
* "concrete"
* "tyre"
* "water"
  • character - Defines a CfgSurfaceCharacters class for a grass-clutter definition (only works on terrain surfaces).
  • footDamage - Defines a chance for a character to get a bleeding wound when walking on this surface without shoes.
  • audibility - Multiplies a noise created by the player characters or bullet impacts on this surface.
  • isDigable - 1 for allowing to dig in surface (hidden stash, base building objects,..), 0 to disallow digging (hard surfaces).
  • isFertile - 1 for allowing to dig worms and digging farming plots. 0 to disallow.
  • impact - Defines a particle effect created when a bullet hits the surface. Available values are:
* "Hit_Plastic"
* "Hit_Sand"
* "Hit_Textile"
* "Hit_Concrete"
* "Hit_Gravel"
* "Hit_Dirt"
* "Hit_Foliage"
* "Hit_Grass"
* "Hit_Wood"
* "Hit_Metal"
* "Hit_Glass"
* "Hit_Water"
* "Hit_Rubber"
* "Hit_Plaster"
* "Hit_MeatBones"
* Look into Scripts\3_Game\ImpactEffects.c to get an idea how impact effects are defined.
  • deflection - Multiplier of a bullet deflecting value.

Additionally, CfgSurfaces entry can also contain following:

  • isLiquid - Defines if this surface should be considered as water by the game (1) or not (0).
  • liquidType - If isLiquid is set to 1, then this parameter is required. Contains type value from the cfgLiquidDefinitions config class. Take a look into dz\data\config.cpp to get an idea of all available liquid types in the game (use the number from type).


Foot steps sounds

While vehicle sounds definition is handled by the soundEnviron parameter and as long as you define existing sound controller into soundEnviron, correct sounds of wheels on a surface will be played.

Character and ai surface-related sounds have to be handled differently though. Any new surface types has to be mentioned within the game config class CfgSoundTables > CfgStepSoundTables. Due to the complexity of this config, it is recommended to use config macros, which will be executed during binarization and will generate all the necessary entries for your newly added surface.

Take a look on the following example to get an idea how to create a sound table for animal, character and infected. There are 3 individual code-blocks (animals, infected and character) that ideally should be put into separate include files (hpp extension) and then 1 code-block, which contains the part of the config that should be used within your config.cpp (note the paths for include have to be correct otherwise binarization wont be able to process your config).


animals.hpp

//  macros for generating sound lookup tables
#define ANIMAL_STEP_LOOUPTABLE_CLASS(roadwayname,surfacesound)\
						class ##animaltype####movementtype##stepSound_##roadwayname##\
						{\
							surface = ##roadwayname##;\
					        soundSets[] =\
							{\
								 ##animaltype####movementtype##_##surfacesound##_SoundSet\
							};\
						};
#define ANIMAL_STEP_SOUNDTABLE(animaltype,movementtype)\
			class ##animaltype####movementtype##_LookupTable\
			{\
				ANIMAL_STEP_LOOUPTABLE_CLASS(yoursurfacename, surfacetype)\
			};

/*
for macro above, do following:
 change yoursurfacename so it is the same as CfgSurfaces class name
 change surfacetype to one of the surface types listed below
  * Road
  * Forest
  * Concrete
  * Dirt
  * Grass
  * Grass_dry
  * Sand
  * Gravel
  * Metal
  * Wood
  * Water
*/

// create lookup tables from macros above
ANIMAL_STEP_SOUNDTABLE(Bird,Walk)
ANIMAL_STEP_SOUNDTABLE(Bird,Grazing)
ANIMAL_STEP_SOUNDTABLE(Bird,Bodyfall)

ANIMAL_STEP_SOUNDTABLE(HoofMedium,Walk)
ANIMAL_STEP_SOUNDTABLE(HoofMedium,Run)
ANIMAL_STEP_SOUNDTABLE(HoofMedium,Grazing)
ANIMAL_STEP_SOUNDTABLE(HoofMedium,Bodyfall)
ANIMAL_STEP_SOUNDTABLE(HoofMedium,Settle)
ANIMAL_STEP_SOUNDTABLE(HoofMedium,Rest2standA)
ANIMAL_STEP_SOUNDTABLE(HoofMedium,Rest2standB)
ANIMAL_STEP_SOUNDTABLE(HoofMedium,Stand2restA)
ANIMAL_STEP_SOUNDTABLE(HoofMedium,Stand2restB)
ANIMAL_STEP_SOUNDTABLE(HoofMedium,Stand2restC)
ANIMAL_STEP_SOUNDTABLE(HoofMedium,Rub1)
ANIMAL_STEP_SOUNDTABLE(HoofMedium,Rub2)

ANIMAL_STEP_SOUNDTABLE(HoofSmall,Walk)
ANIMAL_STEP_SOUNDTABLE(HoofSmall,Run)
ANIMAL_STEP_SOUNDTABLE(HoofSmall,Grazing)
ANIMAL_STEP_SOUNDTABLE(HoofSmall,GrazingHard)
ANIMAL_STEP_SOUNDTABLE(HoofSmall,GrazingLeave)
ANIMAL_STEP_SOUNDTABLE(HoofSmall,Bodyfall)
ANIMAL_STEP_SOUNDTABLE(HoofSmall,Settle)
ANIMAL_STEP_SOUNDTABLE(HoofSmall,Rest2standA)
ANIMAL_STEP_SOUNDTABLE(HoofSmall,Rest2standB)
ANIMAL_STEP_SOUNDTABLE(HoofSmall,Stand2restA)
ANIMAL_STEP_SOUNDTABLE(HoofSmall,Stand2restB)
ANIMAL_STEP_SOUNDTABLE(HoofSmall,Stand2restC)
ANIMAL_STEP_SOUNDTABLE(HoofSmall,Rub1)
ANIMAL_STEP_SOUNDTABLE(HoofSmall,Rub2)

ANIMAL_STEP_SOUNDTABLE(PawBig,Walk)
ANIMAL_STEP_SOUNDTABLE(PawBig,Run)
ANIMAL_STEP_SOUNDTABLE(PawBig,Grazing)
ANIMAL_STEP_SOUNDTABLE(PawBig,Bodyfall)
ANIMAL_STEP_SOUNDTABLE(PawBig,Settle)
ANIMAL_STEP_SOUNDTABLE(PawBig,Rest2standA)
ANIMAL_STEP_SOUNDTABLE(PawBig,Rest2standB)
ANIMAL_STEP_SOUNDTABLE(PawBig,Stand2restA)
ANIMAL_STEP_SOUNDTABLE(PawBig,Stand2restB)
ANIMAL_STEP_SOUNDTABLE(PawBig,Stand2restC)
ANIMAL_STEP_SOUNDTABLE(PawBig,Jump)
ANIMAL_STEP_SOUNDTABLE(PawBig,Impact)

ANIMAL_STEP_SOUNDTABLE(PawMedium,Walk)
ANIMAL_STEP_SOUNDTABLE(PawMedium,Run)
ANIMAL_STEP_SOUNDTABLE(PawMedium,Grazing)
ANIMAL_STEP_SOUNDTABLE(PawMedium,Bodyfall)
ANIMAL_STEP_SOUNDTABLE(PawMedium,Settle)
ANIMAL_STEP_SOUNDTABLE(PawMedium,Rest2standA)
ANIMAL_STEP_SOUNDTABLE(PawMedium,Rest2standB)
ANIMAL_STEP_SOUNDTABLE(PawMedium,Stand2restA)
ANIMAL_STEP_SOUNDTABLE(PawMedium,Stand2restB)
ANIMAL_STEP_SOUNDTABLE(PawMedium,Stand2restC)
ANIMAL_STEP_SOUNDTABLE(PawMedium,Jump)
ANIMAL_STEP_SOUNDTABLE(PawMedium,Impact)

ANIMAL_STEP_SOUNDTABLE(PawSmall,Walk)
ANIMAL_STEP_SOUNDTABLE(PawSmall,Run)
ANIMAL_STEP_SOUNDTABLE(PawSmall,Grazing)
ANIMAL_STEP_SOUNDTABLE(PawSmall,Bodyfall)
ANIMAL_STEP_SOUNDTABLE(PawSmall,Settle)
ANIMAL_STEP_SOUNDTABLE(PawSmall,Rest2standA)
ANIMAL_STEP_SOUNDTABLE(PawSmall,Rest2standB)
ANIMAL_STEP_SOUNDTABLE(PawSmall,Stand2restA)
ANIMAL_STEP_SOUNDTABLE(PawSmall,Stand2restB)
ANIMAL_STEP_SOUNDTABLE(PawSmall,Stand2restC)
ANIMAL_STEP_SOUNDTABLE(PawSmall,Jump)
ANIMAL_STEP_SOUNDTABLE(PawSmall,Impact)


infected.hpp

//  macros for generating sound lookup tables
#define CHAR_BODYFALL_ZMB_LOOUPTABLE_CLASS(roadwayname,surfacesound)\
						class ##shadername##_##roadwayname##\
						{\
							surface = ##roadwayname##;\
					        soundSets[] =\
							{\
								##shadername##_##surfacesound##_Zmb_SoundSet\
							};\
						};
#define CHAR_BODYFALL_LOOKUPTABLE(shadername)\
			class ##shadername##_Zmb_LookupTable\
			{\
				CHAR_BODYFALL_ZMB_LOOUPTABLE_CLASS(yoursurfacename, surfacetype)\
			};

/*
for macro above, do following:
 change yoursurfacename so it is the same as CfgSurfaces class name
 change surfacetype to one of the surface types listed below
 * asphalt_ext, asphalt_int
 * forestBroadleaf
 * grass
 * dirt_ext, dirt_int
 * gravelSmall_ext, gravelSmall_int
 * gravelLarge_ext, gravelLarge_int
 * linoleum_ext, linoleum_int
 * metal_ext, metal_int
 * rubbleLarge_ext, rubbleLarge_int
 * sand_ext, sand_int
 * asphalt_ext, asphalt_int
 * woodParquet_ext, woodParquet_int
 * woodPlanks_ext, woodPlanks_int
*/

// create lookup tables from macros above
CHAR_BODYFALL_LOOKUPTABLE(bodyfall)
CHAR_BODYFALL_LOOKUPTABLE(bodyfall_hand)
CHAR_BODYFALL_LOOKUPTABLE(bodyfall_slide)

//  macros for generating sound lookup tables
#define ZMB_STEP_LOOUPTABLE_CLASS(roadwayname,surfacesound)\
						class ##movementtype##_##roadwayname##\
						{\
							surface = ##roadwayname##;\
					        soundSets[] =\
							{\
								##movementtype##_##surfacesound##_bare_Zmb_Soundset\
							};\
						};
#define ZMB_STEP_LOOKUPTABLE(movementtype)\
			class ##movementtype##_Bare_Zmb_LookupTable\
			{\
        ZMB_STEP_LOOUPTABLE_CLASS(yoursurfacename, surfacetype)\
			};

/*
for macro above, do following:
 change yoursurfacename so it is the same as CfgSurfaces class name
 change surfacetype to one of the surface types listed below
 * asphalt_ext, asphalt_int
 * asphalt_felt_ext, asphalt_felt_int
 * cp_broadleaf_dense1
 * cp_grass_tall
 * concrete_ext, concrete_int
 * ceramic_tiles_ext, ceramic_tiles_int
 * dirt_ext, dirt_int
 * grass_dry_ext, grass_dry_int
 * gravel_small_ext, gravel_small_int
 * metal_thick_ext, metal_thick_int
 * metal_thin_mesh_ext, metal_thin_mesh_int
 * sand_ext, sand_int
 * textile_carpet_ext, textile_carpet_int
 * wood_parquet_ext, wood_parquet_int
 * wood_planks_ext, wood_planks_int
*/

// create lookup tables from macros above
ZMB_STEP_LOOKUPTABLE(walkErc)
ZMB_STEP_LOOKUPTABLE(runErc)
ZMB_STEP_LOOKUPTABLE(sprintErc)
ZMB_STEP_LOOKUPTABLE(landFeetErc)
ZMB_STEP_LOOKUPTABLE(scuffErc)

//  macros for generating sound lookup tables
#define ZMB_STEP_LOOKUPTABLE(movementtype,targetmovement)\
			class ##targetmovement##_Bare_Zmb_LookupTable\
			{\
				ZMB_STEP_LOOUPTABLE_CLASS(yoursurfacename, surfacetype)\
			};

/*
for macro above, do following:
 change yoursurfacename so it is the same as CfgSurfaces class name
 change surfacetype to one of the surface types listed below
 * asphalt_ext, asphalt_int
 * asphalt_felt_ext, asphalt_felt_int
 * cp_broadleaf_dense1
 * cp_grass_tall
 * concrete_ext, concrete_int
 * ceramic_tiles_ext, ceramic_tiles_int
 * dirt_ext, dirt_int
 * grass_dry_ext, grass_dry_int
 * gravel_small_ext, gravel_small_int
 * metal_thick_ext, metal_thick_int
 * metal_thin_mesh_ext, metal_thin_mesh_int
 * sand_ext, sand_int
 * textile_carpet_ext, textile_carpet_int
 * wood_parquet_ext, wood_parquet_int
 * wood_planks_ext, wood_planks_int
*/

// create lookup tables from macros above
ZMB_STEP_LOOKUPTABLE(walkErc,walkRasErc)
ZMB_STEP_LOOKUPTABLE(runErc,runRasErc)
ZMB_STEP_LOOKUPTABLE(runErc,landFootErc)
ZMB_STEP_LOOKUPTABLE(walkErc,walkCro)
ZMB_STEP_LOOKUPTABLE(runErc,runCro)
ZMB_STEP_LOOKUPTABLE(runErc,jumpErc)

//  macros for generating sound lookup tables
#define ZMB_STEP_LOOUPTABLE_CLASS(roadwayname,surfacesound)\
						class ##movementtype##_##roadwayname##\
						{\
							surface = ##roadwayname##;\
					        soundSets[] =\
							{\
								##movementtype##_##surfacesound##_boots_Zmb_Soundset\
							};\
						};
#define ZMB_STEP_LOOKUPTABLE(movementtype)\
			class ##movementtype##_Boots_Zmb_LookupTable\
			{\
				ZMB_STEP_LOOUPTABLE_CLASS(yoursurfacename, surfacetype)\
			};

/*
for macro above, do following:
 change yoursurfacename so it is the same as CfgSurfaces class name
 change surfacetype to one of the surface types listed below
 * asphalt_ext, asphalt_int
 * asphalt_felt_ext, asphalt_felt_int
 * cp_broadleaf_dense1
 * cp_grass_tall
 * concrete_ext, concrete_int
 * ceramic_tiles_ext, ceramic_tiles_int
 * dirt_ext, dirt_int
 * grass_dry_ext, grass_dry_int
 * gravel_small_ext, gravel_small_int
 * metal_thick_ext, metal_thick_int
 * metal_thin_mesh_ext, metal_thin_mesh_int
 * sand_ext, sand_int
 * textile_carpet_ext, textile_carpet_int
 * wood_parquet_ext, wood_parquet_int
 * wood_planks_ext, wood_planks_int
*/

// create lookup tables from macros above
ZMB_STEP_LOOKUPTABLE(walkErc)
ZMB_STEP_LOOKUPTABLE(runErc)
ZMB_STEP_LOOKUPTABLE(sprintErc)
ZMB_STEP_LOOKUPTABLE(landFeetErc)
ZMB_STEP_LOOKUPTABLE(scuffErc)

//  macros for generating sound lookup tables
#define ZMB_STEP_LOOKUPTABLE(movementtype,targetmovement)\
			class ##targetmovement##_Boots_Zmb_LookupTable\
			{\
				ZMB_STEP_LOOUPTABLE_CLASS(yoursurfacename, surfacetype)\
			};

/*
for macro above, do following:
 change yoursurfacename so it is the same as CfgSurfaces class name
 change surfacetype to one of the surface types listed below
 * asphalt_ext, asphalt_int
 * asphalt_felt_ext, asphalt_felt_int
 * cp_broadleaf_dense1
 * cp_grass_tall
 * concrete_ext, concrete_int
 * ceramic_tiles_ext, ceramic_tiles_int
 * dirt_ext, dirt_int
 * grass_dry_ext, grass_dry_int
 * gravel_small_ext, gravel_small_int
 * metal_thick_ext, metal_thick_int
 * metal_thin_mesh_ext, metal_thin_mesh_int
 * sand_ext, sand_int
 * textile_carpet_ext, textile_carpet_int
 * wood_parquet_ext, wood_parquet_int
 * wood_planks_ext, wood_planks_int
*/

// create lookup tables from macros above
ZMB_STEP_LOOKUPTABLE(walkErc,walkRasErc)
ZMB_STEP_LOOKUPTABLE(runErc,runRasErc)
ZMB_STEP_LOOKUPTABLE(runErc,landFootErc)
ZMB_STEP_LOOKUPTABLE(walkErc,walkCro)
ZMB_STEP_LOOKUPTABLE(runErc,runCro)
ZMB_STEP_LOOKUPTABLE(runErc,jumpErc)

//  macros for generating sound lookup tables
#define ZMB_STEP_LOOUPTABLE_CLASS(roadwayname,surfacesound)\
						class ##movementtype##_##roadwayname##\
						{\
							surface = ##roadwayname##;\
					        soundSets[] =\
							{\
								##movementtype##_##surfacesound##_sneakers_Zmb_Soundset\
							};\
						};
#define ZMB_STEP_LOOKUPTABLE(movementtype)\
			class ##movementtype##_Sneakers_Zmb_LookupTable\
			{\
				ZMB_STEP_LOOUPTABLE_CLASS(yoursurfacename, surfacetype)\
			};

/*
for macro above, do following:
 change yoursurfacename so it is the same as CfgSurfaces class name
 change surfacetype to one of the surface types listed below
 * asphalt_ext, asphalt_int
 * asphalt_felt_ext, asphalt_felt_int
 * cp_broadleaf_dense1
 * cp_grass_tall
 * concrete_ext, concrete_int
 * ceramic_tiles_ext, ceramic_tiles_int
 * dirt_ext, dirt_int
 * grass_dry_ext, grass_dry_int
 * gravel_small_ext, gravel_small_int
 * metal_thick_ext, metal_thick_int
 * metal_thin_mesh_ext, metal_thin_mesh_int
 * sand_ext, sand_int
 * textile_carpet_ext, textile_carpet_int
 * wood_parquet_ext, wood_parquet_int
 * wood_planks_ext, wood_planks_int
*/

// create lookup tables from macros above
ZMB_STEP_LOOKUPTABLE(walkErc)
ZMB_STEP_LOOKUPTABLE(runErc)
ZMB_STEP_LOOKUPTABLE(sprintErc)
ZMB_STEP_LOOKUPTABLE(landFeetErc)
ZMB_STEP_LOOKUPTABLE(scuffErc)

//  macros for generating sound lookup tables
#define ZMB_STEP_LOOKUPTABLE(movementtype,targetmovement)\
			class ##targetmovement##_Sneakers_Zmb_LookupTable\
			{\
				ZMB_STEP_LOOUPTABLE_CLASS(yoursurfacename, surfacetype)\
			};

/*
for macro above, do following:
 change yoursurfacename so it is the same as CfgSurfaces class name
 change surfacetype to one of the surface types listed below
 * asphalt_ext, asphalt_int
 * asphalt_felt_ext, asphalt_felt_int
 * cp_broadleaf_dense1
 * cp_grass_tall
 * concrete_ext, concrete_int
 * ceramic_tiles_ext, ceramic_tiles_int
 * dirt_ext, dirt_int
 * grass_dry_ext, grass_dry_int
 * gravel_small_ext, gravel_small_int
 * metal_thick_ext, metal_thick_int
 * metal_thin_mesh_ext, metal_thin_mesh_int
 * sand_ext, sand_int
 * textile_carpet_ext, textile_carpet_int
 * wood_parquet_ext, wood_parquet_int
 * wood_planks_ext, wood_planks_int
*/

// create lookup tables from macros above
ZMB_STEP_LOOKUPTABLE(walkErc,walkRasErc)
ZMB_STEP_LOOKUPTABLE(runErc,runRasErc)
ZMB_STEP_LOOKUPTABLE(runErc,landFootErc)
ZMB_STEP_LOOKUPTABLE(walkErc,walkCro)
ZMB_STEP_LOOKUPTABLE(runErc,runCro)
ZMB_STEP_LOOKUPTABLE(runErc,jumpErc)

//  macros for generating sound lookup tables
#define CHAR_STEP_PRONE_LOOUPTABLE_CLASS(roadwayname,surfacesound)\
						class ##movementtype##_##roadwayname##\
						{\
							surface = ##roadwayname##;\
					        soundSets[] =\
							{\
								##movementtype##_##surfacesound##_Zmb_Soundset\
							};\
						};
#define CHAR_STEP_PRONE_LOOKUPTABLE(movementtype)\
			class ##movementtype##_Zmb_LookupTable\
			{\
				CHAR_STEP_PRONE_LOOUPTABLE_CLASS(yoursurfacename, surfacetype)\
			};

/*
for macro above, do following:
 change yoursurfacename so it is the same as CfgSurfaces class name
 change surfacetype to one of the surface types listed below
 * asphalt_ext, asphalt_int
 * asphalt_felt_ext, asphalt_felt_int
 * cp_broadleaf_dense1
 * cp_grass_tall
 * concrete_ext, concrete_int
 * ceramic_tiles_ext, ceramic_tiles_int
 * dirt_ext, dirt_int
 * grass_dry_ext, grass_dry_int
 * gravel_small_ext, gravel_small_int
 * metal_thick_ext, metal_thick_int
 * metal_thin_mesh_ext, metal_thin_mesh_int
 * sand_ext, sand_int
 * textile_carpet_ext, textile_carpet_int
 * wood_parquet_ext, wood_parquet_int
 * wood_planks_ext, wood_planks_int
*/

// create lookup tables from macros above
CHAR_STEP_PRONE_LOOKUPTABLE(walkProne)
CHAR_STEP_PRONE_LOOKUPTABLE(runProne)


character.hpp

//  macros for generating sound lookup tables
#define CHAR_STEP_LOOUPTABLE_CLASS(roadwayname,surfacesound)\
						class ##movementtype##_##roadwayname##\
						{\
							surface = ##roadwayname##;\
					        soundSets[] =\
							{\
								##movementtype##_##surfacesound##_Char_Soundset\
							};\
						};
#define CHAR_STEP_LOOKUPTABLE(movementtype)\
			class ##movementtype##_Char_LookupTable\
			{\
				CHAR_STEP_LOOUPTABLE_CLASS(yoursurfacename, surfacetype)\
			};

/*
for macro above, do following:
 change yoursurfacename so it is the same as CfgSurfaces class name
 change surfacetype to one of the surface types listed below
 * asphalt_ext, asphalt_int
 * asphalt_felt_ext, asphalt_felt_int
 * cp_broadleaf_dense1
 * cp_grass_tall
 * concrete_ext, concrete_int
 * ceramic_tiles_ext, ceramic_tiles_int
 * dirt_ext, dirt_int
 * grass_dry_ext, grass_dry_int
 * gravel_small_ext, gravel_small_int
 * metal_thick_ext, metal_thick_int
 * metal_thin_ext, metal_thin_int
 * metal_thin_mesh_ext, metal_thin_mesh_int
 * gravel_small_ext, gravel_small_int
 * sand_ext, sand_int
 * textile_carpet_ext, textile_carpet_int
 * wood_parquet_ext, wood_parquet_int
 * wood_planks_ext, wood_planks_int
 * water
*/

// create lookup tables from macros above
CHAR_STEP_LOOKUPTABLE(walkErc)
CHAR_STEP_LOOKUPTABLE(walkRasErc)
CHAR_STEP_LOOKUPTABLE(runErc)
CHAR_STEP_LOOKUPTABLE(runRasErc)
CHAR_STEP_LOOKUPTABLE(sprintErc)
CHAR_STEP_LOOKUPTABLE(landFootErc)
CHAR_STEP_LOOKUPTABLE(landFeetErc)
CHAR_STEP_LOOKUPTABLE(scuffErc)
CHAR_STEP_LOOKUPTABLE(walkCro)
CHAR_STEP_LOOKUPTABLE(runCro)
CHAR_STEP_LOOKUPTABLE(jumpErc)

//  macros for generating sound lookup tables
#define CHAR_STEP_PRONE_LOOUPTABLE_CLASS(roadwayname,surfacesound)\
						class ##movementtype##_##roadwayname##\
						{\
							surface = ##roadwayname##;\
					        soundSets[] =\
							{\
								##movementtype##_##surfacesound##_Char_Soundset\
							};\
						};
#define CHAR_STEP_PRONE_LOOKUPTABLE(movementtype)\
			class ##movementtype##_Char_LookupTable\
			{\
				CHAR_STEP_PRONE_LOOUPTABLE_CLASS(yoursurfacename, surfacetype)\
			};

/*
for macro above, do following:
 change yoursurfacename so it is the same as CfgSurfaces class name
 change surfacetype to one of the surface types listed below
 * asphalt_ext, asphalt_int
 * asphalt_felt_ext, asphalt_felt_int
 * cp_broadleaf_dense1
 * cp_grass_tall
 * concrete_ext, concrete_int
 * ceramic_tiles_ext, ceramic_tiles_int
 * dirt_ext, dirt_int
 * grass_dry_ext, grass_dry_int
 * gravel_small_ext, gravel_small_int
 * metal_thick_ext, metal_thick_int
 * metal_thin_ext, metal_thin_int
 * metal_thin_mesh_ext, metal_thin_mesh_int
 * gravel_small_ext, gravel_small_int
 * sand_ext, sand_int
 * textile_carpet_ext, textile_carpet_int
 * wood_parquet_ext, wood_parquet_int
 * wood_planks_ext, wood_planks_int
 * water
*/

// create lookup tables from macros above
CHAR_STEP_PRONE_LOOKUPTABLE(walkProne)
CHAR_STEP_PRONE_LOOKUPTABLE(runProne)

//  macros for generating sound lookup tables
#define CHAR_STEP_PRONE_LOOUPTABLE_CLASS(roadwayname,surfacesound)\
						class ##movementtype##_##roadwayname##\
						{\
							surface = ##roadwayname##;\
					        soundSets[] =\
							{\
								##movementtype##_noHS_##surfacesound##_Char_Soundset\
							};\
						};
#define CHAR_STEP_PRONE_LOOKUPTABLE(movementtype)\
			class ##movementtype##_noHS_Char_LookupTable\
			{\
				CHAR_STEP_PRONE_LOOUPTABLE_CLASS(yoursurfacename, surfacetype)\
			};

/*
for macro above, do following:
 change yoursurfacename so it is the same as CfgSurfaces class name
 change surfacetype to one of the surface types listed below
 * asphalt_ext
 * cp_broadleaf_dense1
 * dirt_ext
 * grass_dry_ext
 * gravel_small_ext
 * gravel_large_ext
 * wood_planks_ext
 * water
*/

// create lookup tables from macros above
CHAR_STEP_PRONE_LOOKUPTABLE(walkProne)
CHAR_STEP_PRONE_LOOKUPTABLE(walkProneLong)

//  macros for generating sound lookup tables
#define CHAR_HANDSTEP_LOOUPTABLE_CLASS(roadwayname,surfacesound)\
						class handstepSound_##roadwayname##\
						{\
							surface = ##roadwayname##;\
					        soundSets[] =\
							{\
								Handstep_##surfacesound##_Char_SoundSet\
							};\
						};
#define CHAR_HANDSTEP_LOOKUPTABLE\
			class handstepSound_Char_LookupTable\
			{\
				CHAR_HANDSTEP_LOOUPTABLE_CLASS(yoursurfacename, surfacetype)\
			};

/*
for macro above, do following:
 change yoursurfacename so it is the same as CfgSurfaces class name
 change surfacetype to one of the surface types listed below
 * asphalt_ext, asphalt_int
 * asphalt_destroyed_ext, asphalt_destroyed_int
 * cp_broadleaf_dense1
 * forestConifer
 * grass_dry_ext
 * grassTall
 * ceramicTiles_ext, ceramicTiles_int
 * dirt_ext, dirt_int
 * gravelSmall_ext, gravelSmall_int
 * linoleum_ext, linoleum_int
 * metalThick_ext
 * metal_ext, metal_int
 * metalThin_ext, metalThin_int
 * metalThinMesh_ext, metalThinMesh_int
 * rubbleLarge_ext, rubbleLarge_int
 * sand_ext, sand_int
 * carpet_ext, carpet_int
 * woodParquet_ext, woodParquet_int
 * woodPlanks_ext, woodPlanks_int
 * water
*/

// create lookup tables from macros above
CHAR_HANDSTEP_LOOKUPTABLE

//  macros for generating sound lookup tables
#define CHAR_HANDSTEP_LOOUPTABLE_CLASS(roadwayname,surfacesound)\
						class handstepSound_Hard_##roadwayname##\
						{\
							surface = ##roadwayname##;\
					        soundSets[] =\
							{\
								Handstep_Hard_##surfacesound##_Char_SoundSet\
							};\
						};
#define CHAR_HANDSTEP_LOOKUPTABLE\
			class handstepSound_Hard_Char_LookupTable\
			{\
				CHAR_HANDSTEP_LOOUPTABLE_CLASS(yoursurfacename, surfacetype)\
			};

/*
for macro above, do following:
 change yoursurfacename so it is the same as CfgSurfaces class name
 change surfacetype to one of the surface types listed below
 * asphalt_ext, asphalt_int
 * asphalt_destroyed_ext, asphalt_destroyed_int
 * cp_broadleaf_dense1
 * forestConifer
 * grass_dry_ext
 * grassTall
 * ceramicTiles_ext, ceramicTiles_int
 * dirt_ext, dirt_int
 * gravelSmall_ext, gravelSmall_int
 * linoleum_ext, linoleum_int
 * metalThick_ext
 * metal_ext, metal_int
 * metalThin_ext, metalThin_int
 * metalThinMesh_ext, metalThinMesh_int
 * rubbleLarge_ext, rubbleLarge_int
 * sand_ext, sand_int
 * carpet_ext, carpet_int
 * woodParquet_ext, woodParquet_int
 * woodPlanks_ext, woodPlanks_int
 * water
*/

// create lookup tables from macros above
CHAR_HANDSTEP_LOOKUPTABLE

//  macros for generating sound lookup tables
#define CHAR_HANDSTEP_LOOUPTABLE_CLASS(roadwayname,surfacesound)\
						class handsstepSound_##roadwayname##\
						{\
							surface = ##roadwayname##;\
					        soundSets[] =\
							{\
								Handsstep_##surfacesound##_Char_SoundSet\
							};\
						};
#define CHAR_HANDSTEP_LOOKUPTABLE\
			class handsstepSound_Char_LookupTable\
			{\
				CHAR_HANDSTEP_LOOUPTABLE_CLASS(yoursurfacename, surfacetype)\
			};

/*
for macro above, do following:
 change yoursurfacename so it is the same as CfgSurfaces class name
 change surfacetype to one of the surface types listed below
 * asphalt_ext, asphalt_int
 * asphalt_destroyed_ext, asphalt_destroyed_int
 * cp_broadleaf_dense1
 * forestConifer
 * grass_dry_ext
 * grassTall
 * ceramicTiles_ext, ceramicTiles_int
 * dirt_ext, dirt_int
 * gravelSmall_ext, gravelSmall_int
 * linoleum_ext, linoleum_int
 * metalThick_ext
 * metal_ext, metal_int
 * metalThin_ext, metalThin_int
 * metalThinMesh_ext, metalThinMesh_int
 * rubbleLarge_ext, rubbleLarge_int
 * sand_ext, sand_int
 * carpet_ext, carpet_int
 * woodParquet_ext, woodParquet_int
 * woodPlanks_ext, woodPlanks_int
 * water
*/

// create lookup tables from macros above
CHAR_HANDSTEP_LOOKUPTABLE

//  macros for generating sound lookup tables
#define CHAR_BODYFALL_LOOUPTABLE_CLASS(roadwayname,surfacesound)\
						class ##shadername##Sound_##roadwayname##\
						{\
							surface = ##roadwayname##;\
					        soundSets[] =\
							{\
								##shadername##_##surfacesound##_Char_SoundSet\
							};\
						};
#define CHAR_BODYFALL_LOOKUPTABLE(shadername)\
			class ##shadername##Sound_Char_LookupTable\
			{\
				CHAR_BODYFALL_LOOUPTABLE_CLASS(yoursurfacename, surfacetype)\
			};

/*
for macro above, do following:
 change yoursurfacename so it is the same as CfgSurfaces class name
 change surfacetype to one of the surface types listed below
 * asphalt_ext, asphalt_int
 * forestBroadleaf
 * dirt_ext, dirt_int
 * grass
 * gravelSmall_ext, gravelSmall_int
 * linoleum_ext, linoleum_int
 * metal_ext, metal_int
 * rubbleLarge_ext, rubbleLarge_int
 * sand_ext, sand_int
 * woodParquet_ext, woodParquet_int
 * woodPlanks_ext, woodPlanks_int
*/

// create lookup tables from macros above
CHAR_BODYFALL_LOOKUPTABLE(bodyfall)
CHAR_BODYFALL_LOOKUPTABLE(bodyfall_hand)
CHAR_BODYFALL_LOOKUPTABLE(bodyfall_roll)
CHAR_BODYFALL_LOOKUPTABLE(bodyfall_rollHard)
CHAR_BODYFALL_LOOKUPTABLE(bodyfall_slide)
CHAR_BODYFALL_LOOKUPTABLE(bodyfall_slide_light)
CHAR_BODYFALL_LOOKUPTABLE(bodyfall_hand_light)

//  macros for generating sound lookup tables
#define CHAR_HANDSTEP_LOOUPTABLE_CLASS(roadwayname,surfacesound)\
						class handstepSound_##roadwayname##\
						{\
							surface = ##roadwayname##;\
					        soundSets[] =\
							{\
								step_ladder_Char_Soundset\
							};\
						};
#define CHAR_HANDSTEP_LOOKUPTABLE\
			class step_ladder_Char_LookupTable\
			{\
				CHAR_HANDSTEP_LOOUPTABLE_CLASS(yoursurfacename, surfacetype)\
			};

/*
for macro above, do following:
 change yoursurfacename so it is the same as CfgSurfaces class name
 change surfacetype to one of the surface types listed below
 * asphalt_ext, asphalt_int
 * asphalt_destroyed_ext, asphalt_destroyed_int
 * cp_broadleaf_dense1
 * forestConifer
 * ceramicTiles_ext, ceramicTiles_int
 * dirt_ext, dirt_int
 * grass_dry_ext
 * grassTall
 * gravelSmall_ext, gravelSmall_int
 * linoleum_ext, linoleum_int
 * metalThick_ext
 * metal_ext, metal_int
 * metalThin_ext, metalThin_int
 * metalThinMesh_ext, metalThinMesh_int
 * rubbleLarge_ext, rubbleLarge_int
 * sand_ext, sand_int
 * carpet_ext, carpet_int
 * woodParquet_ext, woodParquet_int
 * woodPlanks_ext, woodPlanks_int
 * water
*/

// create lookup tables from macros above
CHAR_HANDSTEP_LOOKUPTABLE

//  macros for generating sound lookup tables
#define CHAR_HANDSTEP_LOOUPTABLE_CLASS(roadwayname,surfacesound)\
						class handstepSound_##roadwayname##\
						{\
							surface = ##roadwayname##;\
					        soundSets[] =\
							{\
								step_ladder_run_Char_Soundset\
							};\
						};
#define CHAR_HANDSTEP_LOOKUPTABLE\
			class step_ladder_run_Char_LookupTable\
			{\
				CHAR_HANDSTEP_LOOUPTABLE_CLASS(yoursurfacename, surfacetype)\
			};

/*
for macro above, do following:
 change yoursurfacename so it is the same as CfgSurfaces class name
 change surfacetype to one of the surface types listed below
 * asphalt_ext, asphalt_int
 * asphalt_destroyed_ext, asphalt_destroyed_int
 * cp_broadleaf_dense1
 * forestConifer
 * ceramicTiles_ext, ceramicTiles_int
 * dirt_ext, dirt_int
 * grass_dry_ext
 * grassTall
 * gravelSmall_ext, gravelSmall_int
 * linoleum_ext, linoleum_int
 * metalThick_ext
 * metal_ext, metal_int
 * metalThin_ext, metalThin_int
 * metalThinMesh_ext, metalThinMesh_int
 * rubbleLarge_ext, rubbleLarge_int
 * sand_ext, sand_int
 * carpet_ext, carpet_int
 * woodParquet_ext, woodParquet_int
 * woodPlanks_ext, woodPlanks_int
 * water
*/

// create lookup tables from macros above
CHAR_HANDSTEP_LOOKUPTABLE


config.cpp

/* can be part of the same config.cpp file as CfgSurfaces */

class CfgSoundTables
{
	class CfgStepSoundTables
	{
		#include "path\to\animals.hpp"
		#include "path\to\infected.hpp"
		#include "path\to\character.hpp"
	};
};

Please keep in mind that in order to get sounds of steps working correctly on your surface for all the cases, all the hpp needs to be modified (animals, infected and character). You can of course add any number of new surfaces, but keep in mind that each line in macro with yoursurfacename represents one surface and more needs to be added into the macro in case of more than one surface being added.


Vehicle surfaces

As mentioned in the beginning, surface information for vehicles can be linked using vpSurface parameter in CfgSurfaces entry. By default, we have "Asphalt", "Dirt", "Grass", "Forest" and "Gravel". Available surfaces are listed from the best to the worst in terms of driving quality.

TBD

Tips and tricks

  • Roadway faces normally flatten the grass-clutter. In some specific cases you may want to have a grass-clutter generated. This can be done by adding DZ\data\data\surfaces\clutter.rvmat material to selected roadway faces.

Sample

You can take a look at DayZ:Terrain sample to see an example of the implementation of brand new terrain surface (utes_concrete).