docs: update README for v0.3.0
Added "What's New in v0.3" section covering species, concepts, sub_concepts, concept_comparison, template species inheritance, and life arc field requirements. Updated quick start example with v0.3 syntax including species and type system declarations.
This commit is contained in:
@@ -25,7 +25,8 @@ Storybook is a **compiled simulation language** designed for **open-world, auton
|
||||
Storybook defines characters, behaviors, relationships, and narrative events for autonomous agents in dynamic worlds. It bridges the gap between storytelling and technical simulation through:
|
||||
|
||||
- **Readable syntax** - Code that looks like natural descriptions, but compiles to efficient bytecode
|
||||
- **Named nodes** - Behavior trees you can read as stories, that drive AI decision-making
|
||||
- **Type system** - Species, concepts, and sub-concepts for compile-time validation
|
||||
- **Behavior trees** - Named nodes you can read as stories, that drive AI decision-making
|
||||
- **Prose blocks** - Embed narrative directly in definitions for context-aware storytelling
|
||||
- **Rich semantics** - From simple traits to complex state machines and schedules
|
||||
- **Game engine integration** - Designed to power autonomous NPCs in Unity, Unreal, Godot, and custom engines
|
||||
@@ -44,24 +45,56 @@ Storybook defines characters, behaviors, relationships, and narrative events for
|
||||
|
||||
**Want inspiration?** Browse the [Examples Gallery](examples/24-baker-family-complete.md) to see what's possible!
|
||||
|
||||
## What's New in v0.3
|
||||
|
||||
Storybook v0.3 introduces a **compile-time type system** for stronger validation and richer world modeling:
|
||||
|
||||
- **`species`** - Define base archetypes with default fields that characters inherit
|
||||
- **`concept` / `sub_concept`** - Algebraic data types with dot notation (`sub_concept Cup.Size { Small, Medium, Large }`)
|
||||
- **`concept_comparison`** - Compile-time pattern matching over concept variants
|
||||
- **Template species inheritance** - Templates extend species for layered defaults (`template Person: Human { ... }`)
|
||||
- **Life arc field requirements** - `life_arc Career requires { skill: Number }` validates fields at compile time
|
||||
|
||||
v0.3 is a clean break from v0.2. See the [Type System reference](TYPE-SYSTEM.md) for full details.
|
||||
|
||||
## Quick Start
|
||||
|
||||
```storybook
|
||||
character Martha {
|
||||
age: 34
|
||||
skill_level: 0.95
|
||||
// Define a species with default fields
|
||||
species Human {
|
||||
age: 0
|
||||
energy: 0.5
|
||||
mood: 0.5
|
||||
}
|
||||
|
||||
---description
|
||||
// Template inheriting from species
|
||||
template Baker: Human {
|
||||
baking_skill: 0.0..1.0
|
||||
specialty: "bread"
|
||||
}
|
||||
|
||||
// Character from template
|
||||
character Martha from Baker {
|
||||
age: 34
|
||||
baking_skill: 0.9
|
||||
specialty: "sourdough"
|
||||
|
||||
---backstory
|
||||
A master baker who learned from her grandmother
|
||||
and now runs the most popular bakery in town.
|
||||
---
|
||||
}
|
||||
|
||||
behavior Baker_MorningRoutine {
|
||||
// Type-safe concepts
|
||||
concept BakedGood
|
||||
sub_concept BakedGood.Category { Bread, Pastry, Cake }
|
||||
|
||||
// Behavior trees
|
||||
behavior BakingWork {
|
||||
choose daily_priority {
|
||||
then prepare_sourdough { ... }
|
||||
then serve_customers { ... }
|
||||
then restock_display { ... }
|
||||
then prepare_sourdough
|
||||
then serve_customers
|
||||
then restock_display
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user