1. Stuck, Having problems with creating your mod? Let us help you: Mod Support

[TUTORIAL] Basic engine explaination.

Discussion in 'Programming' started by Cheekqo™, Oct 26, 2017.

  1. Cheekqo™

    Cheekqo™
    Expand Collapse

    Joined:
    Feb 6, 2016
    Messages:
    1,360
    Hi.
    Today we will have a look at an engine folder to understand the basics.
    First, we need to take a look at an engine jbeam, lets take the Covet's jbeam as an example.
    Code:
    },
    "hatch_turbo_stage3": {
        "information":{
            "authors":"BeamNG",
            "name":"Stage 3 Variable Boost Turbocharger",
            "value":2700,
        },
    
        "slotType" : "hatch_intake",
    
        "variables": [
            ["name", "type", "unit", "category", "default", "min", "max", "title", "description"]
            ["$wastegateStart", "range", "psi", "Turbocharger", 6, 4, 24, "Wastegate Start", "Pressure at which the wastegate begins to open"{"stepDis":0.5}]
            ["$wastegateLimit", "range", "psi", "Turbocharger", 8, 6, 26, "Wastegate Limit", "Pressure at which the wastegate is fully opened"{"stepDis":0.5}]
        ],
        "turbocharger": {
            "volumePer10kRPM":0.07
            "wastegateStart":"$wastegateStart",
            "wastegateLimit":"$wastegateLimit",
            "maxExhaustPower": 8000,
            "backPressureCoef": 0.000035,
            "frictionCoef": 35.3,
            "inertia":2.5,
            "damageThresholdTemperature": 730,
            "pressurePSI":[
                //turbineRPM, pressure(PSI)
                [0,         -4.5],
                [30000,     -1.5],
                [60000,     6],
                [90000,     13],
                [150000,    21],
                [200000,    25],
                [250000,    29],
            ],
            "engineDef":[
                //engineRPM, efficiency, exhaustFactor
                [0,     0.0,    0.0],
                [650,   0.25,   0.15],
                [1400,  0.35,   0.23],
                [2000,  0.42,    0.29],
                [2500,  0.58,    0.41],
                [3000,  0.73,    0.61],
                [4000,  0.88,    0.77],
                [5000,  1.03,    0.87],
                [6000,  1.11,    0.93],
                [7000,  1.02,    1.00],
                [8000,  0.93,    0.95],
                [9000,  0.73,    0.91],
    
            ],
        },
        "mainEngine": {
            "idleRPM":1100,
            "maxRPM":8000,
            "burnEfficiency":0.24,
            //engine durability
            "cylinderWallTemperatureDamageThreshold":180
            //turbocharger name
            "turbocharger":"turbocharger",
        },
        "vehicleController": {
            "clutchLaunchStartRPM":1800,
            "clutchLaunchTargetRPM":2400,
            "highShiftUpRPM":7800
            "revMatchThrottle":0.35,
    The actual engine jbeam way too long and complicated to understand, so we will revert to this.
    This short explanation will show which parts work in the basic overhauls of an engine.
    The name "hatch_turbo_stage3" is what tells you its the file, as in the basics, the part name is as easy as it sounds.
    The ""information"" part is what tells the game that what is below is the information that you see while actually playing the game.
    The ""authors":"BeamNG" Is the sidenote of when the game tells you what the authors are of the content, if its "BeamNG" as you are seeing right now then it is the developer's own content, however, if its for say an example like this it will be a mod:
    Code:
    },
    
    "hatch_turbo_stage3": {
    
        "information":{
    
            "authors":"Insert Mod Authors here",
    
            "name":"Stage 3 Variable Boost Turbocharger",
    
            "value":2700,
    
        },
    The "name:" is what the creation is actually seen as in game, in this its "Stage 3 Turbocharger" but if it were your own mod then it'd be "Insert Own Mod Name Here"
    The "Value" is just what the ingame currency would be, as gabester said its basically a little feature for when the game will develop its own currency worth.
    The wastegate is, to you car people, is the thing which 'closes and opens' the turbo, having higher or lower wastegate levels is somewhere in the between of changing when the wastegate closes and opens, and the adjustment range for the wastegate.
    To see all of what is below, please check the wiki as I am not sure.
    Code:
     "maxExhaustPower": 8000,
    
            "backPressureCoef": 0.000035,
    
            "frictionCoef": 35.3,
    
            "inertia":2.5,
    
            "damageThresholdTemperature": 730,
    
            "pressurePSI":[
    
                //turbineRPM, pressure(PSI)
    
                [0,         -4.5],
    
                [30000,     -1.5],
    
                [60000,     6],
    
                [90000,     13],
    
                [150000,    21],
    
                [200000,    25],
    
                [250000,    29],
    
            ],
    
            "engineDef":[
    
                //engineRPM, efficiency, exhaustFactor
    
                [0,     0.0,    0.0],
    
                [650,   0.25,   0.15],
    
                [1400,  0.35,   0.23],
    
                [2000,  0.42,    0.29],
    
                [2500,  0.58,    0.41],
    
                [3000,  0.73,    0.61],
    
                [4000,  0.88,    0.77],
    
                [5000,  1.03,    0.87],
    
                [6000,  1.11,    0.93],
    
                [7000,  1.02,    1.00],
    
                [8000,  0.93,    0.95],
    
                [9000,  0.73,    0.91],
    "And everything in the next line of code is the same right?"
    Well, probably.
    For anyone wondering why I left out a small bit of what I included in the main code it is because I am not sure, and before the "why did you make this thread if you don't know everything about this topic" it is so I can make modder's lives a bit easier by quickly explaining the meanings of what an engine jbeam is, as the wiki does not have a thread about it.
     
    • Like Like x 1
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice