playMaker

Author Topic: Data loss on heavy-use events  (Read 986 times)

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 773
Data loss on heavy-use events
« on: March 23, 2021, 12:05:04 PM »
Ok, time to deal with a rather ancient bug. I've seen it on projects started in 1.8 and migrated to the latest iterations of PM.
On my current work it had gotten so out of hands that I had had enough and just moved back to an earlier version of PM and even then, the bug managed to corrupt an event which I knew worked perfectly before I archived this older version.

The bug is simple; add data or properties to an event, send it, look at the receiving end, no data is collected.
The only way I could summarize this issue is that there is a complete data loss on what appears to be overloaded events or large FSMs (if this makes any sense), and that's about it really as I'm at a loss to find any better descriptor.

I remember it happened a lot with Set Event Data, I was like fuuuuug but then I found the 'properties' ages ago and for some reason it worked with the same event. However I have recently seen properties' values not being collected by Get Event Properties too, in a safe fallback version of the project which I thought devoid of these.

What I know is this seems to happen in rather large FSMs or/and with events that are cast throughout the software.
Since I could not shrink some FSMs in size, I tried doing ad hoc events for specific FSMs instead of relying on those which are shared among several FSMs (usually used in "broadcast" mode, or send to a whole range of children).
This method seems to be a definitive way to solve this... thus far.
However this is quite unfortunate because it requires a multitude of variants of what is essentially the same event.

I do not know if I am the only one to have experienced this issue but I know for a fact that it definitely exists. It might be possible to highlight this problem if this feature were added to PM.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Data loss on heavy-use events
« Reply #1 on: March 23, 2021, 12:27:50 PM »
Do you have a project you can send me that shows the Set Event Data bug?

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 773
Re: Data loss on heavy-use events
« Reply #2 on: March 24, 2021, 12:36:26 PM »
Unfortunately no, I'm very sorry, but if you have any custom/homemade tool I can drop into the assets to log something of value (saved in a file for example which I could verify before sharing it here in code brackets), then I could try that.

It needs to be said that the project works very well outside of this.

Perhaps a "ghost" event hijacks the real one, like some kind of duplicate that almost works like the original.

I was doing a test in 1.9.0.
A custom event named "Down" is received in a FSM, sent by an Event trigger component on the UI element hosting this FSM.

Before pressing Run, I had deactivated the components' parameter. This is one of the few components which in Unity can simply not be ticked off, as weird as it is, so you have to put them on "Off" so no Unity event gets intercepted.

Then, at runtime, after checking that no event were received, I replaced "Down" with UI Event / UI POINTER DOWN.

But since it was 1.9.0p21 I forgot that there was this bug (gone in 1.9.1 IIRC) where certain changes brought to FSMs at runtime are not understood by Playmaker, such as changing links on the fly too, I had to get stop it.

So I stopped the game and decided to add this UI POINTER DOWN event again, but it had disappeared from the menu.
An error came through the console that said something like "this event already exists, etc.". I forgot to copy it though. UI POINTER DOWN was not listed in this FSM's events in the Events tab.

Maybe a corrupting duplicate of a given event can also exist alongside the real one.
It reminds me of the bug when two copies of the same Global variable exist at the same time, then the Global var can become unavailable.