Page 2 of 6 FirstFirst 1234 ... LastLast
Results 11 to 20 of 54

Thread: [HowTo] Shared Memory (API) App

  1. #11
    WMD Member
    Join Date
    Apr 2012
    Location
    London
    Posts
    48
    Platform
    PC
    READING THE SHARED MEMORY WITH JAVA - AN EXAMPLE WITH VDASH
    To start with, you're going to need a few things. I'm not going to assume anything, so lets start at the top. Here are the things you'll need:
    • Java
    • Eclipse
    • Eclipse CDT
    • MinGW-W64
    • VDash server repository


    Installing Java
    1. Download the Java installer from HERE. If you have a 64-bit OS, download the x64 version, as you're going to be building x86 and x64 DLLs later.
    2. Run the installer, accept defaults (apart from if it asks to install adware.. I cant remember if it does)
    3. Verify it works by opening a command window and running:
      Code:
      java -version
      If it works, you should see something like:
      Code:
      C:\Users\Alex>java -version
      java version "1.8.0_45"
      Java(TM) SE Runtime Environment (build 1.8.0_45-b15)
      Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
      If you don't, you need to add the path to your java installation to your environment variables.
    4. Hurray, you have Java installed!

    Even if you already have Java installed, I recommend keeping it up to date, and making sure you don't have millions of versions installed.

    Installing Eclipse
    Eclipse is a development environment that does a lot for you, but not everything. It is the tool used to build the VDash server, and up until recently, the VDash apps (which have no made the transition to Android Studio)
    1. Download Eclipse from their website. Its just an archive, so extract it somewhere memorable.
    2. Run it. It will ask you to pick a workspace location. Make a new folder. Put it somewhere memorable.
    3. Yay, Eclipse is installed! You can now go crazy with Java.


    Installing Eclipse CDT
    CDT are the tools that allow the Eclipse Java environment to use C/C++ build tools, which are needed to create JNI DLLs to access the shared memory.
    1. In Eclipse, go to 'Help > Install New Software'. Click 'Add' in the top right. Use 'Eclipse CDT' as the name, and 'http://download.eclipse.org/tools/cdt/releases/8.7' as the address, then click OK. Only the bare minimum CDT installation is required, so tick the top box and click next a few times. Accept a license, install it, and restart Eclipse
    2. Wooooo CDT installed!


    Almost there...
    Installing MinGW-W64
    MinGW-W64 is the toolchain that will build and link the x86 and x64 DLLs for us.
    1. Download the online installer. Save it somewhere, you wont need it again
    2. Run it, click next, and let it download the repository information. Once it has, it will show a list of options
    3. Pick from the options:
      • x86_x64 as architecture
      • 'sjlj' as the Exception
      • Leave the others as default
    4. Click next, and pick somewhere for it to install. It wants to go in the Program Files folder, but I chose to move it to the root, with the full path being:
      Code:
      C:\mingw-w64\x86_64-5.1.0-posix-seh-rt_v4-rev0
    5. Dont bother with start menu shortcuts...
    6. Click next, let it download and unpack
    7. Done!


    Not long now...
    Clone VDash-server repository
    • Using your favourite Git client (TortoiseGIT FTW), clone the VDash-server repository. Its available at: 'https://Flynny75@bitbucket.org/Flynny75/vdash-server.git'. Clone the repository into your Eclipse Workspace folder.
    • Open Eclipse, click 'File > Import > General > Existing projects into workspace'. Then browse to your Eclipse workspace folder, and click ok. Select all the projects. Make sure 'Copy projects into workspace' is NOT ticked.


    One last thing...
    Configuring Eclipse to use MinGW-W64
    Eclipse comes with its own compiler, but we are going to use MinGW. So to do that, we need to tell Eclipse the right 'make' command, and where the MinGW installation is.
    1. In Eclipse, right-click on the server project and click 'C/C++ Build' on the left. Enter a custom build command of 'mingw32-make'
    2. Beneath that, select 'Environment Variables'. Edit the value for 'MINGW_HOME' to point to the directory of the MinGW installation. Mine is:
      Code:
      C:\mingw-w64\x86_64-5.1.0-posix-sjlj-rt_v4-rev0\mingw64
    3. Edit the PATH variable to include the MINGW_PATH variable like so:
      Code:
      ${MINGW_HOME}\bin;${Path}


    Building
    Using the green play button at the top of the Eclipse window, run the project. It will fail to run (it will complain about being unable to find libraries, but that's ok). Once its build, the .class should be available for the makefile. So now you should be able to right-click on the makefile in the JNI folder, and click 'Make Targets > Build'. This will display a list of make targets. Build 'all'. This should build all the required DLLs for accessing shared memory for a bunch of different games.

    Then there's just the matter of explaining how it works...
    Last edited by flynny75; 03-07-2015 at 12:14.
    i7-2600K (4.7GHz) | Asus P8P67 Pro | 16GB 1600MHz | EVGA GTX980ti SC + EVGA GTX670 4GB SC | 5760*1920 | Thrustmaster T300 GTE | Fanatec CSP v1
    VDash Android App | VDash community | VDash Latest Updates | VDash server building guide
    The following 4 users likes this Post: Blackvault, Keithb23, Lars Rosenquist, xxTheGoDxx


  2. #12
    WMD Member Lars Rosenquist's Avatar
    Join Date
    Oct 2011
    Location
    The Netherlands
    Posts
    325
    Platform
    PC
    PC: i7-4790k/16GB/GTX970 4GB/Z97-PRO/Logitech G27/Xbox 360 Controller
    Laptop: i7-6700HQ/16GB/GTX1070 8GB/Xbox One Controller
    The following user likes this Post: Blackvault


  3. #13
    WMD Member
    Join Date
    Apr 2012
    Location
    London
    Posts
    48
    Platform
    PC
    BOOM!

    Really hope people actually contribute (aside from those who already have). Having someone else implement more game support would be pretty awesome
    i7-2600K (4.7GHz) | Asus P8P67 Pro | 16GB 1600MHz | EVGA GTX980ti SC + EVGA GTX670 4GB SC | 5760*1920 | Thrustmaster T300 GTE | Fanatec CSP v1
    VDash Android App | VDash community | VDash Latest Updates | VDash server building guide
    The following user likes this Post: Lars Rosenquist


  4. #14
    WMD Member Lars Rosenquist's Avatar
    Join Date
    Oct 2011
    Location
    The Netherlands
    Posts
    325
    Platform
    PC
    Awesome! Link added to first post.
    PC: i7-4790k/16GB/GTX970 4GB/Z97-PRO/Logitech G27/Xbox 360 Controller
    Laptop: i7-6700HQ/16GB/GTX1070 8GB/Xbox One Controller

  5. #15
    WMD Member
    Join Date
    Apr 2012
    Location
    London
    Posts
    48
    Platform
    PC
    There is not an official SMS Project Cars companion app. Just go through the features of each and use whichever one sounds the best for you
    i7-2600K (4.7GHz) | Asus P8P67 Pro | 16GB 1600MHz | EVGA GTX980ti SC + EVGA GTX670 4GB SC | 5760*1920 | Thrustmaster T300 GTE | Fanatec CSP v1
    VDash Android App | VDash community | VDash Latest Updates | VDash server building guide
    The following 2 users likes this Post: jimortality, Keithb23


  6. #16
    WMD Member
    Join Date
    Apr 2012
    Location
    London
    Posts
    48
    Platform
    PC
    Quote Originally Posted by jimortality View Post
    Cheers Flynny, I'm down to 2 now, Pcars dash and dash meter pro. The dash meter one doesn't show tire wear for pcars only ac from what I can gather so it's looking like my £2.99 will go to Pcars dash.
    I have not used either for long enough so couldn't possibly comment :P

    Out of interest... what was it about VDash that put you off?
    i7-2600K (4.7GHz) | Asus P8P67 Pro | 16GB 1600MHz | EVGA GTX980ti SC + EVGA GTX670 4GB SC | 5760*1920 | Thrustmaster T300 GTE | Fanatec CSP v1
    VDash Android App | VDash community | VDash Latest Updates | VDash server building guide

  7. #17
    WMD Member
    Join Date
    Apr 2012
    Location
    London
    Posts
    48
    Platform
    PC
    Quote Originally Posted by jimortality View Post
    Importing my own stuff, I'm not into all that, I just want to set it up and go.
    I see... well I'm sure you wont be disappointed with either.

    /offtopic

    I wonder if the PCars 1 API will see any love now with work started on PCars 2... we are still waiting on a lot of data to be added...
    i7-2600K (4.7GHz) | Asus P8P67 Pro | 16GB 1600MHz | EVGA GTX980ti SC + EVGA GTX670 4GB SC | 5760*1920 | Thrustmaster T300 GTE | Fanatec CSP v1
    VDash Android App | VDash community | VDash Latest Updates | VDash server building guide

  8. #18
    WMD Member Lars Rosenquist's Avatar
    Join Date
    Oct 2011
    Location
    The Netherlands
    Posts
    325
    Platform
    PC
    I'm pretty sure it will, but I guess it's not too high on the priority list yet, so best be patient.
    PC: i7-4790k/16GB/GTX970 4GB/Z97-PRO/Logitech G27/Xbox 360 Controller
    Laptop: i7-6700HQ/16GB/GTX1070 8GB/Xbox One Controller

  9. #19
    Banned
    Join Date
    Nov 2011
    Location
    Czech Republic
    Posts
    175
    Hey Lars, the structure in the OP is not the latest I think. There are some GameStates missing. Unfortunately I can't find neither here or on the WMD forum original SMS posts with the structure.

  10. #20
    WMD Member Lars Rosenquist's Avatar
    Join Date
    Oct 2011
    Location
    The Netherlands
    Posts
    325
    Platform
    PC
    Thanks for the headsup, updated it with the contents of the V5 header file.
    PC: i7-4790k/16GB/GTX970 4GB/Z97-PRO/Logitech G27/Xbox 360 Controller
    Laptop: i7-6700HQ/16GB/GTX1070 8GB/Xbox One Controller
    The following user likes this Post: R74NN


Similar Threads

  1. [Solved - Shared Memory] Geko system GS 105 dynamic seat
    By stf_m in forum PC - Technical Help & Support
    Replies: 3
    Last Post: 15-06-2015, 14:39
  2. Just how hard is it then to make a game like Project Cars
    By KK78 in forum General Discussion
    Replies: 27
    Last Post: 10-06-2015, 21:31
  3. How to make cars less twitchy?
    By MilkyBarKid16 in forum General Discussion
    Replies: 11
    Last Post: 04-06-2015, 18:25
  4. Project Cars audio make me headache with headphone !!!
    By paulguru in forum General Discussion
    Replies: 38
    Last Post: 02-06-2015, 22:31
  5. [ANSWERED] what its shared memory
    By Chanur in forum PC - Technical Help & Support
    Replies: 7
    Last Post: 08-05-2015, 21:34

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •