Forum rules - please read before posting.

Speech ID remains the same when Speaker is changed

edited June 2016 in Engine development
ac1.52, u5.3.5p4

It's a common case to rethink dialogues. Sometimes I change the Speaker and change the text, or leave the text if it is just a greeting.

When there is a speech manager id present on a "Dialogue" "Play speech" Action and I change the Speaker to whatever or Player line and I hit "Gather text" ind the Speech Tab of the AC Game Editor then the ID stays the same, although there already might exist another speech action with that id for the player.

In my case the id was 762 and stayed 762 when I changed the speaker from an NPC to a player.
There already was an Action with that ID for the Player, and the action that had 762 now has 985. So the audio file is not correct anymore.

Comments

  • Why would there be another matching ID elsewhere?  Please give the steps to cause this to happen.

    If you change your speech speaker + text after an ID has been generated for it, you should first reset the Action completely by changing the Action type to something else, and then back to Dialogue: Play speech.
  • The reason there could be another matching id:
    My Player character has speech ids up to 900

    1) Let's say I have a speech action (let's call it Speech Action "Z") of npc xy and it has a speech id of 763
    2)  I change the speaker to "Player"
    3) I hit "gather text" , speech action id for "Z" is still 763

    result:
    the player already had a speech action somewhere else with id 763 and a audio file Player763.wav
    what happens is that the speech action of the player that had 763 got a completely new id 985.

    the better result could be that the speech action "Z" would get a new ID not the one that had 763 before.


    I'm a heavy AC-user , I copy actions around all the time, reuse actions, etc ....
    And Ok, now I know I have to reset the speech-Actions before I can reuse them. 
    Suggestion:
    How could we keep other ac users from getting in the situation?
    - maybe if the speaker selector and the player line-checkbox is disabled when there is a speech id set. (text changes shouldn't matter and be updated on "gather text")
    - further there could be a little x-button next to the speech id which would delete the id and enable the speaker selector and the player line-checkbox again (so the text is not lost - usability nice to have]

    What do you think?

  • A fair suggestion, I'll consider it.

    But I'm still not clear on how the player already has a speech Action of ID=763.  If Speech Action Z was 763 the whole time, at what point did the "somewhere else" Player Action get one of the same number?
  • edited July 2016
    hm. initially i thought that each character npc or player starts counting from 1. so i thought that is the reason it happened. weird. Maybe because some actions are already 1,5 years old from an early AC version.

    What I experienced was:
    1) Player has 900 Speech Actions ids from 1 to 900
    2) I have a speech action Z for NPC Bob which says "Hi!". it has the speech ID 763
    3) I change the speaker of that action to player line
    4) the speech id is still 763, although the player already has speech ids from 1  to 900. 
    So 763 would already exist for a players speech action, lets call it Y.
    5) Hitting "gather text"
    6) Z still keeps 763 and Y changed instead to 985 from 763, although it had the id first
    7) Z now plays the audio file of Y as it has taken the id from it. and Y has no audio file anymore as it got a new speech id

    I guess I'll keep my eyes open if it happens again. or completely reset the speech stuff somehow. 
    so that all get new ids.

  • Yes, it seems like there's a conflict already arisen - perhaps from a previous version, but I can't say.

    Each ID number should only be listed once in the Speech Manager - two characters can't share the same one.  When you click "Gather text", AC will detect such conflicts and address them - seen here by the fact that Y's ID goes from 763 to 985.  This is a "safety measure" to prevent problems, though I appreciate it can be annoying if it occurs.
  • oki doki. if I find out how to collisions occur I ll write it here
  • When I have a speech action with the id 786 and I delete it.
    Then later I add new speech actions. Is it possible that the id 786 is reused at some point because it isn't taken anymore?
  • That's correct.  When assigning ID numbers, the Speech Manager looks for the first-available ID that's not used.
  • Ok. That is probably my problem.

    I m changing texts and actions from time to time. Delete the ones that I think are not that good and reuse actions, etc. ..

    The audio files stay when I delete an action.
    And when an id is reused the old audio file is played.

    It would be nice if id's wouldn't be reused so that there is just an auto increment (I don't think there will ever be 65500 speech lines).
    The old audio files would still be around. But maybe a cleaning script with a button "delete unused speech audio files" in the speech settings would do the trick to get rid of the unused audio files in the resources/speech folder.

    What do you think?

  • The idea of only ever incrementing the ID number could work, but are you manually assigning your audio files to speech lines, or letting their filenames link them automatically?  If you re-gather after deleting an Action, the associated speech line in the Speech Manager will also be removed.
  • at the moment I autogenerate the audio files via text2speech when the action is run.
    but next week if the unity gods allow it i d like to start recording the voices (after refactoring all texts and speech actions). I wonder how long my voice can handle it.

    then I would record the 1000 text lines and export each audio line into the right file (-number) -> manually. At the moment I can't think of a better way

    if I re-gather old audio files of deleted speech action ids are still present. after re-using the number these will be played which is a bit confusing.

    I think the "only ever increment"-approach would be cleaner and easier to maintain when working with audio files.
    AND at the end we can say: "wow, I created 2000 speech actions in the game development process"

    that 'delete unused audio speech files' button would also be a nice goodie :)
  • edited July 2016
    Yes, good points.  I'll have a think about it for v1.53.
  • oki doki, thank you!
    I ll just wait with the recording then.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.