feat(examples): rewrite baker-family as coherent Competition Week narrative
Rewrote the baker-family example around a unified story: the annual Harvest Baking Competition is Saturday. Martha's sourdough starter Old Maggie is sluggish from a cold snap, Jane is secretly entering the FreeStyle category, Emma's science fair project is "The Chemistry of Fermentation", Henry is judging for the first time and worried about impartiality, and Roland is defending last year's title. The week's schedules (Mon guild meeting → Tue test bakes → Wed sourcing → Thu dough prep → Fri science fair → Sat competition → Sun recovery) are now fully populated with narrative-specific actions. Files split for composability: - behaviors/baker_behaviors.sb → 5 focused files by character/domain - schema/types.sb → 4 files (core, baking, world, social) - schedules/work_schedules.sb → 4 files (one per schedule) - relationships/baker_family_relationships.sb → family + bakery Strong typing: replaced all enumerable string fields with concepts (BakerSpecialty, Occupation, LocationType, InstitutionType, ParentingStyle, Intensity, BakeryDomain, BakingDiscipline, ManagementDomain, CompetitiveAdvantage). Remove new-syntax-demo.sb (superseded by baker-family example).
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
//! Behavior trees for the Baker family
|
||||
//! Core baking behaviors — Martha and Jane's craft
|
||||
//!
|
||||
//! These are referenced by schedule blocks via the action: field
|
||||
//! These behaviors are referenced by the Baker template and BakerSchedule.
|
||||
//! See also: competition_behaviors.sb for competition-week-specific actions.
|
||||
|
||||
// Main baking work routine
|
||||
behavior BakingWork {
|
||||
@@ -42,48 +43,7 @@ behavior SellAtMarket {
|
||||
}
|
||||
}
|
||||
|
||||
// Assistant work (subset of main baking)
|
||||
behavior AssistWithBaking {
|
||||
then {
|
||||
check_orders
|
||||
prepare_ingredients
|
||||
choose {
|
||||
assist_with_bread
|
||||
assist_with_pastries
|
||||
}
|
||||
clean_workspace
|
||||
}
|
||||
}
|
||||
|
||||
// Quick morning prep
|
||||
behavior QuickPrep {
|
||||
then {
|
||||
check_supplies
|
||||
organize_workspace
|
||||
}
|
||||
}
|
||||
|
||||
// Basic needs (from Person template)
|
||||
behavior BasicNeeds {
|
||||
repeat {
|
||||
choose {
|
||||
if(self.hunger is hungry) { eat }
|
||||
if(self.hunger is satisfied) { rest }
|
||||
if(self.thirst is thirsty) { drink }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Social interaction
|
||||
behavior SocialInteraction {
|
||||
choose {
|
||||
greet_neighbors
|
||||
chat_with_customers
|
||||
family_time
|
||||
}
|
||||
}
|
||||
|
||||
// Baking skills
|
||||
// Baker skill behaviors (from Baker template)
|
||||
behavior BakingSkills {
|
||||
then {
|
||||
assess_dough
|
||||
@@ -92,7 +52,6 @@ behavior BakingSkills {
|
||||
}
|
||||
}
|
||||
|
||||
// Customer service
|
||||
behavior CustomerService {
|
||||
then {
|
||||
greet_warmly
|
||||
@@ -101,20 +60,3 @@ behavior CustomerService {
|
||||
handle_payment
|
||||
}
|
||||
}
|
||||
|
||||
// Child behaviors
|
||||
behavior PlayBehavior {
|
||||
choose {
|
||||
play_outside
|
||||
play_with_toys
|
||||
draw_pictures
|
||||
}
|
||||
}
|
||||
|
||||
behavior LearnBehavior {
|
||||
then {
|
||||
attend_school
|
||||
do_homework
|
||||
read_books
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user