Advertisement

Sharing behaviour trees between multiple agents

Started by January 24, 2013 05:30 AM
3 comments, last by Ashaman73 11 years, 9 months ago

Hey all,

I've been straining my mind over how I could solve this problem in an efficient way.

I've recently started learning about behaviour trees and I really like them, and I thought they sounded really simple to make too. Well, they are if you want to make it for a single agent, as the execution happens on the actual structure. I want to separate the structure and the execution but I can't figure out how a good way might be.

I thought about having a behaviour tree class hierarchy that creates the structure, and separate classes with the same hierarchy but containing local data. So, the basic root node class, a sequence class, an action class, etc, all used to define the actual behaviour tree. Then these would individually create tasks that would store local data (such as the currently running node in a sequence), one for each agent. But I don't really like this, it sounds too annoying, and I'm thinking there might be a better way. A search on the internet is proving difficult.

I'm using C++ btw.

Cheers!

I am also interested in behavior tree too.but I find outs that there is a little material I can find out it.I have learned something about the theory of it but I still have no idea about how to implement it and integrate it into my game project. It is a rts game,I think there will be many effort I must to do.
Cheer up.
Advertisement
Modify some errors:I am also interested in the behavior tree too.but I find out that there is a little material I can find about it.I have learned something about the theory of it but I still have no idea about how to implement it and integrate it into my game project. It is a rts game,I think there will be many efforts I must to do with it
Cheer up.
There is an article on the wiki about this.
http://en.wikipedia.org/wiki/Behavior_Trees

I thought about having a behaviour tree class hierarchy that creates the structure, and separate classes with the same hierarchy but containing local data.

Some ideas I basically use in my bht implementation:

- Separation of bht structure and data is a good idea (data driven).

- Most often you have only a single path, therefore you don't need to reflect the whole hierachy, basically you only need a data array (union to reflect different structuers) per path.

- Utilize states of the object which the bht controls. You don't need to save all data in the tree, many data should be moved into the object the bht controls.

This topic is closed to new replies.

Advertisement