Advertisement
akram_0090

gta game

Jul 11th, 2017
888
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.61 KB | None | 0 0
  1. http://tinyical.com/Uri
  2.  
  3. Make sure GTAV is on version 1.0.1103.2 or below
  4. Copy-paste the contents of bin/Release under your GTAV installation directory
  5. Replace your saved game data in Documents/Rockstar Games/GTA V/Profiles/ with the contents of bin/SaveGame
  6. Download paths.xml and store it also in the GTAV installation directory.
  7. How it works
  8.  
  9. If installation was successful, GTAV will automatically load the DeepGTAV plugin. Once the game starts DeepGTAV will wait for TCP clients to connect on port 8000.
  10.  
  11. Clients connected to DeepGTAV are allowed to send messages to GTAV to start and configure the research environment (Start and Config messages), send driving commands to control the vehicle (Commands message) and to stop the environment to fallback to normal gameplay (Stop message).
  12.  
  13. When the environment has been started with the Start message, DeepGTAV will start sending the data gathered from the game back to the client in JSON format, so the client can use it to store a dataset, run it through a self-driving agent...
  14.  
  15. The data sent back to the client and intitial conditions will depend on the parameters sent by the client with the Start or Config messages. Things that can be controlled for instance are: rate of transmission, frame width and height, weather, time, type of vehicle, driving style, wether to get surrounding vehicles or peds, type of reward function and a large etc...
  16.  
  17. VPilot provides a nice interface and examples written in Python to use DeepGTAV for your self-driving car research.
  18.  
  19. The following chapters describe the purpose and contents of each message.
  20.  
  21. Messages from the client to DeepGTAV
  22.  
  23. Messages must be always be sent in two steps: First send the JSON message length in bytes and then send the message itself, this is done so DeepGTAV knows when to stop reading a message.
  24.  
  25. Start
  26.  
  27. This is the message that needs to be sent to start DeepGTAV, any other message sent prior to this won't make any effect. Along with this message, several fields can be set to start DeepGTAV with the desired initial conditions and requested Data transmission.
  28.  
  29. When this message is sent the environment starts, the game camera is set to the front center of the vehicle and Data starts being sent back to the client until the client is disconnected or an Stop message is received
  30.  
  31. Here follows an example of the Start message:
  32.  
  33. {"start": {
  34.  "scenario": {
  35.    "location": [1015.6, 736.8],
  36.    "time": [22, null],
  37.    "weather": "RAIN",
  38.    "vehicle": null,
  39.    "drivingMode": [1074528293, 15.0]
  40.  },
  41.  "dataset": {
  42.    "rate": 20,
  43.    "frame": [227, 227],
  44.    "vehicles": true,
  45.    "peds": false,
  46.    "trafficSigns": null,
  47.    "direction": [1234.8, 354.3, 0],
  48.    "reward": [15.0, 0.5],
  49.    "throttle": true,
  50.    "brake": true,
  51.    "steering": true,
  52.    "speed": null,
  53.    "yawRate": false,
  54.    "drivingMode": null,
  55.    "location": null,
  56.    "time": false    
  57.  }
  58. }}
  59. The scenario field specifies the desired intitial conditions for the environment. If any of its fields or itself is null or invalid the relevant configuration will be randomly set.
  60.  
  61. The dataset field specifies the data we want back from the game. If any of its fields or itself is null or invalid, the relevant Data field will be deactivated, except for the frame rate and dimensions, which will be set to 10 Hz and 320x160 by default.
  62.  
  63. Config
  64.  
  65. This message allows to change at any moment during DeepGTAV's execution, the initial configuration set by the Start message.
  66.  
  67. Here follows an example of the Config message (identical to the Start message):
  68.  
  69. {"start": {
  70.   "scenario": {
  71.     "location": [1015.6, 736.8],
  72.     "time": null,
  73.     "weather": "SUNNY",
  74.     "vehicle": "voltic",
  75.     "drivingMode": -1
  76.   },
  77.   "dataset": {
  78.     "rate": null,
  79.     "frame": null,
  80.     "vehicles": false,
  81.     "peds": true,
  82.     "trafficSigns": null,
  83.     "direction": null,
  84.     "reward": null,
  85.     "throttle": null,
  86.     "brake": false,
  87.     "steering": false,
  88.     "speed": true,
  89.     "yawRate": null,
  90.     "drivingMode": null,
  91.     "location": null,
  92.     "time": true  
  93.   }
  94. }}
  95. In this case, if any field is null or invalid, the previous configuration is kept. Otherwise the configuration is overrided.
  96.  
  97. Commands
  98.  
  99. As simple as it seems, this message can be sent at any moment during DeepGTAV's execution to control the vehicle. Note that you will only be able to control the vehicle if drivingMode is set to manual.
  100.  
  101. Here follows an example of the Commands message:
  102.  
  103. {"commands": {
  104.  "throttle": 1.0,
  105.  "brake": 0.0,
  106.  "steering": -0.5
  107. }}
  108. Stop
  109.  
  110. Stops the environment and allows the user to go back to the normal gameplay. Simply disconnecting the client produces the same effect.
  111.  
  112. Here follows an example of the Stop message:
  113.  
  114. {"stop": {}}
  115. Messages from DeepGTAV to the client
  116.  
  117. DeepGTAV will always send the messages in two steps: First it will send the message length in bytes and then it will send the message itself, so the client can know when to stop reading it.
  118.  
  119. The messages rate and content will depend on the configuration set by the Start or Config messages, and are always sent consecutively (Frame, Data).
  120.  
  121. Frame
  122.  
  123. This is a byte array containing the RGB values of the current GTAV screen (resized to the specified width and length). Make sure the window is not minimized, otherwise the values will be all zeroes (black).
  124.  
  125. Data
  126.  
  127. Reporting issues and TODOs
  128.  
  129. DeepGTAV generates a useful log file named deepgtav.log in GTAV's installation directory. Please attach it in your issue when reporting any bug.
  130.  
  131. TODO:
  132.  
  133. Improve code quality (a lot!)
  134. Add support for traffic signs detection
  135. Add support for driving mode override
  136. General bug fixing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement