Several smaller trees more performant than one large one?

mdotstrange

New member
Was watching this GDC presentation about using FSM's to control several smaller BT's versus one large BT doing everything-

My current approach is to have one master tree with several Behavior tree ref nodes inside of it-

Would it be more performant if I broke the big tree into several smaller ones that then are only enabled/run when their associated fsm state is running?

One big tree vs 6-9 smaller bt's on an agent? Thanks!
 
If you are loading many external trees using the behavior tree reference task then it gets loaded into a single tree so from a performance standpoint there isn't any difference.

If you are talking about restructring the tree so each tree has a different function then it's tough to say because it's completely dependent on your specific game situation. If you can separate out your larger tree then it may be worth profiling several different designs to see which one is the most performant. In the end though the actual behavior tree traversal is extremely quick so that is rarely a bottleneck and there are other things that need to be optimized first.
 
Top