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 Now a Download Plan!
  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. 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. Arazok

    Arazok Member

    Joined:
    Mar 26, 2018
    Messages:
    161
    Occupation:
    Computer scientist
    Location:
    Germany
    Balance:
    950Coins
    Ratings:
    +30 / 0 / -0
    My Motion Simulator:
    2DOF
    ok great, but I fear I cannot take a deeper look before monday.
    Stay tuned....
  2. nebriv

    nebriv New Member

    Joined:
    Feb 25, 2020
    Messages:
    9
    Balance:
    58Coins
    Ratings:
    +2 / 0 / -0
    No problem at all - I appreciate any and all feedback! Thanks for the help!
  3. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    18,427
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    131,886Coins
    Ratings:
    +10,200 / 48 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Just flaggi
    Just flagging this for @yobuddy to have a look at, if he has time.
  4. Arazok

    Arazok Member

    Joined:
    Mar 26, 2018
    Messages:
    161
    Occupation:
    Computer scientist
    Location:
    Germany
    Balance:
    950Coins
    Ratings:
    +30 / 0 / -0
    My Motion Simulator:
    2DOF
    Hi, what came into my mind: Are the sender of the data and the receiver running on the same machine ?
    If yes, pls take care of the used ports, the sender needs a different port then the receiver.
    Could this be your problem (I haven't checked the code yet) ?
  5. nebriv

    nebriv New Member

    Joined:
    Feb 25, 2020
    Messages:
    9
    Balance:
    58Coins
    Ratings:
    +2 / 0 / -0
    Possible - I haven't enforced the source port... I was hoping the C# code would handle it for me. Again - I have 0 issues receiving data when using the old format so I don't think its an issue with the actual network communications. I feel as though its something do with the parsing on the client side or the packet handling on the client side. I'm just not really sure how to debug it properly :(

    I haven't given up yet though!
  6. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    4,254
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    39,948Coins
    Ratings:
    +4,501 / 13 / -0
    hi guys,
    My guess is all the quotes is messing with the string var?
    I believe the one without quotes worked?
    chat soon,
    yobuddy
  7. Arazok

    Arazok Member

    Joined:
    Mar 26, 2018
    Messages:
    161
    Occupation:
    Computer scientist
    Location:
    Germany
    Balance:
    950Coins
    Ratings:
    +30 / 0 / -0
    My Motion Simulator:
    2DOF
    The plugin code looks good, so far.
    The datalogger code did not compile on my PC, I don`t have the Unity environment.
    Anyway, if you would like to check if it is a problem of data receiving or parsing, just put a
    Dim file = My.Computer.FileSystem.OpenTextFileWriter("C:\Users\[yourpathhere]\test.txt", True)
    file.WriteLine(received_data);
    file.Close()

    in your
    Public Sub Process_PacketRecieved(received_data As String) Implements IPlugin_Game.Process_PacketRecieved
    function.
    then you see what you received.
    Give it a try.....
  8. Nate J

    Nate J New Member

    Joined:
    Jan 3, 2020
    Messages:
    1
    Balance:
    82Coins
    Ratings:
    +2 / 0 / -0
    My Motion Simulator:
    4DOF
    • Informative Informative x 2
  9. lucien

    lucien study hard, improve every day

    Joined:
    May 4, 2020
    Messages:
    3
    Occupation:
    nothing
    Location:
    China
    Balance:
    - 133Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, Motion platform, 4DOF, 6DOF
    Hello, I have a problem that may be very low-level. Watched the plug-in example, when using udp, the ”Public Sub Process_PacketRecieved (Text As String) Implements IPlugin_Game.Process_PacketRecieved ”function did not see the code about udp receiving, he had an input value text. Does this value need to be processed in advance and processed elsewhere?
  10. kadirbekil

    kadirbekil New Member

    Joined:
    Apr 26, 2020
    Messages:
    4
    Balance:
    87Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, 4DOF, 6DOF
    Is there a plugin for farming simulator 2019?
  11. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    18,427
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    131,886Coins
    Ratings:
    +10,200 / 48 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
  12. value1

    value1 Nerd Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Jan 9, 2011
    Messages:
    2,184
    Location:
    Zug, Switzerland
    Balance:
    12,730Coins
    Ratings:
    +3,289 / 11 / -1
    My Motion Simulator:
    2DOF, DC motor, JRK, Joyrider
    • Informative Informative x 1
  13. lucien

    lucien study hard, improve every day

    Joined:
    May 4, 2020
    Messages:
    3
    Occupation:
    nothing
    Location:
    China
    Balance:
    - 133Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, Motion platform, 4DOF, 6DOF
    Can anyone understand and answer my confusion? Thank you in advance.:sos
  14. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    4,254
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    39,948Coins
    Ratings:
    +4,501 / 13 / -0
    @lucien,
    The Process_PacketRecieved gets processed on Game Engines side of things.
    This is where Game Engines gets its data from.
    Are you using the UDP example plugin?
    Take care,
    yobuddy
  15. pim2020ulg

    pim2020ulg New Member

    Joined:
    Dec 6, 2020
    Messages:
    4
    Balance:
    56Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF
    Hi everyone,

    As a duo of mechanical engineering students, a friend an I have been assigned to work on a driving simulator as part of our master's program integrated project. Thus, we are starting from a "static" driving simulator which runs the 'STISIM Drive 3' simulation software. STISIM is a "game" used for driving simulation and is mostly used for research in driver psychology, driver attention study etc.

    So now, we have to make this static simulator into a motion simulator because the persons in charge have requested to make the simulator more realistic by reproducing acceleration cues.
    Thus, my friend and me have to develop the whole hardware platform, and also manage the software part.
    For the hardware part, we have to adapt the current static structure (see avatar) in a motion platform.

    Starting from scratch on the software side, we first have to build the data acquisition process. We intent to use SimTools to establish communication between the "game", and our hardware setup. We must then develop a plugin for our STISIM Drive 3 "game". The problem is that we have no idea of how to determine which telemetry procotol is used by STISIM, and how to code a plugin afterwards. Does any know how to determine this ?

    Any help would be appreciated.
    Thank you for reading this message,

    Victor & Sébastien
  16. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    4,254
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    39,948Coins
    Ratings:
    +4,501 / 13 / -0
    Hi @pim2020ulg,
    First, I would contact the "STISIM Drive 3" guy's, and ask if their software delivers telemetry for the game in any way. If so we have something to work with and we can go from there. If not then memory hooks are your only option. (we can go into that more later if needed)

    For now thou I would contact the game makers and see what they say.
    take care,
    yobuddy
    • Like Like x 2
  17. pim2020ulg

    pim2020ulg New Member

    Joined:
    Dec 6, 2020
    Messages:
    4
    Balance:
    56Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF
    Hi @yobuddy

    According to the game documentation, there exists a way to do Serial Output communication.
    It "allows for a select set of program variables to be output using a computer’s RS-232 serial
    communications port.
    "
    This communication is unidirectional, from STISIM, to an external device.
    Could this help ? I guess there is a way to intercept data, as it must be extracted to be sent to another device.

    However, I will be asking them if there exists any other protocol to export telemetry data.

    Best,
    Seb
  18. pim2020ulg

    pim2020ulg New Member

    Joined:
    Dec 6, 2020
    Messages:
    4
    Balance:
    56Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF
    hi @yobuddy

    I have news from the developers.
    So, according to the developers of STISIM, we would need what they call their "Open Module" software in order to extract telemetry data. I do not understand this, because the game still has a basic feature to extract data with a serial output.

    Anyway, it seems like we need their "Open Module" to be sending UDP packets. However, I'm not sure my organisation is willing to invest in such a thing since our Master's program Integrated Project only aims at developing a proof of concept. Investment may be heavy considering we are only working on a prototype version.

    In the event of having to use memory hooks, how could we proceed ? And is there anyway to use the default "Serial Output" the game has available to intercept data ?
  19. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    18,427
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    131,886Coins
    Ratings:
    +10,200 / 48 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    There are some good CheatEngine resources in the FAQs, which is used to find pointers for the hook method:

    https://www.xsimulator.net/communit...lugin-for-simtools-2-0-api-documentation.131/

    https://www.xsimulator.net/community/faq/cheat-engine-youtube-tutorials.242/
  20. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    4,254
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    39,948Coins
    Ratings:
    +4,501 / 13 / -0
    When you turn this on, the values its sending has to be in memory somewhere.
    So from that stand point maybe it's helpful for memory hooks.

    You should know that if you use memory hooks, that any update to the game may break the memory hook locations. Causing you will need to update the memory hook locations again. But for a proof of concept, this should be just fine.
    Take care,
    yobuddy
    • Agree Agree x 1