A large amount of AI math done

not sure if it will work with the jumping/painting etc but the theory is
there and it should work