© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•6mo ago•
4 replies
Full Spectrum Wulfenite

BehaviorTree Implementation

Hello! I am working on a
BehaviorTree
BehaviorTree
(https://en.wikipedia.org/wiki/Behavior_tree_(artificial_intelligence,_robotics_and_control)) implementation. I need the
BehaviorTree
BehaviorTree
to be serializable so that it can be saved and loaded, as such I am trying to figure out how to store the leaf nodes or
Task
Task
s.

My initial thought was to have a public class in my namespace that just held a bunch of static methods. Each method corresponding to a
Task
Task
. A leaf node would hold the string of the method name and invoke the method via the
System.Reflection
System.Reflection
library.

I then thought about a second method of using OOP to create a base class of
BehaviorTreeTask
BehaviorTreeTask
and then derive new classes for each type of
Task
Task
, each one overriding a base
PerformTask
PerformTask
method.

I have been spinning my wheels over which implementation to go with. I could use some help in discussing the pro/cons or even talking about another method of achieving the same result.
Behavior tree (artificial intelligence, robotics and control)
A behavior tree is a mathematical model of plan execution used in computer science, robotics, control systems and video games. They describe switchings between a finite set of tasks in a modular fashion. Their strength comes from their ability to create very complex tasks composed of simple tasks, without worrying how the simple tasks are implem...
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ IQueryable implementation
C#CC# / help
3y ago
✅ SAML implementation help
C#CC# / help
9mo ago
DataGridView Virtualization Implementation
C#CC# / help
12mo ago
✅ Explicit interface implementation
C#CC# / help
17mo ago