WIP (Tutorial) How to add/create your own engine torque curve

Discussion in 'Content Creation' started by JesseAye, May 14, 2016.

  1. JesseAye

    JesseAye
    Expand Collapse

    Joined:
    Feb 27, 2016
    Messages:
    14
    Introduction
    Decided to make this to possibly bring more people into the contribution group of BeamNG, even though I'm not the most experienced person with BeamNG/.jbeam. The main purpose of this tutorial is to advise BeamNGers on how they can create their own engine torque curves, or modify existing engines' torque curves, just look for the section that applies to you, and follow along! (This was done using version 0.5.1.0.1739). You will need a program to zip and unzip files (specifically .zip files), and your favorite text editor (I use Notepad++). The basic layout of the engine will be as follows:
    Code:
        "engine_name":
        {
            "information":
            {
                "authors":"Your Handle",
                "name":"Engine Name",
                "value":"5000000000",
            }
           
            "slotType" : "engine_slot",
            "slots": [
                ["type", "default", "description"]
                ["exhaust", "car_exhaust", "Exhaust slot name"]
            ],
           
            "flexbodies": [
                ["mesh", "[group]:", "nonFlexMaterials"],
                ["exhaust_mesh", ["exhaust_mesh"]],
            ],
           
            "enginetorque":[
                ["rpm", "torque"]
                [0, 0],
                [500, 110],
                [1000, 150],
                [1500, 205],
                [2000, 260],
                [2500, 290],
                [3000, 315],
                [3500, 330],
                [4000, 340],
                [5000, 342],
                [5500, 340],
                [6000, 335],
            ],
           
            "engine":{
                "idleRPM":850,
                "shiftDownRPM":2000,
                "shiftUpRPM":6000,
                "maxRPM":6500,
                "revLimiterRPMDrop":100,
                "inertia":0.08,
                "friction":12
                "brakingCoefRPS":0.15
                "burnEfficiency":0.3
                "throttleSensitivity":1.2
                "torqueReactionNodes:":["e1l","e2l","e4r"]
            },
           
            "nodes": [
                 ["id", "posX", "posY", "posZ"],
                 //engine node info
            ],
           
            "beams": [
                //engine beam info
                ["id1:", "id2:"],
                {"beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
                {"beamSpring":7700550,"beamDamp":125},
                {"beamDeform":660000,"beamStrength":"FLT_MAX"},
                {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
            ],
           
            "triangles": [
                ["id1:","id2:","id3:"],
                //engine triangle info
            ],
        }

    Keep in mind some of the code will rely on existing engine code from the same vehicle and engine (if it's a 4 cylinder, the engine will always look like a 4 cylinder unless you have the code and meshes(?) for a different style engine. Further sections will be worked upon as I have time, but shouldn't take too long to complete.

    Modify Existing Engine from Original BeamNG Vehicle
    Locate your root BeamNG folder, then navigate to content\vehicles\ and find the vehicle you'd like to modify. The name of the car may not be exactly how it appears in the game, but the zip file names should be pretty straight forward. Make a backup copy of the untouched file just in case, extract to coupe/ or whatever the vehicle is while the game is closed, and you will have a new folder called coupe. Navigate to \coupe\vehicles\coupe\, then locate your vehicle's engine .jbeam (i.e. coupe_engine.jbeam) with your favorite text editor, and you will be flooded with a whole bunch of code. Review the above file layout for a basic understanding of what you will be seeing. If you simply want to modify the torque curve of the engine, locate the section for the actual engine (i.e. "coupe_engine_I4"). Look a little bit down and find the subcode labelled as "enginetorque":[. Leave the first line below alone, and modify/add the specific torque curve data into this section, ensuring commas and brackets are properly applied. Section should look like this:
    Code:
            "enginetorque":[
                ["rpm", "torque"]
                [0, 0],
                [500, 110],
                [1000, 150],
                [1500, 205],
                [2000, 260],
                [2500, 290],
                [3000, 315],
                [3500, 330],
                [4000, 340],
                [5000, 342],
                [5500, 340],
                [6000, 335],
            ],
    

    Go to the next section of code labelled "engine":{, and adjust the idleRPM, shiftDownRPM, shiftUpRPM, and maxRPM data as needed, keeping commas in the places needed. idleRPM is your engine idle speed, shiftDownRPM is the RPM in which the automatic transmission will shift a gear down, shiftUpRPM is the RPM in which the automatic transmission will shift a gear up, and maxRPM is your engine RPM limiter.

    Save the file, navigate to root\content\vehicles\coupe, and save that vehicles folder as the original name of the zip file (i.e. coupe.zip), and test out the engine in-game!

    Add New Engine to Original BeamNG Vehicle
    WIP

    Modify Existing Engine from a Customer Vehicle
    WIP

    Add New Engine to Custom Vehicle
    WIP
     
    • Like Like x 2
  2. VWlove38

    VWlove38
    Expand Collapse

    Joined:
    Aug 8, 2013
    Messages:
    279
    so useful! :)
     
  3. CreasingCurve

    CreasingCurve
    Expand Collapse

    Joined:
    Jan 19, 2016
    Messages:
    940
    Hey, I'm sorry for bumping the thread, but i have a good reason so don't get mad.
    After reading through this tutorial there is relatively little content, and i thought that if enough people want me to i will be willing to create another tutorial on this subject and answer the unanswered tutorials in this thread as well as any questions, you the community have.
    Seeing as a fair amount of people like modifying engines and it is relatively simple i would be willing to do it as this type of modding can serve as a gateway to learning more about a jbeam and how beamNG works.
     
  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