Skip to content

Commit

Permalink
3.6.33
Browse files Browse the repository at this point in the history
  • Loading branch information
cainhuang committed May 4, 2017
1 parent 1f8184a commit 5f63d08
Show file tree
Hide file tree
Showing 45 changed files with 178 additions and 70 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cmake_minimum_required (VERSION 2.8)
# set(CMAKE_CONFIGURATION_TYPES "Debug;Release;Profile" CACHE STRING "" FORCE)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)

set (BEHAVIAC_PACKAGE_VERSION 3.6.32)
set (BEHAVIAC_PACKAGE_VERSION 3.6.33)

#option( BUILD_SHARED_LIBS "set to OFF to build static libraries" ON )
SET(BUILD_SHARED_LIBS ON CACHE BOOL "set to OFF to build static libraries")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://github.com/Tencent/behaviac/blob/master/license.txt)
[![Release Version](https://img.shields.io/badge/release-3.6.32-red.svg)](https://github.com/Tencent/behaviac/releases)
[![Release Version](https://img.shields.io/badge/release-3.6.33-red.svg)](https://github.com/Tencent/behaviac/releases)
[![Updates](https://img.shields.io/badge/Platform-%20iOS%20%7C%20OS%20X%20%7C%20Android%20%7C%20Windows%20%7C%20Linux%20-brightgreen.svg)](https://github.com/Tencent/behaviac/blob/master/history.txt)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/behaviac/pulls)

Expand Down
Binary file modified docs/behaviac.chm
Binary file not shown.
5 changes: 5 additions & 0 deletions history.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2017-5-4 3.6.33
Remove the inheritance for the agent type of the referenced behaviors.
Fix a bug for the Parallel node.
Fix a bug for the IfElse node.

2017-4-26 3.6.32
Support resetting the children for the SelectorLoop node.
Add the tutorial_13.
Expand Down
2 changes: 1 addition & 1 deletion inc/behaviac/common/_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
#define BEHAVIAC_RELEASE 0
#endif

#define BEHAVIAC_VERSION_STRING "3.6.32"
#define BEHAVIAC_VERSION_STRING "3.6.33"

2 changes: 1 addition & 1 deletion integration/demo_running/behaviac/Base/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1800,7 +1800,7 @@ public static string RemoveQuot(string str)

if (ret.StartsWith(kQuotStr))
{
Debug.Check(ret.EndsWith(kQuotStr));
//Debug.Check(ret.EndsWith(kQuotStr));
ret = ret.Replace(kQuotStr, "\"");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ protected override void onexit(Agent pAgent, EBTStatus s)

protected override EBTStatus update(Agent pAgent, EBTStatus childStatus)
{
Debug.Check(childStatus != EBTStatus.BT_INVALID);
Debug.Check(this.m_children.Count == 3);

EBTStatus conditionResult = EBTStatus.BT_INVALID;
Expand All @@ -109,7 +110,7 @@ protected override EBTStatus update(Agent pAgent, EBTStatus childStatus)
conditionResult = childStatus;
}

if (this.m_activeChildIndex == CompositeTask.InvalidChildIndex || conditionResult != EBTStatus.BT_INVALID)
if (this.m_activeChildIndex == CompositeTask.InvalidChildIndex)
{
BehaviorTask pCondition = this.m_children[0];

Expand All @@ -130,6 +131,10 @@ protected override EBTStatus update(Agent pAgent, EBTStatus childStatus)
this.m_activeChildIndex = 2;
}
}
else
{
return childStatus;
}

if (this.m_activeChildIndex != CompositeTask.InvalidChildIndex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,14 @@ protected override bool onenter(Agent pAgent)
{
Debug.Check(this.m_activeChildIndex == CompositeTask.InvalidChildIndex);

// reset the status cache of the children
for (int i = 0; i < this.m_children.Count; ++i)
{
BehaviorTask pChild = this.m_children[i];

pChild.reset(pAgent);
}

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion integration/demo_running/behaviac/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.6.32
3.6.33
Original file line number Diff line number Diff line change
Expand Up @@ -1800,7 +1800,7 @@ public static string RemoveQuot(string str)

if (ret.StartsWith(kQuotStr))
{
Debug.Check(ret.EndsWith(kQuotStr));
//Debug.Check(ret.EndsWith(kQuotStr));
ret = ret.Replace(kQuotStr, "\"");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ protected override void onexit(Agent pAgent, EBTStatus s)

protected override EBTStatus update(Agent pAgent, EBTStatus childStatus)
{
Debug.Check(childStatus != EBTStatus.BT_INVALID);
Debug.Check(this.m_children.Count == 3);

EBTStatus conditionResult = EBTStatus.BT_INVALID;
Expand All @@ -109,7 +110,7 @@ protected override EBTStatus update(Agent pAgent, EBTStatus childStatus)
conditionResult = childStatus;
}

if (this.m_activeChildIndex == CompositeTask.InvalidChildIndex || conditionResult != EBTStatus.BT_INVALID)
if (this.m_activeChildIndex == CompositeTask.InvalidChildIndex)
{
BehaviorTask pCondition = this.m_children[0];

Expand All @@ -130,6 +131,10 @@ protected override EBTStatus update(Agent pAgent, EBTStatus childStatus)
this.m_activeChildIndex = 2;
}
}
else
{
return childStatus;
}

if (this.m_activeChildIndex != CompositeTask.InvalidChildIndex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,14 @@ protected override bool onenter(Agent pAgent)
{
Debug.Check(this.m_activeChildIndex == CompositeTask.InvalidChildIndex);

// reset the status cache of the children
for (int i = 0; i < this.m_children.Count; ++i)
{
BehaviorTask pChild = this.m_children[i];

pChild.reset(pAgent);
}

return true;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.6.32
3.6.33
2 changes: 1 addition & 1 deletion projects/vs2013/tutorial_13.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{8790DF34-1FF6-41B8-A0AC-CAA181FAB11C}</ProjectGuid>
<ProjectGuid>{5F434F31-A60F-6F4F-8FF2-645F2A8D1B90}</ProjectGuid>
<RootNamespace>tutorial_13</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
Expand Down
8 changes: 6 additions & 2 deletions src/behaviortree/nodes/composites/ifelse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ namespace behaviac {
}

EBTStatus IfElseTask::update(Agent* pAgent, EBTStatus childStatus) {
BEHAVIAC_ASSERT(this->m_children.size() == 3);
BEHAVIAC_ASSERT(childStatus != BT_INVALID);
BEHAVIAC_ASSERT(this->m_children.size() == 3);

EBTStatus conditionResult = BT_INVALID;

Expand All @@ -80,7 +81,7 @@ namespace behaviac {
conditionResult = childStatus;
}

if (this->m_activeChildIndex == CompositeTask::InvalidChildIndex || conditionResult != BT_INVALID) {
if (this->m_activeChildIndex == CompositeTask::InvalidChildIndex) {
BehaviorTask* pCondition = this->m_children[0];

if (conditionResult == BT_INVALID) {
Expand All @@ -96,6 +97,9 @@ namespace behaviac {
this->m_activeChildIndex = 2;
}
}
else {
return childStatus;
}

if (this->m_activeChildIndex != CompositeTask::InvalidChildIndex) {
BehaviorTask* pBehavior = this->m_children[this->m_activeChildIndex];
Expand Down
7 changes: 7 additions & 0 deletions src/behaviortree/nodes/composites/parallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,13 @@ namespace behaviac {

BEHAVIAC_ASSERT(this->m_activeChildIndex == CompositeTask::InvalidChildIndex);

// reset the status cache of the children
for (uint32_t i = 0; i < this->m_children.size(); ++i) {
BehaviorTask* pChild = this->m_children[i];

pChild->reset(pAgent);
}

return true;
}

Expand Down
4 changes: 2 additions & 2 deletions tools/designer/BehaviacDesigner/BehaviorTreeView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -654,15 +654,15 @@ public void Redraw()
private enum NodeAttachMode { None, Left, Right, Top, Bottom, Attachment, Center };

//return true if rootBehavior's agent type is derived from the agent type of childBehavior.
public static bool IsCompatibleAgentType(Behavior rootBehavior, Behavior childBehavior)
private static bool IsCompatibleAgentType(Behavior rootBehavior, Behavior childBehavior)
{
if (rootBehavior != null && childBehavior != null && rootBehavior.AgentType != null && childBehavior.AgentType != null)
{
string rootBTAgent = rootBehavior.AgentType.ToString();
string childBTAgent = childBehavior.AgentType.ToString();

// the agent type specified at root bt should be derived from the agent type at child bt
if (!Plugin.IsAgentDerived(rootBTAgent, childBTAgent))
if (!Plugin.IsAgentDerived(rootBTAgent, childBTAgent) && !Plugin.IsAgentDerived(childBTAgent, rootBTAgent))
{
string errorMsg = string.Format(Resources.AgentErrorInfo, rootBTAgent, rootBehavior.Label, childBTAgent, childBehavior.Label);
MessageBox.Show(errorMsg, Resources.DesignerError, MessageBoxButtons.OK);
Expand Down
4 changes: 2 additions & 2 deletions tools/designer/BehaviacDesigner/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.6.32")]
[assembly: AssemblyFileVersion("3.6.32")]
[assembly: AssemblyVersion("3.6.33")]
[assembly: AssemblyFileVersion("3.6.33")]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tools/designer/BehaviacDesigner/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ Are your sure add it?</value>
<value>This is a referenced tree.</value>
</data>
<data name="AgentErrorInfo" xml:space="preserve">
<value>{0} in {1} is not derived from {2} in {3}. Please try another behavior file again!</value>
<value>{0} in {1} is not derived from or the same as or does not inherit {2} in {3}. Please try another behavior file again!</value>
</data>
<data name="OpenPrefab" xml:space="preserve">
<value>Open Prefab</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@
<value>这是一棵子树</value>
</data>
<data name="AgentErrorInfo" xml:space="preserve">
<value>行为树{1}中的{0}类型不是从行为树{3}中的{2}类型继承出来, 请加载另一个行为树文件!</value>
<value>行为树{1}根节点中的类型{0}跟行为树{3}根节点中的类型{2}没有继承或同类关系,请加载另一个行为树文件!</value>
</data>
<data name="OpenPrefab" xml:space="preserve">
<value>打开预制行为树</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ private void checkErrorForSubTree(BehaviorNode rootBehavior, BehaviorNode refere
string rootBTAgent = rootB.AgentType.ToString();

//the agent type specified at root bt should be derived from the agent type at child bt
if (!Plugin.IsAgentDerived(rootBTAgent, childBTAgent))
if (!Plugin.IsAgentDerived(rootBTAgent, childBTAgent) && !Plugin.IsAgentDerived(childBTAgent, rootBTAgent))
{
result.Add(new Node.ErrorCheck(this, ErrorCheckLevel.Error, Resources.AgentTypeError));
}
Expand Down
2 changes: 1 addition & 1 deletion tutorials/CsTutorials/behaviac/runtime/Base/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1800,7 +1800,7 @@ public static string RemoveQuot(string str)

if (ret.StartsWith(kQuotStr))
{
Debug.Check(ret.EndsWith(kQuotStr));
//Debug.Check(ret.EndsWith(kQuotStr));
ret = ret.Replace(kQuotStr, "\"");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ protected override void onexit(Agent pAgent, EBTStatus s)

protected override EBTStatus update(Agent pAgent, EBTStatus childStatus)
{
Debug.Check(childStatus != EBTStatus.BT_INVALID);
Debug.Check(this.m_children.Count == 3);

EBTStatus conditionResult = EBTStatus.BT_INVALID;
Expand All @@ -109,7 +110,7 @@ protected override EBTStatus update(Agent pAgent, EBTStatus childStatus)
conditionResult = childStatus;
}

if (this.m_activeChildIndex == CompositeTask.InvalidChildIndex || conditionResult != EBTStatus.BT_INVALID)
if (this.m_activeChildIndex == CompositeTask.InvalidChildIndex)
{
BehaviorTask pCondition = this.m_children[0];

Expand All @@ -130,6 +131,10 @@ protected override EBTStatus update(Agent pAgent, EBTStatus childStatus)
this.m_activeChildIndex = 2;
}
}
else
{
return childStatus;
}

if (this.m_activeChildIndex != CompositeTask.InvalidChildIndex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,14 @@ protected override bool onenter(Agent pAgent)
{
Debug.Check(this.m_activeChildIndex == CompositeTask.InvalidChildIndex);

// reset the status cache of the children
for (int i = 0; i < this.m_children.Count; ++i)
{
BehaviorTask pChild = this.m_children[i];

pChild.reset(pAgent);
}

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion tutorials/CsTutorials/behaviac/runtime/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.6.32
3.6.33
Original file line number Diff line number Diff line change
Expand Up @@ -1800,7 +1800,7 @@ public static string RemoveQuot(string str)

if (ret.StartsWith(kQuotStr))
{
Debug.Check(ret.EndsWith(kQuotStr));
//Debug.Check(ret.EndsWith(kQuotStr));
ret = ret.Replace(kQuotStr, "\"");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ protected override void onexit(Agent pAgent, EBTStatus s)

protected override EBTStatus update(Agent pAgent, EBTStatus childStatus)
{
Debug.Check(childStatus != EBTStatus.BT_INVALID);
Debug.Check(this.m_children.Count == 3);

EBTStatus conditionResult = EBTStatus.BT_INVALID;
Expand All @@ -109,7 +110,7 @@ protected override EBTStatus update(Agent pAgent, EBTStatus childStatus)
conditionResult = childStatus;
}

if (this.m_activeChildIndex == CompositeTask.InvalidChildIndex || conditionResult != EBTStatus.BT_INVALID)
if (this.m_activeChildIndex == CompositeTask.InvalidChildIndex)
{
BehaviorTask pCondition = this.m_children[0];

Expand All @@ -130,6 +131,10 @@ protected override EBTStatus update(Agent pAgent, EBTStatus childStatus)
this.m_activeChildIndex = 2;
}
}
else
{
return childStatus;
}

if (this.m_activeChildIndex != CompositeTask.InvalidChildIndex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,14 @@ protected override bool onenter(Agent pAgent)
{
Debug.Check(this.m_activeChildIndex == CompositeTask.InvalidChildIndex);

// reset the status cache of the children
for (int i = 0; i < this.m_children.Count; ++i)
{
BehaviorTask pChild = this.m_children[i];

pChild.reset(pAgent);
}

return true;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.6.32
3.6.33
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,19 @@ FirstAgent::~FirstAgent()
///<<< END WRITING YOUR CODE
}

void FirstAgent::Say(behaviac::string& value)
behaviac::EBTStatus FirstAgent::Say(behaviac::string& value, bool isLatent)
{
///<<< BEGIN WRITING YOUR CODE Say
printf("\n%s\n\n", value.c_str());
if (isLatent && behaviac::Workspace::GetInstance()->GetFrameSinceStartup() < 3)
{
printf("\n%s [Running]\n\n", value.c_str());

return behaviac::BT_RUNNING;
}

printf("\n%s [Success]\n\n", value.c_str());

return behaviac::BT_SUCCESS;
///<<< END WRITING YOUR CODE
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class FirstAgent : public behaviac::Agent

private: int p1;

public: void Say(behaviac::string& value);
public: behaviac::EBTStatus Say(behaviac::string& value, bool isLatent);

///<<< BEGIN WRITING YOUR CODE CLASS_PART

Expand Down
Loading

0 comments on commit 5f63d08

Please sign in to comment.