playMaker

Author Topic: FSM goes through states it isn't intended to [KINDA SOLVED]  (Read 4880 times)

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
FSM goes through states it isn't intended to [KINDA SOLVED]
« on: February 18, 2018, 04:54:25 PM »
How is this even possible?



I've got a problem and started debugging, and it seems that FSM went to BOTH states from the switch.
« Last Edit: February 23, 2018, 09:58:19 AM by krmko »
Available for Playmaker work

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: FSM goes through states it isn't intended to
« Reply #1 on: February 18, 2018, 05:07:53 PM »
As you can see, it's causing a lot of problems



The ones that are ok don't have that kind of problem



There's absolutely no difference between the variables and states between the good and bad object




The worst thing is that it's basically impossible to reproduce because it doesn't happen on all objects, and starts happening after few minutes in-game.

Please advise, i don't know what to do.
« Last Edit: February 18, 2018, 05:33:00 PM by krmko »
Available for Playmaker work

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: FSM goes through states it isn't intended to
« Reply #2 on: February 19, 2018, 01:53:12 AM »
Hi,

 Can you check the fsm log and the timing, Are you sure the first state was not entered twice? I know it mention 1, but I would double check.

 Is it 100% reproduceable? if so, let me know, I'am willing to try to repro locally.

 Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: FSM goes through states it isn't intended to
« Reply #3 on: February 19, 2018, 01:54:20 AM »
Hi

 one more thing. Are you sure one of this transition is not called from another state or as a global event? if that's the case, then it's to be expected.

 a transition can be called out of the blue by another state or fsm using send Event or similar.

 Bye,

 Jean

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: FSM goes through states it isn't intended to
« Reply #4 on: February 19, 2018, 03:09:40 AM »
Graph show the state has been initiated (and it is, since the problem exists visibly), but debug says the state has never been entered



Edit 1: It still makes problems with action sequence enabled, i'll try splitting states.

Edit 2: Still no good, i'll try string compare instead of string switch.

Edit 3: Still no good.



The thing that puzzles me the most is why this happens only after some time from the start, not from the beginning?

I also checked the events, no callbacks.
« Last Edit: February 19, 2018, 05:01:33 AM by krmko »
Available for Playmaker work

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: FSM goes through states it isn't intended to
« Reply #5 on: February 19, 2018, 07:54:23 AM »
This is fucking unbelievable, it must be a bug

Available for Playmaker work

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: FSM goes through states it isn't intended to
« Reply #6 on: February 19, 2018, 08:02:34 AM »
I have an idea, i am using pooling so the objects get disabled, but not the fsm's on them. When they get recycled, the FSM is not getting through states all over again. I'll try fiddling with that.
Available for Playmaker work

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: FSM goes through states it isn't intended to
« Reply #7 on: February 19, 2018, 08:54:42 AM »
Ok, here's what i've done since i am using pooling. When the enemy dies, it disables all attached components, then sends an event to the special FSM (i called it "behaviour enabler") on itself which is used only to deactivate all the rest remaining enabled FSM's before despawning. All of them are set to "reset on disable". When the object appears again, only active FSM is behaviour enabler which restarts the rest of the FSM's.

But, same thing happens again, FSM's show that they have already been through some states.

For example this one. It's on an enemy that is alive, but it says it had already been through despawn state. Shouldn't it all be 0 if the FSM is disabled then enabled with reset on disable?



It must be something wrong with that, otherwise all of these would be wrong or good.



Obviously, only the reactivated clones are making a problem. I even tried this from this topic (https://hutonggames.com/playmakerforum/index.php?topic=16358.0), copy everything to new FSM, but nothing.
« Last Edit: February 19, 2018, 09:44:30 AM by krmko »
Available for Playmaker work

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: FSM goes through states it isn't intended to
« Reply #8 on: February 19, 2018, 12:59:55 PM »
Can this be done via actions?

http://hutonggames.com/playmakerforum/index.php?topic=3646.0

Or at least by calling the stop method from another rsm?
« Last Edit: February 19, 2018, 01:14:03 PM by krmko »
Available for Playmaker work

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: FSM goes through states it isn't intended to
« Reply #9 on: February 20, 2018, 02:01:26 AM »
Hi,

 this is very odd. I never encountered your issue. So before we make an action for this, I'd like to be able to repro this. Fsm should never behave this way, or at least, I am still blurry on what exactly happens.

Could you wrap up a repro package or the steps to repro this. I have used pooling system before and it worked.

 Bye,

 Jean

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: FSM goes through states it isn't intended to
« Reply #10 on: February 20, 2018, 02:15:55 AM »
Sure, i'll isolate it and strip everything else.
Available for Playmaker work

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: FSM goes through states it isn't intended to
« Reply #11 on: February 20, 2018, 05:12:57 AM »
Hi Jean,

i've sent you PM with the stripped project and instruction. Thanks for looking into it.
Available for Playmaker work

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: FSM goes through states it isn't intended to
« Reply #12 on: February 21, 2018, 01:01:43 AM »
Hi,

 odd, I did not get any pm :)

 Bye,

 Jean

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: FSM goes through states it isn't intended to
« Reply #13 on: February 22, 2018, 01:24:42 AM »
Hm, can you send me your e-mail?
Available for Playmaker work

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: FSM goes through states it isn't intended to
« Reply #14 on: February 22, 2018, 02:59:32 AM »
Here's the perpetrator, the FSM doesn't get reset on disable despite being marked for reset, and the rotation is being applied again on reused pool items.



I can't imagine this being anything else but a bug.

Available for Playmaker work