Ijaw Dictionary Online

How Automobiles Work


What’s going on everybody and welcome to a Python Plays GTA V tutorial series. So in this series, what we’re going to be doing is just simply exploring the open world of Grand Theft Auto with Python, seeing what we can come up with and what we can do. The truth is I really don’t know. The only thing I’ve done for this entire series is just make sure it’s possible. So I wanted to make certain a few things. One thing is that we can just process frames quickly enough, so if we can only process frames at like 1 or 2 frames a second, that’s probably not gonna be good enough to really do much at all in this game. So I was really kinda hoping for at least a 10+ frame per second process rate, especially if all we’re doing is trying is just trying to get the frames into Python. Coz then we’re gonna in theory we’ll to be running algorithms and all kinds of stuff. So that was one thing I wanted to confirm and the other thing I wanted to confirm was that we can actually control Grand Theft Auto with Python. I was pretty sure we could just use Zenkeys or PyAutoGui, but I wasn’t positive on that. As long as we can do those two things, I knew that “Okay, we can actually do this project.”

100 thoughts on “Intro and Screen reading – Python plays Grand Theft Auto V p.1

  1. Is there a way to go on faster capturing on GPU ? You talked about it but sadly i did not find a working solution. I tried using GTK but it's not working for me in python 3. Not tried on python 2.

  2. Awesome tutorial.

    Just one question, do you know if it's possible to simulate mouse movements in DirectX (i.e. CS: GO and other FPS) games?

    Everything I've tried so far, ranging from ctypes to pyautogui won't work due to DirectInput and/or forced coordinates.

    Do you have any suggestions?

  3. What could affect the fps, the CPU?
    edit: nvm on linux I was using pyscreenshot instead of PIL. pss seems to just be a wrapper for PIL and is about 5x slower in updating.

  4. Hey! I am trying to build a robot that would play a game that displays numbers on the screen. Is there a way to detect numbers via python?

  5. I am very interested in the idea of machine learning and python is one of the languages I enjoy the most. After watching a few of your python basics I came here. Seeing as how my laptop seemed to retain the same FPS even after the fix you performed I did some additional research and found a solution which nets around 44 FPS with similar window settings. I plan to follow the series but have a different end goal for the bot and have thus made a separate GitHub repository for the modified file. It is called 'v1.0 Modified.py'

  6. can some one help me please

    Could not find a version that satisfies the requirement tensorflow (from versions: )
    No matching distribution found for tensorflow
    i get this error when trying to add tensorflow through pycharm

  7. @sentdex please help me out,  I was working through the tutorials as you have instructed but my keyboard inputs to gta 5 is not working but it is working in NFS most wanted, please help me out………………… I also tried it with import keyboard, but the results are same in nfs it works but in gta 5 no result.

  8. I tries to run this on my mac using Anaconda and Vscode, but when I try to run it the windows does not show up, is this windows specific?

  9. A complete noob, right here just to know what are the prerequisites so that I can understand each and evey line of code you write over here?
    Please help….Someone???

  10. You are the God of Python, Love your tutorials so much, super thoughtful and inspiring topics

  11. Great video man, I got a question: I have a lil project in mind where it moves to beacons on the map, what would be a good start? I got the screen region, now I set the ROI to the mini-map, and I want to make the player move untill it gets closer to the beacon

  12. this is exactly what i need to see how everything works.
    Just starting the playlist.
    thanks in advance.

  13. sentdex i have a problem. i;m running ubuntu and imageGrab is compatible just with windows and mac os. do you know any alternateive solution for that?

  14. My GTA is on Steam, unfortunately. I confess I'd really like to try, but I'm afraid some Steam anti-cheat system might ban me from interpreting that I'm using any cheats.

  15. Hi! I installed GTA 5 on my laptop but it can't be run because my CPU doesn't satisfy the requirements but how about GTA 4? The quality doesn't look as great as version 5, though. Has anyone tried the codes on GTA 4? Or is there someone nice enough who will introduce me a game with pretty much the same quality as GTA 5 but not requiring a powerful CPU? Obviously, I'm not a gamer but I'd be eternally grateful if you do! Much obliged!

  16. For every change in frame ( in the window) cv2 is creating a new wndow is inside window( and goes on), i have used the same code as shown ( cross checked from the website) did anyone face similar issue , can some one help ?, ( it is working fine for displaying any video with cv2 through, its just with Imagegrab )
    thank you

  17. Hello Harrison, are there any tips to enter directly to this scene in GTA? It took me a lot time play the game and compelete the missions rather than programming. 🙁 Thanks

  18. If you're wanting better FPS, have a search for "Python MSS" – it will speed up the loop times to under 1ms. I'm easily getting over 1000fps with a 916×672 game window.
    I'm a Linux user but should still work in Windows/Mac.
    Works just like PIL/Pillow using a grab.

  19. Hi, I found a faster way to get the screencapture.
    https://www.reddit.com/r/Python/comments/7r945t/super_fast_screenshot_taking_pythonmss/
    I'm running on an 8750H
    In fact, the way it's shown in the video doesn't work for me 🙁 I'm on python3

  20. Hi,

    I have a video of a moving car on the highway. Can I use your codes to detect the object in front of the car ?

  21. omg. ImageGrab not support linux. I've tested another library 'pyscreenshot' wich have module ImageGrab but it works veeeeery slow.

  22. HELP – plz someone send a link of MOD asap that makes the game stay in DAY-time instead of switcihing to MP and making a custom Race mission, thank you.

  23. Hey sentdex, when I input the code above you have at around 5.30, and run the code, it keeps opening multiple windows of my screen. how can I get it to just keep the one screen like you have?

  24. The proper way to do it is cv2.RGB2BGR because Pillow uses RGB and cv2 uses BGR, but RGB2BGR and BGR2RGB do practically the same thing.

  25. Hello Sentdex, in the game settings you can change the in-car camera angle from NPC to car hood,, and a setting to keep the first person mode camera to remain stationary,, I wanna learn to do the same thing but with a NPC , (self-learning and evolving npc) I really admire your work and wanna learn and see more , thanks sentdex

  26. I have noticed for some reason that python does things alot quicker than python shell (IDLE). Maybe you could have gotten an even better feedback refresh rate? By python I mean opening a .py with a double click…

  27. Hey, are there any tips or guides towards what version of GTAV to get for this project and a full list of dependencies for Python to interact with the game itself please?

    What I mean is do I just grab the game from Steam? and can I mod/interact with things with this version? or is there another version you use for this?

  28. is there any way that we can just use the window name to capture the frames so that we can minimize the game window and do other works? btw this video helped me a lot, thank you very much for helping the community

  29. Hi bro,
    Can you show how to use Python with unreal engine 4. im searching about it to internet but it didn't find to result and example too much.

  30. Hey man your videos have helped me a lot through the years. I always seem to find my self doing projects and finding tutorials of yours doing exactly what I'm doing lol. I just started a game automation thing recently I have a pythonic window capture thing that gets ~30 fps using win32 API. You've helped me so much so I really wanted to send you my solution like you asked at 14:10
    https://mega.nz/#F!7iw3CSQI!sDEjBGD0OVL31Q2TFsOHrA
    Whether or not you implement it, I just wanted to say thanks for all the great videos. Well, I'm off to binge these GTA tutorials!

  31. I discovered Awesomeness, mastery, and fun….

    Edit:
    Holy moly! I feel blessed!!!!!
    Thanks for reacting to my comment, oh, and one thing, I'm planning to do the same on some other game…
    More on that later…. 🙂

  32. does anyone know how he got the gta window that small? I am having issues making mine that small. Thanks

  33. Hey have you ever heard of automation game for cars? I was thinking you could write a neural network in python for that game since that game allows modding via unreal engine with has a python api and allows you to test cars so maybe you can do self driving car tests there too similar to the what your doing for gta?

  34. I tried running this on Jupyter , with python 3.7. with PIL installed. The code runs with no error. But it doesnt show any window.

  35. Did anyone notice that at 10:22 he was getting better rates just because he printed the time before the actual calculations? But he was happy, thats what matters

Leave a Reply

Your email address will not be published. Required fields are marked *