-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
42 lines (36 loc) · 1.37 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Project Description:
This is really an exercise in learning Ruby (otherwise, Ruby would not
have been picked, as it's not well suited to this kind of application).
Apart from that, it's goal is to use a genetic algorithm to create
series of keypresses that beat QWOP (http://www.foddy.net/Athletics.html).
Status:
Can get 4-5 metres consistently after 5-10 generations, then peters out
due to lack of consistency.
Dependencies:
>=ruby1.9.1
xdotool
xwd
convert
gocr
xlib-devel (for making grabpixel)
google-chrome (with no bookmark bar)
1440x900 resolution (ridiculous)
probably a few other things because pixel locations are hardcoded
To run:
cd qwopper
make
ruby1.9.1 qwop.rb
Notes:
Theoretically, xlib makes it possible to run this in the background,
but most programs (Chrome included) ignore sent keypresses
unless they're running in the foreground. (See "man xdotool")
Before a new trial is started, the program waits for a certain color
pixel to appear near the runner's jawline (to improve consistency).
If the pixel doesn't appear within a certain amount of time, odds
are it's not going to, so the runner purposely falls down ("I Quit.").
TODO:
Make breeding function work so distance goes beyond ~5 meters
Make resolution independent
Improve consistency
Make breeding keylists seamless (detect down keys in previous gen.)
Add time into the scoring function