Branch Pointing To Itself

Sun 5. Jan 2020, 21:34

So when traversing a conversation with dialogue fragments we do the normal thing where the OnFlowPlayerPaused() is called to let us know where we are and OnBranchesUpdated() is called with the valid Branches/Targets to let us know where we can go. We then select a valid Branch based on user input and tell the flow player like FlowPlayer.Play(ourSelectedBranch).

All has worked fine, but now we have a new case where we need to pause/interrupt the flow. This occurs when a new kind of FlowFragment is inserted into the conversation to tell the user to walk to a specific location. The conversation continues but there's a point where the conversation has to be paused until the player reaches their destination. For example, the Captain of the ship has to get to a certain spot before he can start barking orders. The way I achieve this is creating a new FlowFragement called CharacterMovement which holds the last DialogueFragment that can be played before the game has to wait for the character to reach their spot, and the next DialogueFragement in the conversation. Basically we removed the connector pin from DialogueFragment <pausePoint> to <resumePoint> and we manage continuing the flow manually. The way I do that is when I get to the <pausePoint> DialogueFragment that has no Branches, I run a CoRoutine to check their location, and when they're at their location and <pausePoint> DialogueFragement has played, I do this:

FlowPlayer.StartOn = CurCMFrag.StartingDialogueFragment;

FlowPlayer is a reference to our Articy Flow Player, and CurCMFrag.StartingDialogueFragment is the DialogueFragment that we wish to continue on.
The problem is that the first time after setting the StartOn to that fragment, when you get to OnBranchesUpdated() the only valid branch is pointing back to itself, ie the StartingDialogueFragment, so when you click the button on the UI you go back to the same DialogueFragment. I've gone into the debugger in nFlowerPlayerPaused() and double checked and the path ends on the correct Target, but for some reason when I get to OnBranchesUpdated() it's pointing to itself the first time. The 2nd time, after I button through this case and the same DialogueFragement is played, THIS time the Branch is the correct Branch which is the next node in the conversation. What's really odd is that the DialogueFragment that's set via StartOn will never have a connection to it from anywhere else so the fact that it shows up as a Branch at all is extra weird.

It's very odd that the DialogueFragment would only have one connector from it's output pin yet OnBranchesUpdate() thinks its pointing back to itself. You'd figure you'd end up in an infinite look but the 2nd time through all is correct.

Is this a known issue or a bug? The only thing I can think of is that there's something fundamentally different using FlowPlayer.Play(Branch) rather than StartOn, but I can't think of any reason why that would have the DialogueFragment point to itself the first time being used after setting StartOn.

Any help is appreciated.
Thanks!
-Mo
MikeRifRaf
 
Posts: 13
Joined: Tue 8. Oct 2019, 08:06

Re: Branch Pointing To Itself

Fri 10. Jan 2020, 14:55

Hi MikeRifRaf,

This does sound wrong and i currently can't tell you why its doing what you described. Usually setting a node as StartOn is not much different then "Play()ing" to it. If possible, can you send us a link to a stripped down version of your project to support(at)articy.com? This would greatly help us in pinpointing the issue.
In any case, we will have a look into it but are currently a bit short on time, so it could take as a couple of days to 1-2 weeks. You can leave us an email address at the support address so i can get back to you once we know more.

Sorry for the inconvenience and thanks for reporting!

Best regards

Nico
Nico Probst
Senior Software Engineer | Articy | LinkedIn
User avatar
[Articy] Nico Probst
Articy Staff
Articy Staff
 
Posts: 217
Joined: Wed 23. Nov 2011, 09:45
Location: Bochum

Re: Branch Pointing To Itself

Fri 10. Jan 2020, 22:44

OK so I was creating a stripped down version of the project to try and just isolate the problem because our real project was getting pretty bloated. During this I found out what I think is causing the problem though. What we were trying to do was allow a cutscene to begin during a conversation and allow the conversation to continue but only to a certain point in the flow, when it would hold until the cutscene was done. The point we'd hold at was the point where there was a break in the flow (IE no connection between output pin and input at the point of stopping). Once we got to that stopping point we'd wait for the cutscene to end and then continue using FlowPlayer.StartOn = SavedContinuePoint.

HOWEVER, we were assigning that FlowPlayer.StartOn = SavedContinuePoint in OnFlowPlayerPaused() itself. So what was happening is we'd get two OnFlowPlayerPaused() calls in a row followed by two OnBranchesUpdated() calls in a row, which would indicate to me that the whole system was now out of whack.

FWIW the reason I tried this was that I didn't see a way to convert our SavedContinuePoint to a Branch to use normally. But I have a feeling that if I moved that Flow.Player.StartOn = SavedContinuePoint to a point that's NOT in OnFlowPlayerPaused() it would fix it up.
Does that make sense at all?

I hope this didn't waste too much of your time. But at least now perhaps warning people to not use FlowPlayer.StartOn= in OnFlowPlayerPaused() could be a useful tip :D

Thanks!
-Mo
MikeRifRaf
 
Posts: 13
Joined: Tue 8. Oct 2019, 08:06

Re: Branch Pointing To Itself

Mon 13. Jan 2020, 09:16

Glad you have found the issue.

But one thing to point out is: Its actually fine to call StartOn in OnFlowPlayerPaused. But its important to understand what setting this Property entails. Maybe i should have made it a deliberate method call not just a simple property.
Setting StartOn will actually "Resume" the FlowPlayer and it starts traversing until it finds a suitable PausedOn, similar to how Play() works. But it can feel odd, that it will do it synchronously. Maybe a way to set the StartOn but execute it after the flow player has finished OnFlowPlayerPaused. I will add it to the backlog.

If you need anything else let me know

Best regards

Nico
Nico Probst
Senior Software Engineer | Articy | LinkedIn
User avatar
[Articy] Nico Probst
Articy Staff
Articy Staff
 
Posts: 217
Joined: Wed 23. Nov 2011, 09:45
Location: Bochum

Re: Branch Pointing To Itself

Thu 23. Jan 2020, 19:48

Hm....this is very good to know (sorry for the delay in the response BTW I had to switch over to mini-games on our project for a couple of weeks). This is good information, and what it seems like you're saying is that if you use StartOn during OnFlowPlayerPaused(), it will finish OnFlowPlayerPaused() before executing the fragment set in STartOn. Would this then stop the BranchesUpdated() from being called? Even tho we changed things around a bit I'm not looking into some more sophisticated ways of using the flow so any new info would be helpful.
Thanks!
-Mike
MikeRifRaf
 
Posts: 13
Joined: Tue 8. Oct 2019, 08:06

Re: Branch Pointing To Itself

Fri 24. Jan 2020, 08:46

... what it seems like you're saying is that if you use StartOn during OnFlowPlayerPaused(), it will finish OnFlowPlayerPaused() before executing the fragment set in STartOn. Would this then stop the BranchesUpdated() from being called? Even tho we changed things around a bit I'm not looking into some more sophisticated ways of using the flow so any new info would be helpful.


I was just thinking loudly of a potential solution to do this without the events being called twice. Its a matter of expectations, does the user expect it to still be called (so OnBranchesUpdated will be called twice)? Or is the call to startOn meant as a stop of the current events, so finishing OnFlowPlayerPaused but right after call startOn, skipping OnBranchesUpdated (because we have something to continue with) letting the flow player traverse till the next pause and this time calling OnFlowPlayerPaused and OnBranchesUpdated. Interesting use case!

Best regards

Nico
Nico Probst
Senior Software Engineer | Articy | LinkedIn
User avatar
[Articy] Nico Probst
Articy Staff
Articy Staff
 
Posts: 217
Joined: Wed 23. Nov 2011, 09:45
Location: Bochum

Re: Branch Pointing To Itself

Fri 24. Jan 2020, 15:26

Heh. This is exactly what I was thinking as well. Personally...I think that if the user puts a new StartOn object on the FlowPlayer that it just cancels the current situation entirely, so the OnBranchesUpdated() would be cancelled for the current fragment. So if you put print states in OnPause() and OnBranchesUpdated() it would something like
// Normal case
"Start of OnPause()"
"Start of OnBranchesUpdated()"
"Start of OnPause()"
"Start of OnBranchesUpdated()"
/// new case
"Start of OnPause()" // this is where the new StartOn would be added
"Start of OnPause()" // via new StartOn node
"Start of OnBranchesUpdated()" // via new StartOn node

Now of course this is just my personal opinion and i have no idea what other users might expect and i don't know how the behind-the-scenes stuff with the ArticyFlow script works but hey...my two cents!!!
-Mo
MikeRifRaf
 
Posts: 13
Joined: Tue 8. Oct 2019, 08:06

Return to articy:draft Unity Importer

Who is online

Users browsing this forum: No registered users and 8 guests

Who We Are
Contact Us
Social Links