Optimizing combat, cover, and hiding functions