ivanseidel / IAMDinosaur

🦄 An Artificial Inteligence to teach Google's Dinosaur to jump cactus
MIT License
2.8k stars 533 forks source link

Sensor reading slow #18

Open babbott1000 opened 8 years ago

babbott1000 commented 8 years ago

Hi, For the first time when I ran it, it would not pass the cacti, so then looked on the issues page. I found out that it was because the sensor reading was slow(it was only getting about 1 reading a second), but I couldn't figure out why. I am fairly sure it is not because of my computer speed, I think it might have to do with the fact that I am running windows(10 pro). I tried moving it to the top priority in task manager, but that did basically nothing. Any ideas?

ivanseidel commented 8 years ago

This is the limit factor of IAMDinosaur...

The library RobotJS reads a single pixel in the screen by taking a screenshot and reading that data.

This tooks time and is not ideal. The goal is to help them implement this: https://github.com/octalmage/robotjs/issues/13

If you feel you can help, this would improve a LOT

Falci commented 7 years ago

I found your youtube video yesterday, it looks amazing, congrats! I never tested machine learning, and also this was the first time I saw RobotJS

About the screen read time, I was wondering if there is a way to read the javascript variables using RobotJs or something else.

While running the game, try to output this variable: Runner.instance_.horizon.obstacles It has some interesting properties, like:

{
  size: 1,
  speedOffset: 0,
  width: 25,
  xPos: 258,
  yPos: 90
}