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

The Beams section has many optional arguments. We will divide them into categories, which will be sorted from most to least frequently used.

General

These are the most basic arguments, used everywhere in Jbeam files, necessary for correct simulation.

string
type
NORMAL
default
Beam type determines its behavior on compression and extension.

Possible values:

  • NORMAL - General use beams, don’t have any special properties, used in most structures.
  • SUPPORT - The second most used type of beams. These only resist forces in compression, not in extension. With precompression, they start resisting forces when reaching the precompressed length. They can automatically break when reaching a set length. Usually used when multiple parts are connected together - they don’t serve as attachments for those parts, but as limiters, preventing the nodes of one part to clip inside the surface of the other.
  • HYDRO - Defined in a separate section but sharing all normal beam properties, hydros can change length on demand, usually used for steering racks. They can also define the steering wheel lock angle of the car.
  • ANISOTROPIC - They have separate beamSpring and beamDamp values for expansion than for compression, can define transition zone between the two behavior variants, and can also automatically break when exceeding a certain length ratio. Used to simulate structures that are stiffer in expansion than in compression, such as tires (where they are automatically generated), ropes or soft tops.
  • BOUNDED - More complicated than anisotropic beams, these can have different beamSpring and beamDamp values not just for compression and extension, but also for low and high compression and extension speed. The contraction and expansion can be defined as a ratio or metric range, and the transition zone can be modified. They are computionally expensive to use and should usually only be used in suspension components such as dampers and bump stops.
  • LBEAM - Defined with 3 node IDs instead of 2, they resist angle change between 2 beams created between those nodes, rather than a distance between 2 nodes. They can provide high lateral stiffness with low compression resistance. They are used for tires (where they are auto generated) and leaf springs.
  • PRESSURED - Special beams used to simulate air cylinders. Their forces are inversely proportional to their real time length. You can set the starting pressure in Pa or PSI, maximum pressure above which the beam breaks, surface of the cylinder and its volume coefficient. Used in tires (auto generated) and progressive air springs.
  • BROKEN - Broken beams stop resisting forces. You cannot set this type by typing it in Jbeam.
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.

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.
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.

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.

Breakable

Used only on breakable beams, ones with beamStrength other than “FLT_MAX”. These kind of beams are used to simulate plastic, or to attach various components of a vehicle together.

string
type
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.

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.

Deformation limiters

Used to limit a beam’s deformation. DeformLimitExpansion is the most frequently used of these, used in most Jbeam files.

number
type
Limits by how much of original length the beam can deform in compression
number
type
deformLimit
default
Limits by how much of original length 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.

Deform groups

Deform groups are used to trigger an action when a beam deforms. Most often used only for visual glass/lights damage and powertrain damage.

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.

Precompression

These arguments define a length change of the beam on spawn. They are most often used in suspension components.

number
type
1.0
default
The length the beam will become as soon as it spawns
2.0 would be twice the length, 0.5 would be half the length.
number
type
Beam length change on spawn 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.

Drivetrain and suspension

Used only on certain suspension components and other critical vehicle parts.

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.

Suspension sounds

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.

Cargo

Used only on cargo loads.

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"},
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"},
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"},
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"},

Debug

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 either a string with the hex value of the color, or a table with RGB values. Example usage:

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

This will produce the same effect:

["a","b", {
    "highlight":{
        "radius":0.005,
        "col":{
            "r":255,
            "g":0,
            "b":0,
            "a":255
        }
    }
}],

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.2.0 contains 701506 entries in 9283 sections distributed over 16751 parts in 4473 jbeam files.

Last modified: 15/5/2024 14:44

Any further questions?

Join our discord
Our documentation is currently incomplete and undergoing active development. If you have any questions or feedback, please visit this forum thread.