News for hackers. Stuff that matters.
Re:Python plays Grand Theft Auto V by StavrosK on Wednesday April 19, 2017 @08:25AM (#14147205)
Here's a faster way to get a frame using PyGTK:

https://www.pastery.net/xafjmn/

Takes around 5ms per frame for me, rather than 50.

Slightly shorter code (still using the same method): https://askubuntu.com/a/400384/73044

Re:Python plays Grand Theft Auto V by sentdex on Wednesday April 19, 2017 @09:24AM (#14147496)
Thanks for sharing this, will definitely look into it. With the ever improving FPS, this AI's reflexes are going to be insane.
Re:Python plays Grand Theft Auto V by StavrosK on Wednesday April 19, 2017 @09:25PM (#14153251)
No problem, glad to have helped!
Re:Python plays Grand Theft Auto V by nbrochu on Thursday April 20, 2017 @02:11AM (#14154345)
Thank you so much for sharing this! I'm working on something similar right now (a framework to build game agents using computer vision tools) and I just went from capturing at 10-15fps with ImageGrabber, to 15-25fps with FFMpeg and finally 70-80 fps with this technique. Insane!
Re:Python plays Grand Theft Auto V by StavrosK on Thursday April 20, 2017 @08:02AM (#14155870)
You're quite welcome! I used it to capture a single pixel for my Super Hexagon LED strip (https://www.stavros.io/posts/wifi-enabled-rgb-led-strip-cont...) and it works really well.
Re:Python plays Grand Theft Auto V by nbrochu on Thursday April 20, 2017 @01:36PM (#14158910)
Really nice and can see why you needed the performance for this project. Funny that you mention Super Hexagon because it's the game I'm using for my POCs!
Re:Python plays Grand Theft Auto V by StavrosK on Friday April 21, 2017 @08:44AM (#14165022)
Oh cool, what are you doing with it? I was thinking of doing the same, I'm really interested in reading about it.
Re:Python plays Grand Theft Auto V by gejose on Wednesday April 19, 2017 @05:10PM (#14151813)
Is there a cross platform way to do this? I'd like to be able to do this on a Mac, but would prefer not to have to set up GTK (if it even works).