2026-02-08 13:24:35 +00:00
|
|
|
// Test behavior trees and life arcs
|
|
|
|
|
|
|
|
|
|
life_arc Childhood {
|
|
|
|
|
state infant {
|
|
|
|
|
on ready -> toddler
|
|
|
|
|
}
|
|
|
|
|
state toddler {
|
|
|
|
|
on ready -> child
|
|
|
|
|
}
|
|
|
|
|
state child {
|
|
|
|
|
on ready -> teen
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
behavior SimpleBehavior {
|
|
|
|
|
walk_around
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
behavior SequenceBehavior {
|
2026-02-13 21:52:03 +00:00
|
|
|
then {
|
2026-02-08 13:24:35 +00:00
|
|
|
check_energy
|
|
|
|
|
move_to_location
|
|
|
|
|
perform_action
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
behavior SelectorBehavior {
|
2026-02-13 21:52:03 +00:00
|
|
|
choose {
|
2026-02-08 13:24:35 +00:00
|
|
|
try_option_a
|
|
|
|
|
try_option_b
|
|
|
|
|
fallback
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
behavior NestedBehavior {
|
2026-02-13 21:52:03 +00:00
|
|
|
then {
|
|
|
|
|
choose {
|
2026-02-08 13:24:35 +00:00
|
|
|
check_condition_a
|
|
|
|
|
check_condition_b
|
|
|
|
|
}
|
|
|
|
|
perform_action
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
behavior WithSubtree {
|
2026-02-13 21:52:03 +00:00
|
|
|
then {
|
|
|
|
|
include helpers::check_preconditions
|
2026-02-08 13:24:35 +00:00
|
|
|
main_action
|
|
|
|
|
}
|
|
|
|
|
}
|