This document describes BeamNG datablock JSON files.
Datablocks are reusable engine data definitions. They are used by many systems to describe shared resources such as particles, emitters, precipitation, light flares, light animations, sounds, ambience, decals, and other reusable engine objects.
A datablock is not usually a visible level object by itself. Instead, it is a named definition that other objects, systems, or gameplay code can reference.
A datablock JSON file is a JSON object where each top-level key defines one datablock.
Example:
{
"exampleData": {
"name": "exampleData",
"class": "SomeDatablockClass"
}
}
Each datablock entry usually contains:
| Field | Description |
|---|---|
name |
Datablock object name. Usually matches the JSON key. |
class |
Datablock class/type. |
| class-specific fields | Settings used by that datablock type. |
The top-level key and the name field should normally match.
Modern datablock files usually use the suffix:
*.datablocks.json
Examples:
art/datablocks/lights.datablocks.json
art/datablocks/sounds.datablocks.json
art/datablocks/audioProfiles.datablocks.json
art/datablocks/managedDatablocks.datablocks.json
Some managed datablock files use tool-specific names:
art/shapes/particles/managedParticleData.json
art/shapes/particles/managedParticleEmitterData.json
Level-specific datablocks may also exist inside level folders:
levels/<levelName>/datablocks/custom.datablocks.json
During level loading, core datablocks are loaded before level objects. This allows scene objects and systems to reference datablocks by name.
Typical core files include:
art/shapes/particles/managedParticleData.json
art/shapes/particles/managedParticleEmitterData.json
art/datablocks/audioProfiles.datablocks.json
art/datablocks/sounds.datablocks.json
art/datablocks/player.datablocks.json
art/datablocks/datablockExec.datablocks.json
art/datablocks/lights.datablocks.json
art/datablocks/managedDatablocks.datablocks.json
When loading a level, the engine also searches the level folder for files matching patterns such as:
*.datablocks.json
*Data.json
These are loaded before level scene objects are created.
Older content may define datablocks in TorqueScript .cs files.
Examples:
datablockExec.cs
The engine still supports some legacy .cs datablock loading paths, but new content should use JSON datablock files.
A datablock file contains named entries:
{
"datablockName": {
"name": "datablockName",
"class": "SomeDatablockClass",
"fieldA": 1,
"fieldB": "value"
}
}
Minimal example:
{
"TurretFireSound": {
"name": "TurretFireSound",
"class": "SFXProfile",
"description": "AudioMaster",
"filename": "art/sound/turret_firing.wav",
"preload": true
}
}
Common datablock classes include:
| Class | Purpose |
|---|---|
ParticleData |
Defines individual particle appearance and behavior. |
ParticleEmitterData |
Defines particle emission behavior. |
ParticleEmitterNodeData |
Defines particle emitter node settings. |
PrecipitationData |
Defines precipitation textures. |
LightFlareData |
Defines lens flare/light flare elements. |
LightAnimData |
Defines animated light brightness, offset, or rotation behavior. |
SFXProfile |
Defines a reusable sound event/file profile. |
SFXAmbience |
Defines ambience or audio snapshot data. |
Class-specific fields are documented separately.
Datablocks often reference each other by name.
Example:
{
"exampleEmitter": {
"name": "exampleEmitter",
"class": "ParticleEmitterData",
"particles": "exampleParticle"
}
}
Here, exampleEmitter references a ParticleData datablock named exampleParticle.
If the referenced datablock is missing, the effect may fail or use fallback behavior.
Many datablocks reference texture or audio assets.
Examples:
"textureName": "art/shapes/particles/steam.png"
"flareTexture": "core/art/special/lensFlareSheet0.color.png"
"dropTexture": "art/shapes/particles/Particle_rain_drop.dds"
"filename": "art/sound/turret_firing.wav"
"fileName": "event:>UI>Missions>Countdown_Go"
Use valid paths and make sure referenced files are included in the mod or level.
fileName, while others may use filename. Use existing game content or class-specific documentation as reference.Some saved datablocks contain:
"persistentId": "c98465df-dd27-48d0-b855-3f5267b18400"
Persistent IDs are editor/engine identifiers used for object persistence.
When manually creating datablocks, avoid copying the same persistentId to another unrelated datablock.
persistentId values between datablocks. If manually creating new datablocks, omit the field and let the editor generate it.Saved datablock files may contain null values or empty placeholder entries.
Example:
{
"elementDist": null,
"elementRect": null,
"elementScale": null
}
or:
{}
These usually represent unused array slots or default values written by the editor. Tools can generally ignore unused placeholder entries unless the specific datablock class requires them.
Datablocks can be created and managed by editor tools.
When a datablock is created:
The editor tracks dirty datablocks and can save only modified objects.
If no custom filename is provided, editor-created datablocks may be saved to a managed file such as:
art/datablocks/managedDatablocks.json
or a class/tool-specific managed file.
For organized content, prefer saving related datablocks into clearly named files.
Example:
levels/example/datablocks/traffic_lights.datablocks.json
levels/example/datablocks/weather_effects.datablocks.json
levels/example/datablocks/custom_sounds.datablocks.json
{
"exampleSound": {
"name": "exampleSound",
"class": "SFXProfile",
"description": "AudioDefault3D",
"fileName": "art/sound/example.ogg"
},
"exampleFlare": {
"name": "exampleFlare",
"class": "LightFlareData",
"flareTexture": "core/art/special/lensFlareSheet0.color.png",
"overallScale": 1
}
}
name field consistent.persistentId values between unrelated datablocks.Possible causes:
name.Possible causes:
Possible causes:
Only one object should use a given datablock name. Rename one of them and update references.
Remove duplicated persistentId fields and let the editor regenerate them.
Datablock JSON files store reusable engine data definitions.
They can define particles, emitters, precipitation, light flares, light animations, sounds, ambience, decals, and other shared resources.
Modern datablocks should be stored in JSON files such as:
*.datablocks.json
or tool-specific managed JSON files.
Level objects and gameplay systems reference datablocks by name.
Was this article helpful?