Level Manager System

Category: Level Architecture, Initialization, and Scene Control
Context: This document covers the level-specific management layer used in Data Division. The focus here is the LevelManager, its LevelData ScriptableObject, and the map/venue selection flow that depended on that data. This intentionally leaves TimeManager and CameraStateManager out of scope.

What The System Was For

Each Unity scene was meant to carry its own LevelManager.

Unlike the broader GameManager, this manager was not a singleton. The point was to let each level own its own configuration, state, and setup behavior while still pulling from shared groundwork systems.

That mattered because the project had multiple kinds of playable spaces:

The LevelManager was the layer that turned those spaces into configurable venues instead of hard-coded one-offs.

Scene Placement and Relationship To The Map

At the scene level, the level manager sat alongside the other managers, while the map UI and venue selection logic depended on the same underlying LevelData.

Neighborhood scene hierarchy and map context

This image is useful because it shows the real architectural relationship:

Level Manager Component

The LevelManager stores the active state for a specific scene and applies the selected LevelData during initialization.

Important fields visible in the component included:

LevelManager inspector

Two details matter here:

  1. The scene can declare what stage it is currently in.
  2. The actual level configuration is driven by an attached LevelData asset rather than by burying everything directly in the MonoBehaviour.

There are also some holdovers here, like KeycardManager and SuspicionManager. Those were technical-debt remnants from the first iteration. They were left in because removing them midstream caused more problems than keeping them parked for later cleanup.

Level Lifecycle

Levels were meant to move through three explicit stages:

  1. Pre-Level
  2. During Level
  3. Post-Level

The point of that split was not ceremony. It was to separate:

graph TD
    A[Select Venue from Map] --> B[Load Scene]
    B --> C[Pre-Level]
    C --> D[Apply LevelData]
    D --> E[Finished Initializing Level]
    E --> F[During Level]
    F --> G{Exit or Resolution Trigger}
    G --> H[Post-Level]
    H --> I[Return Results to Hub or Next State]

Pre-Level

Pre-Level is where the manager reads the selected LevelData and applies its requirements to the scene and to dependent systems.

Examples:

When the initialization work is complete, Finished Initializing Level flips and the scene can move into active play.

During Level

During Level is the live play state.

This is where the runtime rules from LevelData matter:

Post-Level

Post-Level is the cleanup and resolution stage.

At this point the level can hand off:

That split made the level flow easier to reason about than one giant always-on scene script.

LevelData ScriptableObject

LevelData is where the important level configuration lives.

That is the more important design choice here: level behavior is mostly data-driven.

LevelData ScriptableObject inspector

Important fields included:

This made it possible for a designer to describe a venue without rewriting scene logic every time.

What LevelData Actually Controlled

At the design level, LevelData was meant to answer questions like:

That last point is worth keeping narrow: this page is not about the separate TimeManager system. It is only about the fact that LevelData had fields prepared to communicate time-related behavior into the scene.

Control Types and Raid Logic

Two of the most useful pieces of LevelData were:

Level Control Type determined whether the player was in:

Use Raid Exit Logic controlled the extraction-pressure behavior. If enabled on a company level, the player had a limited amount of time to complete the goal and leave before the exit closed.

That gave the same general scene-management layer enough flexibility to support very different mission feels.

Suspicion, Collectables, and Technical Debt

The suspicion-related fields in the manager and in LevelData reflect a larger intended system that was later cut or reduced because of complexity.

The important part for portfolio purposes is not that the suspicion system fully shipped. It did not. The important part is that the level architecture had already been built to support:

That shows the groundwork was being laid for systemic level-state variation, even where the later implementation was trimmed back.

Map System Dependency

The map system depended on LevelData to display and select venues.

Venue selection map driven by level metadata

That dependency mattered because it made level selection modular:

So the map was not just cosmetic. It was part of the level-selection and runtime configuration pipeline.

Why This System Mattered

The LevelManager and LevelData pairing was one of the cleaner architecture decisions in this branch of the project.

It gave the prototype:

That is also why this page is worth keeping separate from the heavier groundwork documentation. The useful portfolio point here is not generic “manager” complexity. It is the actual level architecture: one scene manager per level, one ScriptableObject per venue, and a modular path from selection to initialization to active play.