1. 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!
  2. 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
  3. 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,540Coins
    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,540Coins
    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,540Coins
    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:
    628Coins
    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:
    729
    Location:
    USA
    Balance:
    4,218Coins
    Ratings:
    +748 / 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,540Coins
    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:
    729
    Location:
    USA
    Balance:
    4,218Coins
    Ratings:
    +748 / 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,540Coins
    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:
    729
    Location:
    USA
    Balance:
    4,218Coins
    Ratings:
    +748 / 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,838
    Occupation:
    Teacher/Cabinet Maker
    Location:
    Michigan USA
    Balance:
    9,391Coins
    Ratings:
    +1,724 / 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