ported code for bot player base