def generate_all_maps(self):
        """
        Call this function to generate all maps before using them
        """
        for seed in tqdm(self.maps.keys(), desc="Generate maps"):
            config = self.engine.global_config.copy()
            current_seed = seed
            self.engine.seed(seed)
            if self.maps[current_seed] is None:
                map_config = config["map_config"]
                map_config.update({"seed": current_seed})
                map_config = self.add_random_to_map(map_config)
                map = self.spawn_object(PGMap, map_config=map_config, random_seed=None)
                self.maps[current_seed] = map
                map.detach_from_world()

        Call this function to generate all maps before using them
        
metadrive/manager/pg_map_manager.py