Experimental Extract simulation data

Discussion in 'Utilities and programming' started by Zorro_X, Oct 18, 2021.

  1. Zorro_X

    Zorro_X
    Expand Collapse

    Joined:
    Oct 18, 2021
    Messages:
    15
    Hi,
    In order to make a real-size simulator is it possible to extract real-time simulation data to animate a real dashboard for example ?
    If yes, is there some API description on how to create a plug-in or something like that ?

    Thankyou for your answers,
    Z
     
    #1 Zorro_X, Oct 18, 2021
    Last edited: Oct 18, 2021
  2. Zorro_X

    Zorro_X
    Expand Collapse

    Joined:
    Oct 18, 2021
    Messages:
    15
    Please, any information would be appreciated. Maybe some tutorials on "howto plug-in/mod" could help (?)
     
  3. atv_123

    atv_123
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,710
    I know for a fact that this can be done, and I believe @Diamondback is the one who will know what needs to be done to achieve what you are looking for.
     
    • Like Like x 1
  4. Neo

    Neo
    Expand Collapse

    Joined:
    Oct 31, 2015
    Messages:
    260
    Hello,
    you could use the build in OutGauge Support: https://wiki.beamng.com/OutGauge
    It is a really simple UDP based protocol.
    You can find the necessary documentation for the package structure in the remote control app: https://github.com/BeamNG/remotecontrol
    If you need custom data you can build your own api with lua sockets: https://github.com/BeamNG/BeamNGpy/blob/master/src/beamngpy/lua/researchCommunication.lua
    You can find plenty of examples for a custom mod in the repository.
    Alternatively you can also use an UI app with websockets to extract data from the game as seen here: .
    A how to tutorial is not available.
    Cheers
     
    #4 Neo, Oct 21, 2021
    Last edited: Oct 22, 2021
    • Like Like x 1
  5. Zorro_X

    Zorro_X
    Expand Collapse

    Joined:
    Oct 18, 2021
    Messages:
    15
    Woohh, excellent, all what I need is there !!!! Wonderful !!!!
    Now it is just time to read, understand and code !!!
    Thankyou very much !!!!
     
  6. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    • Like Like x 1
  7. Zorro_X

    Zorro_X
    Expand Collapse

    Joined:
    Oct 18, 2021
    Messages:
    15
    Thankyou @NOCARGO , I don't need to go so far (converting into CAN bus) but at least it prooves what I want to do is possible !
    Now I'll need time to make it happen...
     
    • Like Like x 1
  8. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    Yup as mentioned above, your best bet for external hardware is an UDP connection from the game to some custom software that interfaces with your hardware (or some Raspi or something)
     
    • Like Like x 1
  9. Zorro_X

    Zorro_X
    Expand Collapse

    Joined:
    Oct 18, 2021
    Messages:
    15
    Thankyou, you're right. I was lookng for a way to "remake" OutGauge protocol adding more simulation data for a more immersive simulator animation.
     
  10. Zorro_X

    Zorro_X
    Expand Collapse

    Joined:
    Oct 18, 2021
    Messages:
    15
    Hello again, it seems the plug-ins (lua) are all in Python... Is there a way to make a plug-in/mod in C/C++ ?
    I've readed this in the MODding documentation : "Modules that are in the common folder and C++ bindings are available for both."
    So where are those "bindings", is there an API description ? That will save my life !

    Another question : is there a linux version of BeamNG.drive ?
     
  11. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    You won't be able to extend the game with C++ really and even if you did somehow do that, it wouldn't make any sense. Most of the simulation data exists only in lua, so that's where you need to fetch it.
    What you are technically looking for is an "extension" lua file, these can be loaded at any time and just execute whatever code you put into them.
     
    • Like Like x 1
  12. Zorro_X

    Zorro_X
    Expand Collapse

    Joined:
    Oct 18, 2021
    Messages:
    15
    Thankyou, the "problem" is my libraries are already in C++, there is no problem for me to learn Python, just a matter of time optimization. If lua is the only way, then it will be lua... ;)
     
  13. Neo

    Neo
    Expand Collapse

    Joined:
    Oct 31, 2015
    Messages:
    260
    Short answer: no, currently not.
    Answer to the question on how to run it on linux: Search for wine, dxvk and mscorefonts. With the assumption that your graphic card has good drivers on linux, these are the tools you need to run it with near windows performance.
    Cheers
     
  14. Zorro_X

    Zorro_X
    Expand Collapse

    Joined:
    Oct 18, 2021
    Messages:
    15
    ok, it will run under a windows emulator... That's not what I was looking for...
     
  15. Zorro_X

    Zorro_X
    Expand Collapse

    Joined:
    Oct 18, 2021
    Messages:
    15
    Hi guys, I'm begining to work on this "little" project, looking some code, architectures, ways to do it, what do I have already coded (by myself) that could be useful, and so on...
    Making some research about python, I've seen there is a way to link (extend) python with C/C++ (here : https://docs.python.org/3/extending/extending.html ). So I wonder if it could be possible to use that method to extend a plug-in/mod in beam.ng ?
    I'm not allergic to python, but I already have coded a C/C++ library that could help me a lot in data communication between beam.ng & my dashboard and input commands...
     
  16. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    I'm not quite sure why you insist on python, BeamNG.drive does not have any python interface. All of the relevant code is in lua...
     
  17. Zorro_X

    Zorro_X
    Expand Collapse

    Joined:
    Oct 18, 2021
    Messages:
    15
    sorry, I though lua was a python library...
     
  18. FBI485

    FBI485
    Expand Collapse

    Joined:
    Nov 11, 2019
    Messages:
    19
    I am wanting to extract more information out of out gauge, I understand potentially altering the original lua but I'm lost in terms of where to get the information or how. Could anyone spare some advice or information as to how I go about doing this?
     
  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