AngryAnt / Behave-release

The Behave project is a system for designing, integrating and running behaviour logic using Behaviour Trees for simulated characters in unity projects. NOTE: This project relates to Behave 1. For Behave 2 support and information, please use the AngryAnt community at http://community.angryant.com
http://angryant.com/behave
34 stars 6 forks source link

Allow for collection inheritance #47

Closed paulpach closed 12 years ago

paulpach commented 12 years ago

As seen on the behaviour trees video from aigamedev.

it would be nice to have collection inheritance. So for example, I have a top level tree that picks between wandering, chasing and avoiding based on player proximity and mob health. where wandering, chasing and avoiding are subtrees.

I would create an inherited collection where I would override the wander, chasing and avoiding trees to take advantage of the mob's unique animations. However, the top level tree would remain the same.

AngryAnt commented 12 years ago

Already supported through agent implementation - even overridable with agent inheritance. You can even parameterize which subtrees to execute.

https://gist.github.com/2418902

paulpach commented 12 years ago

It would be a lot simpler if when I create a collection I could specify the parent collection. It would automatically inherit all trees from parent, and override the trees you have defined in your current collection.

I would gladly submit patches for that if you let me see the code, with copyright assignment and whatever else you require.

On Thu, Apr 19, 2012 at 12:42 AM, Emil Johansen < reply@reply.github.com

wrote:

Already supported through agent implementation - even with agent inheritance. You can even parameterize which subtrees to execute.

public BehaveResult StartPanicAction { get { panic = true; return BehaveResult.Success; } }

public BehaveResult PatrolAction { get { return panic ? panicPatrolTree.Tick (this) : patrolTree.Tick (this); } }


Reply to this email directly or view it on GitHub: https://github.com/AngryAnt/Behave-release/issues/47#issuecomment-5215272