def after_step(self, *args, **kwargs) -> Dict:
        """
        Update states after finishing movement
        :return: if this episode is done
        """

        step_infos = {}
        if self.record_episode:
            assert list(self.managers.keys())[-1] == "record_manager", "Record Manager should have lowest priority"
        for manager in self.managers.values():
            new_step_info = manager.after_step(*args, **kwargs)
            step_infos = concat_step_infos([step_infos, new_step_info])
        self.interface.after_step()

        # === Option 1: Set episode_step to "num of calls to env.step"
        # We want to make sure that the episode_step is always aligned to the "number of calls to env.step"
        # So if this function is called in env.reset, we will not increment episode_step.
        # if call_from_reset:
        #     pass
        # else:
        #     self.episode_step += 1

        # === Option 2: Following old code.
        # Note that this function will be called in _get_reset_return.
        # Therefore, after reset the episode_step is immediately goes to 1
        # even if no env.step is called.

        # Episode_step should be increased before env.step(). I moved it to engine.before_step() now.

        # cull distant blocks
        # poses = [v.position for v in self.agent_manager.active_agents.values()]
        return step_infos

        Update states after finishing movement
        :return: if this episode is done
        
metadrive/engine/base_engine.py