{
"v90_engine_i4_2.0_diesel_D3_D3": {
    "information":{
        "authors":"BeamNG",
        "name":"2.0L I4 D3 Diesel Engine",
        "value":5600,
    },
    "slotType": "big_engines",
    "slots": [
        ["type", "default", "description"],
        ["v90_enginemounts","v90_enginemounts", "Engine Mounts", {"coreSlot":true}],
        ["v90_oilpan_i4","v90_oilpan_i4", "Oil Pan", {"coreSlot":true}],
        ["v90_intake_i4_2.0_diesel_d3","v90_intake_i4_2.0_diesel_d3_turbo", "Intake", {"coreSlot":true}],
        ["v90_exhaust_i4_2.0_diesel","v90_exhaust_i4_2.0_diesel", "Exhaust"],
        ["v90_engine_i4_2.0_diesel_D3_ecu","v90_engine_i4_2.0_diesel_D3_ecu_150", "Engine Management", {"coreSlot":true}],
        ["n2o_system","", "Nitrous Oxide System"],
        ["v90_engine_i4_2.0_diesel_D3_internals","v90_engine_i4_2.0_diesel_D3_internals", "Engine Long Block", {"coreSlot":true}],
        ["v90_transmission","v90_transmission_6M", "Transmission"],
    ],
    "powertrain": [
        ["type", "name", "inputName", "inputIndex"],
        ["combustionEngine", "mainEngine", "dummy", 0],
    ],
    "mainEngine": {
        "torque":[
            ["rpm", "torque"],
            [0,      0],
            [350,   105],
            [600,  152],
            [1000, 158],
            [1750, 172],
            [2000, 179.5],
            [2500, 188.5],
            [3000, 186],
            [4000, 173],
            [4500, 168],
            [5000, 160],
            [6000, 142],
        ],

        "idleRPM":800,
        //max capable
        "maxRPM":5500,
        "inertia":0.18,
        "friction":16,
        "dynamicFriction":0.0239,
        "engineBrakeTorque":26,
        //"burnEfficiency":0.49,
        "burnEfficiency":[
            [0, 0.2],
            [0.05, 0.38],
            [0.4, 0.46],
            [0.7, 0.49],
            [1, 0.3],
        ],
        //fuel system
        "energyStorage": "mainTank",
        "requiredEnergyType":"diesel",

        //exhaust
        "instantAfterFireSound": "event:>Vehicle>Afterfire>01_Single_EQ1",
        "sustainedAfterFireSound": "event:>Vehicle>Afterfire>01_Multi_EQ1",
        "shiftAfterFireSound": "event:>Vehicle>Afterfire>01_Shift_EQ1",
        "particulates":0.015
        "instantAfterFireCoef": 0,
        "sustainedAfterFireCoef": 0,

        //cooling and oil system
        "thermalsEnabled":true,
        "engineBlockMaterial":"aluminum",
        "engineBlockAirCoolingEfficiency":28,

        //engine durability
        "cylinderWallTemperatureDamageThreshold":150,
        "headGasketDamageThreshold":1500000,
        "pistonRingDamageThreshold":1500000,
        "connectingRodDamageThreshold":2000000,
        "maxTorqueRating": 550,
        "maxOverTorqueDamage": 500,

        //node beam interface
        "torqueReactionNodes:":["e3r","e4r","e2l"],
        "waterDamage": {"[engineGroup]:":["engine_intake"]},
        "radiator": {"[engineGroup]:":["radiator"]},
        "engineBlock": {"[engineGroup]:":["engine_block"]},
        "breakTriggerBeam":"engine",
        "uiName":"Engine",
        "soundConfig": "soundConfig",
        "soundConfigExhaust": "soundConfigExhaust",

        //starter motor
        "starterSample":"event:>Engine>Starter>i4diesel_1990_eng",
        "starterSampleExhaust":"event:>Engine>Starter>i4diesel_1990_exh",
        "shutOffSampleEngine":"event:>Engine>Shutoff>i4diesel_1990_eng",
        "shutOffSampleExhaust":"event:>Engine>Shutoff>i4diesel_1990_exh",
        "starterVolume":0.76,
        "starterVolumeExhaust":0.76,
        "shutOffVolumeEngine":0.76,
        "shutOffVolumeExhaust":0.76,
        "idleRPMStartRate":1.5,
        "idleRPMStartCoef":1.0,

        //engine deform groups
        "deformGroups":["mainEngine", "mainEngine_intake", "mainEngine_accessories"]
    },
    "soundConfig": {
        "sampleName": "I4D_engine",
        "intakeMuffling": 1,

        "mainGain": -10,
        "onLoadGain":1.0,
        "offLoadGain":0.63,

        "maxLoadMix": 0.8,
        "minLoadMix": 0,

        "lowShelfGain":3,
        "lowShelfFreq":320,

        "highShelfGain":6,
        "highShelfFreq":3500,

        "eqLowGain": -8,
        "eqLowFreq": 1000,
        "eqLowWidth": 0.1,

        "eqHighGain": 0,
        "eqHighFreq": 6000,
        "eqHighWidth": 0.1,

        "fundamentalFrequencyCylinderCount":4
        "eqFundamentalGain": 2,
    },
    "soundConfigExhaust": {
        "sampleName": "I4D_exhaust",

        "mainGain": -6
        "onLoadGain":1.0,
        "offLoadGain":0.45,

        "maxLoadMix": 0.8
        "minLoadMix": 0,

        "lowShelfGain":-10,
        "lowShelfFreq":100,

        "highShelfGain":4,
        "highShelfFreq":3500,

        "eqLowGain": -5,
        "eqLowFreq": 350,
        "eqLowWidth": 0.1,

        "eqHighGain": 0,
        "eqHighFreq": 1800,
        "eqHighWidth": 0.1,

        "fundamentalFrequencyCylinderCount":4,
        "eqFundamentalGain": 2,
    },
    "vehicleController": {
        "clutchLaunchStartRPM":1200,
        "clutchLaunchTargetRPM":1500,
        //**highShiftDown can be overwritten by automatic transmissions**
        "highShiftDownRPM":[0,0,0,2400,2900,3200,3600,3600],
        //**highShiftUp can be overwritten by intake modifications**
        "highShiftUpRPM":5200,
    },
    "flexbodies": [
        ["mesh", "[group]:", "nonFlexMaterials"],
        ["v90800_engbaycrap", ["v90800_body"]],
        ["v90c_engbaycrap", ["v90c_body"],[]{"pos":{"x":0,"y":-0.11,"z":0.03}}],
        ["v90_engine_i4", ["v90_engine","v90_transmission"],[]{"pos":{"x":0,"y":0,"z":0}}],
        {"deformGroup":"radtube_break", "deformMaterialBase":"v90800", "deformMaterialDamaged":"invis"},
        ["v90_radtube_i4", ["v90_radiator","v90_engine"],[]{"pos":{"x":0,"y":0,"z":0}}],
        {"deformGroup":""},
    ],
    "nodes": [
         ["id", "posX", "posY", "posZ"],
         //--2.0L I4 Engine--
         {"selfCollision":false},
         {"collision":true},
         {"nodeMaterial":"|NM_METAL"},
         {"frictionCoef":0.5},
         {"group":"v90_engine"},
         {"nodeWeight":21},
         {"engineGroup":"engine_block"},
         {"chemEnergy":2000,"burnRate":0.39,"flashPoint":800,"specHeat": 0.1,"selfIgnitionCoef":false,"smokePoint":650,"baseTemp":"thermals","conductionRadius":0.13},
         ["e1r", -0.05, -0.97, 0.26],
         ["e1l", 0.16, -0.97, 0.26],
         ["e2r", -0.05, -1.56, 0.35],
         ["e2l", 0.16, -1.56, 0.35],
         {"chemEnergy":false,"burnRate":false,"flashPoint":false, "specHeat": false,"selfIgnitionCoef":false,"smokePoint":false,"baseTemp":false,"conductionRadius":false},
         {"engineGroup":["engine_block","engine_intake"]},
         ["e3r", -0.26, -0.97, 0.85],
         ["e3l", 0.08, -0.97, 0.85],
         ["e4r", -0.26, -1.56, 0.85, {"isExhaust":"mainEngine"}],
         ["e4l", 0.08, -1.56, 0.85],
         {"group":""},
         {"engineGroup":""},
         //engine mount nodes
         ["em1r", -0.27, -1.45, 0.52, {"nodeWeight":2}],
         ["em1l", 0.27, -1.45, 0.52, {"nodeWeight":2}],
    ],
    "beams": [
          ["id1:", "id2:"],
          {"beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"beamSpring":20001000,"beamDamp":500},
          {"beamDeform":250000,"beamStrength":"FLT_MAX"},
          //engine
          {"deformGroup":"mainEngine", "deformationTriggerRatio":0.001}
          ["e1r","e1l"],
          ["e2r","e2l"],
          ["e3r","e3l"],
          ["e4r","e4l"],

          ["e1r","e2r"],
          ["e1l","e2l"],
          ["e3r","e4r"],
          ["e3l","e4l"],

          ["e1r","e3r"],
          ["e1l","e3l"],
          ["e2r","e4r"],
          ["e2l","e4l"],

          ["e2r","e3r"],
          ["e2l","e3l"],
          ["e2r","e3l"],
          ["e2l","e3r"],

          ["e1r","e4r"],
          ["e1l","e4l"],
          ["e1r","e4l"],
          ["e1l","e4r"],

          ["e1r","e2l"],
          ["e1l","e2r"],
          ["e3r","e4l"],
          ["e3l","e4r"],

          ["e1r","e3l"],
          ["e1l","e3r"],
          ["e2r","e4l"],
          ["e2l","e4r"],
          {"deformGroup":""}
          {"breakGroup":""},

          //radhose and intake breaking beams
          {"beamSpring":4000,"beamDamp":40},
          {"beamDeform":2000,"beamStrength":2000},
          {"deformGroup":"radtube_break","deformationTriggerRatio":0.01},
          ["f15", "e4l"],
          ["f15r", "e4l"],
          ["f15r", "e4r"],
          //["f11", "e2l"],
          ["f11rr", "e2l"],
          ["f11rr", "e2r"],
          {"deformGroup":""},

          //engine mount nodes
          {"beamSpring":3400000,"beamDamp":150},
          {"beamDeform":90000,"beamStrength":"FLT_MAX"},
          ["em1r","e3l"],
          ["em1r","e3r"],
          ["em1r","e4l"],
          ["em1r","e4r"],
          ["em1r", "e1r"],
          ["em1r", "e1l"],
          ["em1r", "e2l"],
          ["em1r", "e2r"],

          ["em1l","e3l"],
          ["em1l","e3r"],
          ["em1l","e4l"],
          ["em1l","e4r"],
          ["em1l", "e1r"],
          ["em1l", "e1l"],
          ["em1l", "e2l"],
          ["em1l", "e2r"],
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
    ],
},
"v90_engine_i4_2.0_diesel_D3_internals": {
    "information":{
        "authors":"BeamNG",
        "name":"Stock Long Block",
        "value":1200,
    },
    "slotType" : "v90_engine_i4_2.0_diesel_D3_internals",
    "mainEngine":{
    },
},
"v90_engine_i4_2.0_diesel_D3_internals_heavy": {
    "information":{
        "authors":"BeamNG",
        "name":"Heavy Duty Long Block",
        "value":3400,
    },
    "slotType" : "v90_engine_i4_2.0_diesel_D3_internals",
    "mainEngine":{
        //max rpm physically capable of
        "$+maxRPM":250,
        "$*friction":1.2,
        "$*dynamicFriction":1.1,
        "$*inertia":1.3,
        "$*engineBrakeTorque":1.15,
        //engine durability
        "cylinderWallTemperatureDamageThreshold":175,
        "headGasketDamageThreshold":1700000,
        "pistonRingDamageThreshold":1700000,
        "connectingRodDamageThreshold":2200000,
        "$*maxTorqueRating": 1.5,
        "$*maxOverTorqueDamage": 2.5,
    },
},
"v90_intake_i4_2.0_diesel_d3_turbo": {
    "information":{
        "authors":"BeamNG",
        "name":"Stock D3 Turbocharger",
        "value":1600,
    },
    "slotType": "v90_intake_i4_2.0_diesel_d3",
    "turbocharger": {
        "bovEnabled":false,
        "hissLoopEvent":"event:>Vehicle>Forced_Induction>Turbo_01>turbo_hiss",
        "whineLoopEvent":"event:>Vehicle>Forced_Induction>Turbo>Spin>turbo_spin_15",
        "turboSizeCoef": 0.0,
        "bovSoundVolumeCoef": 0.0,
        "hissVolumePerPSI": 0.015,
        "whineVolumePer10kRPM": 0.005,
        "whinePitchPer10kRPM": 0.045,
        "wastegateStart":17.5,
        "maxExhaustPower": 4000,
        "backPressureCoef": 0.0000005,
        "pressureRatePSI": 25,
        "frictionCoef": 15.5,
        "inertia":0.50,
        "damageThresholdTemperature": 610,
        "pressurePSI":[
            //turbineRPM, pressure(PSI)
            [0,         -3.5],
            [24000,     -1.5],
            [60000,     22],
            [90000,     30],
            [150000,    34],
            [200000,    39],
            [250000,    45],
        ],
        "engineDef":[
            //engineRPM, efficiency, exhaustFactor
            [0,     0.0,    0.1],
            [650,   0.55,   0.3],
            [1000,   0.95,   0.4],
            [1500,  1.0,    0.8],
            [2000,  0.92,    0.8],
            [2500,  0.85,    1.0],
            [3000,  0.9,    1.0],
            [3500,  0.9,    1.0],
            [4000,  0.83,    1.0],
            [4500,  0.65,    1.0],
            [5000,  0.45,    1.0],
            [6000,  0.3,    1.0],
        ],
    },
    "mainEngine": {
        //turbocharger name
        "turbocharger":"turbocharger",

        //turbocharger deform groups
        "deformGroups_turbo":["mainEngine_turbo","mainEngine_intercooler","mainEngine_piping"]
    },
    "flexbodies": [
        ["mesh", "[group]:", "nonFlexMaterials"],
        ["v90_header_i4_turbo", ["v90_engine", "v90_header"],[]{"pos":{"x":0,"y":0,"z":0}}],
        ["v90_intake_i4_turbo", ["v90_engine","v90_radiator"],[]{"pos":{"x":0,"y":0,"z":0}}],
        {"deformGroup":"mainEngine_piping", "deformMaterialBase":"v90800", "deformMaterialDamaged":"invis"},
        ["v90_icpipe_t_i4", ["v90_engine","v90_radiator"],[]{"pos":{"x":0,"y":0,"z":0}}],
        ["v90_icpipe_i_i4", ["v90_engine","v90_radiator"],[]{"pos":{"x":0,"y":0,"z":0}}],
        {"deformGroup":""},
        ["v90_intercooler", ["v90_intercooler", "v90_radiator"],[]{"pos":{"x":0,"y":0,"z":0}}],
    ],
    "nodes": [
         ["id", "posX", "posY", "posZ"],
         {"selfCollision":false},
         {"collision":true},
         {"frictionCoef":0.5},
         {"nodeMaterial":"|NM_METAL"},

         //turbo
         {"nodeWeight":4.5},
         {"group":"v90_turbo"},
         ["turbo", -0.2, -1.3, 0.52],

         //exhaust manifold
         {"group":"v90_header"},
         ["exm1r", -0.2, -0.9, 0.27],

         //intercooler
         {"nodeWeight":2.5},
         {"group":"v90_intercooler"},
         ["interc1r", -0.3, -2.1, 0.32],
         ["interc1l", 0.3, -2.1, 0.32],

         //airbox
         {"nodeWeight":1.0},
         {"group":"v90_airbox"},
         {"nodeMaterial":"|NM_PLASTIC"},
         ["airb1", 0.35, -1.75, 0.8],
         ["airb2", -0.35, -1.9, 0.76],
         {"engineGroup":""},
         {"group":""},
    ],
    "beams": [
          ["id1:", "id2:"],
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},

          //turbo
          {"beamSpring":2750550,"beamDamp":125},
          {"beamDeform":30000,"beamStrength":"FLT_MAX"},
          {"deformLimitExpansion":""},
          {"deformGroup":"mainEngine_turbo", "deformationTriggerRatio":0.001}
          ["turbo", "e1r"],
          ["turbo", "e1l"],
          ["turbo", "e2r"],
          ["turbo", "e2l"],
          ["turbo", "e3r"],
          ["turbo", "e3l"],
          ["turbo", "e4l"],
          ["turbo", "e4r", {"isExhaust":"mainEngine"}],

          //exhaust manifold
          {"beamSpring":2750550,"beamDamp":125},
          {"beamDeform":30000,"beamStrength":"FLT_MAX"},
          ["exm1r", "e1r"],
          ["exm1r", "e1l"],
          ["exm1r", "e2r"],
          ["exm1r", "e2l"],
          ["exm1r", "e3r"],
          ["exm1r", "e3l"],
          ["exm1r", "e4r"],
          ["exm1r", "e4l"],
          ["exm1r", "turbo", {"isExhaust":"mainEngine"}],

          //intercooler
          {"beamSpring":1001000,"beamDamp":100},
          {"beamDeform":5000,"beamStrength":"FLT_MAX"},
          {"deformGroup":"mainEngine_intercooler", "deformationTriggerRatio":0.1}
          {"deformLimitExpansion":1.5},
          ["interc1r", "interc1l"],
          ["interc1l", "f18l"],
          ["interc1l", "f11ll"],
          ["interc1l", "f13ll"],
          ["interc1l", "f18"],
          ["interc1l", "f15"],
          ["interc1r", "f11rr"],
          ["interc1r", "f18r"],
          ["interc1r", "f18"],
          ["interc1r", "f13rr"],
          ["interc1r", "f15"],
          ["interc1r", "f10rr"],
          ["interc1l", "f10ll"],
          {"deformLimitExpansion":""},

          //intercooler piping
          {"beamSpring":501000,"beamDamp":400},
          {"beamDeform":5000,"beamStrength":15000},
          {"deformGroup":"mainEngine_piping", "deformationTriggerRatio":0.01}
          ["interc1l", "e2l"],
          ["interc1l", "e4l"],
          ["interc1l", "e2r"],
          ["interc1l", "e4r"],
          ["interc1l", "e2l"],
          ["interc1l", "e4l"],
          ["interc1l", "e2r"],
          ["interc1l", "e4r"],
          ["interc1r", "turbo"],
          ["interc1l", "turbo"],
          ["interc1l", "airb1"],
          ["interc1r", "airb1"],
          {"deformGroup":""}

          //airbox
          {"beamSpring":101000,"beamDamp":300},
          {"beamDeform":3000,"beamStrength":25000},
          {"deformGroup":"mainEngine_intake", "deformationTriggerRatio":0.01}
          ["airb1", "e3r"],
          ["airb1", "e3l"],
          ["airb1", "e4r"],
          ["airb1", "e4l"],
          ["airb1", "e2l"],
          ["airb1", "e2r"],
          ["airb2", "e3r"],
          ["airb2", "e3l"],
          ["airb2", "e4r"],
          ["airb2", "e4l"],
          ["airb2", "e2l"],
          ["airb2", "e2r"],
          ["airb2", "airb1"],
          {"deformGroup":""}

          //attach to body
          {"beamDeform":2000,"beamStrength":15000},
          ["airb2", "f13rr"],
          ["airb2", "f15r"],
          ["airb2", "f15"],
          ["airb2", "f11rr"],
          ["airb2", "f15rr"],

          ["airb1", "f12ll"],
          ["airb1", "f15ll"],
          ["airb1", "f13ll"],
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
    ],
},
}