Jump to content
  • Advertisement
Sign in to follow this  
Zotoaster

Sharing behaviour trees between multiple agents

This topic is 2142 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!