Thermals only from environment ?

Discussion in 'Programming' started by NOCARGO, Dec 12, 2020.

  1. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    Hi,

    I am making a mod that sports two different engines, complete in different slots and currently there are two problems that I cannot seem to get rid off. I'd like to present the worst problem ( read title) first, I don't think both problems are related.

    Problem 1
    While working on the mod I seem to have lost engine temperatures/energies while the thermal debug app still works and the exhaust tree is built. Both engine versions share the same structure but are different jbeam files and completely independent slotted. One engine works (the temperatures) and the other doesn't. I have scanned through all the files for comparison between both (especially the jbeam files) and I keep not finding the flaw that causes this problem. I'm using custom engine lua and controllers but the not working engine is depending on the normal combustionEngine lua core file and naturally also combustionEngineThermals. This problem really comes as a surprise since the thermal app still works and picks up the preheated engine setting from the UI menu, then the temps just drop gradually. If the thermals would be inactive the app wouldn't spawn if I'm correct ?

    Problem 2
    Reading the console after loading the vehicle I find the message : Can't find suitable engine node, using ref node instead! I don't think problem 1 and problem 2 are related since both engines produce this message.
    Both engines have working torque reaction nodes so atm I don't know (or remember) which nodes the loader is looking for.

    1.png

     
  2. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    Hey,

    the engine thermals app does not support multiple combustionEngines, so whatever you see there is likely a mix of both engines.This however ,should not impact the actual simulation, it's just the debug output that won't work as expected.
     
    • Like Like x 1
  3. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    I might have not been clear enough and didn't mention that each of the engines uses two different engine lua's. Strange thing is that the one who uses two custom lua's works fine and the one that uses one custom and the vanilla doesn't produce decent thermal output anymore. No matter how hard I push the engine it keeps cooling down from 80 centigrade off (cause of preheat ui setting). I guess I know what to do now, namely give this engine two custom lua's instead of keeping the core one, I suspect that might change something, also the controller/custom controllers might be involved, like I learned the order can be important on using different controllers.

    Thanks so much for thinking along, if it get fixed I will share my setup below, it might be interesting for some to know how the general code responds to it. :)

    Could you maybe explain something about Problem 2 ?
     
  4. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    I've got it working now :)

    To explain a little broader what's it about : I'm using an extra engine only 'lua-wise' without any physical jbeam. This to take advantage of having extra engine and exhaust sounds. When using this method the pitch of the rpm's (dedicated engine lua → update sounds) need be changed in most cases, to match with the base engine sound. Before it had a slot of its own and I think the single vanilla thermals file was handling everything fine then. I believe I've never encountered the problem before while using this method. But then I decided to try and put the second engine inside the same jbeam file so it doesn't appears in the parts selector. I'm not sure but I think I lost the thermals after that step. Anyway, I tried switching controllers and engine lua but that didn't change anything, adding dedicated thermals lua DID. Strange thing is the other (real) engine works just fine, I guess you are right about the vanilla thermals lua picking one of both to give way to :)

    @Diamondback maybe you would like to see this demo of what's going on, I don't know if you tried this before or are aware that it works.
    My tiny white Notepad++ cursor appears black after screencasting but it's pointing out stuff if you look closely :/
     
  5. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    It's looking for torqueReaction nodes of the engine, so these are probably not quite working correctly.

    As for the other stuff... To me it sounds like you should really just add a second set of engine/exhaust loops to the ICE lua file, that's probably much simpler than your approach. The code should be fairly obvious on what you'd have to copy/paste/adjust to make that work.
     
    • Like Like x 1
  6. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    Oh sh*t I never even thought of that - pardon my French !

    Thanks so much for answering these questions, Diamondback !
     
  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