@@ -699,15 +699,15 @@ <h1 id="migration-guide-from-v2-to-v3">Migration Guide from V2 to V3</h1>
699
699
< p > In practice, this means that:</ p >
700
700
< ul >
701
701
< li >
702
- < p > Custom Actions (or, in general, custom TreeNodes) must be reusable building
702
+ < p > Custom Actions (or, in general, custom TreeNodes) must be < strong > reusable</ strong > building
703
703
blocks. Implement them once, reuse them many times.</ p >
704
704
</ li >
705
705
< li >
706
- < p > To build a Behavior Tree out of TreeNodes, the Behavior Designer must
707
- not need to read nor modify the source code of the a given TreeNode.</ p >
706
+ < p > To build a Behavior Tree out of TreeNodes, the Behavior Designer < strong > must
707
+ not need to read nor modify the source code</ strong > of the a given TreeNode.</ p >
708
708
</ li >
709
709
</ ul >
710
- < p > There is a < strong > major design flaw</ strong > that undermines this goal in version < code > 2.x</ code > :
710
+ < p > There was a major design flaw that undermined these goals in version < code > 2.x</ code > :
711
711
the way the BlackBoard was used to implement DataFlow between nodes.</ p >
712
712
< p > As described in < a href ="https://github.com/BehaviorTree/BehaviorTree.CPP/issues/18 "> issue #18</ a >
713
713
there are several potential problems with the Blackboard approach:</ p >
@@ -762,14 +762,15 @@ <h2 id="blackboard-nodeparameters-an-dataports">Blackboard, NodeParameters an Da
762
762
shared < strong > key/value</ strong > table, i.e. a glorified bunch of global variables.</ p >
763
763
< p > The key is a < code > string</ code > , whilst the value is
764
764
stored in a type-safe container similar to < code > std::any</ code > or < code > std::variant</ code > .</ p >
765
- < p > The problem is that writing/reading in an entry of the BB is done < strong > implicitly</ strong >
766
- in the source code and it is usually hard-coded. This makes the TreeNode
765
+ < p > The problem is that writing/reading in an entry of the BB was done < strong > implicitly</ strong >
766
+ in the source code and it was usually hard-coded. This made the TreeNode
767
767
not reusable.</ p >
768
768
< p > To fix this, we still use the Blackboard under the hood, but it can not be
769
- accessed directly anymore. Entries are read/written using respectively < code > InputPorts</ code >
770
- and < code > OutputPorts</ code > .</ p >
771
- < p > These ports < strong > must be modelled</ strong > to allow remapping at run-time.</ p >
772
- < p > Let's take a look to an example at the old code:</ p >
769
+ accessed directly anymore. </ p >
770
+ < p > In version < code > 3.x</ code > Blackboard entries can be read/written using respectively
771
+ < code > InputPorts</ code > and < code > OutputPorts</ code > .</ p >
772
+ < p > These ports < strong > must be defined explicitly</ strong > to allow remapping at run-time.</ p >
773
+ < p > Let's take a look to an example writte using the < strong > old</ strong > code:</ p >
773
774
< div class ="codehilite "> < pre > < span > </ span > < span class ="nt "> <root></ span >
774
775
< span class ="nt "> <BehaviorTree></ span >
775
776
< span class ="nt "> <SequenceStar></ span >
@@ -825,7 +826,7 @@ <h2 id="blackboard-nodeparameters-an-dataports">Blackboard, NodeParameters an Da
825
826
and modify it.</ p >
826
827
< p > In other words, < code > NodeParameter</ code > is already a reasonably good implementation
827
828
of an < code > InputPort</ code > , but we need to introduce a consistent < code > OutputPort</ code > too.</ p >
828
- < p > This is the new code:</ p >
829
+ < p > This is the < strong > new</ strong > code:</ p >
829
830
< div class ="codehilite "> < pre > < span > </ span > < span class ="nt "> <root></ span >
830
831
< span class ="nt "> <BehaviorTree></ span >
831
832
< span class ="nt "> <SequenceStar></ span >
@@ -922,7 +923,7 @@ <h2 id="subtrees-remapping-and-isolated-blackboards">SubTrees, remapping and iso
922
923
remapping in the XML definition. No C++ code need to be modified.</ p >
923
924
< p > From the point of view of the XML, remapped ports of a SubTree looks exactly
924
925
like the ports of a single node.</ p >
925
- < p > For more details, refer to the example __t06_subtree_port_remapping.cpp_ .</ p >
926
+ < p > For more details, refer to the example < strong > t06_subtree_port_remapping.cpp </ strong > .</ p >
926
927
< h2 id ="controlnodes-renamedrefactored "> ControlNodes renamed/refactored</ h2 >
927
928
< p > The < a href ="https://en.wikipedia.org/wiki/Principle_of_least_astonishment "> principle of least astonishment</ a >
928
929
applies to user interface and software design. A typical formulation of the principle, from 1984, is: </ p >
@@ -945,13 +946,13 @@ <h2 id="controlnodes-renamedrefactored">ControlNodes renamed/refactored</h2>
945
946
</ li >
946
947
</ ul >
947
948
< p > The main concern of the original author of this library was to build reactive
948
- Behavior Trees (see for reference this < a href ="0https://arxiv.org/abs/1709.00084 "> publication</ a > .</ p >
949
+ Behavior Trees (see for reference this < a href ="0https://arxiv.org/abs/1709.00084 "> publication</ a > ) .</ p >
949
950
< p > I share this goal, but I prefer to have more explicit names, because reactive
950
951
ControlNodes are useful but hard to reason about sometimes.</ p >
951
- < p > I don't think reactive Controlnodes should be the mindlessly by default. </ p >
952
+ < p > I don't think reactive ControlNodes should be used mindlessly by default. </ p >
952
953
< p > For instance, most of the time users I talked with should have used < code > SequenceStar</ code >
953
954
instead of < code > Sequence</ code > in many cases.</ p >
954
- < p > I renamed the ControlNodes to reflect this reality:</ p >
955
+ < p > I renamed the ControlNodes as follows to reflect this reality:</ p >
955
956
< table >
956
957
< thead >
957
958
< tr >
@@ -999,7 +1000,7 @@ <h2 id="controlnodes-renamedrefactored">ControlNodes renamed/refactored</h2>
999
1000
more than a single asynchronous child. </ p >
1000
1001
< p > The new recommendation is: </ p >
1001
1002
< blockquote >
1002
- < p > < strong > Reactive nodes shouldn't have more than a single asynchronous child</ strong > .</ p >
1003
+ < p > < strong > Reactive nodes should NOT have more than a single asynchronous child</ strong > .</ p >
1003
1004
</ blockquote >
1004
1005
< p > This is a very opinionated decision and for this reason it is documented but
1005
1006
not enforced by the implementation.</ p >
0 commit comments