I'm famous, I've appeared in 4:46! Hahaha Nice to see that my answer in Stack Overflow helped you... I follow your work since 2015 and it's nice to see that some old code of mine helped you in this video! Continue with the good work!
For anyone who has only recently started programming and wants to go through this tutorial thinking, "I can just copy him and everything will be okay." I wanted to leave this comment to let you know that this was an actual nightmare to get through but damn did I learn a lot. You will want to make minor changes to suit your needs and/or use different versions of python/modules and that will throw all of the code out of whack. I wish anyone who wants to follow this series luck and happy programming.
I went through the Automated Trading tutorial, and the hardest part was figuring out how to get stuff working that had evolved so what was in the tutorial was no longer applicable. But man, I learned so much doing it. @sentdex is doing God's work with these project-based tutorials, and there's a sweet spot of about three years where there's enough to keep you moving forward, but enough stuff you have to figure out on your own that you just can't help but grow.
Maxwell's Witch How do you learn these coding languages? Do you take a course or do you just memorize it. I’m asking because I want to be a software developer
This is probably my favorite series so far. I just upgraded to the gtx1070 and grabbed a racing game from steam. Hoping to make a cool AI based off this tutorial. Thanks!!!
Thanks! I got the car sorta driving using 2 lines in the road. Next step is the training data and network training. working on some videos to show the progress!!!
This is going to be an epic series. Always great stuff from you dude! I wish I had more time on my hands to go through your videos. You are the reason I will actually learn Python effectively.
Since you posted this on video #1, I just want to make sure you're aware the first 7 are all live now: pythonprogramming.net/game-frames-open-cv-python-plays-gta-v/
I assume you mean crysis, the FPS game. I am not 100% certain how to control direct mouse input at this point, but I plan to continue this sort of "Python Plays" series. It'd be super cool to continue into an FPS game of some kind in the future.
Oh, I am familiar with the meme, it's just that that meme is typically used in scenarios where it's obvious it cannot play the game in question. In this case, however, it is totally possible :)
Your ingame screen POW is always set at mid. So we know where to get the start. midW = 1920/2 # or whatever your screen size midH = 1080/2 # or whatever your screen size Lets say we have screenshot of AREA 200/200 pixels from center of screen: x0 = midW - 100, y0 = midH - 100, x1 = midW + 100, y1 = midH + 100 We have some pixel we find by our algo we want cursor point to it. POINT pixel = (x0 + 10, y0 + 10); Now we need calibrate this coordinates and make relative mouse move to our game window The formula for this: constant = 0.116f; ingame_mouse_sensetivity = 10.0f; # or whatever your settings modifier = ingame_mouse_sensetivity*constant; aimx= pixel.x + x0 - midW; aimx= int(aimx/modifire); aimy= pixel.y + y0 - midH; aimy= int(aimy/modifire); And finely send this coordinates: # using ctypes and pywin32 in python or just c++ mouse_event or sendInput INPUT ms; ms.type = INPUT_MOUSE; ms.mi.mouseData = 0; ms.mi.dx = aimx; ms.mi.dy = aimy; ms.mi.dwFlags = MOUSEEVENTF_MOVE; SendInput(1, &ms, sizeof(ms));
+sentdex Quake III might be a good choise then, since the bots are quite good and it's completely open-source, so it's relatively easy to modify and you don't get stuck halfway through.
I don't know if you've worked out your own solution by now, I started using Jupyter as well and then had to change IDEs cause I no longer wanted to keep fiddling with the separate code blocks. If it focuses on the while loop for processing the image, it can't move onto getting the car to move if it's in a different code block. I plan to use Jupyter for debugging for this project moving forward but that's about it.
Love the way you solve the problem of FPS man. I always thought that copying answers from StackOverflow and then making it changes would mean that I am a stupid kinda programmer (at least I like to call myself one :D). Thank you for giving me this satisfaction. I am automating 8 puzzle game. Thank you sentdex.
Google should use this method to train their Autonomous cars for safety of the public, I mean who in the world wants to a machine to decide their everyday life. By the way great inspirational tutorial, Now millions of ideas coming to my mind so many possibilities
Google has plenty of methods taking advantage of visual cortex functionality. For example, Google's DeepMind team has a little program you might have heard of... AlphaGo. It uses computer vision to capture data and pass through... I believe 13... layers (number could be off, but it's somewhere in that range). It uses some other things as well, such as Monte Carlo Search Tree, rollout policies, etc., but my point is that they're well aware of training through visual methods.
I'm remember when this video was released in 2017 im still learning hellow world I don't understand what he said, but now I realize he is a good teacher thanks broo
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.... :-)
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
don't know if it's been mentioned, but you can set your in game camera to hoodview on any vehicle just go in the options camera options. That way you don't gotta use the moped.
I'm no expert and this could be total bogus, but I just recently completed a python course with multiprocessing as a chapter and we basically did this: First program sets up a running local server. Second program declares the tasks to do (and puts these as arguments on a list on the local server), loads files of the workers' finished results and evaluates these. Third program creates the workers and tells them to take the next task (with the arguments) on the local server list, feed these arguments into a function and save the results of the function in a file. This is just an idea and I have no clue how good this works out in your case. But if you feel interested, I can send you the three programs we made in our course and you can try to change them accordingly.
Hi sentdex, Have you ever tried PIL in Ubuntu? I had some problem about PIL.ImageGrab function. It is not available in Linux's distributions. I tried pyscreenshot but is very ineficient. What library should i use? Thanks
+Leonardo Leon Vera i am really not sure whats best for ubuntu here, have never needed to take screenshots super fast with Python in Ubuntu. If you find a great method, please share.
YEA DUD YOU'RE A LIFE SAVER XD a simple pip install mss command let me use the code you made ^-^ and hey this works on the Raspberry pi 3 - and yes it's very slow as I just found out: 0.1 second loops showing the screen, but 0.07 second loops without showing it - this lil' RPi is a real trooper
@Sentdex, I am trying to use imagegrab in a similar way, but I'm getting an error. "Pillow was built without xcb support." I have python3.8 installed from the Microsoft store. I was wondering if you knew how I could get it up and running with that. A person on reddit suggested cygwin, but I didn't like the environment for python. It was very slow and cumbersome to use.
I get that this is episode one and that the rest of the series is ahead of me but, given the "two things" you checked to make sure that this project was viable from the start, with one of them being that you could run and train the AI on the game at a reasonable framerate (for it), would 1 really be that bad? For example, I was thinking about this earlier, and what if you ran the game just at 1 or even half a frame per second, but then for its output options instead of just it instantly reacting and doing something, it has then a 1 or 2 second action-queue it adds to to actually play the game. So, based on one frame, it could 'plan out' the next second of its gameplay instead of just instantly having to react on a frame by frame basis. Would that be reasonable? I think it wouldn't be too hard to implement in the python code if you've already got the method of creating actions and putting those in the game anyway.
I think the performance was bad initially because a copy was being made in converting the image to a numpy array maybe because of the dtype being passed. I would try using `np.asarray` instead and play with the dtype to get a bit better than 10fps. Also, why not resample the PIL image before converting to a numpy array?
My sincere thanks to you. I'm actually a psychologist rescholing myself into a Master of Comp. Statistics.. And I just love coding in Python... My end-goals is moving towards Machine Learning, but I actually lack more the computational than the statistical part... Your channel is amazing and gives me motivation to proceed! It's nice to use this as a reference to work on a project as a hobby! Do you have any reference on where/how to start on mastering Python as a 'complete' language, not just data/academic wise?
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?
Hello, maybe you could take away your map as input to the network and build some sort of separate gps, based on that little map, to tell the network when to turn while itself focusses on following lanes and avoiding traffic. The result will be also a way to comunicate to the network where you want to go and what route to take. The gps-app could also provide suggestions where the network could turn and suggested lane speeds etc. Thank you for your efforts and sharing! Cheers
Hey, first of all thanks for these videos they are awesome!, I have a quick question, im new to python but wouldn't it be better to grab the window with a print function rather than looking at specific resolution coordinates? I'm not sure how that would be done but I'm sure you know how to do it.
Is there anything you could suggest for grabbing the frames of a window on linux? I tried ffmpeg, vlc(darn, it could only ever record 5760x1080 on my triple monitors argh), and even OBS to get a solid stream of a window - 640x480 @ 30-60fps is no problem, but the delay of almost 2 seconds (using UDP on the local machine) render it unusable for realtime games. Awesome series btw ! :)
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?
I'm in college right now so I have no time to even think about trying this but I'm definitely putting this on my summer to-do list. I'm thinking maybe I'll code up a snake game and have it play that!
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.
Sentdex I really want to ask you something.... I want to get started with THIS sort of stuff like what you are doing in this video and I don't have any knowledge in Machine Learning or anything in this field. I wanna start fresh. I know the basics of Numpy and Pandas and some basic mathematics for Machine Learning from Andrew Ng's course on Coursera. Can u please please give me a sort of a roadmap of some idea as to what should I start with? It would be very helpful. Thanks Also, can you tell us how you are what you are right now in terms of your knowledge and application of Python?
thanks for your tutor master, and I have something to ask, how do we grab the screen without a new window inside django ?? and how do we detect objects that are in a circle or rectangle or polyline that we make ??
Nicely done sentdex! I've been looking for a solution to reading the screen of a game for other reasons. I couldn't get OpenCV to read the screen direclty, so I was making screnshots using a WIn32 API call and I was passing the images to OpenCV. This video has been immensly helpful! Thank you! Btw. Can you do video on converting images to text and how this could be done in Python more efficiently? I want to read the text of the user interface of a game and the text that is printed in the game and using that to automate a statistics system.
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?
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
I'm running on Ubuntu and wondering if you could recommend a linux friendly on Steam to use for the tutorial? GTA V is unfortunately not one of them. Thanks and thanks for the great tutorials!
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?
Have you tried this (screen reading) in golang? Is it faster, better, worse, slower, just not possible? I wanted to try it but I couldn't figure it out. I'm extremely new to golang though.
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
Hi sentdex! Awesome videos. What prerequisites do you consider i should have to follow these videos? (besides knowing python). Should i first watch your deep learning videos or it is not completely neccesary?
I'm famous, I've appeared in 4:46! Hahaha
Nice to see that my answer in Stack Overflow helped you... I follow your work since 2015 and it's nice to see that some old code of mine helped you in this video! Continue with the good work!
Hah, nice! You wouldn't happen to have some code for implementing PID controlling with the direct keys would you? :)
Nope =/
This is mildly interesting!
When using Imagegrab in linux it shows an error msg reading "ImportError("ImageGrab is OS X and Windows only")". How do you grab the screen on linux?
Hey. Do you think you could convert that answer to work in golang? I'm curious to know if it would perform better.
Dude.. you're the fucking best!
You're literally making learning python really fun.
That's awesome to hear! I've really been enjoying this series like none other myself :)
Everything i think about trying, you release a video on 5 days later. Really amazing work. Thanks!
For anyone who has only recently started programming and wants to go through this tutorial thinking, "I can just copy him and everything will be okay." I wanted to leave this comment to let you know that this was an actual nightmare to get through but damn did I learn a lot. You will want to make minor changes to suit your needs and/or use different versions of python/modules and that will throw all of the code out of whack. I wish anyone who wants to follow this series luck and happy programming.
can you do a video on how to get this to work?
I went through the Automated Trading tutorial, and the hardest part was figuring out how to get stuff working that had evolved so what was in the tutorial was no longer applicable. But man, I learned so much doing it. @sentdex is doing God's work with these project-based tutorials, and there's a sweet spot of about three years where there's enough to keep you moving forward, but enough stuff you have to figure out on your own that you just can't help but grow.
@@XethWaxman project based learning for life!!!!
thanks! I was about to copy his code but then i watched the rest of the videos and it allowed me to actually understand what the shit he was typing
because of you i learned python. One of my best decisions
wuda Programming is great. I had to learn c++, but getting over the learning curve is the best thing you can do.
U are not alone.
Maxwell's Witch How do you learn these coding languages? Do you take a course or do you just memorize it. I’m asking because I want to be a software developer
@@JMR_2028 You must learn the syntax and then do a lot of programming problems
Sir, you are one true legend. So many people (including me ) have benefited from your videos. A big thank you and all the best.
You are the God of Python, Love your tutorials so much, super thoughtful and inspiring topics
Man... seeing new videos from you is like Christmas. I'm excited. Once I get some free time I'll be taking advantage of this series.
I’ve stumbled upon the coding world of RUclips and I actually really like it! Great video man
This video series is so cool! Thank you Sentdex!
This is probably my favorite series so far.
I just upgraded to the gtx1070 and grabbed a racing game from steam. Hoping to make a cool AI based off this tutorial.
Thanks!!!
Best wishes with it! Let us know how you do!
Thanks! I got the car sorta driving using 2 lines in the road. Next step is the training data and network training. working on some videos to show the progress!!!
Didnt expect to see you here UwU
Upload more of that
What game did you use btw? :)
Please do more video likes this....The way you explain things is flawless
Great work man, you've made a lot of people happy with this game bot series!
You are the best,man.
your series are just amazing.
Great series. Seeing how your thought process to solve the problems is a really interesting.
Thanks!
People like you have motivated me to continue building apps, websites, and my youtube channel. Next up, is my NN
This is going to be an epic series. Always great stuff from you dude!
I wish I had more time on my hands to go through your videos.
You are the reason I will actually learn Python effectively.
Loving this new series man ! Inspiring always. Thanks.
April 1st new twighlight zone!!!!!! And I'm pumped to find this channel woot!
Bro. You are just awesome . I cant explain how much you have helped me to improve my python skills.
This kind of thing is exactly what I am looking for!! Ready for the next videos ASAP!!
Since you posted this on video #1, I just want to make sure you're aware the first 7 are all live now: pythonprogramming.net/game-frames-open-cv-python-plays-gta-v/
Heyy!! that was something amazingly interesting thing to do with python.
Man you are awesome. Keep going
Can't like this enough times! Thank you sentdex!
Happy to do it, loving this series.
But can it play crisis?
I assume you mean crysis, the FPS game. I am not 100% certain how to control direct mouse input at this point, but I plan to continue this sort of "Python Plays" series. It'd be super cool to continue into an FPS game of some kind in the future.
+Sentdex meme knowyourmeme.com/memes/but-can-it-run-crysis
Oh, I am familiar with the meme, it's just that that meme is typically used in scenarios where it's obvious it cannot play the game in question. In this case, however, it is totally possible :)
Your ingame screen POW is always set at mid.
So we know where to get the start.
midW = 1920/2 # or whatever your screen size
midH = 1080/2 # or whatever your screen size
Lets say we have screenshot of AREA 200/200 pixels from center of screen:
x0 = midW - 100, y0 = midH - 100, x1 = midW + 100, y1 = midH + 100
We have some pixel we find by our algo we want cursor point to it.
POINT pixel = (x0 + 10, y0 + 10);
Now we need calibrate this coordinates and make relative mouse move to our game window
The formula for this:
constant = 0.116f;
ingame_mouse_sensetivity = 10.0f; # or whatever your settings
modifier = ingame_mouse_sensetivity*constant;
aimx= pixel.x + x0 - midW;
aimx= int(aimx/modifire);
aimy= pixel.y + y0 - midH;
aimy= int(aimy/modifire);
And finely send this coordinates: # using ctypes and pywin32 in python or just c++ mouse_event or sendInput
INPUT ms;
ms.type = INPUT_MOUSE;
ms.mi.mouseData = 0;
ms.mi.dx = aimx;
ms.mi.dy = aimy;
ms.mi.dwFlags = MOUSEEVENTF_MOVE;
SendInput(1, &ms, sizeof(ms));
+sentdex Quake III might be a good choise then, since the bots are quite good and it's completely open-source, so it's relatively easy to modify and you don't get stuck halfway through.
Dude this was so much fun to watch. It's amazing how easy and enjoyable you make coding look.
How did you get to where you are with programming?
Boom !!! Crazy Man !!! You should start something big. Thanks for this series.
This dude is a super hero. Nailed it again!!! Thank you.
Man, just keep doing what you do. Awesome!
Thanks!
Just found these series. You got a new subscriber here ^^
thanks, This is so helpful
I'm excited for this series.
I also appreciate a fellow windows user. Not leaving me in the dust.
Holy crap, I did not expect this. Awesome!
Surprise! :D
i was searching yesterday to do screen reading and it shows on my subscribe feed THNXX FOR SO GOOD TUTORIALS !!!!!
Where did you get that Python hoodie?
I have them made, and sell them: pythonprogramming.net/store/
Awesome! I love the site btw, hands down the best tutorials to learn from.
So many businesses haha! ;)
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.
I don't know if you've worked out your own solution by now, I started using Jupyter as well and then had to change IDEs cause I no longer wanted to keep fiddling with the separate code blocks. If it focuses on the while loop for processing the image, it can't move onto getting the car to move if it's in a different code block. I plan to use Jupyter for debugging for this project moving forward but that's about it.
You are my idol, it's like you waste no second in your life. Good job!
I just found this and I'm so excited. I know how I'm spending the rest of my night haha.
:D
Love the way you solve the problem of FPS man.
I always thought that copying answers from StackOverflow and then making it changes would mean that I am a stupid kinda programmer (at least I like to call myself one :D). Thank you for giving me this satisfaction. I am automating 8 puzzle game.
Thank you sentdex.
You make the coolest videos!
Thanks!
This series is sooooo awesome! btw I'm waiting for some AI bot videos
Damn, 2 years of college and I still think you sir, are a freaking legendary magician
Google should use this method to train their Autonomous cars for safety of the public, I mean who in the world wants to a machine to decide their everyday life. By the way great inspirational tutorial, Now millions of ideas coming to my mind so many possibilities
Google has plenty of methods taking advantage of visual cortex functionality. For example, Google's DeepMind team has a little program you might have heard of... AlphaGo. It uses computer vision to capture data and pass through... I believe 13... layers (number could be off, but it's somewhere in that range). It uses some other things as well, such as Monte Carlo Search Tree, rollout policies, etc., but my point is that they're well aware of training through visual methods.
Yeah the program that beat the human champion of the game, and has possibilities more than the number of atoms in the universe
Code bullet sent me hear
Welcome good sir.
*here not hear
Same
Awesome tutorial series, I'm super excited to start it 😄🐍🚗🤖
I'm remember when this video was released in 2017 im still learning hellow world I don't understand what he said, but now I realize he is a good teacher thanks broo
holy shit, sentdex! this is so cool!
Oh wow, seems like you developed Python by yourself, lmao. You're the man!
awesome video sir I have learned something new that is not all bugs are present in your code block
This is fascinating. Instant subscribe.
Thanks for the support!
Awesome idea for series !
Great series mate!
well. I love this tutorials :) they give me motivation do learn python even more
this is exactly what i need to see how everything works.
Just starting the playlist.
thanks in advance.
Hope you enjoy!
11:27 uAsuhAUsh love your vids bro!
ImageGrab is windows only.. for Linux users you will have to import pyscreenshot as ImageGrab
Thanks! I was hoping someone would have mentioned the linux alternative. Cheers!
11:25
"did i close what we were just working on?!"
good thing you have a monitor on your ceiling for just this situation
Lmao, well I do have a monitor up where I was looking, just not on the ceiling :P
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.... :-)
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
Hi sentdex, you are amazing dude
This is one amazing wallpaper
Sick series!
don't know if it's been mentioned, but you can set your in game camera to hoodview on any vehicle just go in the options camera options. That way you don't gotta use the moped.
+Michael Crider MY man! I did not know this, youre the first to mention. Thanks!
could you get more frames per second by using multiprocessing or multithreading?
I am not sure how I'd set that up, but possibly.
I'm no expert and this could be total bogus, but I just recently completed a python course with multiprocessing as a chapter and we basically did this:
First program sets up a running local server.
Second program declares the tasks to do (and puts these as arguments on a list on the local server), loads files of the workers' finished results and evaluates these.
Third program creates the workers and tells them to take the next task (with the arguments) on the local server list, feed these arguments into a function and save the results of the function in a file.
This is just an idea and I have no clue how good this works out in your case. But if you feel interested, I can send you the three programs we made in our course and you can try to change them accordingly.
sounds interesting, I'd like to try that
How do you wanna recieve it?
Sebastian Gruber send it to this email. alerigau@gmail.com
Fascinating stuff dude :)
Man this is so cool
Hi sentdex, Have you ever tried PIL in Ubuntu? I had some problem about PIL.ImageGrab function. It is not available in Linux's distributions. I tried pyscreenshot but is very ineficient. What library should i use? Thanks
+Leonardo Leon Vera i am really not sure whats best for ubuntu here, have never needed to take screenshots super fast with Python in Ubuntu. If you find a great method, please share.
See my other comment, and i think i've found the best solution: "mss"
My code is here :
gist.github.com/Hell0w/84513beda0b8bada8b5323afc3e491d9
@sentdex You could also use mss, it's cross platform and a lot faster.
YEA DUD YOU'RE A LIFE SAVER XD a simple pip install mss command let me use the code you made ^-^
and hey this works on the Raspberry pi 3
- and yes it's very slow as I just found out: 0.1 second loops showing the screen, but 0.07 second loops without showing it - this lil' RPi is a real trooper
+Spencer (Pizzafoot) Tanks! The raspberry pi is the better thing in the world!
For me, on a 3GB ram computer with a very bad GPU😊, it works awesomely.
Very nice bro! keep it going
I'm sorry, but "Python plays Grand Theft Auto V" is promising far more than I expect this video to deliver.
at 11:56 you convert the colors, is this not unnessecary? shouldn't it make no difference to charles wether the colors are shifted?
Nope, it doesn't. this is wasted processing.
@Sentdex, I am trying to use imagegrab in a similar way, but I'm getting an error. "Pillow was built without xcb support."
I have python3.8 installed from the Microsoft store. I was wondering if you knew how I could get it up and running with that.
A person on reddit suggested cygwin, but I didn't like the environment for python. It was very slow and cumbersome to use.
I get that this is episode one and that the rest of the series is ahead of me but, given the "two things" you checked to make sure that this project was viable from the start, with one of them being that you could run and train the AI on the game at a reasonable framerate (for it), would 1 really be that bad? For example, I was thinking about this earlier, and what if you ran the game just at 1 or even half a frame per second, but then for its output options instead of just it instantly reacting and doing something, it has then a 1 or 2 second action-queue it adds to to actually play the game. So, based on one frame, it could 'plan out' the next second of its gameplay instead of just instantly having to react on a frame by frame basis. Would that be reasonable? I think it wouldn't be too hard to implement in the python code if you've already got the method of creating actions and putting those in the game anyway.
I think the performance was bad initially because a copy was being made in converting the image to a numpy array maybe because of the dtype being passed. I would try using `np.asarray` instead and play with the dtype to get a bit better than 10fps. Also, why not resample the PIL image before converting to a numpy array?
My sincere thanks to you. I'm actually a psychologist rescholing myself into a Master of Comp. Statistics.. And I just love coding in Python... My end-goals is moving towards Machine Learning, but I actually lack more the computational than the statistical part... Your channel is amazing and gives me motivation to proceed! It's nice to use this as a reference to work on a project as a hobby!
Do you have any reference on where/how to start on mastering Python as a 'complete' language, not just data/academic wise?
you are the definition of awesome.
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?
Hello, maybe you could take away your map as input to the network and build some sort of separate gps, based on that little map, to tell the network when to turn while itself focusses on following lanes and avoiding traffic. The result will be also a way to comunicate to the network where you want to go and what route to take. The gps-app could also provide suggestions where the network could turn and suggested lane speeds etc.
Thank you for your efforts and sharing!
Cheers
Awesome video man!
Thanks!
Hey, first of all thanks for these videos they are awesome!, I have a quick question, im new to python but wouldn't it be better to grab the window with a print function rather than looking at specific resolution coordinates? I'm not sure how that would be done but I'm sure you know how to do it.
For following this series.........
What are the pre-requisites........
Please Tell me
Google concepts you don't understand, otherwise, none.
Is there anything you could suggest for grabbing the frames of a window on linux?
I tried ffmpeg, vlc(darn, it could only ever record 5760x1080 on my triple monitors argh), and even OBS to get a solid stream of a window - 640x480 @ 30-60fps is no problem, but the delay of almost 2 seconds (using UDP on the local machine) render it unusable for realtime games.
Awesome series btw ! :)
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.
Do you think it is possible to do such think with GTA San Andreas? I'm asking because I have a mediocre laptop
You can do this with any game but you will have to modify the code to fit the game
What kind of modification will be require?
this is really really fun!
4k wallpapers please? 😂
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?
I'm in college right now so I have no time to even think about trying this but I'm definitely putting this on my summer to-do list. I'm thinking maybe I'll code up a snake game and have it play that!
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.
Sentdex I really want to ask you something....
I want to get started with THIS sort of stuff like what you are doing in this video and I don't have any knowledge in Machine Learning or anything in this field. I wanna start fresh. I know the basics of Numpy and Pandas and some basic mathematics for Machine Learning from Andrew Ng's course on Coursera. Can u please please give me a sort of a roadmap of some idea as to what should I start with? It would be very helpful. Thanks
Also, can you tell us how you are what you are right now in terms of your knowledge and application of Python?
thanks for your tutor master, and I have something to ask,
how do we grab the screen without a new window inside django ?? and how do we detect objects that are in a circle or rectangle or polyline that we make ??
Nicely done sentdex! I've been looking for a solution to reading the screen of a game for other reasons. I couldn't get OpenCV to read the screen direclty, so I was making screnshots using a WIn32 API call and I was passing the images to OpenCV. This video has been immensly helpful! Thank you! Btw. Can you do video on converting images to text and how this could be done in Python more efficiently? I want to read the text of the user interface of a game and the text that is printed in the game and using that to automate a statistics system.
I was wondering if you could put the links to the mods that you use. They look pretty handy.
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?
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
awesome video about ai-gamging.. love it :D
you are awesome 😍😍
so many things learned 😎😎
I'm running on Ubuntu and wondering if you could recommend a linux friendly on Steam to use for the tutorial? GTA V is unfortunately not one of them.
Thanks and thanks for the great tutorials!
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?
instead of running the capture script locally to 'clone' the GTA window, would it be possible to do the same from an another PC on the same network?
Have you tried this (screen reading) in golang? Is it faster, better, worse, slower, just not possible? I wanted to try it but I couldn't figure it out. I'm extremely new to golang though.
last time = time.time.
Woah Deep bro!
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
Hi sentdex! Awesome videos. What prerequisites do you consider i should have to follow these videos? (besides knowing python). Should i first watch your deep learning videos or it is not completely neccesary?