Skip to content

A Convnet to drive vehicles in-game and a murder bot :)

Notifications You must be signed in to change notification settings

MFOSSociety/GTA-V-BOT

Repository files navigation

GTA-V-bot

This will work with other games too

Made by following tutorials by Sentdex

Requirements :

  • Tensorflow-gpu (pip install tensorflow-gpu) (tensorflow for cpu will work, but will take a much longer time, possibly days, to fit the model)

  • CUDA and CuDNN that are compatible with each other and the tensorflow version.

  • mss for screen-cap (pip install mss)

  • numpy (pip install numpy)

  • opencv (pip install opencv-python)

    (Save yourself some time and do pip install -r requirements.txt)

How to use : The Self-driving car

Change the game resolution to 800x600. If you want to use a custom resolution, edit monitor dict in trainingdatacollector.py.

Position the game window in the top left corner, make sure no other window is overlapping with the game window.

Start trainingdatacollector.py and play the game yourself in the manner you want the Neural Net to learn.

If you want to register extra keys while playing, edit the keys_to_output function. Change the size of the one hot array and add more statements accordingly

(consider automating the OHE conversion process if you have too many keys)

After collecting the training data, use balancedata.py to balance the data. You may need to edit balancedata.py if you have additional keys.

Anything less than 50k samples, post-balancing, will yield poor results. Try to reach at least a 100k samples, post-balancing

Use modelfit.py to fit everything, make sure alexnet.py is in the same directory. (you may need to edit alexnet.py if you have additional keys)

After saving the model, start up the game again, position it correctly and use testingfile.py

If all goes well then the ingame character should move according to the predicted moves made by the model you made.


How to use : theRidiculouslySlowMurderBot

clone https://github.com/tensorflow/models and move the .py file to models\research\object_detection

The bot is ridiculously slow, gives a shitty frame-rate and heats up your system. What more could you ask for? :)

(will update the bot to be faster and more accurate in the future)

About

A Convnet to drive vehicles in-game and a murder bot :)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages