playMaker

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mschweitzer

Pages: [1]
1
PlayMaker Help / Re: Restart Level Action loading level twice?
« on: December 11, 2013, 02:54:58 PM »
Ah ok, sorry for assuming you thought it was a level loading issue..

The problem we have is that the PlayMaker state machine exposing the bug only does so under very specific conditions in our game. Unfortunately, those conditions aren't obvious at all because there's nothing about the state machine itself or the component sending the event to the state machine that would indicate this could happen.

That's why I started poking around in decompiled PlayMaker code. The only lead I have is that the switchToState variable in the PlayMaker component is getting reset within the current frame or next frame somehow. I'm just wondering how that's possible. I'm suspicious of an initialization bug in PlayMaker because there is some weird initialization code in there, and there have been bugs with PlayMaker initialization code in the past. In the stack traces I pasted earlier, the first stack trace is fine, and expected (switchToState is changing because I call SendEvent on the FSM), but the second stack trace is very mysterious to me. Somehow, from an Update() loop, the switchToState variable is being reset to the active event.

I already worked around the problem by changing iTween itself, so I'm not waiting on this any more. Would just be nice if the issue were fixed. Unfortunately, I don't have a lot of time to work on repro projects since we have deadlines to meet and it would be difficult to justify burning a few work days trying to discover how to reproduce a PlayMaker bug =\

Hopefully enough users out there run into this bug to the point where someone can narrow down whether this is an avoidable user error or a PlayMaker bug.

Thanks jean.

2
PlayMaker Help / Re: Restart Level Action loading level twice?
« on: December 11, 2013, 10:31:52 AM »
I think you're confused about what the problem is here. This isn't a level loading problem. This is a problem where PlayMaker is entering a state twice, which means it is executing actions twice.

In Mayhem's case, it meant that his level load action happened twice.
For me, it meant that my iTween action happened twice.

I think for weird cases like this, giving people source code would at least let us identify the cause of the problem. That could take maybe a couple hours or less. When you have to create a repro scene for bugs like this, there is a lot of guesswork involved because you're not 100% sure what's causing the problem. Also, you could end up failing to create a scene that perfectly mirrors what you have in your original scene, which means that the bug would just never be fixed.

3
PlayMaker Help / Re: Restart Level Action loading level twice?
« on: December 05, 2013, 12:25:36 PM »
I tried disassembling the PlayMaker.dll to follow my stack traces. Maybe the switchToState variable in the Fsm class is set correctly in the SendEvent call, then sometime before the next Update() call, it's incorrectly set back to the active state?

As far as I can tell, switchToState is only set to a non-null value in 2 functions: DoTransition() and Start(). I didn't think that DoTransition() was the culprit, so I tried looking at Start(). It looks like Start() immediately calls UpdateStateChanges(), which immediately calls SwitchState(), and my stack trace clearly shows the state switch coming from Update(), so I guess I'm not sure how the switchToState variable is being set to the same state again before the call to UpdateState() in Update().

4
PlayMaker Help / Re: Restart Level Action loading level twice?
« on: December 05, 2013, 09:35:25 AM »
Is this issue going to be addressed sometime soon? This issue was one of the last remaining bugs our team encountered that was holding up a patch release.

Not 100% sure why it happens sometimes, but it looks like PlayMaker gets confused about which state it's in after a SendEvent call and re-enters the state in the PlayMakerFSM component's Update function.

This is a *huge* problem when using iTween actions because of iTween's conflict checking feature, where iTween will destroy a previous iTween component that is similar to a newer iTween component. It means that if this bug occurs with an iTween action, the FSM will get stuck on the iTween action forever. I had to work around the problem by modifying iTween to call its "oncomplete" callbacks when it hits a conflict. This at least allowed iTween actions to finish.

Here's a stack trace of the first entry to the state:
iTween:Launch(GameObject, Hashtable)
iTween:MoveTo(GameObject, Hashtable)
HutongGames.PlayMaker.Actions.iTweenMoveTo:DoiTween()
HutongGames.PlayMaker.Actions.iTweenMoveTo:OnEnter()
HutongGames.PlayMaker.FsmState:OnEnter()
HutongGames.PlayMaker.Fsm:EnterState(FsmState)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState)
HutongGames.PlayMaker.Fsm:UpdateStateChanges()
HutongGames.PlayMaker.Fsm:DoTransition(FsmTransition, Boolean)
HutongGames.PlayMaker.Fsm:ProcessEvent(FsmEvent, FsmEventData)
HutongGames.PlayMaker.Fsm:Event(FsmEventTarget, FsmEvent)
HutongGames.PlayMaker.Fsm:Event(FsmEvent)
HutongGames.PlayMaker.Fsm:Event(String)
PlayMakerFSM:SendEvent(String)
OurCustomComponent:ChangeFsmStateNow()
<WaitThenChangeFsmState>c__IteratorC6:MoveNext()

Here's a stack trace of the second entry to that same state:
iTween:Launch(GameObject, Hashtable)
iTween:MoveTo(GameObject, Hashtable)
HutongGames.PlayMaker.Actions.iTweenMoveTo:DoiTween()
HutongGames.PlayMaker.Actions.iTweenMoveTo:OnEnter()
HutongGames.PlayMaker.FsmState:OnEnter()
HutongGames.PlayMaker.Fsm:EnterState(FsmState)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState)
HutongGames.PlayMaker.Fsm:UpdateStateChanges()
HutongGames.PlayMaker.Fsm:UpdateState(FsmState)
HutongGames.PlayMaker.Fsm:Update()
PlayMakerFSM:Update()

I believe the second entry to the state happens the next frame. Not sure if this has anything to do with it, but note that the SendEvent call (the first entry to the state) happens from a coroutine. We had to do this because of another PlayMaker bug where you can't use the FSM until 1 frame after you instantiate a prefab containing the FSM.

Pages: [1]