Groundmodel on static objects

Groundmodel on static objects

From BeamNG

Revision as of 06:57, 25 July 2019 by Nadeox1 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)



This guide will guide you through setting a groundmodel on static objects.

If no groundmodel is defined for a static object, 'asphalt' will be used by default.


Pre-requisites

Tsground 1.jpg


  • Make sure that the part of the object you want to have a different groundmodel has its own material.
  • Material name can be whatever you want.
  • You can assign the same groundmodel to different materials.


How to assign a groundmodel

In the Materials.cs file of your object add this line:

    groundType = "XYZ";


XYZ will have to be replaced with the alias or the name of the groundmodel you want to use.


Example


 singleton Material(gmt_grass)
{
    mapTo = "gmt_grass";
    diffuseMap[0] = "Overlay_Grass-01.dds";
    groundType = "grass";
   useAnisotropic[0] = "1";
};


Here you can find a test object that contains different groundmodels applied to it.

Simply extract it in a level folder you want and add it via the world editor

File:Tsgroundmodel test.zip


Default Groundmodels & Aliases

Here's a partial list of the default groundmodels' names & aliases available.

A full list of available groundmodels can be found in the groundmodels.json file, located in BeamNG.Drive/gameengine.zip/art folder.


Asphalt:

  • groundmodel_asphalt1
  • rock_cliff
  • grid
  • concrete
  • concrete2
  • rocks_large


Gravel:

  • rockydirt
  • dirt_loose
  • dirt_loose_dusty
  • dirt_rocky
  • dirt_rocky_large
  • dirt_sandy


Rock

  • no-aliases


Metal

  • no-aliases


Grass:

  • grass2
  • forest


Sand:

  • beachsand


Dirt_dusty

  • no-aliases


Dirt:

  • dirt_grass
  • derby_dirt


Ice

  • no-aliases


Snow

  • no-aliases


Mud

  • no-aliases


Custom Groundmodels

It is possible to have your own custom groundmodel, per-level.

You create a folder named "groundmodels" inside your own level's folder.

Inside this folder create a Json file (name can be any) that defines your groundmodel, as in the example below:

/*******************************************************************************
This is an example of how to add per-level custom groundmodels
*******************************************************************************/
{
  "goo" : {
    "adhesionVelocity"           : 1,
    "staticFrictionCoefficient"  : 0.73,
    "slidingFrictionCoefficient" : 0.58,
    "hydrodynamicFriction"        : 0.1,
    "stribeckVelocity"           : 3.0,
    "strength"                   : 1.0,
                
    "fluidDensity"               : 1200,
    "flowConsistencyIndex"       : 1000,
    "flowBehaviorIndex"         : 1.5,
    "dragAnisotropy"             : 0,
    "defaultDepth"               : 0.002,
    "collisiontype"              : "DIRT",
    "skidMarks"                  : false
    /*"aliases"                    : ["dirt", "rockydirt", "dirt_loose", "dirt_loose_dusty", "dirt_rocky", "dirt_rocky_large", "dirt_sandy"]*/
  },
}