def add_spawn_info(self, obj, object_class, kwargs):
        """
        Call when spawn new objects, ignore map related things
        """
        if not is_map_related_class(object_class) and self.engine.record_episode:
            name = obj.name
            assert name not in self.current_frame.spawn_info, "Duplicated record!"
            assert name not in self._episode_obj_names, "Duplicated name using!"
            self._episode_obj_names.add(name)
            self.current_frame.spawn_info[name] = {
                ObjectState.CLASS: object_class,
                ObjectState.INIT_KWARGS: kwargs,
                ObjectState.NAME: name
            }

            # update step info in after step so exempt the requirement for adding info here
            # self.current_frame.step_info[name] = obj.get_state()
            # policy_mapping = self.engine.get_policies()
            # if name in policy_mapping:
            #     self.current_frame.policy_info[name] = policy_mapping[name].get_state()

        Call when spawn new objects, ignore map related things
        
metadrive/manager/record_manager.py