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

Train Simulator - Help with Plugin

Discussion in 'SimTools Plugins' started by RaguTom, Sep 25, 2016.

  1. RaguTom

    RaguTom Cool Guy, Chronic Long-Winded Poster Gold Contributor

    Joined:
    Jul 15, 2016
    Messages:
    53
    Occupation:
    Electronics Engineering/Technician
    Location:
    Harrisburg, PA, USA
    Balance:
    341Coins
    Ratings:
    +99 / 1 / -0
    My Motion Simulator:
    DC motor, Motion platform, 6DOF
    Hey all!!!

    I was wondering if I could get some advice. I had suggested Dovetail Train Sim in the forums a couple of weeks ago and decided to tackle it myself. I'm using Cheat Engine 6.5.1 to grab memory values. I was blown away by how much info I could get from this program. The game has 1.2GB ram usage and an open ended search pulls up about 300,000,000 current memory addresses, so I feel its like finding a needle in a haystack.

    I have already found the addresses for MPH, RPM, Fuel Remaining, and Diesel amp usage. These seemed very easy because I have values on the screen to search for.

    My question is: what is the starting point most people use to grab axis info. What are your starting search values. The process I'm currently using is, take a snap shot of float values, move the train so that the camera shifts with the forces, and compare. Is this a good approach? I'm trying to gain: pitch, roll, sway, surge, yaw.

    Thanks a ton!!!

    Tom
    • Old Old x 1
  2. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,460
    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. RaguTom

    RaguTom Cool Guy, Chronic Long-Winded Poster Gold Contributor

    Joined:
    Jul 15, 2016
    Messages:
    53
    Occupation:
    Electronics Engineering/Technician
    Location:
    Harrisburg, PA, USA
    Balance:
    341Coins
    Ratings:
    +99 / 1 / -0
    My Motion Simulator:
    DC motor, Motion platform, 6DOF
    Thanks a bunch! I should have searched the forums better....:roll
    • Like Like x 1
  4. RaguTom

    RaguTom Cool Guy, Chronic Long-Winded Poster Gold Contributor

    Joined:
    Jul 15, 2016
    Messages:
    53
    Occupation:
    Electronics Engineering/Technician
    Location:
    Harrisburg, PA, USA
    Balance:
    341Coins
    Ratings:
    +99 / 1 / -0
    My Motion Simulator:
    DC motor, Motion platform, 6DOF
    OMG!!! Thank you @noorbeast and thank you @value1! I already found surge values! Roll and pitch will definitely be harder because I can't directly introduce those forces on the train at will....
    • Winner Winner x 1
  5. RaguTom

    RaguTom Cool Guy, Chronic Long-Winded Poster Gold Contributor

    Joined:
    Jul 15, 2016
    Messages:
    53
    Occupation:
    Electronics Engineering/Technician
    Location:
    Harrisburg, PA, USA
    Balance:
    341Coins
    Ratings:
    +99 / 1 / -0
    My Motion Simulator:
    DC motor, Motion platform, 6DOF
    Wellllll...... I found all the values I needed....but, after I closed the application and opened it back up, all of those memory locations have changed. I see what registers are being worked with when I decompile, but nothing so far seems to carry the info i'm looking for! Gotta keep searching!
  6. value1

    value1 Nerd SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Jan 9, 2011
    Messages:
    2,184
    Location:
    Zug, Switzerland
    Balance:
    14,461Coins
    Ratings:
    +3,318 / 11 / -1
    My Motion Simulator:
    2DOF, DC motor, JRK, Joyrider
    You will have to find the pointers to the values with a Pointer scan
    PointerScan.png
    • Informative Informative x 2
  7. RaguTom

    RaguTom Cool Guy, Chronic Long-Winded Poster Gold Contributor

    Joined:
    Jul 15, 2016
    Messages:
    53
    Occupation:
    Electronics Engineering/Technician
    Location:
    Harrisburg, PA, USA
    Balance:
    341Coins
    Ratings:
    +99 / 1 / -0
    My Motion Simulator:
    DC motor, Motion platform, 6DOF
    Thanks!!! You even took the time to make a screen shot. I'll give that a shot!
  8. RaguTom

    RaguTom Cool Guy, Chronic Long-Winded Poster Gold Contributor

    Joined:
    Jul 15, 2016
    Messages:
    53
    Occupation:
    Electronics Engineering/Technician
    Location:
    Harrisburg, PA, USA
    Balance:
    341Coins
    Ratings:
    +99 / 1 / -0
    My Motion Simulator:
    DC motor, Motion platform, 6DOF
    Would this be a correct method:
    1. Search for value
    2. search for pointer based on found address
    3. close game, open game
    4. re-find value
    5. search for pointer based on new found address
    6. remaining pointer should be base source of data
    I saw something similar to this in one of the write ups floating around and that's the process I gleaned from it.
    • Agree Agree x 1
  9. RaguTom

    RaguTom Cool Guy, Chronic Long-Winded Poster Gold Contributor

    Joined:
    Jul 15, 2016
    Messages:
    53
    Occupation:
    Electronics Engineering/Technician
    Location:
    Harrisburg, PA, USA
    Balance:
    341Coins
    Ratings:
    +99 / 1 / -0
    My Motion Simulator:
    DC motor, Motion platform, 6DOF
    I feel like I'm having to ask way too many questions since there are so many tutorials out there... I have gained a few pieces of information. I whittled down the pointer scan to get a result of P->1F997F20. Unfortunately, the WarThunder tutorial mentions a pointer result, but I cant see what i'm supposed to do with it. Also, within the pointer scan window my base address is "GameManager.dll"+048DDCF0. I don't know if this is significant.

    Thank you so much for your help. I feel like once I get this piece of the puzzle, the rest will come together quickly!
  10. RaguTom

    RaguTom Cool Guy, Chronic Long-Winded Poster Gold Contributor

    Joined:
    Jul 15, 2016
    Messages:
    53
    Occupation:
    Electronics Engineering/Technician
    Location:
    Harrisburg, PA, USA
    Balance:
    341Coins
    Ratings:
    +99 / 1 / -0
    My Motion Simulator:
    DC motor, Motion platform, 6DOF
    So, I had to take a break from this plug-in development for a while, but i'm back at it now. I'm glad I stepped back, because now that I've checked it out again, I was able to find the base addresses I need!!

    So, I have a question about the addresses I found and what it means for getting them into Visual Studio.
    The application presents itself as "RailWorks.exe" in which I made a "test" plugin, and Simtools sees it and knows when the game is running. However, the pointers I have found point to "GameManager.dll+0546F030" for example. I referenced this in my last post, but didn't understand the significance of it until now. Since my application is being referenced by the plugin as "RailWorks.exe" and the actual base address is at GameManager.dll, do i need to do something different here to set the plugin entry point as GameManager.dll. I know it isn't as simple as changing the "process name" since GameManager.dll isnt shown as a process, and sim tools would never see it running.

    I noticed in the write up for designing plug-ins that you can have multiple process names, comma separated. Would I utilize this??

    Thanks so much,
    Tom
  11. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,619
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,395Coins
    Ratings:
    +3,480 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF

    You really don't want pointers from dll's you need the pointers from the game .exe
  12. RaguTom

    RaguTom Cool Guy, Chronic Long-Winded Poster Gold Contributor

    Joined:
    Jul 15, 2016
    Messages:
    53
    Occupation:
    Electronics Engineering/Technician
    Location:
    Harrisburg, PA, USA
    Balance:
    341Coins
    Ratings:
    +99 / 1 / -0
    My Motion Simulator:
    DC motor, Motion platform, 6DOF
    As i'm seeing it, the game is referencing the dll to do the work. I see lots of pointers that have a RailWorks.exe in front of them, but all of the info I need is offset from GameManager.dll. Since GameManager is not the "captured process" for simtools, the data that simtools is capturing would be from RailWorks.exe+offset rather than GameManager.dll+offset

    Am I just thinking of this incorrectly?

    I thought of throwing in a few lines of code that gathers the base address of the dll as the plug-in is launched and then move to that position rather than the position defined by "_ProcessName"

    This is great practice, because the next game I want to do, "Viper Racing," has all of its data flowing through Race.bin rather than ViperRacing.exe. Luckily though race.bin comes up as a process, so I should be able to grab that directly.

    Thanks,
    Tom
    • Winner Winner x 1
  13. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,619
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,395Coins
    Ratings:
    +3,480 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    I dont really know but every mem hook game I have done always use the game.exe .

    You can tell the plugin to do whatever you want it to.
  14. RaguTom

    RaguTom Cool Guy, Chronic Long-Winded Poster Gold Contributor

    Joined:
    Jul 15, 2016
    Messages:
    53
    Occupation:
    Electronics Engineering/Technician
    Location:
    Harrisburg, PA, USA
    Balance:
    341Coins
    Ratings:
    +99 / 1 / -0
    My Motion Simulator:
    DC motor, Motion platform, 6DOF
    You are 100% correct. I figured it out about 6 hours ago, but 2AM snuck up on me really quick and I needed sleeeeeep!

    It is a multi-level pointer, and I was putting in the offset from the one right next to the very first GameManager.dll+offset rather than going through each of the 5 offset jumps. I just need to run a routine that takes your starting address and drills through 5 more offsets before returning the actual memory location to be read by simtools. The very last memory address that you offset to is indeed "referenced off of RailWorks.exe."

    I should have a working plug-in done pretty soon!

    Thanks for all your help!

    Tom
    • Winner Winner x 1
  15. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,619
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,395Coins
    Ratings:
    +3,480 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Haha I've been there before time flies by looking at frikkin numbers :p

    You don't need a routine to drill through anything, all you have to make sure you get a stable pointer as the base pointers can always change too. Once you have a stable pointer you can use that address+offsets forever or until the game gets updated ;)
    • Agree Agree x 2
  16. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,619
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,395Coins
    Ratings:
    +3,480 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Also do are you using cheatengine?
  17. RaguTom

    RaguTom Cool Guy, Chronic Long-Winded Poster Gold Contributor

    Joined:
    Jul 15, 2016
    Messages:
    53
    Occupation:
    Electronics Engineering/Technician
    Location:
    Harrisburg, PA, USA
    Balance:
    341Coins
    Ratings:
    +99 / 1 / -0
    My Motion Simulator:
    DC motor, Motion platform, 6DOF
    I will give that a try!

    I'm new to spying on applications and feel that my understanding of it is based off of the odd things I'm seeing. I hope you are right (and probably are), because having to find values, create a pointer scan, quit game, find new values, pointer scan, quit, rinse and repeat is really tedious (but fun)

    Definitely, such a powerful piece of software.
  18. RaguTom

    RaguTom Cool Guy, Chronic Long-Winded Poster Gold Contributor

    Joined:
    Jul 15, 2016
    Messages:
    53
    Occupation:
    Electronics Engineering/Technician
    Location:
    Harrisburg, PA, USA
    Balance:
    341Coins
    Ratings:
    +99 / 1 / -0
    My Motion Simulator:
    DC motor, Motion platform, 6DOF
    Also I just noticed your occupation is Railway Maintenance. This plug-in should be right up your alley once it is done!
    • Funny Funny x 1
  19. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,619
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,395Coins
    Ratings:
    +3,480 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    lol no thanks !!! :D
    • Funny Funny x 4
  20. RaguTom

    RaguTom Cool Guy, Chronic Long-Winded Poster Gold Contributor

    Joined:
    Jul 15, 2016
    Messages:
    53
    Occupation:
    Electronics Engineering/Technician
    Location:
    Harrisburg, PA, USA
    Balance:
    341Coins
    Ratings:
    +99 / 1 / -0
    My Motion Simulator:
    DC motor, Motion platform, 6DOF
    I thought you would be my first download..... darn!
    • Funny Funny x 3