1. Hundreds of coffees, endless nights of debugging and coding, and countless feedback by our beta testers led to this new major release. SimTools 2.4 is probably the version with the most upgrades and improvements in a single release ever. Look at everything Dustin has included:
    SimTools 2.4 all features.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Download Package Now!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant here. Do not following these rules will lead to permanent exclusion from this website: Read the forum rules.

News New output possibilities for DCS

Discussion in 'Digital Combat Simulators (DCS)' started by RiftFlyer, Apr 28, 2017.

  1. RiftFlyer

    RiftFlyer Active Member Gold Contributor

    Joined:
    Apr 15, 2014
    Messages:
    194
    Balance:
    1,564Coins
    Ratings:
    +116 / 0 / -0
    My Motion Simulator:
    DC motor
    I have allocated some time to revisit my G-Seat project after a long hiatus. I wasn't happy using roll, pitch and yaw in addition to the surge, heave and sway forces in my earlier testing.

    As many of you are aware I made previous attempts at a new plugin with limited success. I have removed that plugin and put the thread on hold until something better is available. After more studying and trawling the web I have found a few things which may be of interest.

    After studying the export.lua used to feed alternative software to simtools I have discovered a few new values which can be utilised.

    We have the rotational velocities for all three axis expressed as radians per second (rad/s) and the velocity vector of all three axis. I don't know what unit this vector is expressed at yet, perhaps m/s? We can also get the vertical velocity.

    I think the rotational velocities alone may be usable on their own. Has anybody any thoughts on this? It may be difficult to establish a min and max to scale the output!

    I hope to get some input from other users in this thread and once I sit down and spend some time with simtools v2 I will hopefully be able to share something worth testing,

    If anyone wants to view the outputs you can use this code to create an export.lua. It will create an export.log file in your main DCS folder which can then be viewed after a flight (open the log file with notepad++ to make it more readable). Remember to back up your existing export.lua before hand!

    Code:
    function LuaExportStart()
    
    default_output_file = io.open("./Export.log", "w")
        package.path = package.path..";.\\LuaSocket\\?.lua"
        package.cpath = package.cpath..";.\\LuaSocket\\?.dll"
        socket = require("socket")
    
    end
    
    function LuaExportAfterNextFrame()
    
       local Time = LoGetModelTime()
       local Velocity = LoGetVectorVelocity()
       local Accel = LoGetAccelerationUnits()
       local data = LoGetSelfData()
            local Yaw = data.Heading*180/math.pi
            local Pitch = data.Pitch*180/math.pi
            local Roll  = data.Bank*180/math.pi
       local RotVel = LoGetAngularVelocity()
       local VertVel = LoGetVerticalVelocity()
     
    
    default_output_file:write(string.format("Time, %.4f, VelX, %.4f, VelY, %.4f, VelZ, %.4f, AccX, %.4f, AccY, %.4f, AccZ, %.4f, Pitch, %.4f, Bank, %.4f, Heading, %.4f, RotVelX, %.4f, RotVelY, %.4f, RotVelZ, %.4f, VertVel, %.4f \n", Time, Velocity.x, Velocity.y, Velocity.z, Accel.x, Accel.y, Accel.z, Pitch, Roll, Yaw, RotVel.x, RotVel.y, RotVel.z, VertVel))
    
    
    end
    
    function LuaExportStop()
    
       if default_output_file then
          default_output_file:close()
          default_output_file = nil
       end
    
    end
    • Like Like x 3
    Last edited: Apr 28, 2017
  2. RiftFlyer

    RiftFlyer Active Member Gold Contributor

    Joined:
    Apr 15, 2014
    Messages:
    194
    Balance:
    1,564Coins
    Ratings:
    +116 / 0 / -0
    My Motion Simulator:
    DC motor
    I have a couple of questions that perhaps some experienced plugin developers could help me with. They are regarding the min and max values for force outputs. I have read that the max and min values are +1 and -1 and values outside this range are clipped. Is that the case in simtools v2 and does it also apply to the extra outputs?

    Thanks to @value1 I have successfully built a plugin which outputs the angular velocities about the x, y and z axis on extra1, extra2 and extra3. The values are being passed from the game to the plugin in radians/sec. That would mean a value of +1 corresponds to a clockwise rate of rotation of 57.29 degrees per second. Should I scale these values in the plugin? Propeller aircraft can generate faster rotations about the roll axis and I'm sure some of the jets, once tested, will show much higher rates.
    • Like Like x 2
    Last edited: Apr 30, 2017
  3. RiftFlyer

    RiftFlyer Active Member Gold Contributor

    Joined:
    Apr 15, 2014
    Messages:
    194
    Balance:
    1,564Coins
    Ratings:
    +116 / 0 / -0
    My Motion Simulator:
    DC motor
    For those who don't know I want to explain the effect of using angular velocity instead of pitch, bank or yaw. The platform output, for however many of the three rotational axis you use will move to a greater or lesser extent depending on the rate of in game rotation. A slow rate of roll will result in a shallow bank of the platform. Once the rate of rotation stops changing the platform will return to level. I'm not sure how useful this will be for a typical 2-6 dof motion platform but I'm hoping when used on a G-Seat the effect will be much more beneficial. We should get sustained pressure applied to the user in a turn the intensity of which will vary depending on the rate of rotation. I hope this centripetal force output will complement the current forces of heave, surge and sway.
    • Like Like x 3
  4. BrassEm

    BrassEm G-Seat Builder

    Joined:
    Apr 15, 2015
    Messages:
    84
    Location:
    NE of YMML
    Balance:
    620Coins
    Ratings:
    +31 / 0 / -0
    My Motion Simulator:
    DC motor, Arduino
    • Like Like x 2
    Last edited: May 8, 2017
  5. Zed

    Zed VR Simming w/Vive

    Joined:
    Apr 4, 2017
    Messages:
    749
    Location:
    USA
    Balance:
    4,392Coins
    Ratings:
    +760 / 3 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    @RiftFlyer - do you know if the DCS plugin supports wind? And 2 more questions - with the extra data available, is there data for canopy position and would it be possible in SimTools to convolute those so that wind is minimal until you open the canopy?

    New to all this so may be a dumb set of questions but thought I’d ask.
  6. RiftFlyer

    RiftFlyer Active Member Gold Contributor

    Joined:
    Apr 15, 2014
    Messages:
    194
    Balance:
    1,564Coins
    Ratings:
    +116 / 0 / -0
    My Motion Simulator:
    DC motor
    By default the plugin does not support wind.

    With the data available it should be relatively easy to get what you want. You could have wind speed as an extra value and set it to minimum while the canopy is closed and have it output a value based on airspeed while canopy is open.

    Do you want to control a fan?
  7. Zed

    Zed VR Simming w/Vive

    Joined:
    Apr 4, 2017
    Messages:
    749
    Location:
    USA
    Balance:
    4,392Coins
    Ratings:
    +760 / 3 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    @RiftFlyer - I sure do if it is possible. I like to drive the WWII planes in DCS and those had the roll back canopies for the most part and when rolled back is where I hope to get the wind blasting. With the canopy closed I’d still like some wind just because it really ups comfort level in VR.

    For driving in VR I really like the open cockpit cars. Visibility is great and wind really increases immersion. Same for flying in XPlane. Mostly closed cockpit there but I can just set the multiplier low in Game Dash and leave it since mostly closed.

    So you think it would be easy to do?
  8. RiftFlyer

    RiftFlyer Active Member Gold Contributor

    Joined:
    Apr 15, 2014
    Messages:
    194
    Balance:
    1,564Coins
    Ratings:
    +116 / 0 / -0
    My Motion Simulator:
    DC motor
    I don't have time for working on sim tools at the moment due to other commitments. When I find time for it again I'll see if I can extract the necessary data for you.

    How are you controlling the fan? Can you show me details of how you have it working in other sims?
  9. Zed

    Zed VR Simming w/Vive

    Joined:
    Apr 4, 2017
    Messages:
    749
    Location:
    USA
    Balance:
    4,392Coins
    Ratings:
    +760 / 3 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    It’s a kit I bought from @Avenga76 but it’s actually pretty simple and others have built their own. It’s an Arduino Uno mated to a MonsterMoto with each H-bridge controlling 4" SeaFlo axial flow bilge fan motors through a choke on each motor lead.

    Here is his thread at isrtv.com: http://www.isrtv.com/forums/topic/23039-my-diy-wind-simulator/

    I was just starting to think about building a motion sim, saw his thread, and gambled on a set. No regrets! He included velocity stacks and flow straighteners and it’s a trip for anything open cockpit.

    @SilentChill did the Arduino code and there is a thread here about all the technical bits and troubleshooting: https://www.xsimulator.net/community/threads/simulated-wind-using-monstermoto-and-arduinouno.6876/

    Really cheap if you do it yourself and highly recommended!
  10. Historiker

    Historiker Dramamine Adict Staff Member Moderator Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    1,860
    Occupation:
    Teacher/Cabinet Maker
    Location:
    Michigan USA
    Balance:
    9,507Coins
    Ratings:
    +1,744 / 12 / -1
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Anything ever come of GameDash simulated Wind for DCS? I put my monitor and fans on an articulated arm so it will reach both my flight and driving simpit. Would be great to feel air movement in the cockpit.
    • Agree Agree x 1
  11. Dirty

    Dirty Active Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    235
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    2,584Coins
    Ratings:
    +226 / 1 / -0
    Hey there :)

    nice idea, using a fan to "cue" an open cockpit. AFAIK, the DCS plugin does not directly allow for this out of the box, but you can modify the Export.lua to make it work.

    Here's what you'd need:

    - One of the slots needs to export Indicated airspeed by calling LoGetIndicatedAirspeed() and sending it out to Simtools. I'd prefer indicated airspeed over true airspeed, but LoGetTrueAirspeed() will work as well. You DON'T need to export the meteorological wind (if that is even possible) because that information is already contained in the calculation of the indicated airspeed.

    - Another slot would have to export the status of the canopy. You can get this status by calling LoGetMechInfo(). Here's the part of the Export.lua that shows an example:

    Code:
    LoGetMechInfo() -- mechanization info
    result_is =
    {
        gear          = {status,value,main = {left = {rod},right = {rod},nose =  {rod}}}
        flaps          = {status,value}
        speedbrakes   = {status,value}
        refuelingboom = {status,value}
        airintake     = {status,value}
        noseflap      = {status,value}
        parachute     = {status,value}
        wheelbrakes   = {status,value}
        hook          = {status,value}
        wing          = {status,value}
        canopy        = {status,value}
        controlsurfaces = {elevator = {left,right},eleron = {left,right},rudder = {left,right}} -- relative vlues (-1,1) (min /max) (sorry:(
    } 
    ...so a total of two extra slots.

    I find that a good example of users (as opposed to developers) getting creative :) And I would argue that a motion software should allow users to express this creativity. With the 9 slots available in Simtools of which 6 are being already used, I'd say this thread illustrates nicely that more slots could be a great addition for quite a few users.

    A few days ago I had a brief conversation with @yobuddy about striking a balance between more exported data on one hand and smaller overhead load on the other. And even though I am very much in favour of many many many many more slots, I was struggling to come to up with an answer to the question "how much exported data do we need?".

    Reading this thread made me realise that probably the answer should be: So much, that 99 out of 100 users will never say the words: "Damn, I wish there were more slots"

    ...I think it's always a plus if people can get creative :thumbs
    • Like Like x 2
    • Agree Agree x 1
    • Winner Winner x 1
    Last edited: Jun 28, 2019
  12. Historiker

    Historiker Dramamine Adict Staff Member Moderator Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    1,860
    Occupation:
    Teacher/Cabinet Maker
    Location:
    Michigan USA
    Balance:
    9,507Coins
    Ratings:
    +1,744 / 12 / -1
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Bicycle across Europe right now but when I get home in a couple of weeks I will give it a try! Thank so much.
  13. Dirty

    Dirty Active Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    235
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    2,584Coins
    Ratings:
    +226 / 1 / -0
    Wait, there is a simpler method :)

    You can do the math in lua and export the result through Simtool. That would require only 1 Slot :)

    Let me test the code before I post a snippet.

    Dirty :)
    • Winner Winner x 1
    • Informative Informative x 1
    • Useful Useful x 1
  14. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    3,465
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    27,184Coins
    Ratings:
    +3,554 / 10 / -0
    Hi @Dirty,
    We were chatting about expanding the 9 telemetry output slots for GameEngine I believe.
    Remember thou, there is still 20 output slots available for GameDash data. (like canopy open/closed, speed data for fans etc..)
    And another 9 output slots available for GameVibe data too.
    So all in all we have 38 outputs possible per game plugin for various things.

    And like you said
    This is true also.

    Oh and btw, GameDash also supports combining 8 true and false outputs into a single slot.
    You can then send only the bit you want for output from the combined input like this.
    Use "<DashX_b1>" thru "<DashX_b8>" where x is the dash input value you want to use, and b1 thru b8 is the bit you want to send.

    This allows us even more dash data from games that are packed with stuff we want to use.
    Take care!
    yobuddy
    • Informative Informative x 2
    • Like Like x 1
  15. Dirty

    Dirty Active Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    235
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    2,584Coins
    Ratings:
    +226 / 1 / -0
    I played around a little with the Simtools Plugin for DCS (actually, only with the Export.lua file that it creates) but after like an hour or so I was none the wiser. *scratching head*

    I can manipulate the string that is being sent to SimTools. While the raw string that goes through the wire is perfectly fine, the data showing up in Simtools is strange. If I send "0, 0, 0, 0, 0, 0" (all zeros), Simtools reads...

    "180" in yaw
    "1" in heave and
    "0" in all other slots.

    I mean, I have a faint suspicion of why that would be, but nonetheless it keeps me from actually using the 6 default slots (Roll Pitch Heave Yaw Sway Surge) to play around. I can also not use the extra slots, because if I send a 7th, 8th or 9th value, they just won't show up in the tuning center. No idea why.... :) If someone could explain this to me, I'd appreciate.

    But I was still curious about the idea of feeling the wind in the cockpit when the canopy opens :) So, if you want to follow along, here's a step by step tutorial on how to read a value out of DCS that vaguely represents the "windiness" in the cockpit:

    1. Download my Github repository. Go to TCP-Server Console/bin/release and run the TCP-Server Console.exe Bildschirmfoto 2019-05-26 um 21.58.40.png
    2. Rename the Export.txt file that I attached to this post into Export.lua and copy it into your [Username]/Saved Games/DCS/Scripts folder. If you already have an Export.lua file in that folder, MAKE A BACKUP OF YOUR EXSTING EXPORT.LUA!
    3. Create a mission with a little wind, or taxi an aircraft around at speeds of about 10-20Kts. Then open the canopy :)
    4. In the console you should see three values: Canopy value, Indicated Airspeed and Windiness (the product of the two).

    Feel free to play with the string that is being sent out. There are plenty of functions to call that will give you data to export. Bildschirmfoto 2019-05-26 um 22.14.43.png

    If you run into problems, ask me any time. Everyone can get this to work. I think it's a great way to take a peek behind the curtain of the DCS Plugin too. It exports data in a very similar way.

    Maybe this can be a starting point for someone to make it work in Simtools, or maybe send it to an Arduino directly. Would sure be fun...

    Dirty :)

    Attached Files:

    • Like Like x 2
    Last edited: May 26, 2019
  16. Dirty

    Dirty Active Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    235
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    2,584Coins
    Ratings:
    +226 / 1 / -0
    Oh,... 38 is more than I thought! But isn't Dash and Vibe only for the commercial version? Did I get that wrong?

    Cheers...
  17. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    3,465
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    27,184Coins
    Ratings:
    +3,554 / 10 / -0
    GameDash and GameVibe is available in all Pro and Entertainment versions of SimTools. :thumbs
  18. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    3,465
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    27,184Coins
    Ratings:
    +3,554 / 10 / -0
    This is because the plugin is manipulating the the data sent to SimTools.
    For instance I'm guessing the plugin is adding 1 to heave for output to offset gravity.
    (The Game probably always spits out a -1?)
    Yaw from the game may be 0 to -360, so we add 180 to get a range output of -180 to 180.

    These are turned off in the original plugin.
    They would just need to be named in the plugin to turn them on.

    Take care!
    yobuddy
    • Informative Informative x 2
    • Useful Useful x 1
  19. hexpod

    hexpod http://heXpod.xyz

    Joined:
    Apr 18, 2016
    Messages:
    466
    Location:
    berlin
    Balance:
    3,265Coins
    Ratings:
    +151 / 2 / -0
    My Motion Simulator:
    DC motor, 6DOF
    38 yes, but still only 9 for the motion platform.

    Dash and Vibe concerns the butkicker and ventilator stuff and not the platform.

    Am I wrong?

    I just wanted to make sure.
  20. Zed

    Zed VR Simming w/Vive

    Joined:
    Apr 4, 2017
    Messages:
    749
    Location:
    USA
    Balance:
    4,392Coins
    Ratings:
    +760 / 3 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    So glad to see this discussion! I’ve been missing wind in DCS but to maybe even get "windiness" would be a holy grail!