def configure_scenes(
    model: language_model.LanguageModel,
    game_master_memory: associative_memory.AssociativeMemory,
    players: Sequence[deprecated_agent.BasicAgent | entity_agent.EntityAgent],
    clock: game_clock.MultiIntervalClock,
    main_player_configs: Sequence[formative_memories.AgentConfig],
    supporting_player_configs: Sequence[formative_memories.AgentConfig],
    antagonist_config: formative_memories.AgentConfig,
    time_and_place_params: types.ModuleType,
    sampled_settings: Any,
    start_time: datetime.datetime,
    verbose: bool = False,
) -> tuple[
    Sequence[scene_lib.SceneSpec],
    game_master.GameMaster,
    LaborStrike,
]:
  """Configure the scene storyboard structure.

  Args:
    model: the language model to use.
    game_master_memory: the game master memory to use.
    players: the players to use.
    clock: the clock to use.
    main_player_configs: configs for the main characters
    supporting_player_configs: configs for the supporting characters
    antagonist_config: config of the antagonist character
    time_and_place_params: the module containing the time and place parameters
    sampled_settings: the environment configuration containing the time and
      place details.
    start_time: the start time/date in the game world for the first scene
    verbose: whether or not to print debug logging (off by default)

  Returns:
    scenes: a sequence of scene specifications
    decision_env: the game master object for the decision scenes
    industrial_action: the labor strike game master component used in the
      decision scenes
  """
  main_player_configs_list = list(main_player_configs)
  player_configs = main_player_configs_list + list(supporting_player_configs)
  num_workers = float(len(main_player_configs_list))
  industrial_action = gm_contrib.industrial_action.LaborStrike(
      model=model,
      memory=game_master_memory,
      cooperative_option=DAILY_OPTIONS['cooperation'],
      resolution_scene=DECISION_SCENE_TYPE,
      production_function=lambda num_cooperators: num_cooperators / num_workers,
      players=players,
      acting_player_names=[cfg.name for cfg in main_player_configs],
      players_to_inform=[antagonist_config.name],
      clock_now=clock.now,
      pressure_threshold=time_and_place_params.PRESSURE_THRESHOLD,
      name='pressure from industrial action',
      verbose=verbose,
  )
  decision_env = game_master.GameMaster(
      model=model,
      memory=game_master_memory,
      clock=clock,
      name='decision environment',
      players=players,
      components=[industrial_action],
      update_thought_chain=[thought_chains_lib.identity],
      randomise_initiative=True,
      player_observes_event=False,
      concurrent_externalities=False,
      verbose=verbose,
      seed=sampled_settings.seed,
  )

  def _get_discussion_scene_type(
      idx: int) -> tuple[str, scene_lib.SceneTypeSpec]:
    scene_type_name = f'{DISCUSSION_SCENE_TYPE}_{idx}'
    scene_type_spec = scene_lib.SceneTypeSpec(
        name=scene_type_name,
        premise={
            cfg.name: [
                time_and_place_params.WORKER_EVENING_INTRO.format(
                    player_name=cfg.name
                ),
                sampled_settings.overheard_strike_talk[idx].format(
                    player_name=cfg.name
                ),
            ]
            for cfg in player_configs
        },
    )
    return (scene_type_name, scene_type_spec)

  discussion_scene_types = []
  discussion_scene_specs = []
  for i in range(len(sampled_settings.overheard_strike_talk)):
    discussion_scene_type, discussion_scene_spec = _get_discussion_scene_type(i)
    discussion_scene_types.append(discussion_scene_type)
    discussion_scene_specs.append(discussion_scene_spec)

  scene_specs = {
      DECISION_SCENE_TYPE: scene_lib.SceneTypeSpec(
          name=DECISION_SCENE_TYPE,
          premise={
              cfg.name: [
                  time_and_place_params.WORKER_MORNING_INTRO.format(
                      player_name=cfg.name
                  )
              ]
              for cfg in player_configs
          },
          action_spec=agent_lib.choice_action_spec(
              call_to_action='How will {name} spend the day?',
              options=tuple(DAILY_OPTIONS.values()),
              tag='daily_action',
          ),
          override_game_master=decision_env,
      ),
      BOSS_DECISION_SCENE_TYPE: scene_lib.SceneTypeSpec(
          name=BOSS_DECISION_SCENE_TYPE,
          premise={
              cfg.name: [
                  time_and_place_params.BOSS_MORNING_INTRO.format(
                      player_name=cfg.name
                  )
              ]
              for cfg in player_configs
          },
          action_spec=agent_lib.choice_action_spec(
              call_to_action=time_and_place_params.BOSS_CALL_TO_ACTION,
              options=tuple(time_and_place_params.BOSS_OPTIONS.values()),
              tag='boss_action',
          ),
          override_game_master=decision_env,
      ),
  }
  scene_specs.update({discussion_scene_type: discussion_scene_spec
                      for discussion_scene_type, discussion_scene_spec
                      in zip(discussion_scene_types, discussion_scene_specs)})

  day = datetime.timedelta(days=1)
  scenes = [
      # Day 0
      scene_lib.SceneSpec(
          # Dinner in the saloon
          scene_type=scene_specs[discussion_scene_types[0]],
          start_time=start_time + datetime.timedelta(hours=20),
          participant_configs=main_player_configs,
          num_rounds=1,
      ),
      # Day 1
      scene_lib.SceneSpec(
          # Construction workers start the day first
          scene_type=scene_specs[DECISION_SCENE_TYPE],
          start_time=start_time + datetime.timedelta(hours=9) + day,
          participant_configs=main_player_configs,
          num_rounds=1,
      ),
      scene_lib.SceneSpec(
          # The boss starts their day a bit later
          scene_type=scene_specs[BOSS_DECISION_SCENE_TYPE],
          start_time=start_time + datetime.timedelta(hours=10) + day,
          participant_configs=(antagonist_config,),
          num_rounds=1,
      ),
      scene_lib.SceneSpec(
          # Dinner in the saloon
          scene_type=scene_specs[discussion_scene_types[1]],
          start_time=start_time + datetime.timedelta(hours=20) + day,
          participant_configs=main_player_configs,
          num_rounds=1,
      ),
  ]

  def _add_day(
      scenes: list[scene_lib.SceneSpec],
      idx: int,
      work_hour: float = 9,
      boss_hour: float = 10,
      include_dinner: bool = True,
      dinner_hour: float = 20,
      final_day: bool = False,
  ) -> None:
    additional_scenes = [
        scene_lib.SceneSpec(
            # Workers start the day first
            scene_type=scene_specs[DECISION_SCENE_TYPE],
            start_time=(
                start_time + datetime.timedelta(hours=work_hour) + idx * day),
            participant_configs=main_player_configs,
            num_rounds=1,
        ),
    ]
    if not final_day:
      additional_scenes.append(
          scene_lib.SceneSpec(
              # The boss starts their day a bit later
              scene_type=scene_specs[BOSS_DECISION_SCENE_TYPE],
              start_time=(
                  start_time + datetime.timedelta(hours=boss_hour) + idx * day
              ),
              participant_configs=(antagonist_config,),
              num_rounds=1,
          )
      )
      if include_dinner:
        additional_scenes.append(
            scene_lib.SceneSpec(
                # Dinner in the saloon
                scene_type=scene_specs[discussion_scene_types[idx]],
                start_time=(
                    start_time + datetime.timedelta(
                        hours=dinner_hour) + idx * day),
                participant_configs=main_player_configs,
                num_rounds=1,
            )
        )

    scenes.extend(additional_scenes)

  num_days = 2 + sampled_settings.num_additional_days
  for i in range(2, num_days):
    if i == num_days - 1:
      # No need for boss or dinner scenes on the final day.
      _add_day(scenes, idx=i, final_day=True)
    else:
      if i < 2 + sampled_settings.num_additional_dinners:
        _add_day(scenes, idx=i, include_dinner=True)
      else:
        _add_day(scenes, idx=i, include_dinner=False)

  return (
      scenes,
      decision_env,
      industrial_action,
  )
Configure the scene storyboard structure.

  Args:
    model: the language model to use.
    game_master_memory: the game master memory to use.
    players: the players to use.
    clock: the clock to use.
    main_player_configs: configs for the main characters
    supporting_player_configs: configs for the supporting characters
    antagonist_config: config of the antagonist character
    time_and_place_params: the module containing the time and place parameters
    sampled_settings: the environment configuration containing the time and
      place details.
    start_time: the start time/date in the game world for the first scene
    verbose: whether or not to print debug logging (off by default)

  Returns:
    scenes: a sequence of scene specifications
    decision_env: the game master object for the decision scenes
    industrial_action: the labor strike game master component used in the
      decision scenes
  
examples/deprecated/modular/environment/labor_collective_action.py