def configure_scenes(
    model: language_model.LanguageModel,
    game_master_memory: associative_memory.AssociativeMemory,
    players: Sequence[entity_agent_with_logging.EntityAgentWithLogging],
    clock: game_clock.MultiIntervalClock,
    main_player_configs: Sequence[formative_memories.AgentConfig],
    supporting_player_configs: Sequence[formative_memories.AgentConfig],
    start_time: datetime.datetime,
    sampled_settings: Any,
) -> tuple[
    Sequence[scene_lib.SceneSpec],
    game_master.GameMaster | None,
    SchellingPayoffs,
]:
  """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
    start_time: the start time/date in the game world for the first scene
    sampled_settings: the environment configuration containing the time and
      place details

  Returns:
    scenes: a sequence of scene specifications
    decision_env: a game master to handle choice scenes
    schelling_payoffs: a component to compute rewards of collective action
  """
  player_configs = list(main_player_configs) + list(supporting_player_configs)

  contestant_names = [
      player_config.name for player_config in main_player_configs
  ]
  all_contestants_string = _get_all_contestant_names_string(contestant_names)

  conversation_phase_premise = (
      f'{all_contestants_string} are in the break room. Here '
      'they can chat with one another in small groups or all '
      'together at once. Everyone may choose for themself '
      'how they want to spend this free time.'
  )
  debrief_phase_premise = (
      'Host: -- "We have reached the end of the show! I would like to take a '
      'moment to thank you all for participating. I hope this was as much fun '
      'for you as it was for me!"'
  )

  scene_specs = {
      'conversation': scene_lib.SceneTypeSpec(
          name='conversation',
          premise={
              name: [conversation_phase_premise] for name in contestant_names
          },
      ),
  }
  scene_specs[DECISION_SCENE_TYPE], schelling_payoffs = add_minigame_scene_spec(
      model=model,
      game_master_memory=game_master_memory,
      players=players,
      clock=clock,
      player_configs=main_player_configs,
      scene_type_name=DECISION_SCENE_TYPE,
      sampled_settings=sampled_settings,
  )
  decision_env = scene_specs[DECISION_SCENE_TYPE].override_game_master
  scene_specs[DEBRIEF_SCENE_TYPE] = scene_lib.SceneTypeSpec(
      name=DEBRIEF_SCENE_TYPE,
      premise={name: [debrief_phase_premise] for name in contestant_names},
      action_spec=agent_lib.choice_action_spec(
          call_to_action='Host: -- "{name}, did you enjoy being on the show?"',
          options=('yes', 'no'),
          tag='debrief_action',
      ),
      override_game_master=decision_env,
  )

  scenes = [
      scene_lib.SceneSpec(
          scene_type=scene_specs['conversation'],
          start_time=start_time + 0 * datetime.timedelta(hours=2),
          participant_configs=player_configs,
          num_rounds=1,
      ),
      scene_lib.SceneSpec(
          scene_type=scene_specs[DECISION_SCENE_TYPE],
          start_time=start_time + 1 * datetime.timedelta(hours=2),
          participant_configs=player_configs,
          num_rounds=sampled_settings.num_minigame_reps_per_scene[0],
      ),
      scene_lib.SceneSpec(
          scene_type=scene_specs['conversation'],
          start_time=start_time + 2 * datetime.timedelta(hours=2),
          participant_configs=player_configs,
          num_rounds=1,
      ),
      scene_lib.SceneSpec(
          scene_type=scene_specs[DECISION_SCENE_TYPE],
          start_time=start_time + 3 * datetime.timedelta(hours=2),
          participant_configs=player_configs,
          num_rounds=sampled_settings.num_minigame_reps_per_scene[1],
      ),
  ]

  for i in range(sampled_settings.num_additional_minigame_scenes):
    scenes.append(
        scene_lib.SceneSpec(
            scene_type=scene_specs['conversation'],
            start_time=start_time + len(scenes) * datetime.timedelta(hours=2),
            participant_configs=player_configs,
            num_rounds=1,
        )
    )
    scenes.append(
        scene_lib.SceneSpec(
            scene_type=scene_specs[DECISION_SCENE_TYPE],
            start_time=start_time + len(scenes) * datetime.timedelta(hours=2),
            participant_configs=player_configs,
            num_rounds=sampled_settings.num_minigame_reps_per_extra_scene[i],
        )
    )

  scenes.append(
      # The purpose of the debrief scene is to make it so the players receive
      # the observation containing their scores after the last minigame.
      scene_lib.SceneSpec(
          scene_type=scene_specs[DEBRIEF_SCENE_TYPE],
          start_time=start_time + len(scenes) * datetime.timedelta(hours=2),
          participant_configs=player_configs,
          num_rounds=1,
      )
  )

  return (
      scenes,
      scene_specs[DECISION_SCENE_TYPE].override_game_master,
      schelling_payoffs,
  )
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
    start_time: the start time/date in the game world for the first scene
    sampled_settings: the environment configuration containing the time and
      place details

  Returns:
    scenes: a sequence of scene specifications
    decision_env: a game master to handle choice scenes
    schelling_payoffs: a component to compute rewards of collective action
  
examples/deprecated/modular/environment/reality_show.py