Giter VIP home page Giter VIP logo

angryant / behave-release Goto Github PK

View Code? Open in Web Editor NEW
34.0 34.0 6.0 593 KB

The Behave project is a system for designing, integrating and running behaviour logic using Behaviour Trees for simulated characters in unity projects. NOTE: This project relates to Behave 1. For Behave 2 support and information, please use the AngryAnt community at http://community.angryant.com

Home Page: http://angryant.com/behave

behave-release's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

behave-release's Issues

Bug with debugger

Hi Emil,

Just saw a bug with the debugger. i spawn multiple objects with a tree. i see those trees nicely in the debugger.
but when i destroy a object then a null reference error is raised (not always).

Allow for collection inheritance

As seen on the behaviour trees video from aigamedev.

it would be nice to have collection inheritance. So for example, I have a top level tree that picks between wandering, chasing and avoiding based on player proximity and mob health. where wandering, chasing and avoiding are subtrees.

I would create an inherited collection where I would override the wander, chasing and avoiding trees to take advantage of the mob's unique animations. However, the top level tree would remain the same.

Build Library Option is grayed out

I am using Unity 3.1 in Windows XP (can't upgrade to Win 7 just yet). After installing the Behave 1.2 package, I see the Behave menu options under the "Assets" menu, but everything is grayed out. The option to build release/debug libraries, everything. Any suggestions as to what I might be doing incorrectly? I have absolutely no errors in my editor log after importing, either, and I do not have editor options in the "Create" list in the Unity Heirarchy.

Bug: Action cannot be selected in Behave editor

While I was creating my behavior tree the editor suddenly moved an (unconnected) action of mine far to the right, beyond the end of the frame. I only can see the actions name, but not the action itself, and therefore I cannot select it anymore and move it back. The scrollbar does not help either.

Sudden internal compiler error on library build

Sometimes libraries can not build anymore giving the "internal compiler error" message. Even deleting all trees from the library would not allow a successful build of such a library.

NewBehaveLibrary0 in the attached example fails to build.
NewBehaveLibrary1, that was created after the build error appeared on NewBehaveLibrary0, can be build fine.

Unfortunately I don't know what tree/library editing steps lead up to the error. But with the attached Unity 3.0 package the problem can be reproduced as follows:

  1. Create a new Unity 3.0 project
  2. Download Behave 1.2
  3. Import the Behave 1.2 package into the project
  4. Import the package behave1.2_libraryBuildError.unitypackage into the project
  5. Select the NewBehaveLibrary0 and build library debug, witness build error
  6. Select the NewBehaveLibrary1 and build library debug, library builds fine

Using

Thank you for creating Behave!

Hopefully you can shed some light on this issue. Would be aweful to lose some really awesome behaviour tree ;-) during development.

EDIT:
Could not find the option to upload a file, using some file uploading site instead, sorry for that:

http://www.filesonic.com/file/29111189/behave1.2_libraryBuildError.unitypackage

Error running gmcs: Cannot find the specified file

Running on OS X 10.6 with both Unity 3.3.0f4 and 3.4 with Behave 1.3. When trying to build a Behave library (both debug or release) I get this:

System.SystemException: Error running gmcs: Cannot find the specified file
  at Mono.CSharp.CSharpCodeCompiler.CompileFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.CSharpCodeCompiler.CompileFromSourceBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] sources) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.CSharpCodeCompiler.CompileAssemblyFromSourceBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] sources) [0x00000] in <filename unknown>:0 
  at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromSource (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00000] in <filename unknown>:0 
  at Behave.Editor.Compilers.Unity.Compile () [0x00000] in <filename unknown>:0 
UnityEngine.Debug:LogError(Object)
Behave.Runtime.Resources:LogError(String)
Behave.Editor.Compilers.Unity:Compile()
Behave.Editor.Compiler:Run()
Behave.Editor.Compiler:DoCompile(IBehaveAsset, Boolean)
Behave.Editor.Compiler:Compile(IBehaveAsset, Boolean)
BehaveMenu:Compile(Boolean) (at Assets/Behave/Editor/BehaveMenu.cs:55)
BehaveMenu:CompileRelease() (at Assets/Behave/Editor/BehaveMenu.cs:43)
BehaveAssetEditor:Update() (at Assets/Behave/Editor/BehaveAssetEditor.cs:40)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

On Windows (at least on 3.3.0f4) everything works.

My project is installed in "/Users/muumi1024/New Unity Project". gmcs is in default folder by Unity:

/Applications/Unity/Unity.app/Contents/Frameworks/Mono/bin

And its permissions:

-rwxrwxr-x 1 root admin 68 Mar 2 12:08 gmcs

BAD REFERENCE after tree rename

  • Create a sub-tree named OriginalName
  • Reference it from another tree (for instance, within a selector on the Default tree)
  • Using the Behave browser, rename the subtree to DifferentName
  • Return to the default tree. The reference will still have the original name, and the Inspector will display "BAD REFERENCE CollectionName.OriginalName"

Parallel node with single child causes build error

Repro:
Create empty collection and tree.

Place a parallel node.

Attach a single action to the parallel node.

Build -> error.

Attach a second node and build works fine.

I had this "problem" with selectors/sequences a while back. This is a nit-pick though, as what is the point of a parallel without multiple children, but I often place seq/sel nodes with single children as sort of reminders that more is supposed to go there.

It would be fantastic if the error messages would indicate what part of the lib is causing the build error though. I found this one out pretty quickly, as I'd had the same kind of problem before, and I was working on a small library (<50 nodes), but I shiver to think of how long it would take me to find it in my main library that has over 500 nodes. :p

Cannot unlink the top item from the root

Most connections on Behave can be edited, except the one linking the top action/decorator/sequence/etc from the root node. The only way to remove it is by removing the top item as well.

Editor warnings

Behave 1.3b1 just went nuts with editor warnings when the debugger window was open:

Unable to find style 'leftbutton' in skin 'InspectorGUISkin' Repaint
UnityEngine.GUILayout:BeginScrollView(Vector2, Boolean, Boolean, GUIStyle, GUIStyle, GUILayoutOption[])
Behave.Editor.DebugWindow:OnGUI()
BehaveDebugWindow:OnGUI() (at Assets/Behave/Editor/BehaveDebugWindow.cs:98)
UnityEditor.DockArea:OnGUI()

Unable to find style 'rightbutton' in skin 'InspectorGUISkin' Repaint
UnityEngine.GUILayout:BeginScrollView(Vector2, Boolean, Boolean, GUIStyle, GUIStyle, GUILayoutOption[])
Behave.Editor.DebugWindow:OnGUI()
BehaveDebugWindow:OnGUI() (at Assets/Behave/Editor/BehaveDebugWindow.cs:98)
UnityEditor.DockArea:OnGUI()

Unable to find style 'thumb' in skin 'InspectorGUISkin' Repaint
UnityEngine.GUILayout:BeginScrollView(Vector2, Boolean, Boolean, GUIStyle, GUIStyle, GUILayoutOption[])
Behave.Editor.DebugWindow:OnGUI()
BehaveDebugWindow:OnGUI() (at Assets/Behave/Editor/BehaveDebugWindow.cs:98)
UnityEditor.DockArea:OnGUI()

Typo on Decorator description

The Decorator description has a line stating "If none is define". It should be "defined". It also reads "in stead", when it should be "instead".

NRE on Behave 1.4-WIP debugger for 3.5b2 when tree is destroyed

When the tree you're watching is destroyed (for instance, the agent disappears or his tree is disposed), the debugger will throw up a NRE

NullReferenceException: Object reference not set to an instance of an object
Behave.Editor.DebugWindow.OnTreeGUI (Behave.Runtime.Tree tree, Vector2 origin)
Behave.Editor.DebugWindow.OnGUI ()
BehaveDebugWindow.OnGUI () (at Assets/Behave/Editor/BehaveDebugWindow.cs:98)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)

Compile Error after a few builds of any library

After I create any simple behave library, after a few builds a compile error is generated. The library will not build after that (I've also tested this by creating a simple library and building it a few times with no changes). Am running on windows with Unity 3 pro

unable to import package

Hello,
I downloaded the behave package
I have got a file with ".unitypackage.zip" extention
I changed extention to ".unitypackage"
I imported it on my unity 3.3 project
I have got this error:
"Error while importing package: Package has unknown format"

Anyone have solution ?
Thanks

Unity Pro 3.5.0f5 + Behave 1.4 + iOS Build = 'Failed to load AOT module ... /Behave.dll.dylib"

After updating to Unity from 3.4 to 3.5 and Behave from 1.3 to 1.4 I have this error + crash while launching application.

The very same configuration works without errors inside Unity Editor.

Here's the xcode console output while launching on iPad:

// ------------------------------------------------------------------------------------------------------------------------------------
GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Fri Sep 16 06:56:50 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys001
target remote-mobile /tmp/.XcodeGDBRemote-84653-41
Switching to remote-macosx protocol
mem 0x1000 0x3fffffff cache
mem 0x40000000 0xffffffff none
mem 0x00000000 0x0fff none
[Switching to process 7171 thread 0x1c03]
[Switching to process 7171 thread 0x1c03]
sharedlibrary apply-load-rules all
2012-02-17 14:09:47.522 crazyproto[7693:707] -> registered mono modules 0xb32e30
-> applicationDidFinishLaunching()
Mono path[0] = '/var/mobile/Applications/FA153452-B90F-4EBC-B4CE-D7493FE4CB9F/myapp.app/Data/Managed'
Renderer: PowerVR SGX 535
Vendor: Imagination Technologies
Version: OpenGL ES 2.0 IMGSGX535-63.14.2
GL_OES_depth_texture GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_float GL_OES_texture_half_float GL_OES_vertex_array_object GL_EXT_blend_minmax GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_discard_framebuffer GL_EXT_read_format_bgra GL_EXT_separate_shader_objects GL_EXT_shader_texture_lod GL_EXT_texture_filter_anisotropic GL_APPLE_framebuffer_multisample GL_APPLE_rgb_422 GL_APPLE_texture_format_BGRA8888 GL_APPLE_texture_max_level GL_IMG_read_format GL_IMG_texture_compression_pvrtc
Creating OpenGLES2.0 graphics device
Begin MonoManager ReloadAssembly
Platform assembly: /var/mobile/Applications/FA153452-B90F-4EBC-B4CE-D7493FE4CB9F/myapp.app/Data/Managed/UnityEngine.dll (this message is harmless)
Loading /var/mobile/Applications/FA153452-B90F-4EBC-B4CE-D7493FE4CB9F/myapp.app/Data/Managed/UnityEngine.dll into Unity Child Domain
Platform assembly: /var/mobile/Applications/FA153452-B90F-4EBC-B4CE-D7493FE4CB9F/myapp.app/Data/Managed/Assembly-CSharp-firstpass.dll (this message is harmless)
Loading /var/mobile/Applications/FA153452-B90F-4EBC-B4CE-D7493FE4CB9F/myapp.app/Data/Managed/Assembly-CSharp-firstpass.dll into Unity Child Domain
Platform assembly: /var/mobile/Applications/FA153452-B90F-4EBC-B4CE-D7493FE4CB9F/myapp.app/Data/Managed/Assembly-CSharp.dll (this message is harmless)
Loading /var/mobile/Applications/FA153452-B90F-4EBC-B4CE-D7493FE4CB9F/myapp.app/Data/Managed/Assembly-CSharp.dll into Unity Child Domain
Non platform assembly: /private/var/mobile/Applications/FA153452-B90F-4EBC-B4CE-D7493FE4CB9F/myapp.app/Data/Managed/System.Core.dll (this message is harmless)
Non platform assembly: /private/var/mobile/Applications/FA153452-B90F-4EBC-B4CE-D7493FE4CB9F/myapp.app/Data/Managed/EnemyBuild.dll (this message is harmless)
Non platform assembly: /private/var/mobile/Applications/FA153452-B90F-4EBC-B4CE-D7493FE4CB9F/myapp.app/Data/Managed/Behave.Unity.Runtime.dll (this message is harmless)
Non platform assembly: /private/var/mobile/Applications/FA153452-B90F-4EBC-B4CE-D7493FE4CB9F/myapp.app/Data/Managed/System.dll (this message is harmless)
Platform assembly: /var/mobile/Applications/FA153452-B90F-4EBC-B4CE-D7493FE4CB9F/myapp.app/Data/Managed/EnemyBuild.dll (this message is harmless)
Loading /var/mobile/Applications/FA153452-B90F-4EBC-B4CE-D7493FE4CB9F/myapp.app/Data/Managed/EnemyBuild.dll into Unity Child Domain
Platform assembly: /var/mobile/Applications/FA153452-B90F-4EBC-B4CE-D7493FE4CB9F/myapp.app/Data/Managed/Behave.Unity.Assets.dll (this message is harmless)
Loading /var/mobile/Applications/FA153452-B90F-4EBC-B4CE-D7493FE4CB9F/myapp.app/Data/Managed/Behave.Unity.Assets.dll into Unity Child Domain
Platform assembly: /var/mobile/Applications/FA153452-B90F-4EBC-B4CE-D7493FE4CB9F/myapp.app/Data/Managed/Behave.Unity.Runtime.dll (this message is harmless)
Loading /var/mobile/Applications/FA153452-B90F-4EBC-B4CE-D7493FE4CB9F/myapp.app/Data/Managed/Behave.Unity.Runtime.dll into Unity Child Domain
Platform assembly: /var/mobile/Applications/FA153452-B90F-4EBC-B4CE-D7493FE4CB9F/myapp.app/Data/Managed/Behave.dll (this message is harmless)
Loading /var/mobile/Applications/FA153452-B90F-4EBC-B4CE-D7493FE4CB9F/myapp.app/Data/Managed/Behave.dll into Unity Child Domain
Failed to load AOT module '/var/mobile/Applications/FA153452-B90F-4EBC-B4CE-D7493FE4CB9F/myapp.app/Data/Managed/Behave.dll.dylib' in aot-only mode.
// ------------------------------------------------------------------------------------------------------------------------------------

"Tree tried to update without having registered" error

The "Tree tried to update without having registered" error persists on 1.4, and appears randomly but more often when an agent is about to be destroyed:

Tree of type TreeNameHere.Default tried to update without having registered.
UnityEngine.Debug:LogError(Object)
Behave.Runtime.Resources:LogError(String)
Behave.Runtime.Debugging:Update(Tree)
BTCreaturesC0T0:SetActiveComponent(Int32)
BTCreaturesC0T0:Tick9(IAgent, Tree, Object)
BTCreaturesC0T0:Tick(IAgent, Tree, Object)
Behave.Runtime.Tree:Tick()
[...]

It might be that you're first de-registering the tree then attempting to log a debug event.

Error Building Library

Still having trouble turning the tree structure into a code base. Each time I click [Build Library Debug] I get "Error running gmcs: Cannot find the specified file".

I'm using Unity 3.3 and Behave 1.2. Reading the forum thread, this error has occurred before but was suggested as fixed.

The only other anomaly regarding my machine is that it's locked down due to it being a work machine. Would a lack of permission in the application folder cause trouble building the files? The project directory is open obviously.

Any help appreciated, although I just wanted to highlight the issue really.

BAD REFERENCE on 1.4b1

While reviewing a subtree on 1.4b1, I noticed that the inspector displays under the Component:

Context
Invert [ ]
Instant [ ]
Comment
BAD REFERENCE No reference set

Can't find a way to attach a screenshot. I have not edited the tree nor renamed the tree recently, so it's likely not related to issue 7.

Runtime error on empty decorator

If a decorator on a tree does not have any children, Behave will raise a IndexOutOfRangeException and the "Compiling" window will remain open. There is no way to close the window/progress bar other than fixing the library and re-compiling the asset.

System.IndexOutOfRangeException: Array index is out of range.
at Behave.Editor.Compilers.CSharp.BuildDecorator (Behave.Assets.Decorator componentAsset, Int32 componentIdx) [0x00000] in :0
at Behave.Editor.Compilers.CSharp.BuildTreeClasses () [0x00000] in :0
at Behave.Editor.Compilers.CSharp.Compile () [0x00000] in :0
at Behave.Editor.Compilers.Unity.Compile () [0x00000] in :0
UnityEngine.Debug:LogError(Object)
Behave.Runtime.Resources:LogError(String)
Behave.Editor.Compilers.Unity:Compile()
Behave.Editor.Compiler:Run()
Behave.Editor.Compiler:DoCompile(IBehaveAsset, Boolean)
Behave.Editor.Compiler:Compile(IBehaveAsset, Boolean)
BehaveMenu:Compile(Boolean) (at Assets/Behave/Editor/BehaveMenu.cs:55)
BehaveMenu:Compile() (at Assets/Behave/Editor/BehaveMenu.cs:31)
BehaveAssetEditor:Update() (at Assets/Behave/Editor/BehaveAssetEditor.cs:36)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

Collection duplicate does not update tree references

Suppose you have the following collection:

Col-A

  • Col-A.Tree 1
  • Col-A.Tree 2
  • Col-A.Tree 3 (references Col-A.Tree 1 as a subtree)

If you duplicate it into Col-B, you'll end up with

Col-B

  • Col-B.Tree 1
  • Col-B.Tree 2
  • Col-B.Tree 3 (references Col-A.Tree 1 as a subtree)

That is, if any of those trees contained a reference to another one, the reference will not point to the duplicated tree in Col-B, but to the one in Col-A.

Incidentally, the Behave compiler is beachballing Unity when attempting to compile a library with a duplicated collection, which might be related to this issue.

Allow expression parameters

This is an enhancement proposal.

A string and float parameters are welcome, but they are very restricted. How about a parameter where you can plug in an arbitrary expression. It would things like this:

Action: wait
parameter: Random.value * 5 + 5 // sleep between 5 and 10 seconds

It would also be very cool, if you could access content from the context in this expression.

Attention needs to be provided to whether the expression is evaluated once, or per tick (maybe a toggle?)

Since you compile down to a dll, maybe this would not require writing an interpreter or anything like that, but just including the expression as part of the generated code.

Trees not properly reset

As discussed on Skype: trees are not being consistently reset. I reset the behavior tree on the component's OnEnable/OnDisable, but it does not seem to work if there's a behavior running. I've resorted to destroying the tree on disable an re-instantiating it on enable (which has both GC and reflection costs).

'Unable to find style' errors when the debugger is open

I sometimes get a bunch of GUILayout exceptions when the debugger is open, much like the one below.

Unable to find style 'thumb' in skin 'InspectorGUISkin' Repaint
UnityEngine.GUILayout:BeginScrollView(Vector2, Boolean, Boolean, GUIStyle, GUIStyle, GUILayoutOption[])
Behave.Editor.DebugWindow:OnGUI()
BehaveDebugWindow:OnGUI() (at Assets/Behave/Editor/BehaveDebugWindow.cs:98)
UnityEditor.DockArea:OnGUI()

They appear for various UI elements ('thumb' and others). I do not have a consistent repro case, it seems to be random.

Cannot duplicate tree with Priority Selector

Create a tree with a priority selector.

then try to duplicate the tree, I get the following error:

ArgumentException: Unknown component type
Behave.Assets.Component.Copy (Behave.Assets.Component original, Behave.Assets.Tree destinationTree)
Behave.Assets.OutputComponent..ctor (Behave.Assets.OutputComponent original, Behave.Assets.Tree tree)
Behave.Assets.Sequence..ctor (Behave.Assets.Sequence original, Behave.Assets.Tree tree)
Behave.Assets.Component.Copy (Behave.Assets.Component original, Behave.Assets.Tree destinationTree)
Behave.Assets.OutputComponent..ctor (Behave.Assets.OutputComponent original, Behave.Assets.Tree tree)
Behave.Assets.Sequence..ctor (Behave.Assets.Sequence original, Behave.Assets.Tree tree)
Behave.Assets.Component.Copy (Behave.Assets.Component original, Behave.Assets.Tree destinationTree)
Behave.Assets.Tree..ctor (System.String name, Behave.Assets.Tree original)
Behave.Editor.Browser.OnStandardGUI ()
Behave.Editor.Browser.OnGUI ()
BehaveBrowser.OnGUI () (at Assets/Behave/Editor/BehaveBrowser.cs:96)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
16:10:15 Андрей so i need to delete this before duplicate this tree

InitAction not being called after reset

I have a behavior tree on Behave 1.3.1 where Behave might be called in the middle of a Move action (since it might be interrupted by the agent being attacked).

Suppose the creature gets stunned while moving, which invokes a behaviorTree.Reset(). It will eventually reach the Move action dagain. However, the time that Move is ticked after the Reset() the InitMoveAction is not called as it should, so it skips any initialization that you meant to do.

Include built in decorators/actions

This is an enhancement proposal.

The way people can write their own decorators and actions is very powerful. It allows people to have all kinds of crazy components that can be used in their trees.

However, there are a few components that are general purpose that every developer currently has to reinvent. I suggest Behave come with a few built in general purpose decorators and actions like:

  • Repeat. with a count
  • RepeatInfinite. loop for ever
  • Wait. Sleep x seconds, could be an action and decorator, a decorator will execute the underlying tree for x seconds
  • Animate. Play an animation, you could provide animation name, the animation object would have to be provided to the tree (context?). Both synchronous and asynchronous would be useful
  • SendMessage. Send a unity message to an object

and I am sure there could be a million others that a noob like me is not aware of.

Tree instantiation logging in release build significantly slows down application

When a project has

  • the tree library as a release build and
  • is deployed as a release build

there is still a significant slowdown caused by debug output logged for each tree/subtree instantiation.

Here it logs 10 instantiations for quite small trees

  • 4 trees in the library [A, A0, A1, B]
  • 3 instantiations of type A tree (3 monsters) and
  • 1 instantiation of type B tree (group logic)

An example output from output_log.txt would be

AngryAnt Behave version 1.2 loading behaviour tree...
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:Log(Object)
Behave.Runtime.Resources:Log(String)
BTTestLibraryC0T1:.ctor(IAgent)
BLTestLibrary:InstantiateTree(TreeType, IAgent)
CSAgent:InstantiateTreeType(TreeType, IAgent)
CSSquadAgent:Awake()
UnityEngine.Object:INTERNAL_CALL_Internal_InstantiateSingle(Object, Vector3&, Quaternion&)
UnityEngine.Object:Internal_InstantiateSingle(Object, Vector3, Quaternion)
UnityEngine.Object:Instantiate(Object, Vector3, Quaternion)
CSGeneral:UpdateGeneral(GameObject)
GameController:Update()

(Filename: ..\..\Runtime\Export\Generated\BaseClass.cpp Line: 2528)

The cause for the slowdown are the logging entries as deep profiling results inside the Editor show.

I don't know how Behave is built up but the Unity documentation could provide a solution at

http://unity3d.com/support/documentation/ScriptReference/Debug-isDebugBuild.html

"...It is recommended to remove all calls to Debug.Log when deploying a game, this way you can easily deploy beta builds with debug prints and final builds without..."

* C#

// Log some debug information only if this is a debug build
if (Debug.isDebugBuild) {
    Debug.Log ("This is a debug build!");
}

Feature request: list the actions per collection

Please list the actions that each collection references on the info file being generated by Behave. This would make it a lot easier to refactor or rename actions that might be referenced in multiple collections.

Exception during debug

Behave raised an exception while debugging.

NullReferenceException: Object reference not set to an instance of an object
Behave.Editor.DebugWindow.OnTreeListItemGUI (System.Object item, Boolean selected, ICollection list)
Behave.Editor.Resources.SelectList (ICollection list, System.Object selected, Behave.Editor.OnListItemGUI itemHandler)
Behave.Editor.DebugWindow.OnGUI ()
BehaveDebugWindow.OnGUI () (at Assets/Behave/Editor/BehaveDebugWindow.cs:98)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)

Debugger error when clicking on Actors

I've got about 10 agents running the same tree, with names like 'Agent-Spawner1-79.331'. The behave debugger displays as expected, but when clicking on actors all the nodes in the tree disappear, I'm left with a mostly empty UI that shows only the connections and the following exception is raised:

ArgumentException: Getting control 0's position in a group with only 0 controls when doing Repaint
Aborting
UnityEngine.GUILayoutGroup.GetNext ()
UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type LayoutType)
UnityEngine.GUILayout.BeginScrollView (Vector2 scrollPosition, Boolean alwaysShowHorizontal, Boolean alwaysShowVertical, UnityEngine.GUIStyle horizontalScrollbar, UnityEngine.GUIStyle verticalScrollbar, UnityEngine.GUIStyle background, UnityEngine.GUILayoutOption[] options)
UnityEngine.GUILayout.BeginScrollView (Vector2 scrollPosition, UnityEngine.GUILayoutOption[] options)
Behave.Editor.DebugWindow.SelectedTreeInfoWindow (Int32 id)
UnityEngine.GUI+_Window.Do ()
UnityEngine.GUI.EndWindows (UnityEngine.IDList idlist)
UnityEngine.GUI.DoEndWindows (UnityEngine.IDList idlist)
UnityEditor.EditorGUIInternal.EndWindowsForward (UnityEngine.IDList idlist)
UnityEditor.EditorWindow.EndWindows ()
BehaveDebugWindow.EndWindows () (at Assets/Behave/Editor/BehaveDebugWindow.cs:85)
Behave.Editor.DebugWindow.OnGUI ()
BehaveDebugWindow.OnGUI () (at Assets/Behave/Editor/BehaveDebugWindow.cs:98)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)

Editor: Zooming

Having a way of zooming the editor would be great, especially when working on smaller displays.

Editor: Right click context menus

Having more context options when right-clicking actions/sequences/decorators/... would be useful. Some suggestions:

  • Invert
  • Instant
  • Duplicate

Init decorator called every tick instead of just once

I have a "Wait" decorator which receives a float parameter of how long to wait while executing its child. I expected I could initialize the "Wait until time" on the decorator's init, but it is being called every tick instead of just once. I end up with:

InitWaitDecorator with 4 at 2.120646
TickWaitDecorator until 6.120646 now 2.120646 returning Running
InitWaitDecorator with 4 at 2.226122
TickWaitDecorator until 6.226122 now 2.226122 returning Running
InitWaitDecorator with 4 at 2.328562
TickWaitDecorator until 6.328562 now 2.328562 returning Running

And so on. I expect this is a bug, since there is no need to initialize the decorator more than once.

On Windows 7 dual screen setups nodes in the tree editor can be dragged outside of the screen

This can happen when using 2 screens (monitors) and a desktop spanned over both screens in Windows 7.

If the left screen is the main screen and the right screen contains the Behave editor, nodes in the tree editor can be moved outside of the right screen's left edge by dragging the node and mouse pointer over the left edge of the right screen into the left screen.

| main screen  |                  |
|  screen left | screen right     |
|              |  tree editor     |
       <------- dragging node that way

It happens in two cases:

  1. Dragging a node inside the tree view
  2. Dragging a node from the node brushes into the tree view

This can be prevented by using the tree editor on the left screen, where the mouse can not be dragged further to the left outside of the screen.

This obviously is an edge case of very low priority. I guess it could be fixed by clamping mouse coordinates or something like that.

Priority node returning BehaveResult.Running causes error in tree resetting lateron

If attached a minimal priority node example. In the example the first action node attached to the priority node will return BehaveResult.Running for 2 seconds. After that it will return BehaveResult.Success. The tree is reset incompletely. Because after the reset no node is ever visited again.

Instead if the action does never return BehaveResult.Running but instead returns BehaveResult.Success immediately, everything works fine.

This can be reproduced as follows:

  1. Create a new Unity 3.0 project
  2. Download Behave 1.2
  3. Download package behave1.2_priorityNodeRunningTreeResetError.unitypackage from
    http://www.filesonic.com/file/29265981/behave1.2_priorityNodeRunningTreeResetError.unitypackage
  4. Import the Behave 1.2 package into the project
  5. Import the package behave1.2_priorityNodeRunningTreeResetError.unitypackage into the project
  6. Run the application and check the debug log or Behave debugger
  7. After about 2 seconds the correct behaviour stops and the tree nodes are not visited anymore
  8. Stop the application.
  9. Change comments in CSAgent.cs lines 79 and 80 to deactivate the timer, so that the Action never
    returns BehaveResult.Running but BehaveResult.Success immediately.
    1. Run the application and check the debug log or Behave debugger
    2. The output is correct and the action is visited repeatedly after deciding priority.

Using

Unity build error when using Behave 1.4-WIP on iOS 3.5b2

When attempting to build an application which includes Behave on Unity 3.5b2 with an iOS target, I get the following error:

Assets/Behave/BehaveAsset.cs(27,32): error CS0103: The name `UnityEditor' does not exist in the current context

Internal compiler error with non-integral float parameters

When a behavior tree with an action with a non-integer-valued floatParameter is compiled, the result is an "internal compiler error" dialog box. This does not occur when integers are entered for floatParameter.

Steps to reproduce:

  1. Create a new behave library. Select it in the project window.
  2. Click "edit library" in the inspector.
  3. Create->Collection, then Create-Tree.
  4. In the behave editor, add an Action, and connect the root to it.
  5. Select the action, and in the Inspector, set "floatParameter" to 0.5.
  6. In the inspector, click "Select Asset" and then "Build library debug". The error will occur.

This is with Behave 1.2, Unity 3.1.0f3.

Editor warning on 3.5b2

When using the 3.5b2 version of Behave, Unity spits out the following warning:

BehaveEditor must be instantiated using the ScriptableObject.CreateInstance method instead of new BehaveEditor.
UnityEngine.ScriptableObject:.ctor()
BehaveEditor:.ctor()
BehaveMenu:get_EditorInstance() (at Assets/Behave/Editor/BehaveMenu.cs:184)
BehaveMenu:EditLibraryAsset(BehaveAsset) (at Assets/Behave/Editor/BehaveMenu.cs:195)
BehaveMenu:EditLibrary() (at Assets/Behave/Editor/BehaveMenu.cs:19)
BehaveAssetEditor:Update() (at Assets/Behave/Editor/BehaveAssetEditor.cs:32)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

Easy enough to fix locally, but should be fixed on the main.

NRE on Behave debugger for 3.5b2

After upgrading to Behave for 3.5b2 and building a library, open a scene where you have agents and then the behave debugger. Select an agent from the top bar. Unity will spit out:

NullReferenceException: Object reference not set to an instance of an object
Behave.Editor.TreeEditor.GetComponentRect (Behave.Assets.Component component)
Behave.Editor.TreeEditor.GetTreeRect (Behave.Assets.Tree tree)
Behave.Editor.DebugWindow.GetTreeRect (Behave.Runtime.Tree tree, Single scale)
Behave.Editor.DebugWindow.OnGUI ()
BehaveDebugWindow.OnGUI () (at Assets/Behave/Editor/BehaveDebugWindow.cs:98)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)

Multiple priority selectors in one tree

Hey! Great work on behave. I have recently downloaded the library and trying to learn. I am new to game dev and though behave will be of great use to me.

While trying various tree combinations to understand how things are working i came across one problem. I had put two priority selectors in a tree, one under under another. The top priority selector has 2 actions and a priority selector. The other priority selector has 2 more actions.

Now when the IAgent calls to SelectTopPriority, I am not able to figure out which priority selector is calling this method. I found one way, by using (Tree)sender.ActiveComponent. But the id seems to be generated when i am creating the tree in the editor and the editor does not show me this id.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.