Beams

Where BeamNG gets its name - beams.

These are the spring/damper connections between nodes, and serve to build the main structure of any vehicle in the game, allowing for deformation and breakages as required.

There are multiple types of beams for all sorts of purposes, which you can see in more detail in the various examples. Standard beams act as simple springs with damping, with the ability to deform and break if needed, and are used for most applications.

All arguments that apply to standard beams can be used with each of the specialised beam types.

Required arguments

string
type
Name of the first node
string
type
Name of the second node

Optional arguments

string
type
NORMAL
default
Sets the type of the beam.
Possible values: NORMAL, HYDRO, ANISOTROPIC, BOUNDED, PRESSURED, SUPPORT, BROKEN, LBEAM
number
type
4300000
default
Rigidity of the beam (N/m).

Force required to change the length of the beam by a set amount. Excessively high stiffness compared to node weight can cause the beam to vibrate and cause instability issues.

A beam with the beamSpring value of 0 will not be shown in the console as a duplicate. This allows for adding extra damping beams in the structure.

string
type
Function that defines the change of beamSpring based on the cargoGroup load in career mode delivery gameplay

Example usage:

{"beamSpringFunction":"=150*$load+1100","cargoGroup":"RoofbarTank1"},
number
type
580
default
Damping of the beam (N/m/s).
Damping causes oscillations to reduce over time. Excessively high damping compared to the node weight might cause pulsing stresses and instability.
string
type
Function that defines the change of beamDamp based on the cargoGroup load in career mode delivery gameplay

Example usage:

{"beamDampFunction":"=0.2*$load+50","cargoGroup":"RoofbarTank1"},
number
type
FLT_MAX
default
Strength of the beam. (N).

How much force the beam can resist before breaking.

A value of “FLT_MAX” will result in an unbreakable beam.

string
type
Function that defines the change of beamStrength based on the cargoGroup load in career mode delivery gameplay

Example usage:

{"beamStrengthFunction":"=150*$load+1100","cargoGroup":"RoofbarTank1"},
number
type
220000
default
How much force (N) is required to deform the beam permanently.
A value of “FLT_MAX” will result in a beam that can’t be permanently deformed.
string
type
Function that defines the change of beamDeform based on the cargoGroup load in career mode delivery gameplay

Example usage:

{"beamDeformFunction":"=150*$load+1100","cargoGroup":"RoofbarTank1"},
number
type
1.0
default
Precompression of the beam. The length it will become as soon as it spawns
2.0 would be twice the length, 0.5 would be half the length.
number
type
Precompression length change in meters

Overrides beamPrecompression.

A value of 0.2 would cause the beam to lengten by 0.2 meters on spawn, while a value of -0.2 would cause the beam to shorten by 0.2 meters on spawn.

number
type
Time in seconds for precompressed beams to reach their requested length
Helps avoid deformation on spawn from precompressed beams violently going to their desired length.
string
type
The breakGroup of this beam
A beam gets automatically broken when another beam from the same breakGroup breaks.
number
type
Sets breakgroup behavior
If set to 0, this beam will break others in the breakGroup. if set to 1, this beam will NOT break others in the breakGroup, but will be broken by the group.
boolean
type
false
default
Disables mesh breaking

Mesh breaking allows polygons of a flexbody mesh to be dynamically removed when an underlying beam breaks. This can be used to avoid excessive stretching of meshes when part of its assigned jbeam structure breaks free.

Disabling mesh breaking is useful when the breakable beam only acts as a structural support, for example in passenger cabins.

boolean
type
false
default
Disables triangle breaking

Triangle breaking allows the vehicle’s triangles to be dynamically transitioned to a state without collision and aero when an underlying beam breaks. This is used when a triangle connects 2 components that can break apart, such as a vehicle body and frame, and in case of breakable glass, in order to dynamically make a physical hole in it.

Disabling triangle breaking is useful when the breakable beam only acts as a structural support, for example in passenger cabins.

string
type
Name of the beam
Used by some systems to identify the specific beam to use.
number
type
Limits the vibration frequency above which damping applies

Only applies to normal, bounded, and l-beams.

Used mostly with suspension components and other critical parts of the jbeam to help run higher damping before instability kicks in.

Expensive to run, should only be used where needed.

number
type
Limits how much the beam can deform in compression
number
type
Limits how much the beam can deform in expansion
Used to avoid excessive stretching.
number
type
Limits the beamDeform gain to this value (N)
beamDeform increases as the beam deforms, this property caps the deformation. Useful to simulate friction on certain kinds of suspension.
boolean
type
false
default
Deactivates errors when one of the beam’s node is missing

This is used for cases where one of the nodes that make up the beam is located in an optional component.

It will also hide warnings related to duplicate beams.

string
type
Identifies which deform group this beam is part of.

Used to trigger flexbody deform groups. Is also used for damage simulation on some powertrain components.

A beam with a deformGroup will not be treated as a duplicate beam by the console. This is due to a common case of using brittle duplicate beams to simulate breakable glass.

number
type
Level of deformation above which the deformGroup is triggered.

Typical values are very small numbers under 0.1. If the beam is shortened or lengthened by more than that amount, the deformGroup will be triggered.

The existence of this property on a beam will create a deform trigger for the beam, causing extra code to be executed whenever any beam with this property is deformed. This can be performance intensive, so it should only be used where it’s needed.

Suspension sound arguments

These arguments are used on beams that work the roles of struts or shock absorbers in a vehicle. They should all be used together in line only on those beams.

string
type
the FMOD event to play on beam compression.
The list of all usable event paths can be found in the World Editor: Window > Audio > SFX Previewer.
number
type
0.5
default
Reduces the overall FMOD event volume by up to 10dB.
The value of 0 will reduce the sound volume by 10dB, 1 will keep the original volume.
number
type
10
default
Sets the envelope attack factor of the sound.
Sets the time it takes for the sound amplitude to rise from 0% to 100%. The smaller the value the slower the attack.
number
type
1
default
Sets the relationship between the beam compression and sound volume.
0 would mean the maximum volume is reached at 0% compression, and 1 at 100%. Since shock beams don’t compress all the way due to part of them acting as bump stops, a good value could be around 0.8.
number
type
10
default
Sets the envelope decay/release factors of the sound.
Sets the time it takes for the sound amplitude to fall from 100% to 0%. The higher the number, the quicker the decay/release of the sound.
number
type
0
default
Impulse-based pitch bend factor.
The higher the number, the more pitch bend within the impulse.
number
type
35000
default
The beam stress value treated as full compression by the sound system.
Used for normalising purposes. You should approach this value from the physical point of view rather than sound engineering. The volumeFactor should still cover the full expected compression range.

Debug arguments

These are for short term debug purposes and should be removed in the final version of the structure.

dictionary
type
{“radius”:0,“col”:“00000000”}
default
Highlights the beam with the provided radius and color when the beam visualization debug mode is turned on.

The table consists of 2 elements: “radius” is a number that sets the highlight radius in meters and “col” is a string with the hex value of the color. Example usage:

["a","b", {"highlight":{"radius":0.005,"col":"ff0000ff"}}],

Simple Example

A beam between nodes a and b

"beams": [
        ["id1:", "id2:"],
        ["a","b"],
]

Advanced Example

Example of a typical beam section, which begins by initializing all the properties that will be used for the following beams.

{
    "beams": [
          ["id1:", "id2:"],
          //--BODYWORK--
          //roof main shape lengthwise
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1, "beamShortBound":1},
          {"beamSpring":1401000,"beamDamp":140},
          {"beamDeform":32700,"beamStrength":"FLT_MAX"},
          {"deformLimitExpansion":1.1},
          ["rf1r","rf2r"],
          ["rf1","rf2"],
          ["rf1l","rf2l"],
          ["rf2r","rf3r"],
          ["rf2","rf3"],
          ["rf2l","rf3l"],
          ["rf3r","rf4r"],
          ["rf3","rf4"],
          ["rf3l","rf4l"],
    ]
}

0.32.0.0 contains 699896 entries in 9248 sections distributed over 16714 parts in 4451 jbeam files.

Last modified: 16/4/2024 14:55

Any further questions?

Join our discord