Rez now natively supports behaviour trees as an attribute type and provides a helpful selection of tasks in the standard library (composites & decorators) and a
@task element to define custom condition tasks & action tasks yourself (see stdlib source for how the core tasks are implemented).
The result: you can write something like:
@actor sam_spade begin ... behaviours: ^[SELECT [ [SEQUENCE [ [ACTOR_IN location=sams_office] [ACTOR_SEES item=booze] [MAYBE p=20 [ACTOR_DRINKS]]] [SEQUENCE [ [ACTOR_SEES actor=wilmer] [ACTOR_RELATIONSHIP actor=wilmer rel=antagonist] [ACTOR_HAS item=handgun] [SELECT [ [SEQUENCE [ [ACTOR_HAS tag=drunk] [ACTOR_SHOOTS_AND_MISSES]]] [MAYBE p=20 [ [ACTOR_SHOOTS target=wilmer item=handgun]] [SEQUENCE [ [ACTOR_SEES tagged=dame] [RANDOM_EACH [ [ACTOR_SAYS line="You know, that's good, because if you actually were as innocent as you pretend to be, we'd never get anywhere"] [ACTOR_SAYS line="We didn't exactly believe your story, Miss. We believed your 200 dollars"] [ACTOR_SAYS line="You won't need much of anybody's help. You're good. Chiefly your eyes, I think, and that throb you get in your voice when you say things like "Be generous, Mr. Spade"]]]]] @end
Okay, very simple and silly example, but hopefully illustrative of what is possible.
RANDOM_EACH are core tasks from the standard library. The author of this game would implement condition tasks like
ACTOR_SEES and action tasks such as
ACTOR_SAYS, and so on.
With the addition of behaviour trees, Rez is now conceptually complete, although there are still a lot of holes in my implementation of some of those concepts. I plan to fill those in as I switch my focus from tooling to game development.
I realise there are already a lot of authoring systems out there, but if anyone fancies trying Rez drop me a line. The source is all available, but I guess it might require my help to set it up.