Example: Biome Entity Type
This page walks through a complete entity type to show how templates, rules, layouts, and skills work together. The Biome entity type represents environmental regions — forests, deserts, oceans, caves, tundra — and is used in game worldbuilding, fantasy fiction, nature documentaries, and gardening projects.
The Template
The Biome template ships with core as Standard/Biome.md (embedded in crates/sb-server/embedded_templates/Standard/). A template is one Markdown file: YAML frontmatter holds the metadata, the widget configuration, and the default field values, and the Markdown body is the skeleton for the entity’s prose. An abridged excerpt:
---
id: "unique_lowercase_id"
name: "Biome Display Name"
template_version: "1.0"
template_category: "entity"
ui_icon: "Trees"
entity_type: "biome"
folder_name: "Biomes"
file_prefix: "BIO_"
generation_instructions: |
Generate a biome with distinct environmental characteristics. Define climate,
temperature, precipitation, and weather patterns. List flora, fauna, natural
resources, and hazards specific to this biome.
associated_rules:
- BIOME_RULES.md
# FIELD WIDGET CONFIGURATION
field_config:
biome_type:
widget: select
options:
- { value: "forest", label: "Forest" }
- { value: "desert", label: "Desert" }
# ...tundra, ocean, mountain, swamp, plains, volcanic, urban, custom
connected_biomes:
widget: entity-selector
reference_type: biome
max_selections: 10
flora:
widget: tag-list
allow_custom: true
suggestions: ["deciduous trees", "grasses", "mosses", "fungi"]
# FIELDS (defaults)
biome_name: "[Biome Name]"
biome_type: "forest"
climate: "[Tropical / Temperate / Arid / Continental / Polar / ...]"
terrain_description: "[Describe the ground, landforms, and physical geography]"
flora:
- "[Dominant plant species or type 1]"
fauna:
- "[Dominant animal species or type 1]"
natural_resources:
- "[Resource 1, e.g. timber]"
hazards:
- "[Environmental hazard 1, e.g. flash flooding]"
threat_level: "moderate" # safe, low, moderate, high, extreme
connected_biomes:
- "[Adjacent biome ID 1]"
---
# [Biome Name]
## Background
...
## Ecology
...
## Hazards & Challenges
...The full template also covers temperature range, seasonal changes, a sensory profile, dominant colors, narrative integration, and AI-generation helper fields.
An Entity Instance
When a user creates a Biome from this template, the file is saved under the Biomes/ folder with the BIO_ prefix (for example Biomes/BIO_thornwood_forest.md). It carries the same frontmatter keys with real values:
---
entity_type: biome
biome_name: Thornwood Forest
biome_type: forest
climate: Temperate with cold winters. Heavy fog year-round.
terrain_description: Dense old-growth forest with thick canopy and steep ravines cut by seasonal streams.
flora:
- Giant ironwood trees
- Luminous nightcap mushrooms
- Strangler vines
fauna:
- Shadow elk
- Barbed owls
- Fog serpents
natural_resources:
- Ironwood timber
- Nightcap mushroom extract
hazards:
- Strangler vine ambushes
- Disorienting fog banks
threat_level: moderate
connected_biomes: [ashfield-grasslands, greypeak-mountains, mistmarsh-swamp]
---
The Thornwood Forest stretches across the western lowlands between the Greypeak
Mountains and the Mistmarsh Swamp. Its ironwood trees are among the oldest living
organisms in the known world.Automatic Views
You do not have to write UI code for a type like Biome. Browse, list, card, and detail views are built automatically from the template’s field definitions and widget configuration (the core SDK view model), including for custom entity types you define yourself. A layout file, below, is optional and only needed to control page structure.
Rules for Biomes
The template points at BIOME_RULES.md through associated_rules. The structured YAML format below is an illustrative sketch of the rule shape described on the rules page, not a file shipped with core. It keeps AI-generated biome content ecologically consistent:
# _Rules/Standard/biome_generation.yaml
rule_id: biome_generation
entity_type: biome
version: "1.0"
description: Ecological consistency rules for biome generation
priority: 10
rules:
- id: climate_flora_match
description: Flora must be ecologically plausible for the stated climate. Desert biomes should not have water-dependent plants without explanation.
severity: error
applies_to: [flora, climate]
- id: fauna_habitat
description: Fauna must be suited to the terrain and climate. Aquatic creatures should not appear in desert biomes without water features.
severity: error
applies_to: [fauna, terrain_description, biome_type]
- id: transition_logic
description: Neighboring biomes must share a plausible transition zone. A desert cannot directly border a tundra without an intermediate biome.
severity: warning
applies_to: [connected_biomes, biome_type]
- id: hazard_consistency
description: Hazards must relate to the biome's climate, terrain, and fauna. Fire hazards in a swamp need justification.
severity: warning
applies_to: [hazards]
- id: resource_availability
description: Resources must be consistent with the biome type. Mineral resources require appropriate terrain features.
severity: warning
applies_to: [natural_resources, terrain_description]
- id: settlement_justification
description: Settlements mentioned in the body should have a reason to exist in the biome (trade route, resource, strategic position). Extreme-threat biomes should have minimal or fortified settlements.
severity: info
applies_to: [threat_level]
defaults:
min_flora_entries: 3
min_fauna_entries: 3
threat_levels: [safe, low, moderate, high, extreme]Layout for Biomes
A layout file controls how the Biome edit page is organized. This is an illustrative sketch (see UI Layouts); field names match the template above:
{
"entity_type": "biome",
"sections": [
{
"id": "overview",
"label": "Biome Overview",
"tab": "overview",
"fields": ["biome_name", "biome_type", "climate", "threat_level"]
},
{
"id": "hero",
"label": "Biome Image",
"tab": "overview",
"component": "primary-image"
},
{
"id": "terrain",
"label": "Terrain & Landscape",
"tab": "environment",
"fields": ["terrain_description", "seasonal_changes"]
},
{
"id": "ecosystem",
"label": "Ecosystem",
"tab": "environment",
"fields": ["flora", "fauna"]
},
{
"id": "survival",
"label": "Hazards & Resources",
"tab": "survival",
"fields": ["hazards", "natural_resources"]
},
{
"id": "civilization",
"label": "Neighbors",
"tab": "survival",
"fields": ["connected_biomes", "sub_regions"]
},
{
"id": "relationships",
"label": "Related Entities",
"tab": "relations",
"component": "entity-relationships"
},
{
"id": "assets",
"label": "Maps & Reference Images",
"tab": "assets",
"component": "entity-assets"
}
],
"tabs": [
{ "id": "overview", "label": "Overview" },
{ "id": "environment", "label": "Environment" },
{ "id": "survival", "label": "Survival" },
{ "id": "relations", "label": "Relations" },
{ "id": "assets", "label": "Assets" }
]
}Use Cases Beyond Games
The Biome entity type is not limited to fantasy RPGs. The same template structure works for:
| Domain | How Biomes Are Used |
|---|---|
| Game development | World regions with gameplay-relevant attributes (danger, resources, encounters) |
| Fantasy/sci-fi fiction | Environmental settings for scenes and story arcs |
| Nature documentaries | Ecological zone documentation with species catalogs |
| Gardening | Growing zones with climate data, compatible plants, soil types |
| Education | Geography curriculum with real-world biome data |
| Tabletop RPG | Hex-crawl regions with encounter tables and resource nodes |
StudioBrain is a universal content platform. Templates like Biome work across any domain because the schema is user-defined. The same engine that powers game worldbuilding drives recipe management, production tracking, and academic research.
Next Steps
- Template System Overview — How templates work
- AI Generation Rules — Writing rules for your entity types
- Template Packs — Installing complete template sets