1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    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 Now a Download Plan!
  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. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Tutorial How to write a Game Plugin for SimTools 2.0 - API documentation

Discussion in 'Tutorials and Tips by the Developer' started by yobuddy, Sep 23, 2016.

  1. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,461
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    144,596Coins
    Ratings:
    +10,741 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    @Wang did you run LFS prior to patching, as it needs some files to be generated?

    If not then unpatch LFS, close SimTools, run LFS, dive a couple of laps, close LFS, open SimTools, repatch LFS, test.

    Also use English as the default Windows language: https://www.xsimulator.net/community/faq/simtools-language-setting-bug-change-to-english-local.233/
  2. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,461
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    144,596Coins
    Ratings:
    +10,741 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
  3. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    5,133
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    47,902Coins
    Ratings:
    +5,027 / 16 / -0
    This is what you are looking for buddy.
    a.jpg
  4. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,461
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    144,596Coins
    Ratings:
    +10,741 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    It is not which Game Engine that is used, but rather how the game is coded. What is the game you have in mind?
  5. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,461
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    144,596Coins
    Ratings:
    +10,741 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Best you hit the Unreal 4 forums and tutorials @Wang.
  6. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    5,133
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    47,902Coins
    Ratings:
    +5,027 / 16 / -0
    @Wang,
    Once we know how you can send the telemetry values from the game, then which plugin to use will make more sense buddy.

    I would suggest sending data from the game thru UDP.
    And start with the UDP plugin.
    This approach works very well.
    yobuddy
    • Agree Agree x 2
  7. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,461
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    144,596Coins
    Ratings:
    +10,741 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    • Like Like x 1
  8. Tim Armstrong

    Tim Armstrong New Member

    Joined:
    Aug 2, 2017
    Messages:
    19
    Location:
    USA
    Balance:
    295Coins
    Ratings:
    +6 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, Arduino
    Hello :)

    I am a UE4 developer that is new to motion sims and the SimTools software. I am in the process of making a vr game that will make use a motion platform and am trying to understand what data needs to be output and in what format.

    I have been looking over the Dirt 2 sample plugin and see the "Process_PacketRecieved(Text As String)" function as well as the "Outsim" structure that gets populated from the UDP string, but I have a few questions...

    1. What would be the IP and Port I would send to to get the packet to SimTools? Would IP just be localhost?

    2. I am a bit confused also on how the UDP string out of UE4 should be structured...
    - Should the time in milliseconds be how long the game has been running? Would that part of the string be something like "000000000255" = 255 milliseconds over four bytes?
    - I am guessing that the rest is just x,y,z info for the object being simulated...is that correct?
    - Any chance you could provide a sample string showing how the data should be formatted?

    Thanks so much for any help you can send my way! Sorry if these are noob questions...just trying to wrap my head around the data format :)
  9. Tim Armstrong

    Tim Armstrong New Member

    Joined:
    Aug 2, 2017
    Messages:
    19
    Location:
    USA
    Balance:
    295Coins
    Ratings:
    +6 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, Arduino

    Sorry, I do see now in the game settings where you put the port number so please disregard that part. :)

    But still wondering about the IP....
  10. llluis

    llluis Active Member Gold Contributor

    Joined:
    Mar 30, 2017
    Messages:
    165
    Location:
    Quebec
    Balance:
    1,630Coins
    Ratings:
    +103 / 1 / -0
    My Motion Simulator:
    6DOF
    There you go, the C# template for plugin development.
    Follow the exact same instructions as posted by @yobuddy in the first post.

    Attached Files:

    • Winner Winner x 2
    • Useful Useful x 2
    • Like Like x 1
  11. llluis

    llluis Active Member Gold Contributor

    Joined:
    Mar 30, 2017
    Messages:
    165
    Location:
    Quebec
    Balance:
    1,630Coins
    Ratings:
    +103 / 1 / -0
    My Motion Simulator:
    6DOF
    @Tim Armstrong, you have to write both ends of the communication: your UE game and the Simtools plugin for it.
    So, you decide what the format, port, etc will be.

    Define an UDP structure in your game and send the data. Use the same structure in the plugin, get the info and send to Simtools.
    IP is provided by the Simtools interface and is the IP where the software is running. Usually localhost / 127.0.0.1.

    You have 9 options to provide motion data to simtools: pitch, roll, yaw, sway, surge, heave and 3 extra (user defined).
    • Informative Informative x 2
  12. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    5,133
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    47,902Coins
    Ratings:
    +5,027 / 16 / -0
    Updated the GameVibe section in the first post.
    To show the complete list of sound Names we can use with GameVibe.
    yobuddy
    • Like Like x 2
  13. axenic

    axenic Member Gold Contributor

    Joined:
    May 15, 2017
    Messages:
    46
    Occupation:
    IT engineer
    Location:
    Brest
    Balance:
    - 17Coins
    Ratings:
    +24 / 1 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform
    Hi there ! I loaded the rollercoaster plugin example. I see in the debug options that there might be a Game_PlugIn_Tester.
    Is it the same thing as the PluginValidator, or is it something else ?

    As I am trying a lot of things at the same time, I would like to know if there was a tool to simulate a game start / stop and the game manager presence ?
  14. gianluca123

    gianluca123 New Member

    Joined:
    Jul 19, 2018
    Messages:
    3
    Balance:
    109Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, AC motor, Arduino, Motion platform
    Hi, I'm trying to use the plugin example that you provided. I want to send the data from Matlab to SimTool. Specifically, my idea is to send JSON string from Matlab and define the plugin so that it can extract values of both pitch and roll angles. I followed the procedure you posted and everything seemed to work fine, I was able to build and select the defined game from the SimTool GUI. The problem is that I've tried to send values of roll and pitch angles from Matlab and visualize them through the virtual axis in SimTool, and I was not able to see any of the values sent. Here is a picture of the modified code. Thank you for your help!

    1.JPG
  15. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    5,133
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    47,902Coins
    Ratings:
    +5,027 / 16 / -0
    I would copy the code you pasted there and start a new vb.net app (as a test app).
    Then see if that code grabs the data you need, because the code is not in a dll, it can be easier to see what's going on.

    Once you have the code working, simply paste it into the plugin you built and you should be good to go!

    Hope that helps man,
    yobuddy
    • Agree Agree x 2
    Last edited: Jul 20, 2018
  16. gianluca123

    gianluca123 New Member

    Joined:
    Jul 19, 2018
    Messages:
    3
    Balance:
    109Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, AC motor, Arduino, Motion platform
    Hey! I've tried to develop a vb.net app. Everything seems to work correctly! I have been able to see the data sent through the console. However when I copy and paste the code nothing shows up. I am wondering if the plugin has been correctly uploaded into SimTool, and also if using output testing>>virtual axis is the correct way to test if my plugin is working correctly.
    Here is what I've tried lastly: I've just sent the two variables Pitch and Roll equal to a value 45 degree. I was expecting to have the value displayed here. However, nothing shows up again.
    Also, I've realized that after selecting the game from the engine game, this pops up:
    Shouldn't be showing my name instead of yobuddy?

    Thank you in advance again for your help.
    3.JPG 2.JPG
  17. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    5,133
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    47,902Coins
    Ratings:
    +5,027 / 16 / -0
    Did you make a max min file for the plugin?
    Can you show me the tuning center buddy?

    Your making a game plugin, not a axis assignment plugin, so my tag name 'yobuddy' will still be present for the axis assignment plugin.

    take care,
    yobuddy
  18. Arazok

    Arazok Member

    Joined:
    Mar 26, 2018
    Messages:
    161
    Occupation:
    Computer scientist
    Location:
    Germany
    Balance:
    951Coins
    Ratings:
    +30 / 0 / -0
    My Motion Simulator:
    2DOF
    Guys, how do you debug your plugins ? Is there a way todo that and to see (in debugger) if the values (e.g. for roll, pitch, ...) are correctly calculated ?
  19. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    5,133
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    47,902Coins
    Ratings:
    +5,027 / 16 / -0
    I usually just write a little app, and do all this there.
    Once I know how to get the data, I copy it into the plugin and I'm off to the races.
    • Informative Informative x 1
  20. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    436
    Location:
    FRANCE
    Balance:
    5,961Coins
    Ratings:
    +563 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    Same here. A simple stand-alone app that also allows to generate CSV files and validate the calculation/process. Then as yobuddy mentions, a simple copy/paste and here you go !
    • Like Like x 1
    • Informative Informative x 1