Might is Right

Working on Critter AI

Posted on

Implementing critter AI, so far got the prototype working. AI is done using Behavior Trees, only a few lines of code: RepeatBehavior.from( SequenceBehavior.from([ PickWanderPathBehavior.fromJSON({ radius: 5, anchor, distance, axis }), StartAnimationBehavior.fromJSON({ name: wanderAnimation, repeatCount: Number.POSITIVE_INFINITY }), ParallelBehavior.from([ new CheckPathEndBehavior(), WaitForEventBehavior.fromJSON({ event: PathFollowerEventType.EndReached }) ], ParallelBehaviorPolicy.RequireOne, ParallelBehaviorPolicy.RequireAll ), StopAnimationBehavior.fromJSON({ name: wanderAnimation }), StartAnimationBehavior.fromJSON({ name: idleAnimation, repeatCount: […]