Biome Manager

v1.1.0

Core Concepts

How biomes, zones, requirements, barriers, weather, discovery and persistence fit together.

Biome Definitions

A BiomeDefinition is a ScriptableObject describing one region: identity (name, icon, theme color), lock settings, unlock requirements, and references to its environment, weather and audio profiles. Because it is an asset, the same biome can be used across any number of scenes and referenced stably by save data via its GUID.

  • Profiles are assets too — share one "Foggy Swamp" environment across several biomes
  • GC2 event lists — each definition carries On Enter / On Exit / On Unlock / On Lock instruction lists
  • Tags — free-form strings queried by the Has Tag condition (e.g. "water", "safe-zone")

Zones & Shapes

A BiomeZone is the scene-side boundary of a biome. Multiple zones can reference the same definition (one forest, three patches).

Collider Shape

Uses the trigger collider on the same GameObject. Physics-driven enter/exit — works with any collider type, tracks any entrant.

Polygon Shape

An authored XZ outline extruded by a height value. Containment is polled (10×/s) for objects with the Tracked Tag. Edit corners with Scene-view handles — Shift+Click to move several at once; top-outline handles set the height.

Why polling for polygons? Non-convex mesh colliders cannot be triggers in Unity. Point-in-polygon tests are cheap, robust, and allow truly organic outlines. Exits use a hysteresis margin so standing exactly on a border never flickers enter/exit events.

Border Blending

Set a Blend Distance on a zone and the environment cross-fades spatially with the player's distance from the border, instead of switching at a hard line. Weather and audio still switch discretely at the boundary — blending fog density feels great, cross-blending two rain systems does not.

Nesting & Overlaps (Priority)

Zones can overlap and nest: a clearing inside a forest, a cave inside a valley. The zone with the higher Priority provides the current biome (ties go to the most recently entered zone). Leaving a nested zone falls back to the enclosing biome — never to "wilderness" — and stepping into a nested zone demotes the outer biome without firing a false exit. Crossing between two zones of the same biome fires no events at all.

Requirements & Unlocking

Unlocking is driven by requirement tokens — small ScriptableObjects with a name, an icon and a player-facing hint. The flow:

Gameplay milestone reached (quest done, level up, boss killed, item used)
        │
        ▼  Grant Requirement (GC2 instruction)
RequirementDatabase (on the Player) — the granted set is the source of truth
        │
        ▼  OnGranted event
BiomeManager re-evaluates every registered biome
        │
        ▼  requirement set satisfied (AND / OR per definition)
Biome unlocks automatically → barrier despawns → On Biome Unlocked fires
  • Require All toggles AND / OR when a biome lists several tokens
  • Granted is authoritative — once granted, a token stays valid even if the condition that granted it later turns false
  • Revoke Requirement exists for story beats that take access away again

Self-Evaluating Requirements

A Requirement (GC2 Conditions) asset carries its own GC2 ConditionList ("Player level ≥ 5"). One Requirement Auto Grant component on the player sweeps all pending conditional requirements on an interval and grants them when their conditions hold — replacing what would otherwise be one On-Update trigger per requirement. Pure tokens are never polled.

Barriers

While a biome is locked, its zones raise a solid physical wall — characters collide and slide along it naturally, with no scripted pushback. A holographic shield visual is generated automatically: a box for collider zones, a single continuous ribbon tracing the outline for polygon zones, tinted with the definition's barrier color.

  • Contact feedback — touching the barrier fires On Barrier Hit: the HUD flashes, the notification shows the locked message + unlock hint
  • Fires on contact, not while loitering — standing next to the wall does not re-trigger feedback
  • Custom visuals — assign a Barrier Prefab on the definition to replace the generated shield entirely

Weather System

Weather profiles bundle a particle prefab, wind, directional-light tint and an audio loop under a logical WeatherType (Clear / Rain / Snow / Fog / Storm / Custom). The Weather Controller cross-fades between profiles.

Direct Weather

A biome's first weather profile applies on entry. The Set Weather and Cycle Weather instructions switch manually at any time.

Weather Tables

A Weather Table asset holds weighted entries with min/max hold times. Assigned to a biome it schedules changing weather automatically; manual weather calls stop the schedule — player intent wins.

The Biome Cozy Bridge forwards every weather change to COZY: Stylized Weather by mapping WeatherTypes to COZY profiles — via reflection, so there is no dependency when COZY is absent.

Discovery

The BiomeDiscoveryDatabase (on the player) records which biomes have been found and how often they were visited — independent of unlock state. A biome can be discovered-but-locked (saw it, could not enter) or unlocked-but-unvisited (opened via quest, never went).

  • Entering a biome records a visit automatically
  • Mark Biome Discovered reveals a biome manually (e.g. buying a map) with zero visits
  • Query with Is Biome Discovered and the Discovered Count property — great for completion stats and map UIs

Persistence

Biome Manager persists through Game Creator's own Save/Load system — no parallel save files. Three memories plug into GC2 Remember components:

MemoryPlacementSaves
Biome RequirementsPlayer (with RequirementDatabase)Granted requirement tokens
Biome UnlocksGameManager (with BiomeManager)Unlocked biome set
Biome DiscoveryPlayer (with BiomeDiscoveryDatabase)Discovered biomes + visit counts
Loading a save restores everything consistently — including zone barriers, which refresh to the restored lock states automatically.