[Tutorial] Porting Engines (and other parts) inbetween vehicles

Discussion in 'Content Creation' started by wrinkle345, Aug 1, 2016.

  1. wrinkle345

    wrinkle345
    Expand Collapse

    Joined:
    Jul 2, 2015
    Messages:
    553
    After posting some pictures of my default vehicle; an ETK I with 3.0L I6 from the ETK 800, people asked me if I could give a tutorial on how to do this, so I am.

    Note: while this tutorial focuses on porting engines specifically, the same concept can be applied to any part that you want to port.

    For this, while only optional, I highly recommend using the following applications:
    • Blender (for measuring offsets or mesh correcting)
    • Notepad++ (for editing the jbeams)
    So, let's get to it.

    Step 1; Finding your engine and your vehicle

    'Tis very hard to port if you don't know what you're porting, so figure out what you want to port and what vehicle you want to port to. In this tutorial I'll be using the ETK 800/K for the engine and the ETK I for the vehicle target (since I already have it done and ready to show)

    Step 2; Finding your engine files

    Depending on what engine you're going to port, the files will be in one of two places;
    • ETK 800/K engines can be found in the "common.zip" file as "etk_engine.jbeam"
    • Pickup/Roamer engines can be found in the "pickup" folder in the "common.zip" file as either "pickup_engine_i6.jbeam" for the i6 or "pickup_engine_v8.jbeam"
    • The rest of the engines can be found in their respective vehicle's folder (usually) as "vehiclenamehere.jbeam"
    If you wish to have the engine model's .dae for more precise editing, they can be found in the same directory as their respective jbeam's.

    For this tutorial, the files you mainly need are the target vehicle's engine jbeam and the port engine's jbeam

    Note: For any engine other than the ETK 800/K or the Pickup/Roamer, you must also copy the vehicle's .dae and materials.cs files to the folder/directory where you will be porting your engine, otherwise your engine will be invisible. (explanation at the end).

    Step 3; Getting the engine in-game

    Before we go too deep, we want to get the engine to at least appear in-game, so we have something visual to go off of when we work on placement. (for now I recommend you remove the hood from your vehicle until you're sure it fits properly)

    First, we want to change all vehicle references from the ported engine's vehicle to the target vehicle, that way the engine will deform and such with the vehicle.

    Depending on which apps you want to use, there are two ways of doing this;

    • The Easy way: using Notepad++, press Crtl+F, click on the "Replace" tab, under "Find what"; enter in the name of the ported vehicle which is referenced in the jbeam, then under "Replace with"; enter in the references to the target vehicle, then press the "Replace All" button. (for this tutorial, we want to replace "etk" with "etki", but the same principle applies to all vehicles)
    • The Hard way: using Window's notepad, same principle, but instead you need to manually replace each instance of the old reference with the new
    Once you finish that, you want to replace the "slot type" of the engine to match the default engine's slot to the target vehicle (this is where the target vehicle's engine jbeam comes in)
    • for this, we'll be changing "etk_engine" to "etki_engine"
    If you've done this correctly, you should see (or at least kind of see) the newly ported engine!

    screenshot_00043.png

    But! Under further inspection, you can see that it doesn't quite "fit". It'll usually be too far back, forward, or up. (if it's too big then that's a whole new set of issues).

    screenshot_00044.png

    As you can see, it doesn't quite line up with the transmission or the exhaust, and looking from the top you can see various meshes clipping into each other in the wrong places. Let's fix that.

    Step 4; Offsets

    BeamNG has a feature in jbeams that allows you to modify the dimensions, position, and rotation of a mesh without taking it to a modeling program.

    Offsetting is used a lot when it comes to "common" parts of vehicles (Spoilers, Wheels, Light Bars, etc). It can be found in jbeams in the "flexbody" category.

    Code:
     ["etk_engine_i4", ["etki_engine","etki_transmission"],[]{"pos":{"x":0,"y":0.2,"z":0.1}}],
    Most flexbodies/meshes don't have this modifier, and instead look like this:

    Code:
    ["etk_engine_i4", ["etki_engine","etki_transmission"]],
    You can simply paste it onto the end, starting the copy at "],[],{"pos"..." and pasting at the "]],"

    If you wish to scale instead of moving, simply replace "pos" with "scale". Same applies to rotation, replace "pos" with "rot".

    Note: When changing positions, to move towards the front of a vehicle, you need to lower the Y value (negative Y values are at the front of vehicles), to move towards the right of a vehicle, to need to lower the X value (negative values are to the right of vehicles). When changing scale, use "1" as the base scale, using values less than 1 will shrink while using values greater than 1 will grow. Do not use negative values.

    Now, this step doesn't really have a correct answer, you just have to eyeball it as you change it's position/scale/rotation. Change it until you think it looks "right".

    If you have a 3D modeling program, you can import the engine and the rest of the models to align them manually and export them to avoid the offsetting. Or, you can use the modeling program to align the meshes, then use the X, Y, and Z values in the offset, to save the trouble.

    For the ETK 800>I conversion, I used the following:
    Code:
    ["etk_engine_i4", ["etki_engine","etki_transmission"],[]{"pos":{"x":0,"y":0.02503,"z":-0.12937}}],
    If done right, the mesh should be a bit more "snug"

    screenshot_00045.png

    (i know the exhaust is still off, we'll get to that later)

    Step 5; Replacing Nodes/Beams

    I know it might sound a bit complicated, but it's really easy.

    Simply copy the "nodes" and "beams" (and "triangles", if applicable) sections from the target vehicle's engine jbeam and paste them over the ported engine's sections. This should fix any deform problems.

    Step 6; Mesh Editing (optional)

    For the exhaust alignment issue, the only real fix is to manually edit the mesh of the Target vehicle's exhaust so it aligns with the exhaust exit of the engine.

    screenshot_00046.png

    Once you edit the mesh, copy all of the jbeam for the exhaust and rename the flexbody to the new exhaust (Basically just making a new part with an existing jbeam. There should be a tutorial for that out there)

    But this is just a visual change; the exhaust will work even if it doesn't look like it lines up.

    The same applies to the rest of the engine meshes. Things such as radtubes, turbos, intakes, etc will still work even if they are not visually aligned. But they won't be really "show worthy".

    Step 7; Sorting Jbeams (optional)

    When editing meshes (like an exhaust), the resulting part will be usable on the original engine, which will (as you can probably guess) cause clipping.

    The solution is to just change slot names to something more "unique", so the new parts can't be cross-mountable.

    For the ETK 800/I conversion, I changed the exhaust from "etki_exhaust" to "etki_exhaust_modern"

    Note: When changing the names of "slots", you must also change the part's "slotType" to match, or the part will not be mountable.



    If you followed all of these steps, you should now have a working engine, that (for the most part) fits into your vehicle of choice!

    screenshot_00041.png screenshot_00042.png
     
    • Like Like x 26
    • Informative Informative x 2
  2. CreasingCurve

    CreasingCurve
    Expand Collapse

    Joined:
    Jan 19, 2016
    Messages:
    976
    Quick question as I found this fairly useful. From what step does the engine actually become useable, it seems like it is after step three the engine is in the car because of the Jbeam editing but then there are several other steps.
    Thanks for taking the time to create this as I and many, many other members on the forums now have a go-to guide on where to look to do engine swaps.
     
    • Like Like x 1
  3. Stratosphere

    Stratosphere
    Expand Collapse

    Joined:
    Sep 2, 2015
    Messages:
    133
    Been wanting a tutorial like this for ages, Thanks!
     
    • Like Like x 1
  4. wrinkle345

    wrinkle345
    Expand Collapse

    Joined:
    Jul 2, 2015
    Messages:
    553
    Yes, at Step 3 the engine is technically usable, and will work.
     
  5. Vinh

    Vinh
    Expand Collapse

    Joined:
    Nov 15, 2015
    Messages:
    2,803
    When i do this with the fullsize, Moonhawk engine is invisible (.dae and material .cs copied), ETK and Pigeon engine mesh become generic V8 mesh. help?
     
  6. wrinkle345

    wrinkle345
    Expand Collapse

    Joined:
    Jul 2, 2015
    Messages:
    553
    Hmm.. I think I know...

    try renaming the engine flexbody back to it's original, since odds are the "Replace All" step probably changed the name.
     
    • Informative Informative x 1
  7. Vinh

    Vinh
    Expand Collapse

    Joined:
    Nov 15, 2015
    Messages:
    2,803
    Thanks
     
    • Agree Agree x 1
    • Informative Informative x 1
  8. Loafy

    Loafy
    Expand Collapse

    Joined:
    Apr 1, 2016
    Messages:
    64
    Very nice this is pretty helpful. now if I can figure out how to move some wheels a bit forward can edit any Y position in the jbeam but nothing changes been at it almost 4 hours now one line at a time
     
  9. 440cid

    440cid
    Expand Collapse

    Joined:
    Jul 12, 2015
    Messages:
    262
    20160812140324_1.jpg 20160812140339_1.jpg

    Thanks to you my Barstow now have a fuel injected V8! The exhaust is off I know, but that's the best I can do without any 3D modelling program.
     
    • Like Like x 2
  10. Marcus_gt500

    Marcus_gt500
    Expand Collapse

    Joined:
    Apr 16, 2016
    Messages:
    429
    Thank you. Now I have a (yet incomplete) SBR engine on the Kerras.Btw, do you know where the exhaust tips and transaxle materials are stored?

     
  11. wrinkle345

    wrinkle345
    Expand Collapse

    Joined:
    Jul 2, 2015
    Messages:
    553
    I think a better route is to just copy over the entire materials.cs file to the other vehicle directory. Just make sure its in a different subfolder
     
  12. Marcus_gt500

    Marcus_gt500
    Expand Collapse

    Joined:
    Apr 16, 2016
    Messages:
    429
    It worked out. Now to try to improve the stability to handle the power.

     
    • Like Like x 1
  13. GTR2legend

    GTR2legend
    Expand Collapse

    Joined:
    Aug 29, 2013
    Messages:
    216
    EDIT: Worked it out, deleted
     
    #13 GTR2legend, Aug 23, 2016
    Last edited: Aug 23, 2016
  14. Dealercrash

    Dealercrash
    Expand Collapse

    Joined:
    Apr 1, 2016
    Messages:
    3,163
    so i was porting the sunburst engine to the old Pessima and i was wondering where i put the sunburst material.cs file if the Pessima material.cs file was there too, they have the same names so do i make a separate folder inside the directory?
     
  15. Dealercrash

    Dealercrash
    Expand Collapse

    Joined:
    Apr 1, 2016
    Messages:
    3,163
    does anyone have any ideas?
     
  16. Inertia

    Inertia
    Expand Collapse

    Joined:
    Dec 29, 2015
    Messages:
    1,583
    I've never ported engines before but I assume you copy the contents from one material.cs file into the other one so you have all the data in one file as opposed to just one.
     
  17. wrinkle345

    wrinkle345
    Expand Collapse

    Joined:
    Jul 2, 2015
    Messages:
    553
    Sorry about the late reply, but you should make a separate folder. It can be named anything, it just has to be in it's own subfolder
     
  18. Destroyer247_52

    Destroyer247_52
    Expand Collapse

    Joined:
    Mar 9, 2015
    Messages:
    187
    Thank you, that clears up some of the issues I was having.
     
    • Like Like x 1
  19. Dealercrash

    Dealercrash
    Expand Collapse

    Joined:
    Apr 1, 2016
    Messages:
    3,163
    I put a separate folder and put the materiel.cs and .DAE in it and copied the sunburst code in the pessima j beam and I even renamed the flex body engine to its original and it doesn't show the engine.
     
  20. wrinkle345

    wrinkle345
    Expand Collapse

    Joined:
    Jul 2, 2015
    Messages:
    553
    Any errors in the console?
     
  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