{
<h1>Al's (text-style: "blur")[(text-rotate:5)[Unnofficial]] Guide to jBeam</h1>
* [[What is jbeam?]]
* [[jbeam Starter file]]
* [[jbeam syntax]]
* [[jbeam guide]]
}
<credit>//By Alwyn Owen (aljowen)
With Thanks to the BeamNG Wiki//</credit>
{
<h1>What is jbeam?</h1>
In BeamNG Vehicles consist of two main seperate components. The visual model and the Physics skeleton.
* jbeam (.jbeam) files are where you define the physics skeleton.
* Collada (.dae) files is the 3d model format of choice for BeamNG.
When playing BeamNG the physics skeleton is simulated (as seen by pressing 'k' on your keyboard) and the 3d model is then placed overtop of that. The game then anchors the 3d model to the physics skeleton, so if part of the skeleton moves, the game stretches the 3d model to match. The end result is the soft body physics that the players see in game.
}
//There are many other files involved in vehicle creation such as texture files and parts config files. But they are not critical to creating a mod, they just make it prettier and define the preset configurations for each model of vehicle.//
{
<h1>jbeam Starter file</h1>
This is an empty jbeam file that can be used as a template for your own projects.
}
<pre>
`{
"beamng": {
"information":{
"authors":"your name",
"name":"vehicle name",
}
"slotType" : "main",
"slots": [
["type", "default", "description"]
],
"refNodes":[
["ref:", "back:", "left:", "up:"]
],
"cameraExternal":{
"distance":4.5,
"distanceMin":4,
"offset":{"x":0, "y":0.0, "z":1.0},
"fov":65,
},
"camerasInternal":[
["x", "y", "z", "fov", "id1:", "id2:", "id3:", "id4:", "id5:", "id6:"],
{"nodeWeight":2},
{"selfCollision":false}
{"collision":false}
{"beamSpring":100000,"beamDamp":500},
],
"flexbodies": [
["mesh", "[group]:", "nonFlexMaterials"],
],
"nodes": [
["id", "posX", "posY", "posZ"],
{"collision":true}
{"frictionCoef":0.7},
{"nodeMaterial":"|NM_METAL"},
{"nodeWeight":6.5},
{"group":"chassis"},
{"group":""}
],
"beams": [
["id1:", "id2:"],
{"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1, "beamShortBound":1},
{"beamSpring":2000000,"beamDamp":400},
{"beamDeform":10000,"beamStrength":"FLT_MAX"},
],
"triangles": [
["id1:","id2:","id3:"],
],
}
}`
</pre>
{
<h1>Jbeam Syntax</h1>
* [[Nodes]]
* [[Beams]]
}
//Since this is a basics guide to jbeam this is not an exhaustive list. It is just the stuff you need to know to get started. For a fully comprehensive list of syntax head over to the official wiki:
[[http://wiki.beamng.com/Portal ]]
Credit for parts of Syntax defenitions goes to the wiki//
{
<h1>jbeam Guides</h1>
* [[Nodes|NodeGuide]]
* [[Beams|BeamGuide]]
}
<h1>Node Syntax</h1>
<pre>`
"nodes": [
["id", "posX", "posY", "posZ"],
{"collision":true}
{"frictionCoef":0.7},
{"nodeMaterial":"|NM_METAL"},
{"nodeWeight":6.5},
{"group":"chassis"},
["n0",0.0,-1.93,0.494],
["n1",0.0,-1.93,0.606],
{"group":""}
],
`</pre>
{
<h2>Which bit is the nodes?</h2>
The section shown below is an individual Node with headers above to show name of each section.
<pre>`
["id", "posX", "posY", "posZ"],
["n0",0.0,-1.93,0.494],
`</pre>
<syn>id</syn><type>String</type>
<desc>Node name, I would suggest Logically naming your nodes, for example you may want to call front bumper nodes "fb0" etc</desc>
<syn>PosX</syn><type>Float</type>
<desc>The X position of the node (-ve = left)</desc>
<syn>PosY</syn><type>Float</type>
<desc>The Y position of the node (-ve = forward)</desc>
<syn>PosZ</syn><type>Float</type>
<desc>The Z position of the node (-ve = down)</desc>
All nodes should be contained within square brackets and be seperated using comma's.
}
{
<h2>So what does that mean?</h2>
For full detail: <a href="http://wiki.beamng.com/JBeam_Reference#nodes">Wiki Link</a>
}
{
<syn>collision</syn><type>Boolean</type>
<desc>Sets whether Nodes can collide with the terrain and static objects.</desc>
<syn>frictionCoef</syn><type>Float</type>
<desc>Sets the level of friction when the Node is scraped along something.</desc>
<syn>nodeMaterial</syn><type>"|NM_RUBBER", "|NM_METAL", "|NM_PLASTIC", "|NM_GLASS"</type>
<desc>This sets the nodes material, it is used for particles, skidmarks and sounds.</desc>
<syn>nodeWeight</syn><type>Float</type>
<desc>Defines the weight of the Nodes (kg)</desc>
<syn>group</syn><type>String</type>
<desc>Used when assigning objects from the 3d model to the skeleton, for example the chassis model can be set to apply to all models in the chassis group.</desc>
}
[[Nodes Guide|NodeGuide]]
<h1>Beam Syntax</h1>
<pre>`
"beams": [
["id1:", "id2:"],
{"beamSpring":2000000,"beamDamp":400},
{"beamDeform":10000,"beamStrength":"FLT_MAX"},
{"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1, "beamShortBound":1},
["n0","n1"],
],
`</pre>
{
<h2>Which bit is the Beams?</h2>
The section shown below is an individual Beam with headers above to show the name of each section.
<pre>`
["id1:", "id2:"],
["n0","n1"],
`</pre>
<syn>id1</syn><type>String</type>
<desc>First Node that Beam joins to</desc>
<syn>id2</syn><type>String</type>
<desc>Second Node that Beam joins to</desc>
}
{
<h2>So what does that mean?</h2>
For full detail: <a href="http://wiki.beamng.com/JBeam_Reference#beams">Wiki link</a>
}
{
<syn>beamSpring</syn><type>Float</type>
<desc>Stiffness of Beam.How much a beam will change length when a force is applied (N/m).</desc>
<syn>beamDamp</syn><type>Float</type>
<desc>How much energy is dissipated as a beam changes length (N/m/s). Damping causes vibration in the beam to fade out over time.</desc>
<syn>beamDeform</syn><type>Float</type>
<desc>How much force the beam can resist before it deforms permanently (N).</desc>
<syn>beamStrength</syn><type>Float</type>
<desc>How much force the beam can resist before breaking (N).</desc>
<syn>beamPrecompression</syn><type>Float</type>
<desc>How much pressure should be applied to the Beam upon spawning. 1 is default, 2 would be double the length, 0.5 would be half.</desc>
<syn>BeamType</syn><type>|NORMAL, |HYDRO, |ANISOTROPIC, |BOUNDED, |PRESSURED, |SUPPORT, |BROKEN, |LBEAM</type>
<desc>Type of Beam. Default is |NORMAL</desc>
<syn>beamLongBound</syn><type>Float</type>
<desc>How far the beam can expand, beyond that Limit properties will be applied. 0.5 = 150% of length, 1.0 = 200%</desc>
<syn>beamShortBound</syn><type>Float</type>
<desc>How far the beam can contract, beyond that Limit properies will be applied. 0.5 = 50% of length, 1.0 =100% </desc>
}
[[Beams Guide|BeamGuide]]
{
<h1>Node Guide</h1>
//In BeamNG a physics skeleton is formed from Nodes and Beams.//
}
{
<h2>What is a Node?</h2>
* A Node is a single point in space that can collide with the terrain and static objects.
* A Node has mass.
* A Node has a group.
}
{
<h2>Node parameters?</h2>
The Node parameters are properties of Nodes that you can adjust. For example 'nodeWeight' which allows you to adjust how much Nodes weigh in KG.
Node parameters can be defined as many times as you like and only effects the nodes below it.
<pre>`
{"nodeWeight":7},
["n0",0.0,-1.93,0.494],
["n1",0.0,-1.93,0.606],
{"nodeWeight":2},
["n2",0.0,-1.93,0.494],
["n3",0.0,-1.93,0.606],
`</pre>So in the example above 'n0' and 'n1' would weigh 7kg and 'n2' and 'n3' would weigh 2kg. This is the same for all parameters.
}
[[Node Syntax|Nodes]]
{
<h1>Beam Guide</h1>
//In BeamNG a physics skeleton is formed from Nodes and Beams.//
}
{
<h2>What is a Beam?</h2>
* A Beam connects two nodes together
* A Beam has no mass.
* A Beam will not collide with anything
}
{
<h2>Beam parameters?</h2>
The Beam parameters are properties of Beams that you can adjust. For example 'BeamSpring' which allows you to adjust how stiff the Beam is.
beam parameters can be defined as many times as you like and only effects the Beams below it.
<pre>`
{"beamSpring":200000},
["n0","n1"],
["n1","n2"],
{"beamSpring":80000000},
["n2","n0"],
["n3","n0"],
`</pre>So in the example above the second two beams would be much stiffer than the first two beams.
}
{
<h2>So how do I make something with this?</h2>
Well, in order to create a Cube you would need to make 8 [[Nodes]], one for each corner of the cube. Then you would need to use Beams to connect each edge of the cube together.
}
<img src="images/Cube.png" width="256" height="256" alt="A cube">{
At this point if you were to try and run the cube in game it would simply collapse. This is because the Nodes act as hinges, in order to make the cube sturdy you would need to add cross braces to it. You could do this by connecting the opposite corners of each face together in order to make the cube more solid. As shown on one side of the image below.
}
<img src="images/cube cross copy.png" width="256" height="256" alt="A cube">
[[Beams Syntax|Beams]]