pvanallen / delft-ai-toolkit

Tool for Prototyping AI Projects
30 stars 3 forks source link

StringCondition changed with actions instead of triggers - mistake? #7

Closed pvanallen closed 5 years ago

pvanallen commented 5 years ago

Previously, you could have multiple strings that could be matched, but instead it has Actions instead of matching conditions, with an output for each trigger. I'm guessing this was a mistake when updating to eliminate the external reorderable list?

pvanallen commented 5 years ago

And weirdly, sometimes when Unity is in play, it fixes itself and you see conditions instead of actions. But if you try to drag the node around while in play, it reverts to actions. The actions appear to be duplicates of the actions in a separate Action node (in this case, the ding1 anim in the top chain).

Siccity commented 5 years ago

Could you attach a screenshot of it happening?

pvanallen commented 5 years ago

pasted_image_1_3_19__8_36_am

pvanallen commented 5 years ago

and seeing this error message


Aborting
UnityEngine.GUILayoutGroup.GetNext () (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/LayoutGroup.cs:117)
UnityEngine.GUILayoutUtility.DoGetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUILayoutUtility.cs:461)
UnityEngine.GUILayoutUtility.GetRect (Single width, Single height, UnityEngine.GUILayoutOption[] options) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUILayoutUtility.cs:435)
UnityEditorInternal.ReorderableList.DoLayoutList () (at /Users/builduser/buildslave/unity/build/Editor/Mono/GUI/ReorderableList.cs:390)
XNodeEditor.NodeEditorGUILayout.InstancePortList (System.String fieldName, System.Type type, UnityEditor.SerializedObject serializedObject, IO io, ConnectionType connectionType) (at Assets/Scripts/delftToolkit/Submodules/xNode/Scripts/Editor/NodeEditorGUILayout.cs:294)
XNodeEditor.NodeEditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, XNode.NodePort port, Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at Assets/Scripts/delftToolkit/Submodules/xNode/Scripts/Editor/NodeEditorGUILayout.cs:73)
XNodeEditor.NodeEditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at Assets/Scripts/delftToolkit/Submodules/xNode/Scripts/Editor/NodeEditorGUILayout.cs:29)
XNodeEditor.NodeEditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at Assets/Scripts/delftToolkit/Submodules/xNode/Scripts/Editor/NodeEditorGUILayout.cs:21)
DelftToolkit.ActionsEditor.OnBodyGUI () (at Assets/Scripts/delftToolkit/Nodes/Editor/ActionsEditor.cs:50)
XNodeEditor.NodeEditorWindow.DrawNodes () (at Assets/Scripts/delftToolkit/Submodules/xNode/Scripts/Editor/NodeEditorGUI.cs:324)
XNodeEditor.NodeEditorWindow.OnGUI () (at Assets/Scripts/delftToolkit/Submodules/xNode/Scripts/Editor/NodeEditorGUI.cs:29)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:295)
UnityEditor.HostView.Invoke (System.String methodName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:288)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:255)```
Siccity commented 5 years ago

I've been messing around with it and haven't been able to reproduce it. Fixed an unrelated bug. But I'm guessing it has something to do with the reorderable list caching done in xNode. I'll keep a lookout.

Siccity commented 5 years ago

I did some minor changes in 530ab7a2975064d24d05f3e1873f8b7b1d586bbd. I suspect this might fix the issue, but I'm not sure.

pvanallen commented 5 years ago

Unfortunately, that did not fix it. This is an urgent problem at this point for me. Here's a gif showing some of the odd behavior. Is it possible it is something I've done in other parts of the code?

condition-weirdness

Siccity commented 5 years ago

I'm not sure. I will look further into it tomorrow immediately after work.

pvanallen commented 5 years ago

I just cloned a clean version, and see the same problem.

pvanallen commented 5 years ago

A quick list of things I've tried:

In all cases, if I create a new graph, create a string condition and then an actions node, the conditions will magically change to actions, and often will seem to be connected to the actions in the action node.

pvanallen commented 5 years ago

I think I discovered what makes this error show up. If the xNode pane is docked within the main Unity window in one of the panels, it works fine. But if you detach the pane and have float apart from the Unity window, and then start the Play button, that's when things go bad and you get the following error:

ArgumentException: Getting control 6's position in a group with only 6 controls when doing Repaint

I've been using a second monitor and having the xNode pane on that monitor, while the Unity window is on my laptops screen.

pvanallen commented 5 years ago

A refinement of the above: If the xNode pane is active when Play is clicked, it gets the error. If the pane is inactive (i.e. another pane tab is selected where xNode is in the same panel), then no error occurs. So it appears there is some problem with initialization or related.

pvanallen commented 5 years ago

I'm also seeing an issue where newly added condition triggers don't have an outlet, and instead have an inlet.

Siccity commented 5 years ago

Progress! I found that if you remove the two lines relating to OnCreateReorderableList at https://github.com/pvanallen/delft-toolkit-v2/blob/530ab7a2975064d24d05f3e1873f8b7b1d586bbd/unity/delft-toolkit/Assets/Scripts/delftToolkit/Nodes/Editor/ActionsEditor.cs#L48-L51 the bug disappears. These are required to get the action list to correctly display currently highlighted action. I'll see if i can figure out why this happens

Siccity commented 5 years ago

I'm also seeing an issue where newly added condition triggers don't have an outlet, and instead have an inlet.

Yeah i noticed that as well this morning. Swapping it didn't fix the issue though, but you're right.

pvanallen commented 5 years ago

Good news about the progress!

I'm seeing another issue where it most of the time, when trying to make changes to the signal filter URL, the change doesn't stick.

cant change url

Siccity commented 5 years ago

Good news about the progress!

I'm seeing another issue where it most of the time, when trying to make changes to the signal filter URL, the change doesn't stick.

We should take that up as a separate issue