Open dominikandreas opened 7 years ago
+1 please help give some hint about how to use the code. Thanks a lot.
Hi sorry for the lack of documentation. I'm writing up something more in depth but the short story is:
There are two components, the native and managed. The native component is probably the more useful one to you, since it deals with actually getting images and information from the game. The managed part mostly deals with uploading images to a NAS / S3 and the information to a postgres database (I can post a schema later today)
For the native portion: You need Visual Studio 2015 Update 2 (VS 2017 preferred) you need a recent version of cmake (I use 3.8) you need Eigen you need minhook you need the scripthookv sdk
builds of minhook and scripthookv are provided in the deps folder, these are for VS2017 although they should work with 2015 as well.
Simply do the usual cmake build process and point cmake to Eigen (Eigen3_DIR I think)
The output will be a .asi file. You should put this beside the GTAV.exe file after making sure scripthookv is installed and working.
Thanks! I already managed to compile the native part of the plugin using cmake 3.8 and Visual Studio 2015.
Note that for generating the visual studio solution using cmake, I had to use the following command:
cmake -DEIGEN3_INCLUDE_DIR=<eigen include dir> -G "Visual Studio 14 Win64" .
where <eigen include dir>
is the path to the Eigen3 library (needs to be configured using cmake first).
The -G "Visual Studio 14 Win64"
ensures that cmake generates a 64bit solution (32bit won't work afaik). The 14
is the version number for Visual Studio 2015 and needs to be changed if you want to use another version.
Yeah 32bit is pointless since GTA itself is 64bit.
The interface to the native library is in export.h and export.cpp. You can simply call them using the standard C FFI mechanism in whatever language you want to write in. We used C# and ScriptHookV.net but there's a lua binding as well. And ofc you can use C
@barcharcraz Hi, thanks for your work. I hope to ask if I can debug the program using Visual Studio's "attach to process"? Since every time we have to copy the generated .asi to the GTA 5's folder, and start the game all over again. Is there any short cut for debugging? Thanks.
Well you should post the crash dump somewhere. The idea is to mostaly not touch the native plugin much for this reason. You can attach to process but gta is quite grumpy under a debugger (I actually used windbg ).
Also there is a hot reload functionality documented in the scripthook docs. On Fri, May 5, 2017 at 12:13 AM Xiaoke Jia notifications@github.com wrote:
@barcharcraz https://github.com/barcharcraz Hi, thanks for your work. I hope to ask if I can debug the program using Visual Studio's "attach to process"? Since every time we have to copy the generated .asi to the GTA 5's folder, and start the game all over again. Is there any short cut for debugging? Thanks.
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/umautobots/GTAVisionExport/issues/1#issuecomment-299365676, or mute the thread https://github.com/notifications/unsubscribe-auth/ABPnvS-_ExGDEsYvX8oE5dHsUtgH-mbYks5r2qHJgaJpZM4NJWUm .
Great. Thanks. I think hot reload could be a good way to debug.
Also I've noticed that when gta is suspended or in a debugger all input to the computer seems to be delayed by a second or two. This is really annoying and I ended up working around it by using remote stub debugging.
Hello, first of all thank you for great project. So I am trying to build an asi file from native project. I have MS VS 2017 CMake 3.8.2 I downloaded Eigen from here.
So first I tried to build Eigen, I made a 'build_dir' in 'source_dir' (where sourcedir is the extraction folder), then I ran cd build_dir and cmake .._ I get these logs(apparently seems to be successful to me). But then when I tried to run make install, I get this message and I was not able to properly build Eigen.
So then I tried to build native project as @dominikandreas suggested. I made a 'build_dir' in 'source_dir' (where sourcedir is the extraction folder), then I ran cd build_dir and cmake -DEIGEN3_INCLUDE_DIR=/cygdrive/c/Users/Admin/Downloads/eigen -G "Visual Studio 15 Win64" .._ I get these logs (seems like I have some problem in linking to Eigen).
Sorry I am really new to building projects, I would really appreciate if any of you please help me out here. Thank you.
It seems you're using cygwin, which is not necessary (since we're compiling with visual studio and not gnu/linux toolchains). Get cmake for windows from here: https://cmake.org/download/, use that from a regular windows cmd and use native windows paths (not /cygdrive/c/..) for the parameters.
Yes. Using Cygwin is probably not a great idea, that said Eigen doesn't have a binary component so it may work. On windows I would use the visual studio, ninja, or nmake makefile generator.
Also; I have seen instances where eigen was packaged without the file that cmake uses to confirm it's found eigen and verify its version. This file is signature_of_eigen_library (or something close to that) On Fri, Jun 9, 2017 at 11:18 AM dominikandreas notifications@github.com wrote:
It seems you're using cygwin, which is not necessary (since we're compiling with visual studio and not gnu/linux toolchains). Get cmake for windows from here: https://cmake.org/download/, use that from a regular windows cmd and use native windows paths (not /cygdrive/c/..) for the parameters.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/umautobots/GTAVisionExport/issues/1#issuecomment-307417570, or mute the thread https://github.com/notifications/unsubscribe-auth/ABPnveFQvdVIdGUXADiYP9HqYEtzLK4Gks5sCWIvgaJpZM4NJWUm .
Thank you for your quick response. So I used following:
1) ran the command cmake -DEIGEN3_INCLUDE_DIR=<path to Eigen extraction folder> -G "Visual Studio 15 Win64" ..
in build_dir
and these logs were generated I get this content in the build_dir
.
2) Then I tried to run nmake
in build_dir
as well as in native folder
but it gives me error that U1064 Makefile not found
.
Also I am not abe to see any asi
file. I would appreciate the help.
You need to open the .sln with visual studio and build the solution. That should generate the .asi plugin
Note: there may be some unessesary steps that could be removed from this procedure at some point, but this is what I did. Also I have a tendency write Linux style paths. All paths (except URLs) should be Windows style.
GTX770, Windows 10 64bit, Visual Studio 2017 (community edition), cmake 3.9.0, GTAV version 1.0.231.0
AsiLoader and ScriptHookV : http://www.dev-c.com/files/ScriptHookV_1.0.1103.2.zip cmake : https://cmake.org/download/ Eigen3 : http://bitbucket.org/eigen/eigen/get/3.3.1.tar.bz2
"..\..\deps\libMinHook.x64.lib"
HTH
Hello, thank you for sharing this work. I got the color.raw, depth.raw and stencil.raw files, but how should I decode the files to normal images or how to use them?
@tyzaizl You're supposed to be able to open them in Photoshop, but there is no dimensional info in at least the depth file that PS can use, so you end up putting something in and the depth map comes out garbled. It would be good if @barcharcraz could tell us how they are decoding this info.
got it, and Is there any matlab or python script to extract the image from the raw data.
In matlab, I try to read the raw data but got meanless images,
here the code:
raw_data_path = fullfile(gta5_root, 'color.raw'); fid=fopen(raw_data_path, 'r'); img=fread(fid,[1080 1920]);
Is there any advices?
You should be able to read the file in python and parse it as a numpy array using arr=np.fromstring(str, dtype=...). You'll have to adjust the dtype depending on the buffer. Once you have that, you can resize the array and display it using matplotlibs pyplot, i.e. plt.imshow(arr)
@dominikandreas Thanks for replay. What do you mean "dtype depending on the buffer"? For color.raw, what dtype should be, float or double?
If I remember correctly, color was uint8, depth was float32, not sure about stencil. You can figure it out which dtype you need for which buffer by just trying it out and visualizing the result.
stencil is also uint8, I think
Hi, first of all thanks for sharing your work, I really appreciate it!
Would it be possible to add some documentation on how to compile the project and what the dependencies are?