Skip to content

MarkLC-r7/qwopper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

An attempt at a genetic solution to QWOP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published