How to control barking duration/delay?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
nicmar
Posts: 133
Joined: Wed Aug 21, 2019 2:39 am

How to control barking duration/delay?

Post by nicmar »

Hi Tony!

How can I control the delay after a bark?
My bark settings are set to 0, so it should us "Min subtitle seconds" which is set to 2.

Anyhow, the bark lasts exactly 4 seconds.

1) If I have this line (31 chars)
"Where is the smell coming from?",
-> It takes 1 second to show all text, then another 3.3 seconds until it closes. (4.3 seconds total)

2) With this line: (88 chars)
"Where is the smell coming from? I don't know if I can take it anymore. It's so horrible."
-> It takes 2.5 seconds to show all text, then another 1.5 second until it closes. (4.3 seconds total)

3) With this line: (129 chars)
"Where is the smell coming from? I don't know if I can take it anymore. It's so horrible. What happens if the text is even longer?"
-> It takes 4 seconds to show all text, then just 0.3 seconds until it closes. (4.3 seconds total)

The chars per second is set to 35, so it seems to print the text in the correct speed. But why is the delay in the end different? I'd like for all barks to have the exact same delay, AFTER the text has been printed.

For (1) above, I would like 1 second to print, 1.5 second delay = Total 2.5 s
For (2) above, I would like 2.5 second to print, 1.5 second delay = Total 4.0 s (which is about correct now)
For (3) above, I would like 4 second to print, 1.5 second delay = Total 5.5 s

With any longer text than that, the typewriter doesn't finish, and it closes the dialogue prematurely.

I'm using DialogueManager.BarkString to start the bark, and I tried with and without this sequence, didn't notice any difference and don't see any callbacks from the sequence, which I have enabled, and it shows for conversations.

Code: Select all

var sequence = "SetDialoguePanel(false)@{{end}}->Message(Wait); Delay(2)@Message(Wait)->Message(Hid); Delay(2)@Message(Hid)->Message(Delayed); SetDialoguePanel(true)@Message(Delayed)";
DialogueManager.BarkString(text,speaker, listenerTransform, sequence);
It seems to be the exact same behaviour using a DialogueSystemTrigger with a Bark > Text.

Could you enlighten me how to set this up? :)

PS: I'm also waiting for the new version, since the text starts to print before the bubble is shown, should that be possible to change with a sequence too, if they worked?

Thank you!
Working on SpaceChef - A wacky open world space western, featuring a chef with nothing to loose, after he loses everything.. ;) Follow our work on @BlueGooGames.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to control barking duration/delay?

Post by Tony Li »

Hi Niclas,

I had to resubmit the new version to the Asset Store. It should hopefully just be a few days more.

The bark UI has its own Duration field. Set this to zero also, and tick Wait For Sequence. Set the bark's Sequence to:

Code: Select all

Delay({{end}})
Then it will wait for a duration based on the bark text length.
nicmar
Posts: 133
Joined: Wed Aug 21, 2019 2:39 am

Re: How to control barking duration/delay?

Post by nicmar »

Thanks! You were right (of course).. it was set to 4 seconds delay on the bark UI.

But when I do what you suggest, the wait time is the same as the time to display the entire message. So if the message takes 5 sec, it waits for 5 secs.

Can I put a fixed delay of 1.5 seconds after every bark has been written to the screen?

I tried all of these, but they seem to have the same effect as just Delay({{end}})

Code: Select all

Delay(1.5)->Message(Wait); Delay(1.5)@Message(Wait)

Code: Select all

Delay(1.5)

Code: Select all

Delay(5)

Code: Select all

Delay({{end}})
Even if I set the sequence to nothing, it also seems to have the same effect as

Code: Select all

Delay({{end}})
.

I'm not sure if I'm doing something wrong. I'm using the code I posted above, just with a sequence.

Also I'm considering rewriting the typewriter, and have that send a message to close the bark when it's finished (after a delay), so I can add custom stop characters, and don't worry about the sequence not counting the stop characters. I remember there was some kind of issue with the sequence not knowing about stop chars.
Working on SpaceChef - A wacky open world space western, featuring a chef with nothing to loose, after he loses everything.. ;) Follow our work on @BlueGooGames.
nicmar
Posts: 133
Joined: Wed Aug 21, 2019 2:39 am

Re: How to control barking duration/delay?

Post by nicmar »

Cool! 2.2.0 is in the store, trying to update as I type this! :)
Working on SpaceChef - A wacky open world space western, featuring a chef with nothing to loose, after he loses everything.. ;) Follow our work on @BlueGooGames.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to control barking duration/delay?

Post by Tony Li »

Back up your project before importing any asset or update (not just the Dialogue System), just to be safe.

You can use this sequence:

Code: Select all

Delay(1.5)@{{end}}
nicmar
Posts: 133
Joined: Wed Aug 21, 2019 2:39 am

Re: How to control barking duration/delay?

Post by nicmar »

I'm using git, so i was all backed up and ready to rollback, but the upgrade was flawless!

The delay sequence still doesn't work. I have logging set to info, and it doesn't log any output of running the sequence, which it does while playing a conversation.

I think it showed a sequence log at some point, while testing this, but not anymore.

I have duration 0 and Wait for sequence end checked, and I'm using Standard Bark UI component which is linked to /Assets/Plugins/Pixel Crushers/Dialogue System/Wrappers/UI/Standard/Bark/StandardBarkUI.cs

I also tried with 2 instead of 1.5 in case the period didn't work.

Code: Select all

			var sequence = "Delay(2)@{{end}}";
			Transform listenerTransform = null;
			DialogueManager.BarkString(text,speaker, listenerTransform, sequence);
Is there any part of the code I can check where it's supposed to send the log messages to debug where it fails?
Working on SpaceChef - A wacky open world space western, featuring a chef with nothing to loose, after he loses everything.. ;) Follow our work on @BlueGooGames.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to control barking duration/delay?

Post by Tony Li »

Is the Dialogue Manager's Debug Level set to Info?

If so, then you should in fact see this warning unfortunately:

Dialogue System: Unrecognized shortcut {{end}}

DialogueManager.BarkString() doesn't set the value of {{end}}. I'll add this in a patch soon. In the meantime, you can manually compute the duration:

Code: Select all

var duration = 2 + (text.Length / 50f); // <-- Change to your characters per second value.
var sequence = "Delay(" + duration + ")";
Transform listenerTransform = null;
DialogueManager.BarkString(text, speaker, listenerTransform, sequence);
nicmar
Posts: 133
Joined: Wed Aug 21, 2019 2:39 am

Re: How to control barking duration/delay?

Post by nicmar »

Hey! After extensive debugging, I found "Subtitle chars per seconds" on the dialogue manager is set to 15, and I now remember that needs to have the same speed as the typewriter.

So it's working perfectly, woho! (Also saved you a wall of text of my analysis when I figured this out.) :)
Working on SpaceChef - A wacky open world space western, featuring a chef with nothing to loose, after he loses everything.. ;) Follow our work on @BlueGooGames.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to control barking duration/delay?

Post by Tony Li »

I'm glad it's working now. :-)
Post Reply