optimise grid metrics functions so AI tree search runs more deeply in the same amount of time