playMaker

Author Topic: A graph of inter-FSM events  (Read 23086 times)

seldomU

  • Playmaker Newbie
  • *
  • Posts: 17
Re: A graph of inter-FSM events
« Reply #15 on: April 23, 2016, 01:47:32 PM »
HI
i have just imported the demo version and also the unity package posted here and now i am trying to see playmaker graph but i dont see any option to do that

Hi,
these steps should get you a graph for your active scene:
  • in Unity's menu bar, select Window > RelationsInspector
  • RelationsInspector's toolbar has a dropdown of available backends. Select PlayMakerInterFSMCommunicationBackend
  • a second toolbar appears below. Click its Show active scene button
« Last Edit: April 23, 2016, 01:49:46 PM by seldomU »

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: A graph of inter-FSM events
« Reply #16 on: April 23, 2016, 01:49:28 PM »
Thank you for the purchase!

I had only considered the Get/Set Fsm Variable actions, I didn't know about the others. I'll add all the Get/Set Fsm ... actions shortly. Are there any others I should include?

With event's and the get/set fsm actions covered- I can't think of any other Playmaker stuff that is otherwise difficult to debug- it would be a huge help with just those  :)
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

rik

  • Full Member
  • ***
  • Posts: 246
Re: A graph of inter-FSM events
« Reply #17 on: April 23, 2016, 02:07:26 PM »
unfortunately in the drop down i dont see playmaker

rik

  • Full Member
  • ***
  • Posts: 246
Re: A graph of inter-FSM events
« Reply #18 on: April 23, 2016, 02:12:00 PM »
i have reimported the script now i get error
NullReferenceException: Object reference not set to an instance of an object
RelationsInspector.Backend.PlayMaker.PlayMakerInterFSMCommunicationBackend.<GetSceneTargets>m__30 (.PlayMakerFSM pmFSM) (at Assets/Editor/GraphBackends/PlayMaker/PlayMakerInterFSMCommunicationBackend.cs:191)
System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[PlayMakerFSM].MoveNext ()
System.Collections.Generic.List`1[PlayMakerFSM].AddEnumerable (IEnumerable`1 enumerable) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:128)
System.Collections.Generic.List`1[PlayMakerFSM]..ctor (IEnumerable`1 collection) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:65)
System.Linq.Enumerable.ToArray[

rik

  • Full Member
  • ***
  • Posts: 246
Re: A graph of inter-FSM events
« Reply #19 on: April 23, 2016, 02:15:17 PM »
i am getting error when i set the type to playmaker fsm and select active scene i get the following error.
i am using 5.3

NullReferenceException: Object reference not set to an instance of an object
RelationsInspector.Backend.PlayMaker.PlayMakerInterFSMCommunicationBackend.<GetSceneTargets>m__30 (.PlayMakerFSM pmFSM) (at Assets/Editor/GraphBackends/PlayMaker/PlayMakerInterFSMCommunicationBackend.cs:191)
System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[PlayMakerFSM].MoveNext ()
System.Collections.Generic.List`1[PlayMakerFSM].AddEnumerable (IEnumerable`1 enumerable) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:128)
System.Collections.Generic.List`1[PlayMakerFSM]..ctor (IEnumerable`1 collection) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:65)
System.Linq.Enumerable.ToArray[

seldomU

  • Playmaker Newbie
  • *
  • Posts: 17
Re: A graph of inter-FSM events
« Reply #20 on: April 23, 2016, 02:26:25 PM »
I'm using 5.3 as well. Attached is an update that fixes the NullReference exception, but I suspect that's only a symptom, not the actual error.

rik

  • Full Member
  • ***
  • Posts: 246
Re: A graph of inter-FSM events
« Reply #21 on: April 23, 2016, 02:46:26 PM »
i have got new error when i open a huge scene with many fsms

NullReferenceException: Object reference not set to an instance of an object
RelationsInspector.Backend.PlayMaker.PlayMakerInterFSMCommunicationBackend+<GetEventReceivers>c__AnonStorey15.<>m__34 (.PlayMakerFSM pmFSM) (at Assets/Editor/GraphBackends/PlayMaker/PlayMakerInterFSMCommunicationBackend.cs:251)
System.Linq.Enumerable+<CreateSelectManyIterator>c__Iterator12`2[PlayMakerFSM,HutongGames.PlayMakerEditor.FsmInfo].MoveNext ()
RelationsInspector.Backend.PlayMaker.PlayMakerInterFSMCommunicationBackend+<GetRelations>c__Iterator3.MoveNext () (at Assets/Editor/GraphBackends/PlayMaker/PlayMakerInterFSMCommunicationBackend.cs:92)
System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2[RelationsInspector.Relation`2[PlayMakerFSM,RelationsInspector.Backend.PlayMaker.FsmLink],RelationsInspector.Relation`2[PlayMakerFSM,RelationsInspector.Backend.PlayMaker.FsmLink]].MoveNext ()
RelationsInspector.GraphBuilder`2[PlayMakerFSM,RelationsInspector.Backend.PlayMaker.FsmLink].AddRelations (RelationsInspector.Graph`2 graph, IEnumerable`1 entities, RelationsInspector.GetRelations getRelations, RelationsInspector.RNG rng, Int32 maxNodeCount)
RelationsInspector.GraphBuilder`2[PlayMakerFSM,RelationsInspector.Backend.PlayMaker.FsmLink].Build (IEnumerable`1 seeds, RelationsInspector.GetRelations getRelations, RelationsInspector.RNG rng, Int32 maxNodeCount)
RelationsInspector.Workspace`2[PlayMakerFSM,RelationsInspector.Backend.PlayMaker.FsmLink].InitGraph ()
RelationsInspector.Workspace`2[PlayMakerFSM,RelationsInspector.Backend.PlayMaker.FsmLink]..ctor (System.Type backendType, System.Object[] targets, RelationsInspector.GetAPI getAPI, System.Action Repaint, System.Action`1 Exec)
System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:513)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:519)
System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:528)
System.Activator.CreateInstance (System.Type type, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Activator.cs:338)
System.Activator.CreateInstance (System.Type type, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Activator.cs:274)
RelationsInspector.RIInternal.CreateWorkspace ()
RelationsInspector.RIInternal.InitWorkspace ()
RelationsInspector.RIInternal.OnSelectBackend (System.Type backendType)
RelationsInspector.RIInternal+<>c__DisplayClass1e.<SetBackend>b__1d ()
RelationsInspector.RelationsInspectorWindow.Update ()
UnityEngine.Debug:LogException(Exception)
RelationsInspector.RelationsInspectorWindow:Update()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

seldomU

  • Playmaker Newbie
  • *
  • Posts: 17
Re: A graph of inter-FSM events
« Reply #22 on: April 23, 2016, 02:57:21 PM »
Ok, that's the same issue in another line. Are you getting that with the same scene? Fix attached.

rik

  • Full Member
  • ***
  • Posts: 246
Re: A graph of inter-FSM events
« Reply #23 on: April 23, 2016, 03:30:36 PM »
editor was too show now with many fsms

seldomU

  • Playmaker Newbie
  • *
  • Posts: 17
Re: A graph of inter-FSM events
« Reply #24 on: April 23, 2016, 03:47:17 PM »
In general the tool can handle more than 100 nodes just fine, but upwards of that it starts to slow down. With that many nodes the graph becomes unreadable anyway. I'll look into an option to hide FSMs that are not connected.

rik

  • Full Member
  • ***
  • Posts: 246
Re: A graph of inter-FSM events
« Reply #25 on: April 23, 2016, 04:07:18 PM »
i have 526 nodes

seldomU

  • Playmaker Newbie
  • *
  • Posts: 17
Re: A graph of inter-FSM events
« Reply #26 on: April 23, 2016, 04:28:51 PM »
Ok that's heavy :D

The attached version has an toolbar toggle to hide the unconnected nodes. Enable that before generating the graph. Of course it only helps if the majority of your nodes actually are unconnected. Otherwise I think only some kind of hierarchical graph would make your data accessible.

@mdotstrange: this version also adds support for all the Get/Set Fsm ... actions.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: A graph of inter-FSM events
« Reply #27 on: April 23, 2016, 07:50:33 PM »
This looks like it's coming along nicely!

The next Playmaker update will include a callback for OnFsmChanged that you can hook into to update the graph...

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: A graph of inter-FSM events
« Reply #28 on: April 24, 2016, 10:39:57 AM »
WOW - super useful!!!

seldomU

  • Playmaker Newbie
  • *
  • Posts: 17
Re: A graph of inter-FSM events
« Reply #29 on: April 24, 2016, 05:08:29 PM »
@dudebxl: Thank you!

@Alex: Great, I'll build an auto-update option out of that.