def maxstep_terminal_condition(env, max_step=500):
  """A terminal condition based on the time step.

  Args:
    env: An instance of MinitaurGymEnv
    max_step: The maximum time step allowed for the environment

  Returns:
    A boolean indicating if the env.step exceeds the given limit
  """
  return env.env_step_counter > max_step